inspec/docs/resources/postgres_ident_conf.md.erb

77 lines
2 KiB
Text
Raw Normal View History

New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
---
title: About the postgres_ident_conf Resource
platform: linux
New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
---
# postgres\_ident\_conf
New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
Use the `postgres_ident_conf` InSpec audit resource to test the client authentication data defined in the pg_hba.conf file.
<br>
New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
## Syntax
An `postgres_ident_conf` InSpec audit resource block declares client authentication data that should be tested:
describe postgres_ident_conf.where { pg_username == 'filter_value' } do
its('attribute') { should eq ['value'] }
end
where
* `'attribute'` is a attribute in the pg ident configuration file
* `'filter_value'` is the value that is to be filtered for
* `'value'` is the value that is to be matched expected
<br>
New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
## Properties
New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
'conf_file', 'map_name', 'params', 'pg_username', 'system_username'
<br>
## Property Examples
New postgres_ident_conf resource (#1963) * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Initial commit of pg_ident_conf resource Signed-off-by: Rony Xavier <rx294@nyu.edu> * Small updates to organization of code Signed-off-by: Aaron Lippold <lippold@gmail.com> Signed-off-by: Rony Xaiver <rx294@nyu.edu> * updated `conf_path` instance var to `conf_file` since we are returning a file. Signed-off-by: Aaron Lippold <lippold@gmail.com> * Updated few bugs on pg_ident_conf added test files and docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Updated docs Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * Added OS check Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock file Signed-off-by: Rony Xavier <rx294@nyu.edu> * Added mock folders Signed-off-by: Rony Xavier <rx294@nyu.edu> Signed-off-by: Aaron Lippold <lippold@gmail.com> * added windows mock file Signed-off-by: Aaron Lippold <lippold@gmail.com> * Changed resource name from pg_ident_conf to postgres_ident_conf Signed-off-by: Rony Xavier <rx294@nyu.edu> * Completed corrections reccomended on PR Signed-off-by: Rony Xavier <rx294@nyu.edu> * removed copyright information Signed-off-by: Aaron Lippold <lippold@gmail.com>
2017-07-03 18:01:40 +00:00
### map_name([String])
`address` returns a an array of strings that matches the where condition of the filter table
describe pg_hba_conf.where { pg_username == 'name' } do
its('map_name') { should eq ['value'] }
end
### pg_username([String])
`pg_username` returns a an array of strings that matches the where condition of the filter table
describe pg_hba_conf.where { pg_username == 'name' } do
its('pg_username') { should eq ['value'] }
end
### system_username([String])
`system_username` returns a an array of strings that matches the where condition of the filter table
describe pg_hba_conf.where { pg_username == 'name' } do
its('system_username') { should eq ['value'] }
end
<br>
## Matchers
This InSpec audit resource matches any service that is listed in the pg ident configuration file. For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
its('pg_username') { should_not eq ['peer'] }
or:
its('map_name') { should eq ['value'] }
For example:
describe postgres_ident_conf.where { pg_username == 'name' } do
its('system_username') { should eq ['value'] }
its('map_name') { should eq ['value'] }
end