Skip to content

Commit 3ca1cbc

Browse files
author
Douglas Rapp
authored
Merge pull request #9 from sscpac/V-72297
Add more STIGs
2 parents d13dd4e + f269e50 commit 3ca1cbc

File tree

3 files changed

+93
-34
lines changed

3 files changed

+93
-34
lines changed

defaults/main.yml

+37-30
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rhel7stig_audit_complex: yes
1616
# We've defined disruption-high to indicate items that are likely to cause
1717
# disruption in a normal workflow. These items can be remediated automatically
1818
# but are disabled by default to avoid disruption.
19-
rhel7stig_disruption_high: no
19+
rhel7stig_disruption_high: yes
2020

2121
# Show "changed" for disruptive items not remediated per disruption-high
2222
# setting to make them stand out.
@@ -41,41 +41,40 @@ rhel7stig_system_is_container: no
4141
# ACS: For each item that is turned off, a comment will be inserted with rationale
4242
#
4343
# CAT 1 rules
44-
# ACS: (??)
44+
# ACS: ACS3-6674 states that this Mindpoint task will reset all permissions of files owned by root:root to the default,
45+
# which will result in loss of functionality since ACS changed the permission of these files during acs-install
4546
rhel_07_010010: false
46-
# ACS: (??)
47+
# ACS: ACS3-6349 says this won't work for ACS packages
4748
rhel_07_010020: false
4849
rhel_07_010290: true
4950
rhel_07_010300: true
5051
# ACS: GNOME not used
5152
rhel_07_010440: false
52-
# ACS: (??)
53-
rhel_07_010450: true
53+
# ACS: GNOME not used
54+
rhel_07_010450: false
5455
# ACS: Not applicable for RHEL 7.2+
5556
rhel_07_010480: false
56-
# ACS: (??)
57-
rhel_07_010482: false
58-
# ACS: (??)
57+
rhel_07_010482: true
58+
# ACS: Not applicable for RHEL 7.2+
5959
rhel_07_010490: false
60-
# ACS: (??)
61-
rhel_07_010491: false
60+
rhel_07_010491: true
6261
rhel_07_020000: true
6362
rhel_07_020010: true
6463
rhel_07_020050: true
6564
rhel_07_020060: true
66-
# ACS: (??)
65+
# ACS: ACS enables SELinux in a separate playbook
6766
rhel_07_020210: false
68-
# ACS: (??)
67+
# ACS: ACS enables SELinux targeted policy in a separate playbook
6968
rhel_07_020220: false
7069
rhel_07_020230: true
7170
# Not an automated task
7271
rhel_07_020250: true
7372
rhel_07_020310: true
74-
# ACS: (??)
73+
# ACS: ACS enables FIPS in a separate playbook
7574
rhel_07_021350: false
7675
rhel_07_021710: true
7776
rhel_07_030000: true
78-
# ACS: (??)
77+
# ACS: HBSS will provide virus scan program
7978
rhel_07_032000: false
8079
rhel_07_040390: true
8180
rhel_07_040540: true
@@ -90,6 +89,9 @@ rhel_07_010040: true
9089
rhel_07_010050: true
9190
rhel_07_010060: true
9291
rhel_07_010061: true
92+
# ACS: New STIG in Red Hat Enterprise Linux 7 - Ver 2, Rel 3 STIG
93+
# GNOME not used
94+
rhel_07_010062: false
9395
rhel_07_010070: true
9496
rhel_07_010081: true
9597
rhel_07_010082: true
@@ -125,6 +127,9 @@ rhel_07_010460: true
125127
rhel_07_010470: true
126128
rhel_07_010481: true
127129
rhel_07_010500: true
130+
# ACS: New STIG in Red Hat Enterprise Linux 7 - Ver 2, Rel 3 STIG
131+
# HBSS will be installed
132+
rhel_07_020019: false
128133
rhel_07_020020: true
129134
rhel_07_020030: true
130135
# Send AIDE reports as mail notifications - Disabled by default as this is a non-ideal way to do notifications
@@ -134,7 +139,7 @@ rhel_07_020100: true
134139
rhel_07_020101: true
135140
rhel_07_020110: true
136141
rhel_07_020240: true
137-
# ACS: (??)
142+
# ACS: Manually patch and update system packages. Mindpoint task updates all RPMs on the system, which could break ACS.
138143
rhel_07_020260: false
139144
rhel_07_020270: true
140145
rhel_07_020320: true
@@ -158,7 +163,8 @@ rhel_07_021000: true
158163
rhel_07_021010: true
159164
rhel_07_021020: true
160165
rhel_07_021021: true
161-
# ACS: (??)
166+
# ACS: ACS3-6353 states Mindpoint task changes all world-writable directories to be owned by root,
167+
# which could break things. This will be remediated manually.
162168
rhel_07_021030: false
163169
rhel_07_021040: true
164170
rhel_07_021100: true
@@ -188,11 +194,11 @@ rhel_07_030430: true
188194
rhel_07_030440: true
189195
rhel_07_030450: true
190196
rhel_07_030460: true
191-
# ACS: (??)
197+
# ACS: Not a finding in cybersecurity assessment
192198
rhel_07_030470: false
193-
# ACS: (??)
199+
# ACS: Not a finding in cybersecurity assessment
194200
rhel_07_030480: false
195-
# ACS: (??)
201+
# ACS: Not a finding in cybersecurity assessment
196202
rhel_07_030490: false
197203
rhel_07_030500: true
198204
rhel_07_030510: true
@@ -245,22 +251,20 @@ rhel_07_040100: true
245251
rhel_07_040110: true
246252
rhel_07_040160: true
247253
rhel_07_040170: true
248-
# ACS: (??)
249-
rhel_07_040180: false
254+
rhel_07_040180: true
250255
rhel_07_040190: true
251256
rhel_07_040200: true
252257
rhel_07_040201: true
253258
rhel_07_040300: true
254259
rhel_07_040310: true
255-
# ACS: (??)
256-
rhel_07_040320: false
260+
# ACS: relax to 3600 seconds = 1 hour
261+
rhel_07_040320: true
257262
# ACS: Not applicable for RHEL 7.4+
258263
rhel_07_040330: false
259264
rhel_07_040340: true
260265
rhel_07_040350: true
261266
rhel_07_040360: true
262-
# ACS: (??)
263-
rhel_07_040370: false
267+
rhel_07_040370: true
264268
rhel_07_040380: true
265269
rhel_07_040400: true
266270
rhel_07_040410: true
@@ -274,18 +278,21 @@ rhel_07_040500: true
274278
rhel_07_040510: true
275279
rhel_07_040520: true
276280
rhel_07_040610: true
281+
# ACS: New STIG in Red Hat Enterprise Linux 7 - Ver 2, Rel 3 STIG
282+
rhel_07_040611: true
283+
# ACS: New STIG in Red Hat Enterprise Linux 7 - Ver 2, Rel 3 STIG
284+
rhel_07_040612: true
277285
rhel_07_040620: true
278286
rhel_07_040630: true
279287
rhel_07_040640: true
280288
rhel_07_040641: true
281289
rhel_07_040650: true
282290
rhel_07_040660: true
283291
rhel_07_040670: true
284-
# ACS: (??)
285-
rhel_07_040680: false
292+
rhel_07_040680: true
286293
rhel_07_040720: true
287294
rhel_07_040730: true
288-
# ACS: (??)
295+
# ACS: Not compatible with OpenShift. See https://access.redhat.com/solutions/4056101
289296
rhel_07_040740: false
290297
rhel_07_040750: true
291298
rhel_07_040810: true
@@ -359,7 +366,7 @@ rhel7stig_time_service_configs:
359366
conf: /etc/ntp.conf
360367
lines:
361368
- regexp: ^#?maxpoll
362-
line: maxpoll 10
369+
line: server 0.rhel.pool.ntp.org iburst maxpoll 10
363370

