Skip to content

Commit daba40c

Browse files
committed
Signed-off-by: Aaron Lippold <[email protected]>
2 parents f963d46 + 13d38aa commit daba40c

File tree

9 files changed

+51
-40
lines changed

9 files changed

+51
-40
lines changed

.kitchen.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ platforms:
6868
intermediate_instructions:
6969
- RUN dnf -y install yum which systemd-sysv initscripts
7070

71-
- name: ubuntu-12.04
72-
driver:
73-
image: ubuntu-upstart:12.04
74-
pid_one_command: /sbin/init
75-
intermediate_instructions:
76-
- RUN /usr/bin/apt-get update
77-
7871
- name: ubuntu-14.04
7972
driver:
8073
image: ubuntu-upstart:14.04
@@ -103,7 +96,6 @@ platforms:
10396
intermediate_instructions:
10497
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which
10598

106-
10799
suites:
108100
- name: default
109101
run_list:

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ services: docker
2020

2121
env:
2222
matrix:
23-
- INSTANCE=default-ubuntu-1204
2423
- INSTANCE=default-ubuntu-1404
2524
- INSTANCE=default-ubuntu-1604
2625
- INSTANCE=default-centos-6
@@ -32,7 +31,7 @@ before_script:
3231
- /opt/chefdk/embedded/bin/chef --version
3332
- /opt/chefdk/embedded/bin/cookstyle --version
3433
- /opt/chefdk/embedded/bin/foodcritic --version
35-
- /opt/chefdk/embedded/bin/chef gem install coveralls # needed for chefspecs
34+
- /opt/chefdk/embedded/bin/chef gem install coveralls -v 0.8.19 # needed for chefspecs
3635

