{"id":28405954,"url":"https://github.com/ansible-lockdown/ubuntu18-cis","last_synced_at":"2025-07-19T03:32:34.959Z","repository":{"id":43468325,"uuid":"289094383","full_name":"ansible-lockdown/UBUNTU18-CIS","owner":"ansible-lockdown","description":"Automated CIS Benchmark Compliance Remediation for Ubuntu 18 with Ansible","archived":false,"fork":false,"pushed_at":"2025-06-24T08:42:00.000Z","size":728,"stargazers_count":32,"open_issues_count":1,"forks_count":27,"subscribers_count":6,"default_branch":"devel","last_synced_at":"2025-06-24T09:44:10.484Z","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","secure-baseline","secure-configuration","system-hardening","ubuntu-18-hardening","ubuntu-security","ubuntu18"],"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":"2020-08-20T19:36:31.000Z","updated_at":"2025-06-24T08:40:17.000Z","dependencies_parsed_at":"2024-01-30T11:43:10.729Z","dependency_job_id":"6d54f4a9-f7aa-47a5-9288-a63f47793202","html_url":"https://github.com/ansible-lockdown/UBUNTU18-CIS","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ansible-lockdown/UBUNTU18-CIS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FUBUNTU18-CIS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FUBUNTU18-CIS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FUBUNTU18-CIS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FUBUNTU18-CIS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansible-lockdown","download_url":"https://codeload.github.com/ansible-lockdown/UBUNTU18-CIS/tar.gz/refs/heads/devel","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansible-lockdown%2FUBUNTU18-CIS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265883658,"owners_count":23843792,"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","secure-baseline","secure-configuration","system-hardening","ubuntu-18-hardening","ubuntu-security","ubuntu18"],"created_at":"2025-06-01T22:09:38.568Z","updated_at":"2025-07-19T03:32:34.952Z","avatar_url":"https://github.com/ansible-lockdown.png","language":"YAML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UBUNTU18 CIS\n\n## Configure a Ubuntu18 machine to be [CIS](https://www.cisecurity.org/cis-benchmarks/) compliant\n\n### Based on [ CIS Ubuntu1804 Benchmark v2.1.0 ](https://www.cisecurity.org/cis-benchmarks/)\n\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/UBUNTU18-CIS?label=Repo%20Stars\u0026style=social)\n![Forks](https://img.shields.io/github/forks/ansible-lockdown/UBUNTU18-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![Ansible Galaxy Quality](https://img.shields.io/ansible/quality/54776?label=Quality\u0026\u0026logo=ansible)\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/UBUNTU18-CIS)\n![Release Date](https://img.shields.io/github/release-date/ansible-lockdown/UBUNTU18-CIS)\n\n[![Main Pipeline Status](https://github.com/ansible-lockdown/UBUNTU18-CIS/actions/workflows/main_pipeline_validation.yml/badge.svg?)](https://github.com/ansible-lockdown/UBUNTU18-CIS/actions/workflows/main_pipeline_validation.yml)\n\n[![Devel Pipeline Status](https://github.com/ansible-lockdown/UBUNTU18-CIS/actions/workflows/devel_pipeline_validation.yml/badge.svg?)](https://github.com/ansible-lockdown/UBUNTU18-CIS/actions/workflows/devel_pipeline_validation.yml)\n![Devel Commits](https://img.shields.io/github/commit-activity/m/ansible-lockdown/UBUNTU18-CIS/devel?color=dark%20green\u0026label=Devel%20Branch%20Commits)\n\n![Issues Open](https://img.shields.io/github/issues-raw/ansible-lockdown/UBUNTU18-CIS?label=Open%20Issues)\n![Issues Closed](https://img.shields.io/github/issues-closed-raw/ansible-lockdown/UBUNTU18-CIS?label=Closed%20Issues\u0026\u0026color=success)\n![Pull Requests](https://img.shields.io/github/issues-pr/ansible-lockdown/UBUNTU18-CIS?label=Pull%20Requests)\n\n![License](https://img.shields.io/github/license/ansible-lockdown/UBUNTU18-CIS?label=License)\n\n---\n\n## Looking for support?\n\n[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_UB18_cis)\n\n[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_UB18_cis)\n\n### Community\n\nJoin us on 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 UBUNTU18-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 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\nRefer to [UBUNTU18-CIS-Audit](https://github.com/ansible-lockdown/UBUNTU18-CIS-Audit).\n\n## Example Audit Summary\n\nThis is based on a vagrant image with selections enabled. e.g. No Gui or firewall.\nNote: More tests are run during audit as we check config and running state.\n\n```txt\n\nok: [default] =\u003e {\n    \"msg\": [\n        \"The pre remediation results are: ['Total Duration: 5.454s', 'Count: 338, Failed: 47, Skipped: 5'].\",\n        \"The post remediation results are: ['Total Duration: 5.007s', 'Count: 338, Failed: 46, Skipped: 5'].\",\n        \"Full breakdown can be found in /var/tmp\",\n        \"\"\n    ]\n}\n\nPLAY RECAP *******************************************************************************************************************************************\ndefault                    : ok=270  changed=23   unreachable=0    failed=0    skipped=140  rescued=0    ignored=0\n```\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_UB18_cis)\n- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise#GH_AL_UB18_cis)\n- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration#GH_AL_UB18_cis)\n- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise#GH_AL_UB18_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- Access to download or add the goss binary and content to the system if using auditing\n(other options are available on how to get the content to the system.)\n- Python3\n- Ansible 2.10.1+\n- python-def\n- libselinux-python\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-server\n      - level1-workstation\n      - scored\n      - avahi\n      - services\n      - patch\n      - rule_2.2.4\n```\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## Known Issues\n\ncloud0init - due to a bug this will stop working if noexec is added to /var.\nubtu18cis_rule_1_1_3_3\n\n[bug 1839899](https://bugs.launchpad.net/cloud-init/+bug/1839899)\n\n## Pipeline Testing\n\nuses:\n\n- ansible-core 2.16\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## 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-lockdown%2Fubuntu18-cis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansible-lockdown%2Fubuntu18-cis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansible-lockdown%2Fubuntu18-cis/lists"}