Skip to content

adding docker-bench-security #5

adding docker-bench-security

adding docker-bench-security #5

name: Docker Bench for Security
on:
pull_request:
branches: [ develop ]
permissions:
contents: read
jobs:
docker-bench-security:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Run Docker Bench for Security
run: |
mkdir -p results
# docker run --net host --pid host --cap-add audit_control --cap-add sys_admin --cap-add syslog \
# -e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
# -v /etc:/etc:ro \
# -v /lib/systemd/system:/lib/systemd/system:ro \
# -v /usr/bin/containerd:/usr/bin/containerd:ro \
# -v /usr/bin/runc:/usr/bin/runc:ro \
# -v /usr/lib/systemd:/usr/lib/systemd:ro \
# -v /var/lib:/var/lib:ro \
# -v /var/run/docker.sock:/var/run/docker.sock:ro \
# --label docker_bench_security \
# docker-bench-security > results/docker-bench-results.txt
docker run --net host --pid host --cap-add audit_control --cap-add sys_admin --cap-add syslog \
--security-opt apparmor=unconfined \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc:/etc \
-v /usr/bin/docker:/usr/bin/docker \
--label docker-bench-security \
docker/docker-bench-security > docker-bench-report.txt
- name: Upload Results
uses: actions/upload-artifact@v3
with:
name: docker-bench-results
path: results/docker-bench-results.txt