mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
bc3c5039f3
* Updates aide-conf docs Signed-off-by: kagarmoe <kgarmoe@chef.io> * Removes 'matchers' language. Signed-off-by: kagarmoe <kgarmoe@chef.io> * Really resolves merge conflict Signed-off-by: kagarmoe <kgarmoe@chef.io>
78 lines
2.3 KiB
Text
78 lines
2.3 KiB
Text
---
|
|
title: The aide_conf Resource
|
|
---
|
|
|
|
# aide_conf
|
|
|
|
Use the `aide_conf` InSpec audit resource to test the rules established for the file integrity tool AIDE. Controlled by the aide.conf file typically at /etc/aide.conf.
|
|
|
|
<br>
|
|
|
|
## Syntax
|
|
|
|
An `aide_conf` resource block can be used to determine if the selection lines contain one (or more) directories whose files should be added to the aide database:
|
|
|
|
describe aide_conf('path') do
|
|
its('selection_lines') { should include '/sbin' }
|
|
end
|
|
|
|
where
|
|
|
|
* `'selection_lines'` refers to all selection lines found in the aide.conf file
|
|
* `('path')` is the non-default path to the `aide.conf` file (optional)
|
|
* `should include 'value'` is the value that is expected
|
|
|
|
Use the where clause to match a selection_line to one rule or a particular set of rules found in the aide.conf file:
|
|
|
|
describe aide_conf.where { selection_line == '/bin' } do
|
|
its('rules.flatten') { should include 'r' }
|
|
end
|
|
|
|
describe aide_conf.where { selection_line == '/sbin' } do
|
|
its('rules') { should include ['p', 'i', 'l', 'n', 'u', 'g', 'sha512'] }
|
|
end
|
|
|
|
<br>
|
|
|
|
## Supported Properties
|
|
|
|
* `conf_path`, `content`, `rules`, `all_have_rule`
|
|
|
|
## Property Examples
|
|
|
|
The following examples show how to use this InSpec audit resource.
|
|
|
|
### Test if all selection lines contain the xattr rule
|
|
|
|
describe aide_conf.all_have_rule('xattr') do
|
|
it { should eq true }
|
|
end
|
|
|
|
### Test whether selection line for /bin contains a particular rule
|
|
|
|
describe aide_conf.where { selection_line == '/bin' } do
|
|
its('rules.flatten') { should include 'r' }
|
|
end
|
|
|
|
### Test whether selection line for /sbin consists of a particular set of rules
|
|
|
|
describe aide_conf.where { selection_line == '/sbin' } do
|
|
its('rules') { should include ['r', 'sha512'] }
|
|
end
|
|
|
|
### The usage of all\_have\_rule will return whether or not all selection lines in audit.conf contain a particular rule:
|
|
|
|
describe aide_conf.all_have_rule('sha512') do
|
|
it { should eq true }
|
|
end
|
|
|
|
<br>
|
|
|
|
## Matchers
|
|
|
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
|
This InSpec audit resource uses the matchers `eq` and `include`.
|
|
|
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
|
|
|
|