Giter Site home page Giter Site logo

dcallao / cis-ubuntu-ansible Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awailly/cis-ubuntu-ansible

0.0 2.0 0.0 647 KB

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

License: GNU General Public License v2.0

Python 71.61% Shell 28.39%

cis-ubuntu-ansible's Introduction

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 http://git.io/vZw8S > /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 http://git.io/vZw8S | 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.

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.

cis-ubuntu-ansible's People

Contributors

awailly avatar pchaigno avatar paskl47 avatar lauraleppert avatar memelet avatar eastokes avatar cpliakas avatar fti7 avatar mjallday avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.