File tree Expand file tree Collapse file tree 5 files changed +194
-76
lines changed Expand file tree Collapse file tree 5 files changed +194
-76
lines changed Original file line number Diff line number Diff line change 26
26
- name : Run tests
27
27
run : |
28
28
docker run --name gtfonow_test_${{ matrix.python-version }} -d gtfonow_test:${{ matrix.python-version }}
29
-
29
+ - name : Wait
30
+ run : sleep 15
30
31
- name : Run Pytest
31
- run : docker exec gtfonow_test_${{ matrix.python-version }} su -l lowpriv -c " pytest -v --cov=gtfonow --cov-report=xml --cov-report=term-missing"
32
+ run : docker exec -u lowpriv gtfonow_test_${{ matrix.python-version }} pytest -v --cov=gtfonow --cov-report=xml --cov-report=term-missing
32
33
- name : Copy coverage report from Docker container to host
33
34
run : docker cp gtfonow_test_${{ matrix.python-version }}:/home/lowpriv/coverage.xml .
34
35
Original file line number Diff line number Diff line change @@ -23,10 +23,12 @@ RUN chmod u+s $(which tee)
23
23
RUN chmod u+s $(which dd)
24
24
RUN chmod u+s $(which mv)
25
25
RUN chmod u+s $(which rbash)
26
-
26
+ RUN pip install mock
27
27
RUN useradd -ms /bin/bash lowpriv
28
28
RUN useradd -ms /bin/bash higherpriv
29
-
29
+ RUN ssh-keygen -N '' -f /root/.ssh/id_rsa
30
+ RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
31
+ RUN echo "ONLY_ROOT_CAN_READ_THIS" > /root/proof.txt
30
32
RUN echo "lowpriv ALL=(ALL) NOPASSWD: /usr/bin/head" >> /etc/sudoers
31
33
RUN echo "lowpriv ALL=(higherpriv) NOPASSWD: /usr/bin/vim" >> /etc/sudoers
32
34
You can’t perform that action at this time.
0 commit comments