364371
rhel7stig_firewall_service: firewalld
365372

@@ -485,7 +492,7 @@ rhel7stig_shell_session_timeout:
485492
# terminate at the end of the session or after 10 minutes of inactivity, except
486493
# to fulfill documented and validated mission requirements.
487494
# Timeout value is in seconds. (60 seconds * 10 = 600)
488-
rhel7stig_ssh_session_timeout: 600
495+
rhel7stig_ssh_session_timeout: 3600
489496

490497
# RHEL-07-020260
491498
# Configure regular automatic package updates using yum-cron

tasks/fix-cat2.yml

+49-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
- name: "MEDIUM | RHEL-07-010240 | The Red Hat Enterprise Linux operating system must be configured so that passwords are restricted to a 24 hours/1 day minimum lifetime."
284284
block:
285285
- name: "MEDIUM | RHEL-07-010240 | AUDIT | Passwords must be restricted to a 24 hours/1 day minimum lifetime."
286-
command: "awk -F: '$1 !~ /^root$/ && $2 !~ /^[!*]/ && $4 < 1 {print $1}' /etc/shadow"
286+
command: "awk -F: '$4 < 1 {print $1}' /etc/shadow"
287287
check_mode: no
288288
changed_when: no
289289
register: rhel_07_010240_audit
@@ -310,7 +310,7 @@
310310
- name: "MEDIUM | RHEL-07-010260 | The Red Hat Enterprise Linux operating system must be configured so that existing passwords are restricted to a 60-day maximum lifetime."
311311
block:
312312
- name: "MEDIUM | RHEL-07-010260 | AUDIT | The Red Hat Enterprise Linux operating system must be configured so that existing passwords are restricted to a 60-day maximum lifetime."
313-
command: "awk -F: '$1 !~ /^root$/ && $2 !~ /^[!*]/ && $5 > 60 {print $1}' /etc/shadow"
313+
command: "awk -F: '$5 > 60 {print $1}' /etc/shadow"
314314
check_mode: no
315315
changed_when: rhel_07_010260_audit.stdout != ""
316316
register: rhel_07_010260_audit
@@ -2166,6 +2166,12 @@
21662166
name: ntp
21672167
state: present
21682168

