{"id":13467760,"url":"https://github.com/dev-sec/ansible-collection-hardening","last_synced_at":"2026-01-23T00:49:40.011Z","repository":{"id":31487678,"uuid":"35051828","full_name":"dev-sec/ansible-collection-hardening","owner":"dev-sec","description":"This Ansible collection provides battle tested hardening for Linux, SSH, nginx, MySQL","archived":false,"fork":false,"pushed_at":"2026-01-16T06:58:19.000Z","size":2472,"stargazers_count":5122,"open_issues_count":73,"forks_count":805,"subscribers_count":118,"default_branch":"master","last_synced_at":"2026-01-16T22:05:46.632Z","etag":null,"topics":["ansible","ansible-collection","collection","devsec","hacktoberfest","hardening","linux","mysql-hardening","nginx","nginx-hardening","os-hardening","playbook","protection","role","ssh-hardening","sysctl"],"latest_commit_sha":null,"homepage":"http://dev-sec.io/","language":"Jinja","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-05-04T18:26:56.000Z","updated_at":"2026-01-16T21:09:09.000Z","dependencies_parsed_at":"2024-01-15T15:40:45.197Z","dependency_job_id":"9b25899c-0ba9-443f-86cc-de2468c3881e","html_url":"https://github.com/dev-sec/ansible-collection-hardening","commit_stats":null,"previous_names":["dev-sec/ansible-os-hardening"],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/dev-sec/ansible-collection-hardening","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fansible-collection-hardening","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fansible-collection-hardening/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fansible-collection-hardening/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fansible-collection-hardening/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-sec","download_url":"https://codeload.github.com/dev-sec/ansible-collection-hardening/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-sec%2Fansible-collection-hardening/sbom","scorecard":{"id":336597,"data":{"date":"2025-08-11","repo":{"name":"github.com/dev-sec/ansible-collection-hardening","commit":"50befb5fe86ffaef61312a9bbd41ef8d68fda14b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/18 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ansible-lint.yml:1","Warn: no topLevel permission defined: .github/workflows/codespell.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/enforce-labels.yml:9","Warn: no topLevel permission defined: .github/workflows/galaxy-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/mysql_hardening.yml:1","Warn: no topLevel permission defined: .github/workflows/nginx_hardening.yml:1","Warn: no topLevel permission defined: .github/workflows/os_hardening.yml:1","Warn: no topLevel permission defined: .github/workflows/os_hardening_vm.yml:1","Warn: no topLevel permission defined: .github/workflows/prettier-md.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/roles-readme.yml:1","Warn: no topLevel permission defined: .github/workflows/ssh_hardening.yml:1","Warn: no topLevel permission defined: .github/workflows/ssh_hardening_bsd.yml:1","Warn: no topLevel permission defined: .github/workflows/ssh_hardening_custom_tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/codespell.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/dev-sec/ansible-collection-hardening/codespell.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/dev-sec/ansible-collection-hardening/release.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/mysql_hardening.yml:72","Warn: pipCommand not pinned by hash: .github/workflows/mysql_hardening.yml:76","Warn: pipCommand not pinned by hash: .github/workflows/nginx_hardening.yml:71","Warn: pipCommand not pinned by hash: .github/workflows/nginx_hardening.yml:75","Warn: pipCommand not pinned by hash: .github/workflows/os_hardening.yml:76","Warn: pipCommand not pinned by hash: .github/workflows/os_hardening.yml:80","Warn: pipCommand not pinned by hash: .github/workflows/os_hardening_vm.yml:64","Warn: pipCommand not pinned by hash: .github/workflows/os_hardening_vm.yml:65","Warn: pipCommand not pinned by hash: .github/workflows/os_hardening_vm.yml:66","Warn: pipCommand not pinned by hash: .github/workflows/os_hardening_vm.yml:72","Warn: pipCommand not pinned by hash: .github/workflows/roles-readme.yml:40","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening.yml:79","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening.yml:83","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening_bsd.yml:52","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening_bsd.yml:53","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening_bsd.yml:54","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening_custom_tests.yml:79","Warn: pipCommand not pinned by hash: .github/workflows/ssh_hardening_custom_tests.yml:83","Info:  21 out of  21 GitHub-owned GitHubAction dependencies pinned","Info:  11 out of  13 third-party GitHubAction dependencies pinned","Info:   0 out of  18 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-18T04:53:06.644Z","repository_id":31487678,"created_at":"2025-08-18T04:53:06.644Z","updated_at":"2025-08-18T04:53:06.644Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28676147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T20:48:19.482Z","status":"ssl_error","status_checked_at":"2026-01-22T20:48:14.968Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ansible","ansible-collection","collection","devsec","hacktoberfest","hardening","linux","mysql-hardening","nginx","nginx-hardening","os-hardening","playbook","protection","role","ssh-hardening","sysctl"],"created_at":"2024-07-31T15:01:00.215Z","updated_at":"2026-01-23T00:49:40.005Z","avatar_url":"https://github.com/dev-sec.png","language":"Jinja","funding_links":[],"categories":["Jinja","🚀 Lets go!","Roles","Linux Hardening"],"sub_categories":["⚡ Preparing Ubuntu with Ansible"],"readme":"# Ansible Collection - devsec.hardening\n\n[![devsec.os_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening.yml)\n[![devsec.os_hardening VM](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening_vm.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening_vm.yml)\n[![devsec.ssh_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening.yml)\n[![devsec.ssh_hardening BSD](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_bsd.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_bsd.yml)\n[![devsec.ssh_hardening with custom tests](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_custom_tests.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_custom_tests.yml)\n[![devsec.nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/nginx_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/nginx_hardening.yml)\n[![devsec.mysql_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/mysql_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/mysql_hardening.yml)\n\n## Description\n\nThis collection provides battle tested hardening for:\n\n- Linux operating systems:\n  - CentOS Stream 9\n  - AlmaLinux 8/9/10\n  - Rocky Linux 8/9/10\n  - Debian 11/12/13\n  - Ubuntu 20.04/22.04/24.04\n  - Amazon Linux (some roles supported)\n  - Arch Linux (some roles supported)\n  - Fedora 39/40 (some roles supported)\n  - Suse Tumbleweed (some roles supported)\n- MySQL\n  - MariaDB \u003e= 5.5.65, \u003e= 10.1.45, \u003e= 10.3.17\n  - MySQL \u003e= 5.7.31, \u003e= 8.0.3\n- Nginx 1.0.16 or later\n- OpenSSH 5.3 and later\n\nThe hardening is intended to be compliant with the Inspec DevSec Baselines:\n\n- \u003chttps://github.com/dev-sec/linux-baseline\u003e\n- \u003chttps://github.com/dev-sec/mysql-baseline\u003e\n- \u003chttps://github.com/dev-sec/nginx-baseline\u003e\n- \u003chttps://github.com/dev-sec/ssh-baseline\u003e\n\n## Looking for the old roles?\n\nThe roles are now part of the hardening-collection.\nWe have kept the old releases of the `os-hardening` role in this repository, so you can find the them by exploring older tags.\nThe last release of the standalone role was [6.2.0](https://github.com/dev-sec/ansible-collection-hardening/tree/6.2.0).\n\nThe other roles are in separate archives repositories:\n\n- [apache_hardening](https://github.com/dev-sec/ansible-apache-hardening)\n- [mysql_hardening](https://github.com/dev-sec/ansible-mysql-hardening)\n- [nginx_hardening](https://github.com/dev-sec/ansible-nginx-hardening)\n- [ssh_hardening](https://github.com/dev-sec/ansible-ssh-hardening)\n- [windows_hardening](https://github.com/dev-sec/ansible-windows-hardening)\n\n## Minimum required Ansible-version\n\n- Ansible \u003e= 2.16\n\n## Included content\n\n- [os_hardening](roles/os_hardening/)\n- [mysql_hardening](roles/mysql_hardening/)\n- [nginx_hardening](roles/nginx_hardening/)\n- [ssh_hardening](roles/ssh_hardening/)\n\nIn progress, not working:\n\n- [apache_hardening](roles/apache_hardening/)\n- [windows_hardening](roles/windows_hardening/)\n\n## Installation\n\nInstall the collection via ansible-galaxy:\n\n`ansible-galaxy collection install devsec.hardening`\n\n## Using this collection\n\nPlease refer to the examples in the readmes of the role.\n\nSee [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.\n\n## Contributing to this collection\n\nSee the [contributor guideline](CONTRIBUTING.md).\n\n## Release notes\n\nSee the [changelog](https://github.com/dev-sec/ansible-os-hardening/tree/master/CHANGELOG.md).\n\n## Roadmap\n\nTodos:\n\n- Work on [apache_hardening](roles/apache_hardening/) and [windows_hardening](roles/windows_hardening/)\n- Add support for more operating systems\n\n## More information\n\nGeneral information:\n\n- [Ansible Collection overview](https://github.com/ansible-collections/overview)\n- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)\n- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)\n- [Ansible Collections Checklist](https://github.com/ansible-collections/overview/blob/master/collection_requirements.rst)\n- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)\n- [The Bullhorn (the Ansible Contributor newsletter)](https://us19.campaign-archive.com/home/?u=56d874e027110e35dea0e03c1\u0026id=d6635f5420)\n- [Changes impacting Contributors](https://github.com/ansible-collections/overview/issues/45)\n\n## Licensing\n\nLicensed 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\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-sec%2Fansible-collection-hardening","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-sec%2Fansible-collection-hardening","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-sec%2Fansible-collection-hardening/lists"}