3736
script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
3837

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## [v3.0.0](https://github.com/dev-sec/chef-nginx-hardening/tree/v3.0.0) (2018-01-05)
4+
[Full Changelog](https://github.com/dev-sec/chef-nginx-hardening/compare/v2.0.0...v3.0.0)
5+
6+
**Closed issues:**
7+
8+
- Update metadata to depend on "nginx" cookbook [\#47](https://github.com/dev-sec/chef-nginx-hardening/issues/47)
9+
10+
**Merged pull requests:**
11+
12+
- switch to nginx cookbook [\#48](https://github.com/dev-sec/chef-nginx-hardening/pull/48) ([rveznaver](https://github.com/rveznaver))
13+
- add headers and cleaning [\#46](https://github.com/dev-sec/chef-nginx-hardening/pull/46) ([atomic111](https://github.com/atomic111))
14+
315
## [v2.0.0](https://github.com/dev-sec/chef-nginx-hardening/tree/v2.0.0) (2017-01-04)
416
[Full Changelog](https://github.com/dev-sec/chef-nginx-hardening/compare/v1.1.0...v2.0.0)
517

Gemfile

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,38 @@
22

33
source 'https://rubygems.org'
44

5-
gem 'berkshelf', '~> 5.0'
6-
gem 'chef', '>= 12.0'
7-
8-
# pin dependency for Ruby 1.9.3 since bundler is not
9-
# detecting that net-ssh 3 does not work with 1.9.3
10-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
11-
gem 'listen', '~> 3.0.0'
12-
gem 'ruby_dep', '~> 1.3.0'
13-
gem 'rack', '< 2.0'
14-
end
5+
gem 'berkshelf', '~> 6.1'
6+
gem 'chef', '~> 12.5' # chefspec builds get stucked with 13.1
157

168
group :test do
179
gem 'rake'
18-
gem 'chefspec', '~> 5.3'
19-
gem 'foodcritic', '~> 8.0'
10+
gem 'chefspec', '~> 7.1.0'
11+
gem 'foodcritic', '~> 11.1'
12+
gem 'thor', '~> 0.19.1'
2013
gem 'thor-foodcritic'
2114
gem 'cookstyle'
2215
gem 'coveralls', require: false
23-
gem 'minitest', '~> 5.5'
16+
gem 'minitest', '~> 5.10.2'
17+
gem 'rubocop', '~> 0.49.0'
2418
gem 'simplecov', '~> 0.10'
2519
end
2620

2721
group :development do
2822
gem 'guard'
2923
gem 'guard-rspec'
24+
gem 'guard-foodcritic', '~> 3.0'
3025
gem 'guard-kitchen'
3126
gem 'guard-rubocop'
32-
# gem 'guard-foodcritic' # disabled until a new release comes out that removes the pin
3327
end
3428

3529
group :integration do
36-
gem 'test-kitchen', '~> 1.0'
30+
gem 'test-kitchen', '~> 1.16.0'
3731
gem 'kitchen-vagrant'
38-
gem 'kitchen-inspec'
39-
gem 'kitchen-sharedtests', '~> 0.2.0'
40-
gem 'concurrent-ruby', '~> 0.9'
4132
gem 'kitchen-dokken'
33+
gem 'kitchen-inspec'
34+
gem 'concurrent-ruby', '~> 1.0.5'
4235
end
4336

4437
group :tools do
45-
gem 'github_changelog_generator', '~> 1.14.0'
38+
gem 'github_changelog_generator', '~> 1.14'
4639
end

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This cookbook provides a secure overlay for nginx configuration.
1313
### Platform
1414

1515
- Debian 7, 8
16-
- Ubuntu 12.04, 14.04, 16.04
16+
- Ubuntu 14.04, 16.04
1717
- CentOS 6, 7
1818
- OracleLinux 6.6, 6.7, 7.1
1919

@@ -26,12 +26,12 @@ This cookbook provides a secure overlay for nginx configuration.
2626
- `['nginx']['server_tokens']` - `off` to disable disables emitting nginx version in error messages and in the "Server" response header field. Set to `on` to enable the nginx version in error messages and "Server" response header.
2727
- `['nginx-hardening']['source']['http_autoindex_module']` - `false` to disable the HTTP Autoindex module. Set to `true` to enable http_autoindex_module.
2828
- `['nginx-hardening']['source']['http_ssi_module']` - `false` to disable the HTTP SSI module. Set to `true` to enable http_ssi_module.
29-
- `['nginx-hardening']['options']['ssl_protocols']` - `'TLSv1 TLSv1.1 TLSv1.2'` to specify the SSL protocol which should be used.
30-
- `['nginx-hardening']['options']['ssl_ciphers']` - `'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'` to specify the TLS ciphers which should be used.
29+
- `['nginx-hardening']['options']['ssl_protocols']` - `'TLSv1.2'` to specify the SSL protocol which should be used.
30+
- `['nginx-hardening']['options']['ssl_ciphers']` - `'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'` to specify the TLS ciphers which should be used.
3131
- `['nginx-hardening']['options']['ssl_prefer_server_ciphers']` - `'on'` Specifies that server ciphers should be preferred over client ciphers when using the TLS protocols. Set to `false` to disable it.
3232
- `['nginx-hardening']['dh-size']` - `2048` Specifies the length of DH parameters for EDH ciphers.
3333

34-
You can also use the complete attributes from the [chef_nginx cookbook](https://supermarket.chef.io/cookbooks/chef_nginx)
34+
You can also use the complete attributes from the [nginx cookbook](https://supermarket.chef.io/cookbooks/nginx)
3535

3636
## Usage
3737

@@ -40,7 +40,7 @@ Add the recipes to the run_list:
4040
```
4141
"recipe[apt]"
4242
"recipe[nginx-hardening::upgrades]"
43-
"recipe[chef_nginx]"
43+
"recipe[nginx]"
4444
"recipe[nginx-hardening]"
4545
```
4646

@@ -65,15 +65,15 @@ bundle install
6565
bundle exec rake lint
6666

6767
# fast test on one machine
68-
bundle exec kitchen test default-ubuntu-1204
68+
bundle exec kitchen test default-ubuntu-1404
6969

7070
# test on all machines
7171
bundle exec kitchen test
7272

7373
# for development
74-
bundle exec kitchen create default-ubuntu-1204
75-
bundle exec kitchen converge default-ubuntu-1204
76-
bundle exec kitchen verify default-ubuntu-1204
74+
bundle exec kitchen create default-ubuntu-1404
75+
bundle exec kitchen converge default-ubuntu-1404
76+
bundle exec kitchen verify default-ubuntu-1404
7777
```
7878

7979
## Contributors + Kudos

attributes/hardening.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,5 @@
9595
default['nginx-hardening']['options']['ssl_protocols'] = 'TLSv1 TLSv1.1 TLSv1.2'
9696
default['nginx-hardening']['options']['ssl_ciphers'] = "'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA@STRENGTH'"
9797
default['nginx-hardening']['options']['ssl_prefer_server_ciphers'] = 'on'
98+
default['nginx-hardening']['options']['ssl_session_tickets'] = 'off'
9899
default['nginx-hardening']['dh-size'] = 2048

metadata.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
name 'nginx-hardening'
1919
maintainer 'Dominik Richter'
2020
maintainer_email '[email protected]'
21-
license 'Apache 2.0'
21+
license 'Apache-2.0'
2222
description 'Configures nginx hardening'
2323
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
2424

25-
version '2.0.0'
25+
version '3.0.0'
2626

2727
issues_url 'https://github.com/dev-sec/chef-nginx-hardening/issues'
2828
source_url 'https://github.com/dev-sec/chef-nginx-hardening'
@@ -31,7 +31,11 @@
3131
supports 'ubuntu', '>= 12.04'
3232
supports 'centos', '>= 6.6'
3333

34+
<<<<<<< HEAD
3435
depends 'nginx', '>= 4.0'
36+
=======
37+
depends 'nginx', '>= 7.0'
38+
>>>>>>> 13d38aa133278ff7db765cb8f6b812f7d89aa43a
3539
depends 'openssl'
3640

3741
recipe 'nginx-hardening::default', 'configures nginx for hardening'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include_controls 'nginx-baseline' do
2+
# skip http method control
3+
skip_control 'nginx-14'
4+
# skip HTTPOnly and secure cookie control
5+
skip_control 'nginx-16'
6+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: nginx-hardening-integration-tests
2+
depends:
3+
- name: nginx-baseline
4+
url: https://github.com/dev-sec/nginx-baseline

0 commit comments

Comments
 (0)