{"id":14984430,"url":"https://github.com/ansible-lockdown/rhel7-cis","last_synced_at":"2025-05-15T04:04:53.048Z","repository":{"id":38188655,"uuid":"48126664","full_name":"ansible-lockdown/RHEL7-CIS","owner":"ansible-lockdown","description":"Automated CIS Benchmark Compliance Remediation for RHEL 7 with Ansible","archived":false,"fork":false,"pushed_at":"2025-05-05T17:26:15.000Z","size":1372,"stargazers_count":479,"open_issues_count":1,"forks_count":302,"subscribers_count":37,"default_branch":"devel","last_synced_at":"2025-05-15T04:04:52.073Z","etag":null,"topics":["ansible","ansible-playbook","ansible-role","automation","cis","cis-benchmark","cis-compliance","cis-hardening","cis-security","configuration-management","cybersecurity","enterprise-hardening","it-compliance","linux-hardening","rhel-7-hardening","rhel-security","rhel7","secure-baseline","secure-configuration","system-hardening"],"latest_commit_sha":null,"homepage":"https://www.lockdownenterprise.com","language":"YAML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansible-lockdown.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":"CONTRIBUTING.rst","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}},"created_at":"2015-12-16T18:05:36.000Z","updated_at":"2025-05-13T18:29:16.000Z","dependencies_parsed_at":"2024-01-09T17:56:14.241Z","dependency_job_id":"8a18d54b-9fd5-41f2-99a1-80cac80c483e","html_url":"https://github.com/ansible-lockdown/RHEL7-CIS","commit_stats":{"total_commits":695,"total_committers":34,"mean_commits":"20.441176470588236","dds":0.2834532374100719,"last_synced_commit":"271a44dc586e8a5506cb25fdbbeaab386c56a17c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FRHEL7-CIS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FRHEL7-CIS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FRHEL7-CIS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FRHEL7-CIS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansible-lockdown","download_url":"https://codeload.github.com/ansible-lockdown/RHEL7-CIS/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270641,"owners_count":22042858,"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":["ansible","ansible-playbook","ansible-role","automation","cis","cis-benchmark","cis-compliance","cis-hardening","cis-security","configuration-management","cybersecurity","enterprise-hardening","it-compliance","linux-hardening","rhel-7-hardening","rhel-security","rhel7","secure-baseline","secure-configuration","system-hardening"],"created_at":"2024-09-24T14:09:02.056Z","updated_at":"2025-05-15T04:04:53.027Z","avatar_url":"https://github.com/ansible-lockdown.png","language":"YAML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RHEL 7 CIS\n\n## Configure a RHEL/Centos 7 machine to be [CIS](https://www.cisecurity.org/cis-benchmarks/) compliant\n\n### Based on [CIS RedHat Enterprise Linux 7 Benchmark v4.0.0 - 21-12-2023 ](https://www.cisecurity.org/cis-benchmarks/)\n\n---\n![Org Stars](https://img.shields.io/github/stars/ansible-lockdown?label=Org%20Stars\u0026style=social)\n![Stars](https://img.shields.io/github/stars/ansible-lockdown/RHEL7-CIS?label=Repo%20Stars\u0026style=social)\n![Forks](https://img.shields.io/github/forks/ansible-lockdown/RHEL7-CIS?style=social)\n![followers](https://img.shields.io/github/followers/ansible-lockdown?style=social)\n[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/AnsibleLockdown.svg?style=social\u0026label=Follow%20%40AnsibleLockdown)](https://twitter.com/AnsibleLockdown)\n\n![Discord Badge](https://img.shields.io/discord/925818806838919229?logo=discord)\n\n![Release Branch](https://img.shields.io/badge/Release%20Branch-Main-brightgreen)\n![Release Tag](https://img.shields.io/github/v/release/ansible-lockdown/RHEL7-CIS)\n![Release Date](https://img.shields.io/github/release-date/ansible-lockdown/RHEL7-CIS)\n\n[![Main Pipeline Status](https://github.com/ansible-lockdown/RHEL7-CIS/actions/workflows/main_pipeline_validation.yml/badge.svg?)](https://github.com/ansible-lockdown/RHEL7-CIS/actions/workflows/main_pipeline_validation.yml)\n\n[![Devel Pipeline Status](https://github.com/ansible-lockdown/RHEL7-CIS/actions/workflows/devel_pipeline_validation.yml/badge.svg?)](https://github.com/ansible-lockdown/RHEL7-CIS/actions/workflows/devel_pipeline_validation.yml)\n![Devel Commits](https://img.shields.io/github/commit-activity/m/ansible-lockdown/RHEL7-CIS/devel?color=dark%20green\u0026label=Devel%20Branch%20Commits)\n\n![Issues Open](https://img.shields.io/github/issues-raw/ansible-lockdown/RHEL7-CIS?label=Open%20Issues)\n![Issues Closed](https://img.shields.io/github/issues-closed-raw/ansible-lockdown/RHEL7-CIS?label=Closed%20Issues\u0026\u0026color=success)\n![Pull Requests](https://img.shields.io/github/issues-pr/ansible-lockdown/RHEL7-CIS?label=Pull%20Requests)\n\n![License](https://img.shields.io/github/license/ansible-lockdown/RHEL7-CIS?label=License)\n\n---\n\n## Looking for support?\n\n[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_RH7_cis)\n\n[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_RH7_cis)\n\n### Community\n\nOn our [Discord Server](https://www.lockdownenterprise.com/discord) to ask questions, discuss features, or just chat with other Ansible-Lockdown users\n\n---\n\n## Caution(s)\n\nThis role **will make changes to the system** which may have unintended consequences. This is not an auditing tool but rather a remediation tool to be used after an audit has been conducted.\n\nCheck Mode is not supported! The role will complete in check mode without errors, but it is not supported and should be used with caution. The RHEL7-CIS-Audit role or a compliance scanner should be used for compliance checking over check mode.\n\nThis role was developed against a clean install of the Operating System. If you are implementing to an existing system please review this role for any site specific changes that are needed.\n\nTo use release version please point to main branch and relevant release for the cis benchmark you wish to work with.\n\n---\n\n## Matching a security Level for CIS\n\nIt is possible to to only run level 1 or level 2 controls for CIS.\nThis is managed using tags:\n\n- level1-server\n- level1-workstation\n- level2-server\n- level2-workstation\n\nThe control found in defaults main also need to reflect this as this control the testing thet takes place if you are using the audit component.\n\n## Coming from a previous release\n\nCIS release always contains changes, it is highly recommended to review the new references and available variables. This have changed significantly since ansible-lockdown initial release.\nThis is now compatible with python3 if it is found to be the default interpreter. This does come with pre-requisites which it configures the system accordingly.\n\nFurther details can be seen in the [Changelog](./ChangeLog.md)\n\n## Auditing (new)\n\nThis can be turned on or off within the defaults/main.yml file with the variable rhel7cis_run_audit. The value is false by default, please refer to the wiki for more details. The defaults file also populates the goss checks to check only the controls that have been enabled in the ansible role.\n\nThis is a much quicker, very lightweight, checking (where possible) config compliance and live/running settings.\n\nA new form of auditing has been developed, by using a small (12MB) go binary called [goss](https://github.com/goss-org/goss) along with the relevant configurations to check. Without the need for infrastructure or other tooling.\nThis audit will not only check the config has the correct setting but aims to capture if it is running with that configuration also trying to remove [false positives](https://www.mindpointgroup.com/blog/is-compliance-scanning-still-relevant/) in the process.\n\n## Documentation\n\n- [Read The Docs](https://ansible-lockdown.readthedocs.io/en/latest/)\n- [Getting Started](https://www.lockdownenterprise.com/docs/getting-started-with-lockdown#GH_AL_RH7_cis)\n- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise#GH_AL_RH7_cis)\n- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration#GH_AL_RH7_cis)\n- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise#GH_AL_RH7_cis)\n\n## Requirements\n\n**General:**\n\n- Basic knowledge of Ansible, below are some links to the Ansible documentation to help get started if you are unfamiliar with Ansible\n\n  - [Main Ansible documentation page](https://docs.ansible.com)\n  - [Ansible Getting Started](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html)\n  - [Tower User Guide](https://docs.ansible.com/ansible-tower/latest/html/userguide/index.html)\n  - [Ansible Community Info](https://docs.ansible.com/ansible/latest/community/index.html)\n- Functioning Ansible and/or Tower Installed, configured, and running. This includes all of the base Ansible/Tower configurations, needed packages installed, and infrastructure setup.\n- Please read through the tasks in this role to gain an understanding of what each control is doing. Some of the tasks are disruptive and can have unintended consiquences in a live production system. Also familiarize yourself with the variables in the defaults/main.yml file.\n\n**Technical Dependencies:**\n\n- Running Ansible/Tower setup (this role is tested against Ansible version 2.9.1 and newer)\n- Python3 Ansible run environment\n- python-def (should be included in RHEL/CentOS 7) - First task sets up the prerequisites (Tag pre-reqs)for python3 and python2 (where required)\n  - libselinux-python\n  - python3-rpm (package used by py3 to use the rpm pkg)\n\n## Role Variables\n\nThis role is designed that the end user should not have to edit the tasks themselves. All customizing should be done via the defaults/main.yml file or with extra vars within the project, job, workflow, etc.\n\n## Tags\n\nThere are many tags available for added control precision. Each control has it's own set of tags noting what level, if it's scored/notscored, what OS element it relates to, if it's a patch or audit, and the rule number.\n\nBelow is an example of the tag section from a control within this role. Using this example if you set your run to skip all controls with the tag services, this task will be skipped. The opposite can also happen where you run only controls tagged with services.\n\n```sh\n      tags:\n      - level1-workstation\n      - level1-server\n      - automated\n      - avahi\n      - services\n      - patch\n      - rule_2.2.4\n```\n\n member branches\n\n## Community Contribution\n\nWe encourage you (the community) to contribute to this role. Please read the rules below.\n\n- Your work is done in your own individual branch. Make sure to Signed-off and GPG sign all commits you intend to merge.\n- All community Pull Requests are pulled into the devel branch\n- Pull Requests into devel will confirm your commits have a GPG signature, Signed-off, and a functional test before being approved\n- Once your changes are merged and a more detailed review is complete, an authorized member will merge your changes into the main branch for a new release\n\n## Pipeline Testing\n\nuses:\n\n- ansible-core 2.12\n- ansible collections - pulls in the latest version based on requirements file\n- runs the audit using the devel branch\n- This is an automated test that occurs on pull requests into devel\n\n## Local Testing\n\n- Ansible\n\n  - ansible-base 2.10.17 - python 3.8\n  - ansible-core 2.13.4  - python 3.10\n  - ansible-core 2.15.1  - python 3.11\n\n## Added Extras\n\n- [pre-commit](https://pre-commit.com) can be tested and can be run from within the directory\n\n```sh\npre-commit run\n```\n\n## Credits and Thanks\n\nMassive thanks to the fantastic community and all its members.\n\nThis includes a huge thanks and credit to the original authors and maintainers.\n\nJosh Springer, Daniel Shepherd, Bas Meijeri, James Cassell, Mike Renfro, DFed, George Nalen, Mark Bolwell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-lockdown%2Frhel7-cis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansible-lockdown%2Frhel7-cis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-lockdown%2Frhel7-cis/lists"}