Skip to content

Commit a25db90

Browse files
committed
fix inputs
1 parent fa7926e commit a25db90

10 files changed

Lines changed: 22 additions & 42 deletions

File tree

controls/SV-238197.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@
6363
tag 'container'
6464

6565
xorg_status = command('which Xorg').exit_status
66+
gdm3_config_file = input('gdm3_config_file')
6667

6768
if xorg_status == 0
6869
describe 'banner-message-enable must be set to true' do
69-
subject { command('grep banner-message-enable /etc/gdm3/greeter.dconf-defaults').stdout.strip }
70+
subject { command("grep banner-message-enable #{gdm3_config_file}").stdout.strip }
7071
it { should match(/banner-message-enable\s*=\s*true/) }
7172
end
7273
else

controls/SV-238236.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
file_integrity_tool = input('file_integrity_tool')
5757
expected_aide_sha1sum = input('expected_aide_sha1sum')
58+
aide_conf_path = input('aide_conf_path')
5859

5960
if file_integrity_tool == 'aide'
6061
cron_script_path = '/etc/cron.daily/dailyaidecheck'
@@ -73,7 +74,7 @@
7374
end
7475
end
7576
# Verify aide.conf matches expected vendor default SHA-1 (provided via input)
76-
describe command("sha1sum /etc/aide/aide.conf | awk '{print $1}' | tr -d '\n'") do
77+
describe command("sha1sum #{aide_conf_path} | awk '{print $1}' | tr -d '\n'") do
7778
its('exit_status') { should eq 0 }
7879
its('stdout') { should cmp expected_aide_sha1sum }
7980
end

controls/SV-238303.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@
5050
audit_tools = input('audit_tools')
5151
audit_rule_suffix = 'p+i+n+u+g+s+b+acl+xattrs+sha512'
5252
file_integrity_tool = input('file_integrity_tool')
53+
aide_conf_path = input('aide_conf_path')
5354

5455
if file_integrity_tool == 'aide'
55-
describe file('/etc/aide/aide.conf') do
56+
describe file(aide_conf_path) do
5657
it { should exist }
5758
end
5859

5960
describe 'AIDE audit tools selection lines' do
6061
it 'must include exact lines for all audit tools' do
61-
config = parse_config_file('/etc/aide/aide.conf', assignment_regex: %r{^\s*(/\S+)\s+(.*?)\s*$})
62+
config = parse_config_file(aide_conf_path, assignment_regex: %r{^\s*(/\S+)\s+(.*?)\s*$})
6263
missing = audit_tools.reject { |tool| config[tool].to_s == audit_rule_suffix }
63-
expect(missing).to be_empty, "Missing or incorrect lines in /etc/aide/aide.conf for: #{missing.join(', ')}"
64+
expect(missing).to be_empty, "Missing or incorrect lines in #{aide_conf_path} for: #{missing.join(', ')}"
6465
end
6566
end
6667
else

controls/SV-238330.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
tag 'container'
3333

3434
days_of_inactivity = input('days_of_inactivity')
35+
useradd_config_file = input('useradd_config_file')
3536

3637
describe 'Useradd configuration' do
37-
useradd_config = parse_config_file('/etc/default/useradd')
38+
useradd_config = parse_config_file(useradd_config_file)
3839

3940
context 'when INACTIVE is set' do
4041
it 'should exist' do

controls/SV-238356.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
if chrony_conf_exists
5858
describe 'time sources' do
59-
server_entries = command('grep "^server" /etc/chrony/chrony.conf').stdout.strip.split("\n").entries
59+
server_entries = command("grep \"^server\" #{chrony_conf}").stdout.strip.split("\n").entries
6060

6161
server_entries.each do |entry|
6262
describe entry do

controls/SV-238363.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
!%w[docker podman kubepods lxc].include?(virtualization.system)
3131
}
3232

