Repository navigation
Update Rhel10 stig v1r2 to v1r3 #15216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 18 commits
fd008ad
844764b
6608e36
bae5af7
b22db7e
74e5daa
d4ce118
675375b
046aed6
80c58af
c1659a2
b86b491
d6d049a
5ce9b6e
18db811
62cf24d
122a95b
cf4cf0f
cf4179c
f9ec401
c310255
100e7fb
d50100b
ebcf3f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| controls: | ||
| - id: SRG-OS-000250-GPOS-00093 | ||
| levels: | ||
| - high | ||
| title: {{{ full_name }}} must implement cryptography to protect the integrity | ||
| of remote access sessions. | ||
| rules: | ||
| - file_sshd_50_redhat_exists | ||
| - sshd_include_crypto_policy | ||
| - harden_sshd_ciphers_openssh_conf_crypto_policy | ||
| - harden_sshd_ciphers_opensshserver_conf_crypto_policy | ||
| - harden_sshd_macs_openssh_conf_crypto_policy | ||
| - harden_sshd_macs_opensshserver_conf_crypto_policy | ||
| - sshd_approved_ciphers=stig_rhel9 | ||
| - sshd_approved_macs=stig_rhel9 | ||
| status: automated | ||
| - id: SRG-OS-000250-GPOS-00093 | ||
| levels: | ||
| - high | ||
| title: {{{ full_name }}} must implement cryptography to protect the integrity | ||
| of remote access sessions. | ||
| rules: | ||
| - configure_openssl_crypto_policy | ||
| - file_sshd_50_redhat_exists | ||
| - sshd_include_crypto_policy | ||
| - harden_sshd_ciphers_openssh_conf_crypto_policy | ||
| - harden_sshd_ciphers_opensshserver_conf_crypto_policy | ||
| - harden_sshd_macs_openssh_conf_crypto_policy | ||
| - harden_sshd_macs_opensshserver_conf_crypto_policy | ||
| - sshd_approved_ciphers=stig_rhel9 | ||
| - sshd_approved_macs=stig_rhel9 | ||
| status: automated | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
|
Mab879 marked this conversation as resolved.
|
||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the rules with the '-S execve' filter, the shape the RHEL 9 STIG prescribes; the RHEL 10 required rules have no syscall filter, so the scan must fail and the remediation must rewrite them into the plain form (the RHEL 9 to RHEL 10 upgrade case). | ||
|
|
||
| {{{ setup_auditctl_environment() }}} | ||
|
|
||
| echo "-a always,exit -F arch=b32 -S execve -F path=/usr/bin/gpasswd -F perm=x -k privileged-gpasswd" >> /etc/audit/audit.rules | ||
| echo "-a always,exit -F arch=b64 -S execve -F path=/usr/bin/gpasswd -F perm=x -k privileged-gpasswd" >> /etc/audit/audit.rules | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-k' spelling, the form the RHEL 9 STIG and the old template default generate; the remediation must not treat the rule as already compliant. | ||
|
|
||
| {{{ setup_auditctl_environment() }}} | ||
|
|
||
| echo "-a always,exit -F arch=b32 -F path=/usr/bin/gpasswd -F perm=x -k privileged" >> /etc/audit/audit.rules | ||
| echo "-a always,exit -F arch=b64 -F path=/usr/bin/gpasswd -F perm=x -k privileged" >> /etc/audit/audit.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the rules with the '-S execve' filter, the shape the RHEL 9 STIG prescribes; the RHEL 10 required rules have no syscall filter, so the scan must fail and the remediation must rewrite them into the plain form (the RHEL 9 to RHEL 10 upgrade case). | ||
|
|
||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
| echo "-a always,exit -F arch=b32 -S execve -F path=/usr/bin/gpasswd -F perm=x -k privileged-gpasswd" >> /etc/audit/rules.d/privileged-gpasswd.rules | ||
| echo "-a always,exit -F arch=b64 -S execve -F path=/usr/bin/gpasswd -F perm=x -k privileged-gpasswd" >> /etc/audit/rules.d/privileged-gpasswd.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-k' spelling, the form the RHEL 9 STIG and the old template default generate; the remediation must not treat the rule as already compliant. | ||
|
|
||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
| echo "-a always,exit -F arch=b32 -F path=/usr/bin/gpasswd -F perm=x -k privileged" >> /etc/audit/rules.d/privileged-gpasswd.rules | ||
| echo "-a always,exit -F arch=b64 -F path=/usr/bin/gpasswd -F perm=x -k privileged" >> /etc/audit/rules.d/privileged-gpasswd.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the rules with the '-S execve' filter, the shape the RHEL 9 STIG prescribes; the RHEL 10 required rules have no syscall filter, so the scan must fail and the remediation must rewrite them into the plain form (the RHEL 9 to RHEL 10 upgrade case). | ||
|
|
||
| {{{ setup_auditctl_environment() }}} | ||
|
|
||
| echo "-a always,exit -F arch=b32 -S execve -F path=/usr/bin/passwd -F perm=x -k privileged-passwd" >> /etc/audit/audit.rules | ||
| echo "-a always,exit -F arch=b64 -S execve -F path=/usr/bin/passwd -F perm=x -k privileged-passwd" >> /etc/audit/audit.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-k' spelling, the form the RHEL 9 STIG and the old template default generate; the remediation must not treat the rule as already compliant. | ||
|
|
||
| {{{ setup_auditctl_environment() }}} | ||
|
|
||
| echo "-a always,exit -F arch=b32 -F path=/usr/bin/passwd -F perm=x -k privileged" >> /etc/audit/audit.rules | ||
| echo "-a always,exit -F arch=b64 -F path=/usr/bin/passwd -F perm=x -k privileged" >> /etc/audit/audit.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the rules with the '-S execve' filter, the shape the RHEL 9 STIG prescribes; the RHEL 10 required rules have no syscall filter, so the scan must fail and the remediation must rewrite them into the plain form (the RHEL 9 to RHEL 10 upgrade case). | ||
|
|
||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
| echo "-a always,exit -F arch=b32 -S execve -F path=/usr/bin/passwd -F perm=x -k privileged-passwd" >> /etc/audit/rules.d/privileged-passwd.rules | ||
| echo "-a always,exit -F arch=b64 -S execve -F path=/usr/bin/passwd -F perm=x -k privileged-passwd" >> /etc/audit/rules.d/privileged-passwd.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-k' spelling, the form the RHEL 9 STIG and the old template default generate; the remediation must not treat the rule as already compliant. | ||
|
|
||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
| echo "-a always,exit -F arch=b32 -F path=/usr/bin/passwd -F perm=x -k privileged" >> /etc/audit/rules.d/privileged-passwd.rules | ||
| echo "-a always,exit -F arch=b64 -F path=/usr/bin/passwd -F perm=x -k privileged" >> /etc/audit/rules.d/privileged-passwd.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| srg_requirement: |- | ||
| {{{ full_name }}} must generate audit records for successful and unsuccessful uses of the "useradd" command. | ||
|
|
||
| fixtext: |- | ||
| Configure {{{ full_name }}} to generate audit records upon successful and unsuccessful attempts to use the "useradd" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": | ||
|
|
||
| -a always,exit -F path=/usr/sbin/useradd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -k privileged-useradd | ||
|
|
||
| Restart the audit daemon with the following command for the changes to take effect: | ||
|
|
||
| $ sudo service auditd restart | ||
|
|
||
| checktext: |- | ||
| Verify {{{ full_name }}} is configured to audit the execution of the "useradd" command with the following command: | ||
|
|
||
| $ sudo auditctl -l | grep useradd | ||
| -a always,exit -S all -F path=/usr/sbin/useradd -F perm=x -F auid>={{{ uid_min }}} -F auid!=-1 -F key=privileged-useradd | ||
|
|
||
| If the command does not return a line, or the line is commented out, this is a finding. | ||
|
|
||
| vuldiscussion: |- | ||
| Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. | ||
|
|
||
| Audit records can be generated from various components within the information system (e.g., module or policy filter). | ||
|
|
||
| When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. | ||
|
|
||
| The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary because these affect performance. More rules lead to poorer performance. The performance can be helped, however, by combining system calls into one rule whenever possible. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ rationale: |- | |
| severity: medium | ||
|
|
||
| identifiers: | ||
| cce@rhel10: CCE-86501-4 | ||
| cce@sle15: CCE-92614-7 | ||
| cce@slmicro5: CCE-93661-7 | ||
|
|
||
|
|
@@ -32,3 +33,5 @@ template: | |
| name: audit_rules_privileged_commands | ||
| vars: | ||
| path: /usr/sbin/useradd | ||
| key: privileged-useradd | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep |
||
| require_key: 'true' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-F key' spelling; the scan must fail and the remediation must write the rules with the required key. | ||
|
|
||
| {{{ setup_auditctl_environment() }}} | ||
|
|
||
| # Start from a clean audit state, like the augenrules variants do | ||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
|
|
||
| echo "-a always,exit -F path=/usr/sbin/useradd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=wrong" >> /etc/audit/audit.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-k' spelling, the form the RHEL 9 STIG and the old template default generate; the remediation must not treat the rule as already compliant. | ||
|
|
||
| {{{ setup_auditctl_environment() }}} | ||
|
|
||
| # Start from a clean audit state, like the augenrules variants do | ||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
|
|
||
| echo "-a always,exit -F path=/usr/sbin/useradd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -k privileged" >> /etc/audit/audit.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-F key' spelling; the scan must fail and the remediation must write the rules with the required key. | ||
|
|
||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
| echo "-a always,exit -F path=/usr/sbin/useradd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=wrong" >> /etc/audit/rules.d/useradd.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| # platform = Red Hat Enterprise Linux 10 | ||
| # packages = audit | ||
| # Writes the required rule shape but with a wrong audit key in the '-k' spelling, the form the RHEL 9 STIG and the old template default generate; the remediation must not treat the rule as already compliant. | ||
|
|
||
| rm -f /etc/audit/rules.d/*.rules | ||
| truncate -s 0 /etc/audit/audit.rules | ||
|
|
||
| echo "-a always,exit -F path=/usr/sbin/useradd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -k privileged" >> /etc/audit/rules.d/useradd.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #!/bin/bash | ||
| # packages = audit | ||
|
|
||
| echo "-a always,exit -F arch=b32 -S mount -F auid>={{{ uid_min }}} -F auid!=unset -k export" >> /etc/audit/rules.d/export.rules | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC the key doesn't matter to our OVAL, maybe just add test for different key? |
||
| echo "-a always,exit -F arch=b64 -S mount -F auid>={{{ uid_min }}} -F auid!=unset -k export" >> /etc/audit/rules.d/export.rules | ||
| echo "-a always,exit -F arch=b32 -S mount -F auid>={{{ uid_min }}} -F auid!=unset -k {{{ "privileged-mount" if product == "rhel10" else "export" }}}" >> /etc/audit/rules.d/export.rules | ||
| echo "-a always,exit -F arch=b64 -S mount -F auid>={{{ uid_min }}} -F auid!=unset -k {{{ "privileged-mount" if product == "rhel10" else "export" }}}" >> /etc/audit/rules.d/export.rules | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to reformat this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe yamllint complained