Skip to content

Commit 344a41b

Browse files
committed
add inspec attributes daemon_tlscacert, daemon_tlscert and daemon_tlskey, also update README.md
Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>
1 parent 65ed726 commit 344a41b

2 files changed

Lines changed: 34 additions & 7 deletions

File tree

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
## Description
88

9-
This [InSpec](https://github.com/chef/inspec) compliance profile implement the [CIS Docker 1.11.0 Benchmark](https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=docker16.110) in an automated way to provide security best-practice tests around Docker daemon and containers in a production environment.
9+
This [InSpec](https://github.com/chef/inspec) compliance profile implement the [CIS Docker 1.12.0 Benchmark](https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=docker16.120) in an automated way to provide security best-practice tests around Docker daemon and containers in a production environment.
1010

1111
InSpec is an open-source run-time framework and rule language used to specify compliance, security, and policy requirements for testing any node in your infrastructure.
1212

1313
## Requirements
1414

15-
* [InSpec](https://github.com/chef/inspec)
15+
* [InSpec](http://inspec.io/)
1616

1717
### Platform
1818

@@ -60,9 +60,18 @@ We use a yml attribute file to steer the configuration, the following options ar
6060
* `managable_container_number: 25`
6161
keep number of containers on a host to a manageable total. cis-docker-benchmark-6.5
6262

63+
* `daemon_tlscacert : /etc/docker/ssl/ca.pem`
64+
configure the Trust certs. cis-docker-benchmark-2.6
65+
66+
* `daemon_tlscert: /etc/docker/ssl/server_cert.pem`
67+
configure the server certificate. cis-docker-benchmark-2.6
68+
69+
* `daemon_tlskey: /etc/docker/ssl/server_key.pem`
70+
configure the server key. cis-docker-benchmark-2.6
71+
6372
## Usage
6473

65-
InSpec makes it easy to run your tests wherever you need. More options listed here: https://github.com/chef/inspec/blob/master/docs/ctl_inspec.rst
74+
InSpec makes it easy to run your tests wherever you need. More options listed here: [InSpec cli](http://inspec.io/docs/reference/cli/)
6675

6776
```
6877
# run profile locally
@@ -110,4 +119,4 @@ limitations under the License.
110119

111120
[1]: http://travis-ci.org/dev-sec/cis-docker-benchmark
112121
[2]: https://gitter.im/dev-sec/general
113-
[3]: https://benchmarks.cisecurity.org/tools2/docker/CIS_Docker_1.11.0_Benchmark_v1.0.0.pdf
122+
[3]: https://benchmarks.cisecurity.org/tools2/docker/CIS_Docker_1.12.0_Benchmark_v1.0.0.pdf

controls/docker_level1.rb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,24 @@
5151
description: 'define needed capabilities for containers.'
5252
)
5353

54+
DAEMON_TLSCACERT = attribute(
55+
'daemon_tlscacert',
56+
description: 'Trust certs signed only by this CA',
57+
default: '/etc/docker/ssl/ca.pem'
58+
)
59+
60+
DAEMON_TLSCERT = attribute(
61+
'daemon_tlscert',
62+
description: 'Path to TLS certificate file',
63+
default: '/etc/docker/ssl/server_cert.pem'
64+
)
65+
66+
DAEMON_TLSKEY = attribute(
67+
'daemon_tlskey',
68+
description: 'Path to TLS key file',
69+
default: '/etc/docker/ssl/server_key.pem'
70+
)
71+
5472
# check if docker exists
5573
only_if do
5674
command('docker').exist?
@@ -133,13 +151,13 @@
133151
its(['tlsverify']) { should eq(true) }
134152
end
135153
describe json('/etc/docker/daemon.json') do
136-
its(['tlscacert']) { should eq('/etc/docker/ssl/ca.pem') }
154+
its(['tlscacert']) { should eq(DAEMON_TLSCACERT) }
137155
end
138156
describe json('/etc/docker/daemon.json') do
139-
its(['tlscert']) { should eq('/etc/docker/ssl/server_cert.pem') }
157+
its(['tlscert']) { should eq(DAEMON_TLSCERT) }
140158
end
141159
describe json('/etc/docker/daemon.json') do
142-
its(['tlskey']) { should eq('/etc/docker/ssl/server_key.pem') }
160+
its(['tlskey']) { should eq(DAEMON_TLSKEY) }
143161
end
144162
end
145163

0 commit comments

Comments
 (0)