2169+
- name: "MEDIUM | RHEL-07-040500 | PATCH | Remove duplicate maxpoll lines."
2170+
replace:
2171+
path: "{{ rhel7stig_time_service_configs[rhel7stig_time_service].conf }}"
2172+
regexp: "{{ item.line }}"
2173+
with_items: "{{ rhel7stig_time_service_configs[rhel7stig_time_service].lines }}"
2174+
21692175
- name: "MEDIUM | RHEL-07-040500 | PATCH | The Red Hat Enterprise Linux operating system must, for networked systems, synchronize clocks with a server that is synchronized to one of the redundant United States Naval Observatory (USNO) time servers, a time server designated for the appropriate DoD network (NIPRNet/SIPRNet), and/or the Global Positioning System (GPS)."
21702176
lineinfile:
21712177
create: yes
@@ -2174,6 +2180,12 @@
21742180
line: "{{ item.line }}"
21752181
notify: restart {{ rhel7stig_time_service }}
21762182
with_items: "{{ rhel7stig_time_service_configs[rhel7stig_time_service].lines }}"
2183+
2184+
- name: "MEDIUM | RHEL-07-040500 | PATCH | restart {{ rhel7stig_time_service }}"
2185+
service:
2186+
name: "{{ rhel7stig_time_service }}"
2187+
state: restarted
2188+
enabled: yes
21772189
when:
21782190
- rhel7stig_time_service == 'ntpd'
21792191
- rhel_07_040500
@@ -2262,6 +2274,32 @@
22622274
- RHEL-07-040610
22632275
- ipv4
22642276

2277+
- name: "MEDIUM | RHEL-07-040611 | PATCH | The Red Hat Enterprise Linux operating system must use a reverse-path filter for IPv4 network traffic when possible on all interfaces."
2278+
sysctl:
2279+
name: net.ipv4.conf.all.rp_filter
2280+
state: present
2281+
value: 1
2282+
sysctl_set: yes
2283+
reload: "{{ rhel7stig_sysctl_reload }}"
2284+
ignoreerrors: yes
2285+
when: rhel_07_040611
2286+
tags:
2287+
- RHEL-07-040611
2288+
- ipv4
2289+
2290+
- name: "MEDIUM | RHEL-07-040612 | PATCH | The Red Hat Enterprise Linux operating system must use a reverse-path filter for IPv4 network traffic when possible by default."
2291+
sysctl:
2292+
name: net.ipv4.conf.default.rp_filter
2293+
state: present
2294+
value: 1
2295+
sysctl_set: yes
2296+
reload: "{{ rhel7stig_sysctl_reload }}"
2297+
ignoreerrors: yes
2298+
when: rhel_07_040612
2299+
tags:
2300+
- RHEL-07-040612
2301+
- ipv4
2302+
22652303
- name: "MEDIUM | RHEL-07-040620 | PATCH | The Red Hat Enterprise Linux operating system must not forward Internet Protocol version 4 (IPv4) source-routed packets by default."
22662304
sysctl:
22672305
name: net.ipv4.conf.default.accept_source_route
@@ -2364,6 +2402,15 @@
23642402
changed_when: no
23652403
register: rhel_07_040680_rpm_audit
23662404

2405+
- name: "MEDIUM | RHEL-07-040680 | AUDIT | Set inet_protocol = ipv4 so postfix can start"
2406+
replace:
2407+
path: /etc/postfix/main.cf
2408+
regexp: '^inet_protocols = all$'
2409+
replace: 'inet_protocols = ipv4'
2410+
check_mode: no
2411+
changed_when: no
2412+
when: rhel_07_040680_rpm_audit.rc == 0
2413+
23672414
- name: "MEDIUM | RHEL-07-040680 | AUDIT | The Red Hat Enterprise Linux operating system must be configured to prevent unrestricted mail relaying."
23682415
command: "/usr/sbin/postconf -n smtpd_client_restrictions"
23692416
check_mode: no

tasks/fix-cat3.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,14 @@
164164
- '[default=1]'
165165
- "{{ default_control }}"
166166

167-
- name: "MEDIUM | RHEL-07-010270 | PATCH | Remove old remediation"
167+
- name: "MEDIUM | RHEL-07-010270 | PATCH | Remove silent option"
168+
replace:
169+
path: /etc/pam.d/postlogin
170+
regexp: 'silent'
171+
172+
- name: "MEDIUM | RHEL-07-010270 | PATCH | Add session required pam_lastlog.so showfailed"
168173
blockinfile:
169-
state: absent
174+
state: present
170175
path: /etc/pam.d/postlogin
171176
insertafter: '^# User changes will be destroyed'
172177
block: |

0 commit comments

Comments
 (0)