Dec 1st 2015: first version of this article published

Dec 2nd 2015: UPDATED OpenSCAP section with Atomic scan information and references

Dec 7th 2015: UPDATED Twistlock section, after a session/demo with the vendor. Conclusions updated.

Dec 14th 2015: UPDATED OpenSCAP section with a link of a demo made by : UPDATED OpenSCAP section with a link of a demo made by @ianmiell

Dec 16th 2015: UPDATED the tools list with a new one called : UPDATED the tools list with a new one called Scalock . Updated the conclusion section as well.

Dec 17th 2015: UPDATED Scalock section after some corrections they made me by email (thanks guys btw). I also fixed some typos.

April 7th 2017: UPDATED Scalock renamed to Aqua Security

Let’s suppose you are working in Security. Now, your company decides to run some applications in containers, they choose Docker, after some weeks or months testing it they want to go live, and suddenly someone says “should we do a security audit before going to production?”, the rest of the story is you and an audit to a Docker environment.

You can use all your existing arsenal and procedures your are familiar to audit the application running in the containers (file permissions, logs, etc.) but what about the containers, images, dockerfiles, docker servers or even the clustering and orchestration platform? This article is about that.

Considerations for this particular audit:

Check if images and packages inside images are up-to-date and are free of security vulnerabilities. Audit automatization, we must be able to automatize all checks. That will save us a precious time and we can run it as often as we require, forget about to do it manually unless you are just testing or learning. Container links and volumes. If you use read-only filesystem in your running container “docker diff” can help you to find issues. The bigger an image is the harder the audit will be, reduce as much as you can the size of your images. The host kernel is the shared point between all containers in the same server, keep that kernel up-to-date.

Once said that, I want to give you an overview of the existing tools I have found to achieve your duty mentioned above. I have probably missed other tools, if so, please point me to them in the comments.

Docker Bench for Security: Description : The Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production. Those checks are based on all recommendations taken from the CIS Docker 1.6 Benchmark document.

: The Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production. Those checks are based on all recommendations taken from the CIS Docker 1.6 Benchmark document. Focus : mostly Docker server and few tips for images and containers.

: mostly Docker server and few tips for images and containers. Language : Shell script

: Shell script Methodology : Run the script in the same server where Docker is running or from a container. It will create a shell report with INFO, WARN or PASS alerts.

: Run the script in the same server where Docker is running or from a container. It will create a shell report with INFO, WARN or PASS alerts. License : Apache 2.0

: Apache 2.0 Installation/usability level : Easy

: Easy Demo/Presentation : https://youtu.be/8mUm0x1uy7c?t=18m15s

: https://youtu.be/8mUm0x1uy7c?t=18m15s More about audit and vulnerabilities assessment from Docker Inc: Project Nautilus : presented during Docker CON 2015 in Barcelona: https://www.youtube.com/watch?v=fLfFFtOHRZQ& Project Nautilus, the new image scanning and vulnerability detection service for official repos on Docker Hub. As in @diogomonica words “Nautilus is already working on the background on all the official images”. Nautilus looks for any suspicious piece of software. Is not depending on public vulnerabilities data bases nor based on Linux distros, instead, it looks for vulnerabilities using their own data base. We will have more information soon and probably a closer look by Q1 2016. (Thanks Diogo for the info).

My comments: From the Docker server/daemon configuration point of view this is the best tool you can use to make sure you are in the right path. Definitely I would use this tool but in conjunction with others, keep reading. OpenSCAP Container Compliance: Description : Based on the same philosophy as its parent project OpenSCAP that supports CVE scan, multiple report formats and custom policies. Specific instructions and packages for RedHat 7 are here. Note: SCAP is U.S. standard maintained by National Institute of Standards and Technology (NIST). The OpenSCAP project is an open source collection of tools for implementing and enforcing this standard.

: Based on the same philosophy as its parent project OpenSCAP that supports CVE scan, multiple report formats and custom policies. Specific instructions and packages for RedHat 7 are here. Note: SCAP is U.S. standard maintained by National Institute of Standards and Technology (NIST). The OpenSCAP project is an open source collection of tools for implementing and enforcing this standard. Focus : Images and Containers

: Images and Containers Language : Shell script

: Shell script Methodology : run the oscap-docker command against an image or container and get the results on a very helpful and descriptive html report.

: run the oscap-docker command against an image or container and get the results on a very helpful and descriptive html report. License : GPL v3

: GPL v3 Installation/usability level : Easy

: Easy Demo/Presentation : https://zwischenzugs.wordpress.com/2015/12/14/888/

: https://zwischenzugs.wordpress.com/2015/12/14/888/ My comments : If you use RedHat/Fedora/CentOS based containers this is highly recommended for you.

: If you use RedHat/Fedora/CentOS based containers this is highly recommended for you. UPDATE (Dec 2nd 2015): If you use Atomic they have recently released a new feature that allows you to scan containers for vulnerabilities using OpenSCAP, see this blog post here and code here. CoreOS Clair: Description : Clair is a container vulnerability analysis service. It works as an API that analyzes every container layer to find known vulnerabilities using existing package managers such as Debian (dpkg), Ubuntu (dpkg), CentOS (rpm). It also can be used from the command line as showed here. It provides a list of vulnerabilities that threaten a container, and can notify users when new vulnerabilities that affect existing containers become known. It is being used by https://quay.io/

: Clair is a container vulnerability analysis service. It works as an API that analyzes every container layer to find known vulnerabilities using existing package managers such as Debian (dpkg), Ubuntu (dpkg), CentOS (rpm). It also can be used from the command line as showed here. It provides a list of vulnerabilities that threaten a container, and can notify users when new vulnerabilities that affect existing containers become known. It is being used by https://quay.io/ Focus : Images and Containers

: Images and Containers Language : Go

: Go Methodology : Used via API or command line it extract all layers of the image, notifies if vulnerabilities are found whenever they found it because it stores all the information in a data base, it also manages its own vulnerability database updates from known vulnerability sources.

: Used via API or command line it extract all layers of the image, notifies if vulnerabilities are found whenever they found it because it stores all the information in a data base, it also manages its own vulnerability database updates from known vulnerability sources. License : Apache v2

: Apache v2 Installation/usability level : Hard

: Hard Demo/Presentation : https://coreos.com/blog/vulnerability-analysis-for-containers/

: https://coreos.com/blog/vulnerability-analysis-for-containers/ My comments: I couldn’t make it work in CentOS 7.1. I will add more info here as soon as I got something new. Banyan Collector: Description : the BanyanOps guys are who started a the discussion about the huge amount of vulnerable images available in Docker Hub and that was responded in detail by @jpetazzo here. As the author says “it is a framework for Static Analysis of Docker container images”. That means that is does more than security analysis.

: the BanyanOps guys are who started a the discussion about the huge amount of vulnerable images available in Docker Hub and that was responded in detail by @jpetazzo here. As the author says “it is a framework for Static Analysis of Docker container images”. That means that is does more than security analysis. Focus : Images

: Images Language : Go

: Go Methodology : Even though it can run in a container, banyan collector can run form command line and connect to a given Docker registry to perform its analysis. See how it works in detail here.

: Even though it can run in a container, banyan collector can run form command line and connect to a given Docker registry to perform its analysis. See how it works in detail here. License : Apache 2.0

: Apache 2.0 Installation/usability level : Medium-Hard

: Medium-Hard Demo/Presentation : N/A

: N/A My comments: It is very oriented to check registries more than a pure vulnerability assessment tool. Lynis: Description : Lynis is a Linux, Mac and Unix security auditing and system hardening tool that includes a module to audit Dockerfiles. It also shows some Docker server statistics and check permissions.

: Lynis is a Linux, Mac and Unix security auditing and system hardening tool that includes a module to audit Dockerfiles. It also shows some Docker server statistics and check permissions. Focus : Dockerfile

: Dockerfile Language : Shell script

: Shell script Methodology : just run Lynis with the proper options and Dockerfile path and Lynis will take a look to the files installed and some other parameters inside the file.

: just run Lynis with the proper options and Dockerfile path and Lynis will take a look to the files installed and some other parameters inside the file. License : GPL v3

: GPL v3 Installation/usability level : N

: N Demo/Presentation :

: My comments: You can hit two birds with one stone but not really useful for docker audit yet. I know the author is willing to add more support to Docker. Twistlock: Description : As in the author words: Twistlock scans container images in registries, on developer workstations, or on production servers. We detect and report vulnerabilities in the Linux distribution layer, app frameworks, and even your customer app packages. In addition to the Open Source threat feeds it uses commercial threat feeds. Their solution also offers access control to actions based in users and groups and a very interesting Runtime defense that allows to monitor and act upon security based in roles, behaviors, compliance, malicious actions and more.

: As in the author words: Twistlock scans container images in registries, on developer workstations, or on production servers. We detect and report vulnerabilities in the Linux distribution layer, app frameworks, and even your customer app packages. In addition to the Open Source threat feeds it uses commercial threat feeds. Their solution also offers access control to actions based in users and groups and a very interesting Runtime defense that allows to monitor and act upon security based in roles, behaviors, compliance, malicious actions and more. Focus : images, containers, packages. Made for Docker and Kubernetes or Mesos.

