{"id":28481444,"url":"https://github.com/dev-sec/chef-nginx-hardening","last_synced_at":"2025-07-04T17:31:35.092Z","repository":{"id":19364055,"uuid":"22604019","full_name":"dev-sec/chef-nginx-hardening","owner":"dev-sec","description":"This chef cookbook provides secure nginx configurations.","archived":false,"fork":false,"pushed_at":"2025-04-23T19:49:33.000Z","size":123,"stargazers_count":50,"open_issues_count":5,"forks_count":15,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-06-07T20:07:24.878Z","etag":null,"topics":["chef","chef-cookbook","devops","hardening","nginx","security"],"latest_commit_sha":null,"homepage":"http://dev-sec.io/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dev-sec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-04T12:55:48.000Z","updated_at":"2024-08-27T22:35:50.000Z","dependencies_parsed_at":"2023-11-06T11:31:48.579Z","dependency_job_id":"7b605bac-741f-4022-a4ee-a9d19aa0468e","html_url":"https://github.com/dev-sec/chef-nginx-hardening","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dev-sec/chef-nginx-hardening","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fchef-nginx-hardening","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fchef-nginx-hardening/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fchef-nginx-hardening/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fchef-nginx-hardening/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-sec","download_url":"https://codeload.github.com/dev-sec/chef-nginx-hardening/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fchef-nginx-hardening/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263588089,"owners_count":23484860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","chef-cookbook","devops","hardening","nginx","security"],"created_at":"2025-06-07T20:07:25.618Z","updated_at":"2025-07-04T17:31:35.076Z","avatar_url":"https://github.com/dev-sec.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx-hardening (Chef cookbook)\n\n[![Supermarket](http://img.shields.io/cookbook/v/nginx-hardening.svg)][1] [![Build Status](http://img.shields.io/travis/dev-sec/chef-nginx-hardening.svg)][2] [![Code Coverage](http://img.shields.io/coveralls/dev-sec/chef-nginx-hardening.svg)][3] [![Dependencies](http://img.shields.io/gemnasium/dev-sec/chef-nginx-hardening.svg)][4] [![Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)][5]\n\n## Description\n\nThis cookbook provides a secure overlay for nginx configuration.\n\n## Requirements\n\n- Chef 12+\n\n### Platform\n\n- Debian 7, 8\n- Ubuntu 14.04, 16.04\n- CentOS 6, 7\n- OracleLinux 6.6, 6.7, 7.1\n\n## Attributes\n\n- `['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.\n- `['nginx']['default_site_enabled']` - `false` to disable the default site. Set to `on` to enable the default site in nginx.\n- `['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.\n- `['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.\n- `['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.\n- `['nginx-hardening']['source']['http_autoindex_module']` - `false` to disable the HTTP Autoindex module. Set to `true` to enable http_autoindex_module.\n- `['nginx-hardening']['source']['http_ssi_module']` - `false` to disable the HTTP SSI module. Set to `true` to enable http_ssi_module.\n- `['nginx-hardening']['options']['ssl_protocols']` - `'TLSv1.2'` to specify the SSL protocol which should be used.\n- `['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.\n- `['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.\n- `['nginx-hardening']['dh-size']` - `2048` Specifies the length of DH parameters for EDH ciphers.\n\nYou can also use the complete attributes from the [nginx cookbook](https://supermarket.chef.io/cookbooks/nginx)\n\n## Usage\n\nAdd the recipes to the run_list:\n\n```\n\"recipe[apt]\"\n\"recipe[nginx-hardening::upgrades]\"\n\"recipe[nginx]\"\n\"recipe[nginx-hardening]\"\n```\n\nConfigure attributes:\n\n```\n\"nginx-hardening\" : {\n  \"dh-size\" : \"4096\"\n}\n```\n\n## Local Testing\n\nFor 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](http://downloads.vagrantup.com/) for a vagrant or [Docker Downloads](https://docs.docker.com/mac/) 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](http://kitchen.ci/docs/getting-started).\n\n```bash\n# Install dependencies\ngem install bundler\nbundle install\n\n# Do lint checks\nbundle exec rake lint\n\n# fast test on one machine\nbundle exec kitchen test default-ubuntu-1404\n\n# test on all machines\nbundle exec kitchen test\n\n# for development\nbundle exec kitchen create default-ubuntu-1404\nbundle exec kitchen converge default-ubuntu-1404\nbundle exec kitchen verify default-ubuntu-1404\n```\n\n## Contributors + Kudos\n\n- Dominik Richter [arlimus](https://github.com/arlimus)\n- Christoph Hartmann [chris-rock](https://github.com/chris-rock)\n- Patrick Muench [atomic111](https://github.com/atomic111)\n- Edmund Haselwanter [ehaselwanter](https://github.com/ehaselwanter)\n\n## Contributing\n\nSee [contributor guideline](CONTRIBUTING.md).\n\n## License and Author\n\n- Author:: Dominik Richter [dominik.richter@googlemail.com](mailto:dominik.richter@googlemail.com)\n- Author:: Deutsche Telekom AG\n\n\n```\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n[1]: https://supermarket.getchef.com/cookbooks/nginx-hardening\n[2]: https://travis-ci.org/dev-sec/chef-nginx-hardening\n[3]: https://coveralls.io/r/dev-sec/chef-nginx-hardening\n[4]: https://gemnasium.com/dev-sec/chef-nginx-hardening\n[5]: https://gitter.im/dev-sec/general\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-sec%2Fchef-nginx-hardening","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-sec%2Fchef-nginx-hardening","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-sec%2Fchef-nginx-hardening/lists"}