|
84 | 84 | impact 1.0 |
85 | 85 | title 'Confirm default cgroup usage' |
86 | 86 | desc 'The --cgroup-parent option allows you to set the default cgroup parent to use for all the containers. If there is no specific use case, this setting should be left at its default.' |
87 | | - ref 'https://docs.docker.com/engine/reference/commandline/daemon/' |
| 87 | + tag 'daemon' |
| 88 | + ref 'Docker daemon configuration', url: 'https://docs.docker.com/engine/reference/commandline/daemon/' |
88 | 89 |
|
89 | 90 | describe json('/etc/docker/daemon.json') do |
90 | 91 | its(['cgroup-parent']) { should eq('docker') } |
|
95 | 96 | impact 1.0 |
96 | 97 | title 'Do not change base device size until needed' |
97 | 98 | desc 'In certain circumstances, you might need containers bigger than 10G in size. In these cases, carefully choose the base device size.' |
98 | | - ref 'https://docs.docker.com/engine/reference/commandline/daemon/#storage-driver-options' |
| 99 | + tag 'daemon' |
| 100 | + ref 'Docker daemon storage driver options', url: 'https://docs.docker.com/engine/reference/commandline/daemon/#storage-driver-options' |
99 | 101 |
|
100 | 102 | describe json('/etc/docker/daemon.json') do |
101 | 103 | its(['storage-opts']) { should eq(['dm.basesize=10G']) } |
|
106 | 108 | impact 1.0 |
107 | 109 | title 'Use authorization plugin' |
108 | 110 | desc 'Docker’s out-of-the-box authorization model is all or nothing. Any user with permission to access the Docker daemon can run any Docker client command. The same is true for callers using Docker’s remote API to contact the daemon. If you require greater access control, you can create authorization plugins and add them to your Docker daemon configuration. Using an authorization plugin, a Docker administrator can configure granular access policies for managing access to Docker daemon.' |
109 | | - ref 'https://docs.docker.com/engine/reference/commandline/daemon/#access-authorization' |
110 | | - ref 'https://docs.docker.com/engine/extend/plugins_authorization/' |
111 | | - ref 'https://github.com/twistlock/authz' |
112 | | - ref 'https://sreeninet.wordpress.com/2016/03/06/docker-security-part-3engine-access/' |
| 111 | + tag 'daemon' |
| 112 | + ref 'Access authorization', url: 'https://docs.docker.com/engine/reference/commandline/daemon/#access-authorization' |
| 113 | + ref 'Auhtorization plugins', url: 'https://docs.docker.com/engine/extend/plugins_authorization/' |
| 114 | + ref 'Twistlock authorization plugin', url: 'https://github.com/twistlock/authz' |
113 | 115 |
|
114 | 116 | describe json('/etc/docker/daemon.json') do |
115 | 117 | its(['authorization-plugins']) { should_not be_empty } |
|
123 | 125 | impact 1.0 |
124 | 126 | title 'Configure centralized and remote logging' |
125 | 127 | desc 'Docker now supports various log drivers. A preferable way to store logs is the one that supports centralized and remote logging.' |
126 | | - tag 'Bug: logs-opts seems broken in daemon.json https://github.com/docker/docker/issues/22311' |
127 | | - ref 'https://docs.docker.com/engine/admin/logging/overview/' |
| 128 | + tag 'daemon' |
| 129 | + ref 'Logging overview', url: 'https://docs.docker.com/engine/admin/logging/overview/' |
128 | 130 |
|
129 | 131 | describe json('/etc/docker/daemon.json') do |
130 | 132 | its(['log-driver']) { should_not be_empty } |
|
141 | 143 | impact 1.0 |
142 | 144 | title 'Disable operations on legacy registry (v1)' |
143 | 145 | desc 'The latest Docker registry is v2. All operations on the legacy registry version (v1) should be restricted.' |
144 | | - ref 'https://docs.docker.com/engine/reference/commandline/daemon/' |
145 | | - ref 'https://github.com/docker/docker/issues/8093' |
146 | | - ref 'https://github.com/docker/docker/issues/9015' |
147 | | - ref 'https://github.com/docker/docker-registry/issues/612' |
| 146 | + tag 'daemon' |
| 147 | + ref 'Docker daemon storage driver options', url: 'https://docs.docker.com/engine/reference/commandline/daemon/#storage-driver-options' |
| 148 | + ref 'Proposal: Provenance step 1 - Transform images for validation and verification', url: 'https://github.com/docker/docker/issues/8093' |
| 149 | + ref 'Proposal: JSON Registry API V2.1', url: 'https://github.com/docker/docker/issues/9015' |
| 150 | + ref 'Registry next generation', url: 'https://github.com/docker/docker-registry/issues/612' |
| 151 | + ref 'Docker Registry HTTP API V2', url: 'https://docs.docker.com/registry/spec/api/' |
| 152 | + ref 'Creating Private Docker Registry 2.0 with Token Authentication Service', url: 'https://the.binbashtheory.com/creating-private-docker-registry-2-0-with-token-authentication-service/' |
| 153 | + ref 'New Tool to Migrate From V1 Registry to Docker Trusted Registry or V2 Open Source Registry', url: 'https://blog.docker.com/2015/07/new-tool-v1-registry-docker-trusted-registry-v2-open-source/' |
| 154 | + ref 'Docker Registry V2', url: 'https://www.slideshare.net/Docker/docker-registry-v2' |
148 | 155 |
|
149 | 156 | describe json('/etc/docker/daemon.json') do |
150 | 157 | its(['disable-legacy-registry']) { should eq(true) } |
151 | 158 | end |
152 | 159 | end |
153 | 160 |
|
| 161 | +control 'cis-docker-benchmark-2.14' do |
| 162 | + impact 1.0 |
| 163 | + title 'Enable live restore' |
| 164 | + desc 'The \'--live-restore\' enables full support of daemon-less containers in docker. It ensures that docker does not stop containers on shutdown or restore and properly reconnects to the container when restarted.' |
| 165 | + tag 'daemon' |
| 166 | + ref 'Add --live-restore flag', url: 'https://github.com/docker/docker/pull/23213' |
| 167 | + |
| 168 | + describe json('/etc/docker/daemon.json') do |
| 169 | + its(['live-restore']) { should eq(true) } |
| 170 | + end |
| 171 | +end |
| 172 | + |
| 173 | +control 'cis-docker-benchmark-2.15' do |
| 174 | + impact 1.0 |
| 175 | + title 'Do not enable swarm mode, if not needed' |
| 176 | + desc 'Do not enable swarm mode on a docker engine instance unless needed.' |
| 177 | + tag 'daemon' |
| 178 | + ref 'docker swarm init', url: 'https://docs.docker.com/engine/reference/commandline/swarm_init/' |
| 179 | + |
| 180 | + describe command('docker info') do |
| 181 | + its('stdout') { should include 'Swarm: inactive' } |
| 182 | + end |
| 183 | +end |
| 184 | + |
154 | 185 | control 'cis-docker-benchmark-4.5' do |
155 | 186 | impact 1.0 |
156 | 187 | title 'Enable Content trust for Docker' |
|
0 commit comments