Skip to content

Commit

Permalink
Merge pull request #12329 from svet-se/slmicro5-stig-add-integrity-an…
Browse files Browse the repository at this point in the history
…d-auditing-rules-support

Slmicro5 stig add integrity and auditing rules support
  • Loading branch information
jan-cerny authored Aug 26, 2024
2 parents 6622c36 + 77354ae commit e91075f
Show file tree
Hide file tree
Showing 40 changed files with 81 additions and 68 deletions.
52 changes: 32 additions & 20 deletions controls/stig_slmicro5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -846,24 +846,28 @@ controls:
levels:
- medium
title: SLEM 5 must not have unnecessary accounts.
rules: []
status: pending
rules:
- accounts_authorized_local_users
- var_accounts_authorized_local_users_regex=slmicro5
status: automated

- id: SLEM-05-411060
levels:
- medium
title: SLEM 5 must not have unnecessary account capabilities.
rules: []
status: pending
rules:
- no_shelllogin_for_systemaccounts
status: automated

- id: SLEM-05-411065
levels:
- high
title:
SLEM 5 root account must be the only account with unrestricted access to
the system.
rules: []
status: pending
rules:
- accounts_no_uid_except_zero
status: automated

- id: SLEM-05-411070
levels:
Expand All @@ -888,8 +892,9 @@ controls:
title:
SLEM 5 must display the date and time of the last successful account logon
upon logon.
rules: []
status: pending
rules:
- display_login_attempts
status: automated

- id: SLEM-05-412015
levels:
Expand Down Expand Up @@ -980,8 +985,9 @@ controls:
title:
SLEM 5 must use the invoking user's password for privilege escalation when
using "sudo".
rules: []
status: pending
rules:
- sudoers_validate_passwd
status: automated

- id: SLEM-05-432015
levels:
Expand Down Expand Up @@ -1016,8 +1022,9 @@ controls:
title:
SLEM 5 must specify the default "include" directory for the /etc/sudoers
file.
rules: []
status: pending
rules:
- sudoers_default_includedir
status: automated

- id: SLEM-05-611010
levels:
Expand Down Expand Up @@ -1051,8 +1058,10 @@ controls:
levels:
- medium
title: SLEM 5 must prevent the use of dictionary words for passwords.
rules: []
status: pending
rules:
- cracklib_accounts_password_pam_retry
- var_password_pam_retry=3
status: automated

- id: SLEM-05-611035
levels:
Expand Down Expand Up @@ -1844,22 +1853,25 @@ controls:
levels:
- medium
title: SLEM 5 must generate audit records for the "/run/utmp file".
rules: []
status: pending
rules:
- audit_rules_session_events_utmp
status: automated

- id: SLEM-05-654235
levels:
- medium
title: SLEM 5 must generate audit records for the "/var/log/btmp" file.
rules: []
status: pending
rules:
- audit_rules_session_events_btmp
status: automated

- id: SLEM-05-654240
levels:
- medium
title: SLEM 5 must generate audit records for the "/var/log/wtmp" file.
rules: []
status: pending
rules:
- audit_rules_session_events_wtmp
status: automated

- id: SLEM-05-654245
levels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle
# platform = multi_platform_sle,multi_platform_slmicro
# reboot = true
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle,multi_platform_ubuntu
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu

# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
{{{ bash_fix_audit_watch_rule("auditctl", "/var/log/btmp", "wa", "session") }}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ severity: medium

identifiers:
cce@sle15: CCE-85758-1
cce@slmicro5: CCE-93725-0

references:
disa: CCI-000172
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle
# platform = multi_platform_sle,multi_platform_slmicro
# reboot = true
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle,multi_platform_ubuntu
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu

# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
{{{ bash_fix_audit_watch_rule("auditctl", "/run/utmp", "wa", "session") }}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ severity: medium

identifiers:
cce@sle15: CCE-85714-4
cce@slmicro5: CCE-93723-5

references:
disa: CCI-000172
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle
# platform = multi_platform_sle,multi_platform_slmicro
# reboot = true
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_sle,multi_platform_ubuntu
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu

# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
{{{ bash_fix_audit_watch_rule("auditctl", "/var/log/wtmp", "wa", "session") }}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ severity: medium

identifiers:
cce@sle15: CCE-85757-3
cce@slmicro5: CCE-93724-3

references:
disa: CCI-000172
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,Red Hat Virtualization 4
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro,Red Hat Virtualization 4
# reboot = false
# strategy = configure
# complexity = low
# disruption = low

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{%- set pam_lastlog_path = "/etc/pam.d/login" %}}
{{%- set after_match = "^\s*session.*include\s+common-session$" %}}
{{%- else %}}
{{%- set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
{{%- set after_match = "^\s*session\s+.*pam_succeed_if\.so.*" %}}
{{%- endif %}}

{{%- if "ol" in product or "ubuntu" in product %}}
{{%- if "ol" in product or "slmicro" in product or "ubuntu" in product %}}
{{%- set control = "required" %}}
{{%- elif "sle" in product %}}
{{%- set control = "optional" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# platform = multi_platform_sle,Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu
# platform = multi_platform_sle,multi_platform_slmicro,Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{%- set pam_lastlog_path = "/etc/pam.d/login" %}}
{{%- set after_match = "^\s*session.*include\s+common-session$" %}}
{{%- else %}}
{{%- set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
{{%- set after_match = "^\s*session\s+.*pam_succeed_if\.so.*" %}}
{{%- endif %}}

{{%- if "ol" in product or "ubuntu" in product %}}
{{%- if "ol" in product or "slmicro" in product or "ubuntu" in product %}}
{{%- set control = "required" %}}
{{%- elif "sle" in product %}}
{{%- set control = "optional" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{%- set pam_lastlog_path = "/etc/pam.d/login" %}}
{{%- else %}}
{{%- set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
{{%- endif %}}

{{%- if "ol" in product or "ubuntu" in product %}}
{{%- if "ol" in product or "slmicro" in product or "ubuntu" in product %}}
{{%- set control = "required" %}}
{{%- elif "sle" in product %}}
{{%- set control = "optional" %}}
Expand Down Expand Up @@ -37,6 +37,7 @@ identifiers:
cce@rhel10: CCE-88650-7
cce@sle12: CCE-83149-5
cce@sle15: CCE-85560-1
cce@slmicro5: CCE-93730-0

references:
cis-csc: 1,12,15,16
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_sle,multi_platform_ubuntu,Oracle Linux 7
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,Oracle Linux 7

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_all

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_all

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_sle,multi_platform_ubuntu,Oracle Linux 7
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,Oracle Linux 7

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_all

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_sle,multi_platform_ubuntu,Oracle Linux 7
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,Oracle Linux 7

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# platform = multi_platform_sle,multi_platform_ubuntu,Oracle Linux 7
# platform = multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,Oracle Linux 7

{{%- if "sle" in product or "ubuntu" in product %}}
{{%- if "sle" in product or "slmicro" in product or "ubuntu" in product %}}
{{% set pam_lastlog_path = "/etc/pam.d/login" %}}
{{% else %}}
{{% set pam_lastlog_path = "/etc/pam.d/postlogin" %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ severity: medium
identifiers:
cce@sle12: CCE-83174-3
cce@sle15: CCE-85575-9
cce@slmicro5: CCE-93729-2

references:
cis@sle12: 5.3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ identifiers:
cce@rhel10: CCE-88135-9
cce@sle12: CCE-83195-8
cce@sle15: CCE-85561-9
cce@slmicro5: CCE-93731-8

references:
disa: CCI-000366
Expand All @@ -43,7 +44,7 @@ references:

ocil_clause: 'there are unauthorized local user accounts on the system'

{{% if 'rhel' in product or 'ol' in product %}}
{{% if 'rhel' in product or 'ol' in product or 'slmicro5' in product %}}
warnings:
- general: |-
Automatic remediation of this control is not available due to the unique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ identifiers:
cce@rhel10: CCE-87552-6
cce@sle12: CCE-83020-8
cce@sle15: CCE-85664-1
cce@slmicro5: CCE-93734-2

references:
cis-csc: 1,12,13,14,15,16,18,3,5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<!-- Get all /etc/passwd entries having shell defined as OVAL object -->
<ind:textfilecontent54_object id="object_etc_passwd_entries" version="1">
<ind:filepath>/etc/passwd</ind:filepath>
{{% if "ubuntu" in product or "sle" in product %}}
{{% if "ubuntu" in product or "sle" in product or "slmicro" in product %}}
<ind:pattern operation="pattern match">^(?!root).*:x:([\d]+):[\d]+:[^:]*:[^:]*:(?!\/usr\/sbin\/nologin|\/sbin\/nologin|\/bin\/sync|\/sbin\/shutdown|\/sbin\/halt|\/bin\/false|\/usr\/bin\/false).*$</ind:pattern>
{{% else %}}
<ind:pattern operation="pattern match">^(?!root).*:x:([\d]+):[\d]+:[^:]*:[^:]*:(?!\/usr\/sbin\/nologin|\/sbin\/nologin|\/bin\/sync|\/sbin\/shutdown|\/sbin\/halt).*$</ind:pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ identifiers:
cce@rhel10: CCE-87448-7
cce@sle12: CCE-83232-9
cce@sle15: CCE-85672-4
cce@slmicro5: CCE-93732-6

references:
cis-csc: 1,12,13,14,15,16,18,3,5,7,8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ options:
rhel9: "^(root|bin|daemon|adm|lp|sync|shutdown|halt|mail|operator|games|ftp|nobody|tss|systemd-coredump|dbus|polkitd|avahi|colord|rtkit|pipewire|clevis|sssd|geoclue|flatpak|setroubleshoot|libstoragemgmt|systemd-oom|gdm|cockpit-ws|cockpit-wsinstance|gnome-initial-setup|sshd|chrony|dnsmasq|tcpdump|admin)$"
sle12: "^(root|bin|daemon|adm|lp|sync|shutdown|halt|mail|operator|games|ftp|nobody|pegasus|systemd-bus-proxy|systemd-network|dbus|polkitd|abrt|unbound|tss|libstoragemgmt|rpc|colord|usbmuxd$|pcp|saslauth|geoclue|setroubleshoot|rtkit|chrony|qemu|radvd|rpcuser|nfsnobody|pulse|gdm|gnome-initial-setup|postfix|avahi|ntp|sshd|tcpdump|oprofile|uuidd|systemd-resolve|systemd-coredump|sssd|rngd|man|systemd-timesync|scard|hacluster|statd|at|dockremap|vnc)$"
sle15: "^(root|bin|daemon|adm|lp|sync|shutdown|halt|mail|operator|games|ftp|nobody|pegasus|systemd-bus-proxy|systemd-network|dbus|polkitd|abrt|unbound|tss|libstoragemgmt|rpc|colord|usbmuxd$|pcp|saslauth|geoclue|setroubleshoot|rtkit|chrony|qemu|radvd|rpcuser|nfsnobody|pulse|gdm|gnome-initial-setup|postfix|avahi|ntp|sshd|tcpdump|oprofile|uuidd|systemd-resolve|systemd-coredump|sssd|rngd|man|systemd-timesync|scard|hacluster|statd|at|dockremap|vnc|messagebus|nscd|flatpak|srvGeoClue|tftp|wsdd|dnsmasq|usbmux|brltty)$"
slmicro5: "^(root|bin|daemon|adm|lp|sync|shutdown|halt|mail|operator|games|ftp|nobody|pegasus|systemd-bus-proxy|systemd-network|dbus|polkitd|abrt|unbound|tss|libstoragemgmt|rpc|colord|usbmuxd$|pcp|saslauth|geoclue|setroubleshoot|rtkit|chrony|qemu|radvd|rpcuser|nfsnobody|pulse|gdm|gnome-initial-setup|postfix|avahi|ntp|sshd|tcpdump|oprofile|uuidd|systemd-resolve|systemd-coredump|sssd|rngd|man|systemd-timesync|scard|hacluster|statd|at|dockremap|vnc|messagebus|nscd|flatpak|srvGeoClue|tftp|wsdd|dnsmasq|usbmux|brltty|salt|cockpit-ws|cockpit-wsinstance)$"
default: "^(root|bin|daemon|adm|lp|sync|shutdown|halt|mail|operator|games|ftp|nobody|tss|systemd-coredump|dbus|polkitd|avahi|colord|rtkit|pipewire|clevis|sssd|geoclue|flatpak|setroubleshoot|libstoragemgmt|systemd-oom|gdm|cockpit-ws|cockpit-wsinstance|gnome-initial-setup|sshd|chrony|dnsmasq|tcpdump|admin)$"
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ identifiers:
cce@rhel9: CCE-86477-7
cce@sle12: CCE-83255-0
cce@sle15: CCE-91151-1
cce@slmicro5: CCE-93733-4

references:
disa: CCI-000366
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ identifiers:
cce@rhel10: CCE-88855-2
cce@sle12: CCE-83230-3
cce@sle15: CCE-85747-4
cce@slmicro5: CCE-93735-9

references:
disa: CCI-000366,CCI-002227
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro
# packages = sudo

echo 'Defaults !targetpw' >> /etc/sudoers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro
# packages = sudo

touch /etc/sudoers.d/empty
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,SUSE Linux Enterprise 15,multi_platform_slmicro
# packages = sudo

echo 'Defaults !targetpw' >> /etc/sudoers
Expand Down
Loading

0 comments on commit e91075f

Please sign in to comment.