Git Product home page Git Product logo

cis-puppet's Introduction

Build Status

Overview

This module implements the Center for Internet Security (CIS) Security Configuration Benchmark for:

  • Amazon Linux 2014.09
  • Red Hat Enterprise Linux 6 v.1.4.0
  • Red Hat Enterprise Linux 7 v.1.1.0

Each scored control has been implemented as a class or a custom fact.

Installation

Please either:

Use

The class cis::el6all or cis::el7all will enforce all the controls for either RHEL6 or RHEL7. If you wish to deviate please look for the el6all.pp or el7all.pp file and use that as a template. Note that some of the scored controls not able to be written in Puppet code have been implemented as custom facts using Facter. Controls labeled "not scored" by the benchmark are not included.

Also note that there are three subclasses in the cis module:

  • cis::linuxcontrols (implements the specific controls with a general name, e.g. cis::linuxcontrols::c0001, allowing for future re-use)
  • cis::el6 (maps directly to a specific CIS control for RHEL6, e.g. cis::el6::1_1_17 for control 1.1.17 in the benchmark)
  • cis::el7 (maps directly to a specific CIS control for RHEL7, e.g. cis::el6::4_7 for control 4.7 in the benchmark)
  • cis::awslinux (maps directly to a specific CIS control for AWS Linux)

User-Controlled Settings

Some of the settings, such as which log server to use, can be specified by the user. Below is a sample hiera file containing all the current configurable settings:

cis::logserver: 'syslog.localdomain'
cis::ntpserver:
  - ntp1
  - ntp2
  - ntp3
cis::aide_cron_check:
  hour: 6
  minute: 30

Author

Written by Arild Jensen [email protected] with source code repository at https://github.com/arildjensen/cis-puppet.

Release History

  • 0.2.1 - Added Apache 2.0 license
  • 0.2.0 - Added comments and implemented hiera support for some of the settings.
  • 0.1.0 - Initial release

cis-puppet's People

Contributors

arildjensen avatar ericsakowski avatar jorritfolmer avatar kayari75 avatar nibalizer avatar proletaryo avatar thesha1chemist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cis-puppet's Issues

f0004 through f0006 can only pass

From the way I read it, those tests can never fail. Since the COMMANDS variable is being set but the FILES variable is being tested.

rm 'files/el6/etc/rsyslog.conf'

This file is not used anywhere that I can see -- it is probably leftover from before templates/el6/etc/rsyslog.conf.erb was created instead.

Incompatibility with Puppet 4+

It seems this module is incompatible with the just released Puppet 4.
I haven't tested this yet on a VM myself, but the Travis CI builds that are used in testing Pull Requests fail big time. Example 1 and example 2:

[SNIP]
Installing puppet 4.0.0
[SNIP]
Could not parse for environment *root*: Illegal fully qualified name in file /home/travis/build/arildjensen/cis-puppet/manifests/el6/1_1_1.pp at line 6:17
Could not parse for environment *root*: Illegal fully qualified name in file /home/travis/build/arildjensen/cis-puppet/manifests/el6/1_1_10.pp at line 6:17
Could not parse for environment *root*: Illegal fully qualified name in file /home/travis/build/arildjensen/cis-puppet/manifests/el6/1_1_14.pp at line 6:17
Could not parse for environment *root*: Illegal fully qualified name in file /home/travis/build/arildjensen/cis-puppet/manifests/el6/1_1_15.pp at line 6:17
Could not parse for environment *root*: Illegal fully qualified name in file /home/travis/build/arildjensen/cis-puppet/manifests/el6/1_1_16.pp at line 6:17
[SNIP]

After some Googling, this came up from the Puppetlabs website:

Each namespace segment must begin with a lowercase letter and can include Lowercase letters, Numbers and Underscores.

So for compatibility with Puppet 4.0.0+ it looks classes like el6::1_1_1 will need to be renamed to el6::c1_1_1 or something similar that makes seach namespace segment begin with a lowercase letter.

/usr/local/sbin/f000.sh line 10 too many arguments

Hi,

I am using c0010.pp for f0000.sh According to my understanding f0000.sh which is under scripts will be executed and provided the output(pass or fail) under /usr/local/sbin/ as f000.sh.
But for me the f000.sh under scripts is just copiying the file and placing it under /usr/local/sbin. And when I execute just f0000.sh it is throwing me error.

!/bin/sh

  2
  3
  4 # This script is used by the cis Puppet module.
  5 # For the latest version see https://github.com/arildjensen/cis-puppet/
  6
  7
  8 COMMAND=`grep ^password /boot/grub/grub.conf 2>/dev/null`
  9
 10 if [ $COMMAND = x ];
 11   then
 12     echo fail;
 13   else
 14     echo pass;
 15 fi
 16

/usr/local/sbin/f000.sh: line 10: [: too many arguments

Please help me

Errors on minimal CentOS 6.5 install

I did a minimal install of CentOS 6.5, added puppet 3.4.2, and cis. I get the following errors:

puppet apply -e 'include cis::el6all'

/bin/cat: /var/log/control_f0003: No such file or directory
/bin/cat: /var/log/control_f0003: No such file or directory
/bin/cat: /var/log/control_f0002: No such file or directory
/bin/cat: /var/log/control_f0002: No such file or directory
Warning: Variable access via 'ntpserver' is deprecated. Use '@ntpserver' instead. template[/etc/puppet/modules/cis/templates/el6/etc/ntp.conf.erb]:5
(at /etc/puppet/modules/cis/templates/el6/etc/ntp.conf.erb:5:in result') Warning: Variable access via 'logserver' is deprecated. Use '@logserver' instead. template[/etc/puppet/modules/cis/templates/el6/etc/rsyslog.conf.erb]:16 (at /etc/puppet/modules/cis/templates/el6/etc/rsyslog.conf.erb:16:inresult')
Notice: Compiled catalog for vmtest3.ats.msu.edu in environment production in 4.39 seconds
/bin/cat: /var/log/control_f0003: No such file or directory
/bin/cat: /var/log/control_f0003: No such file or directory
/bin/cat: /var/log/control_f0002: No such file or directory
/bin/cat: /var/log/control_f0002: No such file or directory

Scripts cis/files/linuxcontrols/scripts/f000[23].sh send output to /var/log/control_f000[23] and it is checked in cis/lib/facter/f000[23].rb. The other scripts send pass/fail to standard out and check the results of the shell.

If I change f0002 and 3 to behave like the other scripts it seems to work so I don't understand why the difference.

Typo in c0053.pp

source => $hardwaremode ? {

should be

source => $hardwaremodel ? {

Thanks for the great module!

I want to add support for CIS v2.1.1, structure questions

With CIS v2.1.1 for RHEL and CentOS specification how would you like this structured within the repo? Much of the specification i'm writing will be able to reuse existing manifests but more requirements have been added and existing requirements have been relabeled and enumerated differently in the newer specification version. While I wait to hear back I am creating a new directory with el7v2_1_1 as the name.

Security loophole in /var/tmp bind mount

The bind mount of /var/tmp on /tmp doesn't have the same mount options as /tmp.
This means that /var/tmp doesn't have noexec,nodev,nosuid.

A quick test shows that the same shell scipt is executable on /var/tmp, but not on /tmp.
It should be non-executable on both.

Get log server name from hiera

Log server is currently hard coded to "logger". Instead the module should use hiera to look up the name of the central log server and use a default value if none found.

No License File

Since there is no license mentioned in the README or a LICENSE file this isn't properly open sourced, which makes it hard to reuse in my environment.

Please attach a license, I recommend the Apache 2 License for anything Puppet related.

issues on /bin/cat: /var/log/control_f0002: No such file or directory

Hi,

when I run your modules I am getting this error:
/bin/cat: /var/log/control_f0002: No such file or directory
/bin/cat: /var/log/control_f0002: No such file or directory
/bin/cat: /var/log/control_f0003: No such file or directory
/bin/cat: /var/log/control_f0003: No such file or directory

And .sh files are not placed /usr/local/sbin where the results stored?

Please let me know.

Appreciate your help.

Thank You

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.