GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - awailly/cis-ubuntu-ansible: Audit and modify an Ubuntu system to satisfy CIS (Center for Internet Security) rules

BranchesTags
Open more actions menu

Latest commit

 

History

470 Commits
470 Commits

Folders and files

NameName
Last commit message
Last commit date
defaults
defaults
 
 
docs
docs
 
 
handlers
handlers
 
 
meta
meta
 
 
tasks
tasks
 
 
tests
tests
 
 
vars
vars
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CONTRIBUTORS
CONTRIBUTORS
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Vagrantfile
Vagrantfile
 
 
mkdocs.yml
mkdocs.yml
 
 

Repository files navigation

CIS for Ubuntu 14.04

Build Status Documentation Status Coverage Status

Prerequisites

The role is focused on hardening an Ubuntu 14.04 system. However it has been successfully tested on other Debian based systems (Debian 8, Raspbian). The minimum requirements of the targeted system are ssh, aptitude and python2; ansible>=1.9 is required on your local system.

Usage

One liner installation & execution

The following will automatically install Ansible, download and run the playbook on your local system.

$ \curl -sSL https://raw.githubusercontent.com/awailly/cis-ubuntu-ansible/install/get.sh > /tmp/cis.sh && bash /tmp/cis.sh

To apply the playbook on a remote system:

$ IP=[remote host's IP] USER=[remote user] \curl -sSL https://raw.githubusercontent.com/awailly/cis-ubuntu-ansible/install/get.sh | bash

Manual installation

Install dependencies on your host (on Ubuntu 14.04):

$ sudo apt-get install python-pip git python-dev
$ sudo pip install ansible markupsafe

Create a placeholder to describe your machine:

$ mkdir -p ansible/roles-ubuntu/roles
$ cd ansible/roles-ubuntu
$ git clone https://github.com/awailly/cis-ubuntu-ansible.git roles/cis

Create a playbook in the roles-ubuntu folder:

$ cat >>  playbook.yml << 'EOF'
---
- hosts: all
  roles:
    - cis
EOF

Tuning the environment

You have to tune the environment to match your security requirements. The default is very restrictive and will perform strong modifications on the system. All requirements are enabled and may not work. For example the rsyslog server address have to be defined to respect the CIS rule.

Read default/main.yml file and set your variables in vars/main.yml

For the CI tests we only create specific files for the environment (see tests/travis_defaults.yml) in the vars/ directory.

The role does not ship default passwords. Before running it, set these two variables in vars/main.yml (or with -e):

  • root_password_grub: PBKDF2 hash for the bootloader password, generated with grub-mkpasswd-pbkdf2. The play fails if a bootloader password has to be set and this variable is missing.
  • root_password: SHA-512 crypt hash for the root account, generated with mkpasswd --method=sha-512. When it is missing, the role leaves the root password untouched.

Running the role

Replace the target information (USER, IPADDRESS) and run the playbook with a version of ansible higher than 1.8:

$ ansible-playbook -b -u USER -i 'IPADDRESS,' playbook.yml

Note that this command will perform modifications on the target. Add the -C option to only check for modifications and audit the system. However, some tasks cannot be audited as they need to register a variable on the target and thus modify the system.

If the user you are using is not privileged you have to use the -b (become) option to perform privilege escalation. The password required to become superuser can be specified with the --ask-become-pass option.

Optimizations

Ansible come with some great options that can improve your operations:

  • Add the -e "pipelining=True" option to the command line to speed up the hardening process.
  • Specify the private key to use with the --private-key=~/.ssh/id_rsa option.
  • The conventional method to specify hosts in ansible is to create an inventory file and feed it with a group of hosts to process.

Documentation

The details of each tasks operated on the target system is available in the online documentation. It is build on every commit based on the docs/ repository content.

Contributing

We accept modifications through pull requests. Please note that CI tests and code coverage are being performed automatically. All tests have to pass before accepting the contribution.

Issues are welcome too, and we expect reproductible steps to have efficient discussions.

License

This project is under GPL license.

Contact

We have a dedicated IRC channel for the project on chat.freenode.net. Join us on ##cis-ansible or with the direct link.

About

Audit and modify an Ubuntu system to satisfy CIS (Center for Internet Security) rules

Resources

Readme
GPL-2.0 license
Activity

Stars

134 stars

Watchers

21 watching

Forks

72 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.