HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
docker
docker-bench-security
Shell2015–2021
docker / docker-bench-security

docker-bench-security

The Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production.

8Distinct people
8Mentions
0Explicit recommenders
9.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year8 dated mentions

Observed mentions: 2015-06-03 20:22:52 UTC to 2021-03-13 16:44:42 UTC.

01232015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC220
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC110
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC110
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC312
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101

What Hacker News says

8 sources

Ask HN: Do you trust/install Docker in your personal computer?

I'm no longer using a separate computer from my employer and containers' security always worried me. Using VMs is very cumbersome in my opinion. I haven't used Docker in years, do you think it's safe enough now to install in your main computer (Linux host)? It's not like I'm going to test malware inside the containers but there's a lot of 3rd-party dependencies living there. If you do trust Docker, what precautions would you take? Running without root is viable? I'm aware of https://github.com/docker/docker-bench-security
33 points · Open discussion
(Same discussion as on lobste.rs) Thank you for this link, I've only seen the initial CVE announcement. > This is not FUD [...] The site is practicing FUD, it accomplishes communicating a message in an untruthful fashion by mixing two different things into one. (Just check out their stack overflow links, it is not clear if they are talking about root or `--privileged`) People are confused wether `docker root == host system root` and this site doesn't help them to get a better understanding whether or not it is the case. (It isn't) Plus it misses what its main goal should be, running a Secure Docker environment. You are talking about a previous exploit, not a permanent issue. Keeping your host system up to date and additional hardenings is always going to be necessary in exposed environments. > Use Docker containers with SELinux enabled (-
Read the rest
-selinux-enabled). This prevents processes inside the container from overwriting the host docker-runc binary. Authors recommendation is also using SELinux, this also helped with outer Docker/Kernel related vulnerabilities in the past. Why isn't the page even mentioning this? --- I think it is important to give a proper outlook on how problematic things are and not to confuse people with super high expectations. You often end up running containers that you have only little control about. 1. Avoiding root in self-built containers is definitively the way to go, since it reduces (unnecessary) attack surface, but 1. It requires some glue code 2. Might slow down your builds (`Dockerfile` multistage `cp --from=0 /app /app` loses permissions, requires chown afterwards) 2. Avoiding root in CI/CD is nearly impossible 1. many package managers won't work 2. some capabilities to test things (sshd for testing ansible scripts for example) 3. can you use kaniko for building Docker images from within Docker without root? 3. Harden your Docker host 1. Use SELinux 2. Use monitoring 3. Drop capabilities that aren't necessary (NET_BIND_SERVICE, NET_RAW, ...) 4. Use docker network separation 5. Frequent system updates 4. Keep yourself up-to-date, especially if you are running an exposed environment Just googled and this is rather more helpful: - https://dev.to/petermbenjamin/docker-security-best-practices... - https://blog.aquasec.com/docker-security-best-practices - https://sysdig.com/blog/7-docker-security-vulnerabilities/ - https://github.com/docker/docker-bench-security
In Simple Dockerfile examples are often broken by default
There is Docker Bench for security that helps you get a quick overview for your system: https://github.com/docker/docker-bench-security If you compare with LXD security on Docker is just sad... Have fun hitting strange bugs: multi-stage builds break when you use user-namespaces: https://github.com/moby/moby/issues/34645 Using USER has some interesting side effects like no more access to /dev/stdout and /dev/stderr Using apparmor profiles does not do what you think it would do (i.e. disallowing access outside of image-fs) it's rather a few rules to prevent access to certain /proc things. But you can do this: https://docs.docker.com/engine/security/apparmor/
In Show HN: Security and Docker: tips and tricks

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.