Skip to content

Commit

Permalink
(SIMP-2512) Remove logic from rsyslog rule (#22)
Browse files Browse the repository at this point in the history
- Update rsyslog rule to remove now-implied logic

SIMP-2512 #close
  • Loading branch information
Nick Miller authored and Nick Markowski committed Jan 25, 2017
1 parent 574284e commit baa03f1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 115 deletions.
12 changes: 3 additions & 9 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
fixtures:
repositories:
auditd: https://github.com/simp/pupmod-simp-auditd
augeasproviders_core:
repo: https://github.com/simp/augeasproviders_core
branch: simp-master
augeasproviders_grub:
repo: https://github.com/simp/augeasproviders_grub
branch: simp-master
augeasproviders_core: https://github.com/simp/augeasproviders_core
augeasproviders_grub: https://github.com/simp/augeasproviders_grub
logrotate: https://github.com/simp/pupmod-simp-logrotate
pki: https://github.com/simp/pupmod-simp-pki
rsyslog: https://github.com/simp/pupmod-simp-rsyslog
simpcat: https://github.com/simp/pupmod-simp-simpcat
simplib: https://github.com/simp/pupmod-simp-simplib
stdlib:
repo: https://github.com/simp/puppetlabs-stdlib
branch: master
stdlib: https://github.com/simp/puppetlabs-stdlib
symlinks:
sudosh: "#{source_dir}"
2 changes: 1 addition & 1 deletion .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--log-format="%{path}:%{line}:%{check}:%{KIND}:%{message}"
--relative
--no-class_inherits_from_params_class-check
--no-80chars-check
--no-140chars-check
--no-trailing_comma-check
--no-empty_string_assignment-check
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Mon Jan 23 2017 Nick Miller <nick.miller@onyxpoint.com> - 6.0.0
- Updated rsyslog rule to remove logic

* Wed Dec 14 2016 Liz Nemsick <lnemsick.simp@gmail.com> - 6.0.0-0
- Use simp_options module for global catalysts
- Use strong typed parameters
Expand Down
92 changes: 0 additions & 92 deletions CONTRIBUTING.md

This file was deleted.

6 changes: 3 additions & 3 deletions build/rpm_metadata/requires
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Obsoletes: pupmod-sudosh-test >= 0.0.1
Requires: pupmod-puppetlabs-stdlib < 5.0.0-0
Requires: pupmod-puppetlabs-stdlib >= 4.13.1-0
Requires: pupmod-simp-logrotate < 7.0.0-0
Requires: pupmod-puppetlabs-stdlib < 5.0.0-0
Requires: pupmod-simp-logrotate >= 6.0.0-0
Requires: pupmod-simp-rsyslog < 8.0.0-0
Requires: pupmod-simp-logrotate < 7.0.0-0
Requires: pupmod-simp-rsyslog >= 7.0.0-0
Requires: pupmod-simp-rsyslog < 8.0.0-0
Requires: pupmod-simp-simplib >= 3.1.0-0
Requires: pupmod-simp-simplib < 4.0.0-0
11 changes: 6 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# to create a log rotate rule for the sudosh log file.
#
# @example Ensuring all sudo operations are run with sudosh
# Insert the following code in an appropriate manifest (e.g.,
# Insert the following code in an appropriate manifest (e.g.,
# /etc/puppet/manifests/nodes/default_classes/base_config.pp).
#
#
# sudo::user_specification { 'global_admin':
# user_list => '%administrators',
# host_list => 'ALL',
Expand All @@ -23,10 +23,11 @@
# @author Trevor Vaughan <tvaughan@onyxpont.com>
#
class sudosh (
Boolean $syslog = simplib::lookup('simp_options::syslog', { 'default_value' => false }),
Boolean $logrotate = simplib::lookup('simp_options::logrotate', { 'default_value' => false })
Boolean $syslog = simplib::lookup('simp_options::syslog', { 'default_value' => false }),
Boolean $logrotate = simplib::lookup('simp_options::logrotate', { 'default_value' => false })
) {

# This package is from the SIMP repo
package { 'sudosh2':
ensure => 'latest'
}
Expand All @@ -35,7 +36,7 @@
include '::rsyslog'
# named 'XX_sudosh' so that it appears before the local filesystem defaults
rsyslog::rule::local { 'XX_sudosh':
rule => 'if ($programname == \'sudosh\') then',
rule => '$programname == \'sudosh\'',
target_log_file => '/var/log/sudosh.log',
stop_processing => true
}
Expand Down
18 changes: 15 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"issues_url": "https://simp-project.atlassian.net",
"tags": [
"simp",
"sudosh"
"sudosh",
"audit"
],
"dependencies": [
{
Expand All @@ -26,7 +27,7 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.13.1 < 5.0.0"
"version_requirement": ">= 4.13.0 < 5.0.0"
}
],
"operatingsystem_support": [
Expand All @@ -44,5 +45,16 @@
"7"
]
}
]
],
"requirements": [
{
"name": "puppet",
"version_requirement": "4.x"
},
{
"name": "pe",
"version_requirement": ">= 2016.2.0"
}
],
"data_provider": "hiera"
}
4 changes: 2 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
it { is_expected.to_not contain_rsyslog__rule__local('XX_sudosh') }
it { is_expected.to_not contain_logrotate__rule('sudosh') }
end

context 'with syslog and logrotate enabled' do
let(:params) {{ :syslog => true, :logrotate => true }}
it { is_expected.to create_class('sudosh') }
Expand All @@ -25,7 +25,7 @@

it do
is_expected.to contain_rsyslog__rule__local('XX_sudosh').with({
'rule' => "if ($programname == \'sudosh\') then",
'rule' => "$programname == \'sudosh\'",
'target_log_file' => '/var/log/sudosh.log',
'stop_processing' => true
})
Expand Down

0 comments on commit baa03f1

Please sign in to comment.