: images, containers, packages. Made for Docker and Kubernetes or Mesos. Language : Shell script, Javascript and Go.

: Shell script, Javascript and Go. Methodology : it uses NIST to find CVEs and the Docker CIS for vulnerability assessment. It does more than just that, features like advanced access control, runtime defense, monitoring and continuous integration. A container called defender has to run in every host and a central console collect and manages all of them from a central location.

: it uses NIST to find CVEs and the Docker CIS for vulnerability assessment. It does more than just that, features like advanced access control, runtime defense, monitoring and continuous integration. A container called defender has to run in every host and a central console collect and manages all of them from a central location. License : commercial depending on number of hosts. Free Developer Edition up to 2 hosts without support.

: commercial depending on number of hosts. Free Developer Edition up to 2 hosts without support. Installation/usability level : Not tested, I have seen a live presentation and demo run by de vendor.

: Not tested, I have seen a live presentation and demo run by de vendor. Demo/Presentation : https://www.youtube.com/watch?v=SMCYHFDfSzk

: https://www.youtube.com/watch?v=SMCYHFDfSzk My comments: Nothing much to say since I could’t play with it or see it in action. I will add more info once I have something else . I have had a meeting with the vendor and have a better view about what the product is, and it is the most complete solution I have seen so far. They cover enterprise grade security, they are starting and is a brand new product with just a few customer, the product has a big room to improve and add new features but it is covering in a smart way most of the requirements at this moment and with enough granularity that allow us to improve Docker security. Finally it is important to highlight that it is not just an auditing tool, it is a managed security tool for Docker. Bitnami Stacksmith: Description : it is a tool to quickly generate custom Dockerfiles (as per Bitnami words: a declarative API to create containers), is not intended to be a security tool but it has that cool feature that helps you to detect outdated and vulnerable components while building your Dockerfiles or even in existing containers built in Stacksmith. It sends you an email when a compoenent has to be updated.

: it is a tool to quickly generate custom Dockerfiles (as per Bitnami words: a declarative API to create containers), is not intended to be a security tool but it has that cool feature that helps you to detect outdated and vulnerable components while building your Dockerfiles or even in existing containers built in Stacksmith. It sends you an email when a compoenent has to be updated. Focus : Dockerfiles, images and containers.

: Dockerfiles, images and containers. Language : unknown

: unknown Methodology : it uses an external public CVE scores https://cve.mitre.org DB to find CVEs of the given components for vulnerability assessment.

: it uses an external public CVE scores https://cve.mitre.org DB to find CVEs of the given components for vulnerability assessment. License : SaaS

: SaaS Installation/usability level : Easy

: Easy Demo/Presentation: https://www.youtube.com/watch?v=4A24pD-P_N4

https://www.youtube.com/watch?v=4A24pD-P_N4 My comments: As SaaS it seems to be a very easy tool, from the security point of view it gives the user a clear view of the status of the container components which is very helpful to figure out if we have vulnerable or outdated containers. Dockscan Description : a brand new tool, in a very early stage, released 2 weeks ago, it was presented at BlackHat Europe Arsenal. As per the author: Dockscan is a vulnerability assessment and audit tool for Docker and container installations. It will report on Docker installation security issues as well as Docker container configurations. The tool helps both system administrator administering Docker to help them secure Docker, as well as security auditors and penetration testers who need to audit Docker installation.

: a brand new tool, in a very early stage, released 2 weeks ago, it was presented at BlackHat Europe Arsenal. As per the author: Dockscan is a vulnerability assessment and audit tool for Docker and container installations. It will report on Docker installation security issues as well as Docker container configurations. The tool helps both system administrator administering Docker to help them secure Docker, as well as security auditors and penetration testers who need to audit Docker installation. Focus : Docker server

: Docker server Language : Ruby

: Ruby Methodology : it uses some the existing CIS Docker 1.6 Benchmark best practices. Can work in local and remote Docker installations.

: it uses some the existing CIS Docker 1.6 Benchmark best practices. Can work in local and remote Docker installations. License : GPL v2

: GPL v2 Installation/usability level : easy

: easy Demo/Presentation : N/A

: N/A My comments: It has a very short list of features yet but looks interesting, I would keep an eye on it but not to be used as a mature tool by now. Drydock: (do not confuse it with Dry-dock cluster) Description : As per the author: drydock is a Docker security audit tool written in Python. It was initially inspired by Docker Bench for Security but aims to provide a more flexible way for assessing Docker installations and deployments. drydock allows easy creation and use of custom audit profiles in order to eliminate noise and false alarms. Reports are saved in JSON format for easier parsing. drydock makes heavy use of docker-py client API to communicate with Docker. It is based on CIS Docker 1.6 Benchmark.

