Commit 43fba82
committed
Fix no_empty_passwords remediation for RHCOS 9
On RHCOS 9, the PAM files are not managed by authselect. Although
/usr/bin/authselect exists, using it rewrites the PAM stack with
RHEL 8 era templates (pam_fprintd.so, authselect 2018 header) that
do not match the actual RHCOS 9 PAM configuration, causing the
compliance scan to still report FAIL after remediation.
Add RHCOS-specific branches in bash and ansible remediations that
use direct sed/replace to surgically remove nullok from the existing
PAM files, preserving the native RHCOS 9 PAM stack.
Update the kubernetes MachineConfig remediation to deploy the native
RHCOS 9 PAM stack (pam_usertype.so, no pam_fprintd.so) instead of
the RHEL 8 authselect template.
Add RHCOS test scenarios for pass (no nullok) and fail (nullok
present) cases using the native RHCOS 9 PAM stack layout.
Tested on OCP 4.22 (RHCOS 9.8, 3 masters + 2 workers):
- Before fix: no_empty_passwords = FAIL (even after remediation)
- After fix (direct sed): no_empty_passwords = PASS1 parent c3b212a commit 43fba82
5 files changed
Lines changed: 89 additions & 4 deletions
File tree
- linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords
- ansible
- bash
- kubernetes
- tests
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
| |||
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| 37 | + | |
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
0 commit comments