33-
describe command('grep -i 1 /proc/sys/crypto/fips_enabled') do
33+
fips_config_file = input('fips_config_file')
34+
35+
describe command("grep -i 1 #{fips_config_file}") do
3436
its('stdout') { should match('1') }
3537
end
3638
end

controls/SV-274855.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
skip 'This system is not using PKI for authentication so the controls is Not Applicable.'
7272
end
7373
else
74-
config_file = '/etc/sssd/sssd.conf'
74+
config_file = input('sssd_conf_path')
7575
config_file_exists = file(config_file).exist?
7676

7777
if config_file_exists
@@ -89,7 +89,7 @@
8989
it { should be true }
9090
end
9191
else
92-
describe '/etc/sssd/sssd.conf exists' do
92+
describe "#{config_file} exists" do
9393
subject { config_file_exists }
9494
it { should be true }
9595
end

controls/SV-274856.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
tag nist: ['IA-5 (13)']
2626
tag 'host'
2727

28-
sssd_config = parse_config_file('/etc/sssd/sssd.conf')
28+
sssd_conf_path = input('sssd_conf_path')
29+
sssd_config = parse_config_file(sssd_conf_path)
2930

3031
only_if('This control is Not Applicable to containers', impact: 0.0) {
3132
!%w[docker podman kubepods lxc].include?(virtualization.system)

controls/SV-274857.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
!%w[docker podman kubepods lxc].include?(virtualization.system)
2424
}
2525

26-
sssd_conf = '/etc/sssd/sssd.conf'
26+
sssd_conf = input('sssd_conf_path')
2727

2828
describe file(sssd_conf) do
2929
it { should exist }

inspec.yml

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ inputs:
6262
'/sbin/augenrules'
6363
]
6464

65-
- name: standard_audit_log_size
66-
description: Set audit log size in bytes (default:1073741824 per control specification)
67-
type: Numeric
68-
value: 8894028
69-
7065
- name: aide_conf_path
7166
description: Path to aide.conf
7267
type: String
@@ -78,11 +73,6 @@ inputs:
7873
type: string
7974
value: root
8075

81-
- name: maxlogins
82-
description: Maximum number of concurrent sessions
83-
type: Numeric
84-
value: 10
85-
8676
# SV-238334
8777
- name: is_kdump_required
8878
description: Is kdump service required? (check with SA and documented with ISSO)
@@ -107,19 +97,6 @@ inputs:
10797
type: string
10898
value: (9676F287356C89A12683D65234098CB77C4F1C18F23C0E541DE0E196725B7EBE|B107B33F453E5510F68E513110C6F6944BACC263DF0137F821C1B3C2F8F863D2|559A5189452B13F8233F0022363C06F26E3C517C1D4B77445035959DF3244F74|1F4EDE9DC2A241F6521BF518424ACD49EBE84420E69DAF5BAC57AF1F8EE294A9)
10999

110-
- name: allowed_network_interfaces
111-
description: Array of allowed network interfaces (wired & wireless)
112-
type: Array
113-
value: [
114-
'lo',
115-
'eth0'
116-
]
117-
118-
- name: audit_sp_remote_server
119-
description: Address of the remote server receiving the audit log
120-
type: String
121-
value: '192.0.0.1'
122-
123100
# SV-252704
124101
- name: approved_wireless_interfaces
125102
description: List of approved wireless interfaces
@@ -154,16 +131,12 @@ inputs:
154131
type: String
155132
value: '/etc/rsyslog.d/50-default.conf'
156133

157-
- name: auditoffload_config_file
158-
description: Location of audit offload config file
134+
# SV-238321
135+
- name: audit_offload_script
136+
description: Location of audit offload script
159137
type: String
160138
value: '/etc/cron.weekly/audit-offload'
161139

162-
- name: audispremote_config_file
163-
description: Location of audisp-remote plugin config file
164-
type: String
165-
value: '/etc/audisp/plugins.d/au-remote.conf'
166-
167140
# SV-238198
168141
- name: gdm3_config_file
169142
description: Location of gdm3 config file

0 commit comments

Comments
 (0)