2017-07-03 18:01:40 +00:00
---
title: About the postgres_ident_conf Resource
2018-02-16 00:28:15 +00:00
platform: linux
2017-07-03 18:01:40 +00:00
---
2018-01-08 18:09:13 +00:00
# postgres\_ident\_conf
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.
2017-10-03 21:35:10 +00:00
<br>
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
2017-10-03 21:35:10 +00:00
<br>
2017-07-03 18:01:40 +00:00
2018-02-15 14:33:22 +00:00
## Properties
2017-07-03 18:01:40 +00:00
'conf_file', 'map_name', 'params', 'pg_username', 'system_username'
2017-10-03 21:35:10 +00:00
<br>
2018-02-15 14:33:22 +00:00
## Property Examples
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
2017-10-03 21:35:10 +00:00
<br>
## Matchers
2018-02-16 03:07:18 +00:00
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/).
2017-10-03 21:35:10 +00:00
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