感覺挺好用的,mark一下~
Docker Bench for Security是一個腳本,用於檢查有關在生產中部署Docker容器的安全問題。
github地址:https://github.com/docker/docker-bench-security
一、鏡像方式運行監測:
加上--rm,運行後刪除,強迫症~~
docker run -it --rm --net host --pid host --userns host --cap-add audit_control \
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
-v /var/lib:/var/lib \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/lib/systemd:/usr/lib/systemd \
-v /etc:/etc --label docker_bench_security \
docker/docker-bench-security
二、docker-compose安裝:
git clone https://github.com/docker/docker-bench-security.git
cd docker-bench-security
docker-compose run --rm docker-bench-security
三、git下載:
git clone https://github.com/docker/docker-bench-security.git
cd docker-bench-security
sudo sh docker-bench-security.sh