Skip to content

Commit f2b8850

Browse files
authored
Merge pull request #51 from dev-sec/inspec6
ensure compatibility with new inspec version
2 parents 79aea7a + 1516b0a commit f2b8850

2 files changed

Lines changed: 22 additions & 41 deletions

File tree

controls/postgres_spec.rb

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,13 @@
2222
title 'PostgreSQL Server Configuration'
2323

2424
# inputs
25-
USER = input(
26-
'user',
27-
description: 'define the postgresql user to access the database',
28-
value: 'postgres'
29-
)
30-
31-
PASSWORD = input(
32-
'password',
33-
description: 'define the postgresql password to access the database',
34-
value: 'iloverandompasswordsbutthiswilldo'
35-
)
36-
37-
POSTGRES_DATA = input(
38-
'postgres_data',
39-
description: 'define the postgresql data directory',
40-
value: postgres.data_dir
41-
)
42-
43-
POSTGRES_CONF_DIR = input(
44-
'postgres_conf_dir',
45-
description: 'define the postgresql configuration directory',
46-
value: postgres.conf_dir
47-
)
48-
49-
POSTGRES_CONF_PATH = input(
50-
'postgres_conf_path',
51-
description: 'define path for the postgresql configuration file',
52-
value: File.join(POSTGRES_CONF_DIR.to_s, 'postgresql.conf')
53-
)
54-
55-
POSTGRES_HBA_CONF_FILE = input(
56-
'postgres_hba_conf_file',
57-
description: 'define path for the postgresql configuration file',
58-
value: File.join(POSTGRES_CONF_DIR.to_s, 'pg_hba.conf')
59-
)
60-
61-
POSTGRES_LOG_DIR = input(
62-
'postgres_log_dir',
63-
description: 'define path for the postgresql log file',
64-
value: '/var/log/postgresql'
65-
)
25+
USER = input('user', value: 'postgres')
26+
PASSWORD = input('password', value: 'iloverandompasswordsbutthiswilldo')
27+
POSTGRES_DATA = input('postgres_data', value: postgres.data_dir)
28+
POSTGRES_CONF_DIR = input('postgres_conf_dir', value: postgres.conf_dir)
29+
POSTGRES_CONF_PATH = input('postgres_conf_path', value: File.join(POSTGRES_CONF_DIR.to_s, 'postgresql.conf'))
30+
POSTGRES_HBA_CONF_FILE = input('postgres_hba_conf_file', value: File.join(POSTGRES_CONF_DIR.to_s, 'pg_hba.conf'))
31+
POSTGRES_LOG_DIR = input('postgres_log_dir', value: '/var/log/postgresql')
6632

6733
only_if do
6834
command('psql').exist?

inspec.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,18 @@ inspec_version: '>= 4.6.3'
1010
version: 3.1.1
1111
supports:
1212
- os-family: unix
13+
inputs:
14+
- name: user
15+
description: define the postgresql user to access the database
16+
- name: password
17+
description: define the postgresql password to access the database
18+
- name: postgres_data
19+
description: define the postgresql data directory
20+
- name: postgres_conf_dir
21+
description: define the postgresql configuration directory
22+
- name: postgres_conf_path
23+
description: define path for the postgresql configuration file
24+
- name: postgres_hba_conf_file
25+
description: define path for the postgresql configuration file
26+
- name: postgres_log_dir
27+
description: define path for the postgresql log file

0 commit comments

Comments
 (0)