Forge Home

toughen

CIS System hardening for RedHat, Debian, and more.

8,623 downloads

4,715 latest version

4.5 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.0 (latest)
  • 0.6.0
  • 0.5.2
  • 0.4.0
  • 0.2.0
  • 0.1.0
released Dec 30th 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 6.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'shearn89-toughen', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add shearn89-toughen
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install shearn89-toughen --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

shearn89/toughen — version 1.0.0 Dec 30th 2018

toughen

Build Status Test Coverage

Table of Contents

  1. Description
  2. Setup - The basics of getting started with toughen
  3. Usage - A quick how-to
  4. Reference - Parameters, classes, types, etc.
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This is a puppet module that applies various hardening controls as detailed in the documents referenced in guides.txt.

The aim of me writing my own module is to lay out the controls in a manner that I feel is readable and easy to understand, whilst also providing flexibility to the user so that they can add exceptions where necessary.

First priority for development will be CentOS 7, followed by RHEL7. Then the version 6 of both those, followed by Ubuntu and Debian. Other Linux OS's will follow in good time.

Setup

What toughen affects

A range from everything to nothing - it's server hardening. If you're unaware what that involves I strongly recommend you read the guides.

Beginning with toughen

At it's most basic, simply include toughen. However, this will apply the defaults with no consideration for any specific requirments. Good as a starting point if you're building from scratch, not so good if you're hardening an existing server. For that you'll want to apply specific sections of the module.

Usage

For more fine-grained usage, wrap sections into a profile:

class profile::security {
    include toughen::aide
    include toughen::auditing
    include toughen::banners
    include toughen::boot
    include toughen::cron
    include toughen::filesystem
    ## Skip firewall, managed elsewhere.
    # include toughen::firewall
    include toughen::init
    include toughen::legacy_services
    include toughen::mandatory_access
    include toughen::network
    include toughen::pam
    include toughen::perms_owners
    include toughen::process
    include toughen::rsyslog
    include toughen::services
    include toughen::shadow
    include toughen::ssh
    include toughen::sudo
    ## Skip updates, managed elsewhere
    include toughen::updates
    include toughen::user_env
}

You can also pass in parameters directly:

class profile::security {

    class { 'toughen::ssh':
        $port => 2222,
        $allow_users => ['shearna', 'vagrant'],
    }

}

And many other things. The full list of parameters is long and distinguished...

Reference

TODO

Here, include a complete list of your module's classes, types, providers, facts, along with the parameters for each. Users refer to this section (thus the name "Reference") to find specific details; most users don't read it per se.

Limitations

So far, supported only on Puppet 3.8 and CentOS/RedHat 7.

Still to come:

  • CentOS/RedHat 6
  • Ubuntu 16.04.x LTS
  • Amazon Linux?

Also:

  • Scan results with well-known compliance scanners (Nessus, Nexpose)

At some point it would be nice to use some of the iterators in Puppet 4, given RedHat doesn't use Puppet 4 yet, it's a ways off.

Development

Please feel free to contribute via GitHub with a pull request. If you're adding classes, please add unit tests (take a look in spec/classes/ for examples). You can get set up with:

$> bundle install
$> bundle exec rake

...which will lint, validate, and run the spec tests. Please ensure these tests still pass when you have made changes!

You can also view the compliance score against the STIG 'RHEL7 upstream' profile. On CentOS 7:

$> sudo yum install -y openscap-scanner scap-security-guide
$> sudo oscap xccdf eval \
    --profile xccdf_org.ssgproject.content_profile_stig-rhel7-server-upstream \
    --results report.xml \
    --report  report.html \
    /usr/share/xml/scap/ssg/content/ssg-centos7-ds.xml

...and then open up report.html in a browser. Note that this module aims for compliance with CIS standards, not STIG, so there is some discrepancy.