Skip to content

Commit

Permalink
Merge pull request ComplianceAsCode#11358 from yuumasato/audit_rules_…
Browse files Browse the repository at this point in the history
…login_tempate_kubernetes_path_is_variable

OCPBUGS-24594: audit_rule_login_events - handle `path_is_variable` in Kubernetes remediation
  • Loading branch information
rhmdnd authored Dec 7, 2023
2 parents bfe4953 + 8e17177 commit 68a4f72
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions controls/nist_rhcos4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ controls:
- audit_rules_login_events_tallylog
- audit_rules_privileged_commands_umount
- audit_rules_login_events_faillock
- var_accounts_passwords_pam_faillock_dir=run
- audit_rules_privileged_commands_crontab
- audit_rules_execution_setsebool
- audit_rules_etc_group_open_by_handle_at
Expand Down Expand Up @@ -2553,6 +2554,7 @@ controls:
- audit_rules_execution_semanage
- audit_rules_unsuccessful_file_modification_chmod
- audit_rules_login_events_faillock
- var_accounts_passwords_pam_faillock_dir=run
- audit_rules_unsuccessful_file_modification_open
- audit_rules_unsuccessful_file_modification_open_by_handle_at_o_creat
- audit_rules_privileged_commands_chage
Expand Down Expand Up @@ -3541,6 +3543,7 @@ controls:
- audit_rules_execution_semanage
- audit_rules_unsuccessful_file_modification_chmod
- audit_rules_login_events_faillock
- var_accounts_passwords_pam_faillock_dir=run
- audit_rules_unsuccessful_file_modification_open
- audit_rules_unsuccessful_file_modification_open_by_handle_at_o_creat
- audit_rules_privileged_commands_chage
Expand Down Expand Up @@ -5077,6 +5080,7 @@ controls:
- sysctl_net_ipv4_conf_default_rp_filter
- audit_rules_unsuccessful_file_modification_chmod
- audit_rules_login_events_faillock
- var_accounts_passwords_pam_faillock_dir=run
- audit_rules_unsuccessful_file_modification_open
- audit_rules_unsuccessful_file_modification_open_by_handle_at_o_creat
- audit_rules_privileged_commands_chage
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default_result: FAIL
result_after_remediation: PASS
1 change: 1 addition & 0 deletions products/rhcos4/profiles/e8.profile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ selections:
- auditd_name_format
- audit_rules_login_events_tallylog
- audit_rules_login_events_faillock
- var_accounts_passwords_pam_faillock_dir=run
- audit_rules_login_events_lastlog
- audit_rules_login_events
- audit_rules_time_adjtimex
Expand Down
1 change: 1 addition & 0 deletions products/rhcos4/profiles/stig-v1r1.profile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ selections:
- var_sshd_set_keepalive=0
- var_selinux_policy_name=targeted
- var_selinux_state=enforcing
- var_accounts_passwords_pam_faillock_dir=run
# Let's mark the vsyscall argument as info - the check and the fix is there, but setting this
# karg is not suitable for people who still run legacy 32bit apps.
- coreos_vsyscall_kernel_argument.role=unscored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ spec:
storage:
files:
- contents:
{{% if PATH_IS_VARIABLE %}}
source: data:,-w%20{{ {{{ url_encode("{{.var_accounts_passwords_pam_faillock_dir}}") }}} }}%20-p%20wa%20-k%20logins%0A
{{% else %}}
source: data:,-w%20{{{ PATH }}}%20-p%20wa%20-k%20logins%0A
{{% endif %}}
mode: 0644
path: /etc/audit/rules.d/75-{{{ NAME }}}_login_events.rules
path: /etc/audit/rules.d/75-{{{ rule_id }}}.rules
overwrite: true

0 comments on commit 68a4f72

Please sign in to comment.