-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSV-257796.rb
56 lines (41 loc) · 2.72 KB
/
SV-257796.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
control 'SV-257796' do
title 'RHEL 9 must enable auditing of processes that start prior to the audit daemon.'
desc 'Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.
If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created.'
desc 'check', 'Verify that GRUB 2 is configured to enable auditing of processes that start prior to the audit daemon with the following commands:
Check that the current GRUB 2 configuration enabled auditing:
$ sudo grubby --info=ALL | grep audit
args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 pti=on
If "audit" is not set to "1" or is missing, this is a finding.
Check that auditing is enabled by default to persist in kernel updates:
$ sudo grep audit /etc/default/grub
GRUB_CMDLINE_LINUX="audit=1"
If "audit" is not set to "1", is missing, or is commented out, this is a finding.'
desc 'fix', 'Enable auditing of processes that start prior to the audit daemon with the following command:
$ sudo grubby --update-kernel=ALL --args="audit=1"
Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates:
GRUB_CMDLINE_LINUX="audit=1"'
impact 0.3
ref 'DPMS Target Red Hat Enterprise Linux 9'
tag severity: 'low'
tag gtitle: 'SRG-OS-000037-GPOS-00015'
tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000254-GPOS-00095']
tag gid: 'V-257796'
tag rid: 'SV-257796r958412_rule'
tag stig_id: 'RHEL-09-212055'
tag fix_id: 'F-61461r925374_fix'
tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001464', 'CCI-002884']
tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'AU-14 (1)', 'MA-4 (1) (a)']
tag 'host'
only_if('This control is Not Applicable to containers', impact: 0.0) {
!virtualization.system.eql?('docker')
}
grub_stdout = command('grubby --info=ALL').stdout
setting = /audit\s*=\s*1/
describe 'GRUB config' do
it 'should enable page poisoning' do
expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting'
expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates'
end
end
end