mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
Merge pull request #5422 from yarick/auditd_conf_readers
This commit is contained in:
commit
9cbca732c2
2 changed files with 7 additions and 1 deletions
|
@ -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/).
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue