cookbook 'nginx-hardening', '~> 3.0.0'
nginx-hardening (3) Versions 3.0.0 Follow4
Configures nginx hardening
cookbook 'nginx-hardening', '~> 3.0.0', :supermarket
knife supermarket install nginx-hardening
knife supermarket download nginx-hardening
nginx-hardening (Chef cookbook)
Description
This cookbook provides a secure overlay for nginx configuration.
Requirements
- Chef 12+
Platform
- Debian 7, 8
- Ubuntu 14.04, 16.04
- CentOS 6, 7
- OracleLinux 6.6, 6.7, 7.1
Attributes
-
['nginx']['client_body_buffer_size']
-1k
Sets buffer size for reading client request body. In case the request body is larger than the buffer, the whole body or only its part is written to a temporary file. -
['nginx']['default_site_enabled']
-false
to disable the default site. Set toon
to enable the default site in nginx. -
['nginx']['client_max_body_size']
-1k
to set the maximum allowed size of the client request body, specified in the "Content-Length" request header field. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. -
['nginx']['keepalive_timeout']
-5 5
The first parameter sets a timeout during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections. The optional second parameter sets a value in the "Keep-Alive: timeout=time" response header field. -
['nginx']['server_tokens']
-off
to disable disables emitting nginx version in error messages and in the "Server" response header field. Set toon
to enable the nginx version in error messages and "Server" response header. -
['nginx-hardening']['source']['http_autoindex_module']
-false
to disable the HTTP Autoindex module. Set totrue
to enable http_autoindex_module. -
['nginx-hardening']['source']['http_ssi_module']
-false
to disable the HTTP SSI module. Set totrue
to enable http_ssi_module. -
['nginx-hardening']['options']['ssl_protocols']
-'TLSv1.2'
to specify the SSL protocol which should be used. -
['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. -
['nginx-hardening']['options']['ssl_prefer_server_ciphers']
-'on'
Specifies that server ciphers should be preferred over client ciphers when using the TLS protocols. Set tofalse
to disable it. -
['nginx-hardening']['dh-size']
-2048
Specifies the length of DH parameters for EDH ciphers.
You can also use the complete attributes from the nginx cookbook
Usage
Add the recipes to the run_list:
"recipe[apt]"
"recipe[nginx-hardening::upgrades]"
"recipe[nginx]"
"recipe[nginx-hardening]"
Configure attributes:
"nginx-hardening" : {
"dh-size" : "4096"
}
Local Testing
For local testing you can use vagrant or docker to run tests locally. You will have to install VirtualBox and Vagrant or docker on your system. See Vagrant Downloads for a vagrant or Docker Downloads package suitable for your system. For all our tests we use test-kitchen
. If you are not familiar with test-kitchen
please have a look at their guide.
# Install dependencies gem install bundler bundle install # Do lint checks bundle exec rake lint # fast test on one machine bundle exec kitchen test default-ubuntu-1404 # test on all machines bundle exec kitchen test # for development bundle exec kitchen create default-ubuntu-1404 bundle exec kitchen converge default-ubuntu-1404 bundle exec kitchen verify default-ubuntu-1404
Contributors + Kudos
- Dominik Richter arlimus
- Christoph Hartmann chris-rock
- Patrick Muench atomic111
- Edmund Haselwanter ehaselwanter
Contributing
See [contributor guideline](CONTRIBUTING.md).
License and Author
- Author:: Dominik Richter dominik.richter@googlemail.com
- Author:: Deutsche Telekom AG
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Change Log
v3.0.0 (2018-01-05)
Closed issues:
- Update metadata to depend on "nginx" cookbook #47
Merged pull requests:
v2.0.0 (2017-01-04)
Closed issues:
Merged pull requests:
- Fix failing Chefspecs #44 (tas50)
- fix github resolve #42 (chris-rock)
- Added sources and issue url, for the Chef Supermarket reference #40 (enzor)
- Switch to chef_nginx and update testing #39 (tas50)
- move to chef_nginx fork #37 (mburns)
v1.1.0 (2016-11-21)
Closed issues:
Merged pull requests:
- delete duplicate entry about server tokens #36 (rndmh3ro)
- Add fedora to platform_family. #35 (chris-rock)
- remove net-ssh version pin and fix chefspec issue #34 (atomic111)
- remove ubuntu 15.10 from kitchen.yml #32 (atomic111)
- bump version to 1.0.0 #31 (chris-rock)
- change hardeni-io in dev-sec #29 (atomic111)
- migrate to kitchen-dokken and create content for README.md #28 (atomic111)
- update common kitchen.yml platforms #27 (chris-rock)
- fix foodcritic warnings #26 (chris-rock)
- dh group generation #25 (bpieck)
- update common Gemfile for chef11+12 #24 (arlimus)
- common files: centos7 + rubocop #23 (arlimus)
- fix FC001: Use strings in preference to symbols to access node attributes #22 (chris-rock)
- remove deprecated chefspec/server #21 (chris-rock)
- update travis tests to tests chef 11 and chef 12 #20 (chris-rock)
- update common kitchen.yml platforms #19 (arlimus)
- update common readme badges, kitchen.yml platforms #18 (arlimus)
- Bring berksfile and metadata.rb in sync #17 (Rockstar04)
- fix the chef nginx deployment #16 (ehaselwanter)
- add test instructions #15 (chris-rock)
- updating common files #14 (arlimus)
- Badges #13 (chris-rock)
- updating common files #12 (arlimus)
- chef-spec: use expect instead of should #10 (chris-rock)
- more_clear_headers support in centos #9 (chris-rock)
- updating common files #8 (arlimus)
- Chefspec #7 (chris-rock)
- improvement: only install nginx extras if available #6 (chris-rock)
- nginx.conf must only be accessible to user root #4 (atomic111)
- improvement: handle ubuntu installation methods #3 (arlimus)
- add configuration of compilation flags #2 (arlimus)
- First features #1 (arlimus)
* This Change Log was automatically generated by github_changelog_generator
Collaborator Number Metric
3.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
3.0.0 failed this metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
3.0.0 passed this metric
3.0.0 passed this metric
Testing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
3.0.0 failed this metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number