: As per the author: drydock is a Docker security audit tool written in Python. It was initially inspired by Docker Bench for Security but aims to provide a more flexible way for assessing Docker installations and deployments. drydock allows easy creation and use of custom audit profiles in order to eliminate noise and false alarms. Reports are saved in JSON format for easier parsing. drydock makes heavy use of docker-py client API to communicate with Docker. It is based on CIS Docker 1.6 Benchmark. Focus : Docker server and containers

: Docker server and containers Language : Python

: Python Methodology : it uses some the existing CIS Docker 1.6 Benchmark best practices to check server configuration options.

: it uses some the existing CIS Docker 1.6 Benchmark best practices to check server configuration options. License : GPL v2

: GPL v2 Installation/usability level : Easy

: Easy Demo/Presentation : N/A

: N/A My comments: It is in a very early stage of development yet, seems to be ahead of Dockscan. Let’s see what’s next with this tool. Not mature enough to consider as a player. Batten: Description : Hardening and auditing tool for docker hosts and containers. It is pretty much the same as Drydock or Docker Bench for Security.

: Hardening and auditing tool for docker hosts and containers. It is pretty much the same as Drydock or Docker Bench for Security. Focus : Docker server and containers

: Docker server and containers Language : Go

: Go Methodology : run as container and check the server and containers following the CIS Docker 1.6 Benchmark.

: run as container and check the server and containers following the CIS Docker 1.6 Benchmark. License : MIT

: MIT Installation/usability level : Easy

: Easy Demo/Presentation : N/A

: N/A My comments: Nothing different to what Drydock or Docker Bench for Security does. Scalock (now known as Aqua Security): Description : By the author: Scalock secures every stage of the container lifecycle. Scalock provides a comprehensive security solution for virtual containers by adding visibility and control to containerized environments, enabling organizations to scale-out without security limitations even on a very large scale. We support major container platforms, including Docker, CoreOS, VMWare and Microsoft Windows. Secures virtualized containers on every level: containers, hosts and applications.

: By the author: Scalock secures every stage of the container lifecycle. Scalock provides a comprehensive security solution for virtual containers by adding visibility and control to containerized environments, enabling organizations to scale-out without security limitations even on a very large scale. We support major container platforms, including Docker, CoreOS, VMWare and Microsoft Windows. Secures virtualized containers on every level: containers, hosts and applications. Focus : images, containers, packages. Made for Docker and Kubernetes, CoreOS, VMWare and Microsoft Windows.

: images, containers, packages. Made for Docker and Kubernetes, CoreOS, VMWare and Microsoft Windows. Language : Go and C/C++.

: Go and C/C++. Methodology :It works pretty much in the same way as Twistlock does, using a central server and agent containers running in privileged mode on every Docker host. It uses Docker Bench for server configuration security best practices, it also uses public vulnerabilities DB to check outdated packages (RPMs and/or Debs) and code libraries (Java, Python, PHP, NodeJS, etc.) inside containers and images using their own scanner database. It can also control AuthZ/AuthN and implements runtime defense to protect containers from other containers, users or attackers. They use their own kernel module to improve the container isolation.

:It works pretty much in the same way as Twistlock does, using a central server and agent containers running in privileged mode on every Docker host. It uses Docker Bench for server configuration security best practices, it also uses public vulnerabilities DB to check outdated packages (RPMs and/or Debs) and code libraries (Java, Python, PHP, NodeJS, etc.) inside containers and images using their own scanner database. It can also control AuthZ/AuthN and implements runtime defense to protect containers from other containers, users or attackers. They use their own kernel module to improve the container isolation. License : commercial depending on number of hosts. In BETA status right now.

: commercial depending on number of hosts. In BETA status right now. Installation/usability level : Not tested, I have seen a live presentation and demo run by de vendor. It looks straighforward to use.

: Not tested, I have seen a live presentation and demo run by de vendor. It looks straighforward to use. Demo/Presentation : N/A

: N/A My comments: They contacted me after I published this article. They show me more or less what the product can do and how it looks like. It is the biggest competitor of Twistlock at this momment but it is in a very early stage. As its competitor it has a huge room to improve and to add more security capabilities once they are coming to Docker like user namespaces. It is not just an auditing tool, it does that correctly it is a runtime defense tool as well.

Conclusion: