Skip to content

Commit

Permalink
(SIMP-6150) Fixed issue where auditd failed to start (#95)
Browse files Browse the repository at this point in the history
SIMP-6150 #close
  • Loading branch information
sharkbruhaha authored and trevor-vaughan committed Apr 11, 2019
1 parent a17078c commit 929e66a
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 93 deletions.
4 changes: 4 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ fixtures:
repo: https://github.com/simp/inspec-profile-disa_stig-el7
branch: master
target: spec/fixtures/inspec_deps/inspec_profiles/profiles

augeas_core:
repo: https://github.com/simp/pupmod-puppetlabs-augeas_core.git
puppet_version: ">= 6.0.0"
134 changes: 71 additions & 63 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
# https://puppet.com/misc/puppet-enterprise-lifecycle
# https://puppet.com/docs/pe/latest/overview/getting_support_for_pe.html#standard-releases-and-long-term-support-releases
# ------------------------------------------------------------------------------
# release pup ruby eol
# PE 2018.4 5.5.6 2.4.4 2020-05 (LTS)
# SIMP 6.3 5.5.7 2.4.4
# release pup ruby eol
# SIMP 6.3 5.5.10 2.4.5 TBD***
# PE 2018.1 5.5.8 2.4.5 2020-05 (LTS)***
# PE 2019.0 6.0 2.5.1 2019-08-31^^^
#
# *** = Modules created for SIMP 6.2+ are not required to support Puppet < 4.10
# *** = Modules created for SIMP 6.3+ are not required to support Puppet < 4.10
---
stages:
- 'sanity'
Expand All @@ -17,11 +18,9 @@ stages:
- 'compliance'
- 'deployment'

image: 'ruby:2.1'

variables:
PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
BUNDLER_VERSION: '1.16.1'
BUNDLER_VERSION: '1.17.1'

# Force dependencies into a path the gitlab-runner user can write to.
# (This avoids some failures on Runners with misconfigured ruby environments.)
Expand All @@ -44,58 +43,58 @@ variables:
paths:
- '.vendor'
before_script:
- 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.16.0}")'
- 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=e.map{|x| x.size}.max+1; e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
- 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.17.1}")'
- 'declare GEM_INSTALL_CMD=(gem install --no-document)'
- 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
- 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
- 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
- 'rm -rf pkg/ || :'
- 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || echo "PIPELNE: Bundler could not find everything"'
- 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || { echo "PIPELINE: Bundler could not install everything (see log output above)" && exit 99 ; }'

# Puppet + testing environments
# --------------------------------------
.pup_4_10_X: &pup_4_10_X
image: 'ruby:2.1'
variables:
PUPPET_VERSION: '~> 4.10.4'
MATRIX_RUBY_VERSION: '2.1'
# To avoid running a prohibitive number of tests every commit,
# don't set this env var in your gitlab instance
.only_with_SIMP_FULL_MATRIX: &only_with_SIMP_FULL_MATRIX
only:
variables:
- $SIMP_FULL_MATRIX == "yes"

.pup_4_latest: &pup_4_latest
image: 'ruby:2.1'
variables:
PUPPET_VERSION: '~> 4.0'
MATRIX_RUBY_VERSION: '2.1'
# Puppet Versions
#-----------------------------------------------------------------------

.pup_5_5_6: &pup_5_5_6
.pup_5: &pup_5
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '5.5.6'
PUPPET_VERSION: '~> 5.0'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'

.pup_5_5_7: &pup_5_5_7
.pup_5_5_10: &pup_5_5_10
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '5.5.7'
PUPPET_VERSION: '5.5.10'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'

.pup_5_latest: &pup_5_latest
image: 'ruby:2.4'
.pup_6: &pup_6
image: 'ruby:2.5'
variables:
PUPPET_VERSION: '~> 5.0'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'
PUPPET_VERSION: '~> 6.0'
BEAKER_PUPPET_COLLECTION: 'puppet6'
MATRIX_RUBY_VERSION: '2.5'


# Testing Environments
#-----------------------------------------------------------------------

# jobs
# --------------------------------------
.lint_tests: &lint_tests
stage: 'validation'
tags: ['docker']
<<: *setup_bundler_env
script:
- 'bundle exec rake syntax'
- 'bundle exec rake lint'
- 'bundle exec rake metadata_lint'

.unit_tests: &unit_tests
stage: 'validation'
Expand All @@ -114,77 +113,86 @@ variables:
tags: ['beaker']
<<: *setup_bundler_env


# Pipeline / testing matrix
#=======================================================================

sanity_checks:
<<: *pup_5_latest
<<: *pup_5
<<: *setup_bundler_env
stage: 'sanity'
tags: ['docker']
script:
- 'if `hash apt-get`; then apt-get update; fi'
- 'if `hash apt-get`; then apt-get install -y rpm; fi'
- 'bundle exec rake check:dot_underscore'
- 'bundle exec rake check:test_file'
- 'bundle exec rake pkg:check_version'
- 'bundle exec rake pkg:compare_latest_tag'
- 'bundle exec rake pkg:create_tag_changelog'
- 'bundle exec puppet module build'

# Linting
#-----------------------------------------------------------------------

pup4-lint:
<<: *pup_4_latest
pup5-lint:
<<: *pup_5
<<: *lint_tests

pup5-lint:
<<: *pup_5_latest
pup6-lint:
<<: *pup_6
<<: *lint_tests

pup4.10-unit:
<<: *pup_4_10_X
<<: *unit_tests
# Unit Tests
#-----------------------------------------------------------------------

pup5.3-unit:
<<: *pup_5_5_6
pup5-unit:
<<: *pup_5
<<: *unit_tests

pup5.5-unit:
<<: *pup_5_5_7
pup5.5.10-unit:
<<: *pup_5_5_10
<<: *unit_tests

pup5.latest-unit:
<<: *pup_5_latest
pup6-unit:
<<: *pup_6
<<: *unit_tests

pup4.10-acceptance:
<<: *pup_4_10_X
# Acceptance tests
# ==============================================================================
pup5.5.10:
<<: *pup_5_5_10
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites'

pup4.10-fips-acceptance:
<<: *pup_4_10_X
pup5.5.10-fips:
<<: *pup_5_5_10
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites'

pup5.5-acceptance:
<<: *pup_5_5_7
pup5.5.10-oel-combined-x64:
<<: *pup_5_5_10
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites'
- 'bundle exec rake beaker:suites[default,oel-combined-x64]'

pup5.5-fips-acceptance:
<<: *pup_5_5_7
pup5.5.10-oel-combined-x64-fips:
<<: *pup_5_5_10
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites'
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,oel-combined-x64]'

pup5.5-oel-acceptance:
<<: *pup_5_5_7
pup6:
<<: *pup_6
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,oel]'
- 'bundle exec rake beaker:suites'

pup5.5-fips-compliance:
<<: *pup_5_5_7
<<: *compliance_base
pup6-fips:
<<: *pup_6
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[compliance]'
- 'BEAKER_fips=yes bundle exec rake beaker:suites'
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.4
2.4.5
32 changes: 10 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.2 4.10 2.1.9 TBD
# PE 2016.4 4.10 2.1.9 2018-12-31 (LTS)
# PE 2017.3 5.3 2.4.4 2018-12-31
# SIMP 6.3 5.5 2.4.4 TBD***
# PE 2018.1 5.5 2.4.4 2020-05 (LTS)***
# PE 2017.3 5.3 2.4.5 2018-12-31
# SIMP 6.3 5.5 2.4.5 TBD***
# PE 2018.1 5.5 2.4.5 2020-05 (LTS)***
# PE 2019.0 6.0 2.5.1 2019-08-31^^^
#
# *** = Modules created for SIMP 6.3+ are not required to support Puppet < 5.5
# ^^^ = SIMP doesn't support 6 yet; tests are info-only and allowed to fail

---
language: ruby
Expand All @@ -38,18 +35,16 @@ addons:

before_install:
- rm -f Gemfile.lock
- gem install -v '~> 1.17' bundler

global:
- STRICT_VARIABLES=yes

jobs:
allow_failures:
- name: 'Latest Puppet 6.x (allowed to fail)'

include:
- stage: check
name: 'Syntax, style, and validation checks'
rvm: 2.4.4
rvm: 2.4.5
env: PUPPET_VERSION="~> 5"
script:
- bundle exec rake check:dot_underscore
Expand All @@ -61,43 +56,36 @@ jobs:
- bundle exec rake lint
- bundle exec puppet module build

- stage: spec
name: 'Puppet 4.10 (SIMP 6.2, PE 2016.4)'
rvm: 2.1.9
env: PUPPET_VERSION="~> 4.10.0"
script:
- bundle exec rake spec

- stage: spec
name: 'Puppet 5.3 (PE 2017.3)'
rvm: 2.4.4
rvm: 2.4.5
env: PUPPET_VERSION="~> 5.3.0"
script:
- bundle exec rake spec

- stage: spec
rvm: 2.4.4
rvm: 2.4.5
name: 'Puppet 5.5 (SIMP 6.3, PE 2018.1)'
env: PUPPET_VERSION="~> 5.5.0"
script:
- bundle exec rake spec

- stage: spec
name: 'Latest Puppet 5.x'
rvm: 2.4.4
rvm: 2.4.5
env: PUPPET_VERSION="~> 5.0"
script:
- bundle exec rake spec

- stage: spec
name: 'Latest Puppet 6.x (allowed to fail)'
name: 'Latest Puppet 6.x'
rvm: 2.5.1
env: PUPPET_VERSION="~> 6.0"
script:
- bundle exec rake spec

- stage: deploy
rvm: 2.4.4
rvm: 2.4.5
script:
- true
before_deploy:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Wed Apr 10 2019 Joseph Sharkey <[email protected]> - 8.2.2-0
- Ensure that space_left is always larger than admin_space_left
- Updated tests in support of puppet6, and removed puppet4 support

* Sat Apr 06 2019 Jim Anderson <[email protected]> - 8.2.2-0
- config.pp now managed /etc/audit in addition to /etc/audit/rules.d.
The permissions and ownership of the two directories should be the
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ group :test do
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 2.2')
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 5.6')
gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.8', '< 6.0'])
end

group :development do
Expand All @@ -28,5 +28,5 @@ end
group :system_tests do
gem 'beaker'
gem 'beaker-rspec'
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '>= 1.13.0')
gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '>= 1.13')
end
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![License](https://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![License](https://img.shields.io/:license-apache-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/73/badge)](https://bestpractices.coreinfrastructure.org/projects/73)
[![Puppet Forge](https://img.shields.io/puppetforge/v/simp/auditd.svg)](https://forge.puppetlabs.com/simp/auditd)
[![Puppet Forge Downloads](https://img.shields.io/puppetforge/dt/simp/auditd.svg)](https://forge.puppetlabs.com/simp/auditd)
Expand Down
9 changes: 6 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@
Auditd::NameFormat $name_format = 'USER',
Integer[0] $max_log_file = 24, # CCE-27550-3
Auditd::MaxLogFileAction $max_log_file_action = 'ROTATE', # CCE-27237-7
Integer[0] $space_left = 75,
Auditd::SpaceLeftAction $space_left_action = 'SYSLOG', # CCE-27238-5 : No guarantee of e-mail server so sending to syslog.
String[1] $action_mail_acct = 'root', # CCE-27241-9
Integer[0] $admin_space_left = 50,
Auditd::SpaceLeftAction $admin_space_left_action = 'SUSPEND', # CCE-27239-3 : No guarantee of e-mail server so sending to syslog.
Integer[0] $space_left = $admin_space_left + 25, # needs to be larger than $admin_space_left or auditd will not start
Auditd::SpaceLeftAction $space_left_action = 'SYSLOG', # CCE-27238-5 : No guarantee of e-mail server so sending to syslog.
String[1] $action_mail_acct = 'root', # CCE-27241-9
Auditd::DiskFullAction $disk_full_action = 'SUSPEND',
Auditd::DiskErrorAction $disk_error_action = 'SUSPEND',
Boolean $write_logs = $log_format ? { 'NOLOG' => false, default => true },
Expand All @@ -185,6 +185,9 @@
) {

if $enable {
unless $space_left > $admin_space_left {
fail('Auditd requires $space_left to be greater than $admin_space_left, otherwise it will not start')
}
if $facts['auditd_version'] and ( versioncmp($facts['auditd_version'], '2.6.0') < 0 ) {
if ( versioncmp($facts['auditd_version'], '2.5.2') < 0 ) {
unless $write_logs {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.10.4 < 6.0.0"
"version_requirement": ">= 5.0.0 < 7.0.0"
}
]
}
Loading

0 comments on commit 929e66a

Please sign in to comment.