Merge pull request #5422 from yarick/auditd_conf_readers

This commit is contained in:
Clinton Wolfe 2021-03-15 11:49:22 -04:00 committed by GitHub
commit 9cbca732c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -41,7 +41,7 @@ where
This matcher will match any property listed in the `auditd.conf` configuration file. Property names and expected values are case-insensitive:
- `admin_space_left`, `admin_space_left_action`, `action_mail_acct`, `disk_error_action`, `disk_full_action`, `flush`, `freq`, `log_file`, `log_format`, `max_log_file`, `max_log_file_action`, `num_logs`, `space_left`, `space_left_action`
- `admin_space_left`, `admin_space_left_action`, `action_mail_acct`, `conf_path`, `content`, `disk_error_action`, `disk_full_action`, `flush`, `freq`, `log_file`, `log_format`, `max_log_file`, `max_log_file_action`, `num_logs`, `params`, `space_left`, `space_left_action`
## Property Examples
@ -66,6 +66,10 @@ The following examples show how to use this Chef InSpec audit resource.
its('disk_error_action') { should cmp 'halt' }
end
describe file(auditd_conf.conf_path) do
its('group') { should cmp 'root' }
end
## Matchers
For a full list of available matchers, please visit our [matchers page](/inspec/matchers/).

View file

@ -16,6 +16,8 @@ module Inspec::Resources
include FileReader
attr_reader :conf_path, :content, :params
def initialize(path = nil)
@conf_path = path || "/etc/audit/auditd.conf"
@content = read_file_content(@conf_path)