Skip to content

Commit

Permalink
Merge pull request #12295 from svet-se/slmicro5-stig-add-accounts-and…
Browse files Browse the repository at this point in the history
…-auditing-rules-support

Slmicro5 stig add accounts and auditing rules support
  • Loading branch information
teacup-on-rockingchair authored Aug 20, 2024
2 parents d484bc7 + e778622 commit bcf8dae
Show file tree
Hide file tree
Showing 31 changed files with 109 additions and 55 deletions.
57 changes: 35 additions & 22 deletions controls/stig_slmicro5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,9 @@ controls:
title:
SLEM 5 must configure the Linux Pluggable Authentication Modules (PAM) to
only store encrypted representations of passwords.
rules: []
status: pending
rules:
- set_password_hashing_algorithm_systemauth
status: automated

- id: SLEM-05-611055
levels:
Expand All @@ -1087,15 +1088,19 @@ controls:
title:
SLEM 5 must employ user passwords with a minimum lifetime of 24 hours (one
day).
rules: []
status: pending
rules:
- accounts_password_set_min_life_existing
- var_accounts_minimum_age_login_defs=1
status: automated

- id: SLEM-05-611070
levels:
- medium
title: SLEM 5 must employ user passwords with a maximum lifetime of 60 days.
rules: []
status: pending
rules:
- accounts_password_set_max_life_existing
- var_accounts_maximum_age_login_defs=60
status: automated

- id: SLEM-05-611075
levels:
Expand All @@ -1119,8 +1124,9 @@ controls:
title:
SLEM 5 shadow password suite must be configured to use a sufficient number
of hashing rounds.
rules: []
status: pending
rules:
- set_password_hashing_min_rounds_logindefs
status: automated

- id: SLEM-05-611090
levels:
Expand All @@ -1137,26 +1143,29 @@ controls:
title:
SLEM 5 must be configured to create or update passwords with a minimum lifetime
of 24 hours (one day).
rules: []
status: pending
rules:
- accounts_minimum_age_login_defs
status: automated

- id: SLEM-05-611100
levels:
- medium
title:
SLEM 5 must be configured to create or update passwords with a maximum lifetime
of 60 days.
rules: []
status: pending
rules:
- accounts_maximum_age_login_defs
status: automated

- id: SLEM-05-612010
levels:
- medium
title:
SLEM 5 must have the packages required for multifactor authentication to
be installed.
rules: []
status: pending
rules:
- install_smartcard_packages
status: automated

- id: SLEM-05-612015
levels:
Expand Down Expand Up @@ -1199,8 +1208,9 @@ controls:
SLEM 5, for PKI-based authentication, must validate certificates by constructing
a certification path (which includes status information) to an accepted trust
anchor.
rules: []
status: pending
rules:
- smartcard_configure_ca
status: automated

- id: SLEM-05-631025
levels:
Expand Down Expand Up @@ -1328,8 +1338,9 @@ controls:
title:
SLEM 5 audit system must take appropriate action when the audit storage volume
is full.
rules: []
status: pending
rules:
- auditd_data_disk_full_action
status: automated

- id: SLEM-05-653040
levels:
Expand Down Expand Up @@ -1397,17 +1408,19 @@ controls:
The information system security officer (ISSO) and system administrator (SA),
at a minimum, must have mail aliases to be notified of a SLEM 5 audit processing
failure.
rules: []
status: pending
rules:
- postfix_client_configure_mail_alias
status: automated

- id: SLEM-05-653080
levels:
- medium
title:
The information system security officer (ISSO) and system administrator (SA),
at a minimum, must be alerted of a SLEM 5 audit processing failure event.
rules: []
status: pending
rules:
- auditd_data_retention_action_mail_acct
status: automated

- id: SLEM-05-654010
levels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle
# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro
# reboot = false
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = Red Hat Virtualization 4,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu
# platform = Red Hat Virtualization 4,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu

{{{ bash_instantiate_variables("var_auditd_disk_full_action") }}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ identifiers:
cce@rhel10: CCE-88198-7
cce@sle12: CCE-83032-3
cce@sle15: CCE-85606-2
cce@slmicro5: CCE-93679-9

references:
cis-csc: 1,11,12,13,14,15,16,19,2,3,4,5,6,7,8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle
# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro
# reboot = false
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu
# platform = Red Hat Virtualization 4,multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu

{{{ bash_instantiate_variables("var_auditd_action_mail_acct") }}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ identifiers:
cce@rhel10: CCE-89081-4
cce@sle12: CCE-83030-7
cce@sle15: CCE-85604-7
cce@slmicro5: CCE-93677-3

references:
cis-csc: 1,11,12,13,14,15,16,19,2,3,4,5,6,7,8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_rhv,multi_platform_sle,multi_platform_debian
# platform = multi_platform_rhel,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro,multi_platform_debian
# reboot = false
# strategy = configure
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_rhv,multi_platform_sle,multi_platform_debian
# platform = multi_platform_rhel,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro,multi_platform_debian

{{{ bash_instantiate_variables("var_postfix_root_mail_alias") }}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ identifiers:
cce@rhel10: CCE-87937-9
cce@sle12: CCE-83031-5
cce@sle15: CCE-85605-4
cce@slmicro5: CCE-93678-1

references:
disa: CCI-000139,CCI-000366
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# complexity = low
# disruption = medium

{{% if product in ["sle15", "sle12"] -%}}
{{% if product in ["sle15", "sle12", "slmicro5"] -%}}
{{%- set pam_file="/etc/pam.d/common-password" %}}
{{%- set control="required" %}}
{{%- else -%}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{{ bash_instantiate_variables("var_password_hashing_algorithm_pam") }}}

{{% if 'sle' in product -%}}
{{% if 'sle' in product or 'slmicro' in product -%}}
PAM_FILE_PATH="/etc/pam.d/common-password"
CONTROL="required"
{{%- elif 'ubuntu' in product -%}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</criteria>
</definition>

{{% if product in ['sle12', 'sle15'] %}}
{{% if product in ['sle12', 'sle15', 'slmicro5'] %}}
{{% set pam_file = "/etc/pam.d/common-password" %}}
{{% set line_pattern = "^[\s]*password[\s]+(?:(?:required))[\s]+pam_unix\.so[\s]+" %}}
{{% elif 'ubuntu' in product %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ documentation_complete: true

title: "Set PAM''s Password Hashing Algorithm"

{{% if product in ["sle12", "sle15"] or 'ubuntu' in product %}}
{{% if product in ["sle12", "sle15", "slmicro5"] or 'ubuntu' in product %}}
{{% set pam_passwd_file_path = "/etc/pam.d/common-password" %}}
{{% else %}}
{{% set pam_passwd_file_path = "/etc/pam.d/system-auth" %}}
Expand All @@ -17,7 +17,7 @@ description: |-
<tt>{{{ xccdf_value("var_password_hashing_algorithm_pam") }}}</tt> and no other hashing
algorithms as shown below:
<br />
{{% if product in ["sle12", "sle15"] %}}
{{% if product in ["sle12", "sle15", "slmicro5"] %}}
<pre>password required pam_unix.so {{{ xccdf_value("var_password_hashing_algorithm_pam") }}} <i>other arguments...</i></pre>
{{% elif 'ubuntu' in product %}}
<pre>password [success=1 default=ignore] pam_unix.so {{{ xccdf_value("var_password_hashing_algorithm_pam") }}} <i>other arguments...</i></pre>
Expand Down Expand Up @@ -47,6 +47,7 @@ identifiers:
cce@rhel10: CCE-88697-8
cce@sle12: CCE-83184-2
cce@sle15: CCE-85565-0
cce@slmicro5: CCE-93681-5

references:
cis-csc: 1,12,15,16,5
Expand Down Expand Up @@ -77,7 +78,7 @@ ocil: |-
<tt>{{{ xccdf_value("var_password_hashing_algorithm_pam") }}}</tt>:
<pre>$ sudo grep "^password.*pam_unix\.so.*{{{ xccdf_value("var_password_hashing_algorithm_pam") }}}" {{{ pam_passwd_file_path }}}
{{% if product in ["sle12", "sle15"] -%}}
{{% if product in ["sle12", "sle15", "slmicro5"] -%}}
password required pam_unix.so {{{ xccdf_value("var_password_hashing_algorithm_pam") }}}
{{% elif 'ubuntu' in product %}}
password [success=1 default=ignore] pam_unix.so {{{ xccdf_value("var_password_hashing_algorithm_pam") }}}
Expand All @@ -97,7 +98,7 @@ fixtext: |-
Edit/modify the following line in the "{{{ pam_passwd_file_path }}}" file to include the {{{ xccdf_value("var_password_hashing_algorithm_pam") }}}
option for pam_unix.so:
{{% if product in ['sle12', 'sle15'] -%}}
{{% if product in ['sle12', 'sle15', 'slmicro5'] -%}}
password required pam_unix.so {{{ xccdf_value("var_password_hashing_algorithm_pam") }}}
{{% elif 'ubuntu' in product %}}
password [success=1 default=ignore] pam_unix.so {{{ xccdf_value("var_password_hashing_algorithm_pam") }}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ identifiers:
cce@rhel10: CCE-90508-3
cce@sle12: CCE-83171-9
cce@sle15: CCE-85567-6
cce@slmicro5: CCE-93682-3

references:
disa: CCI-000196,CCI-000803
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# platform = multi_platform_slmicro
# reboot = false
# strategy = enable
# complexity = low
# disruption = low

- name: Set smartcard packages fact
set_fact:
smartcard_packages:
- pam_pkcs11
- mozilla-nss
- mozilla-nss-tools
- pcsc-ccid
- pcsc-lite
- pcsc-tools
- opensc
- coolkey

- name: Ensure {{ smartcard_packages }} are installed
package:
name: "{{ smartcard_packages }}"
state: present
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# platform = multi_platform_slmicro
# reboot = false
# strategy = enable
# complexity = low
# disruption = low

SMARTCARD_PACKAGES=( "pam_pkcs11" "mozilla-nss" "mozilla-nss-tools" "pcsc-ccid" "pcsc-lite" "pcsc-tools" "opensc" "coolkey")

for PKGNAME in "${SMARTCARD_PACKAGES[@]}"
do
{{{ bash_package_install(package="$PKGNAME") }}}
done
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{% if product in ["sle12"] %}}
{{% if product in ["sle12", "slmicro5"] %}}
{{% set smartcard_packages = ['pam_pkcs11', 'mozilla-nss', 'mozilla-nss-tools', 'pcsc-ccid', 'pcsc-lite', 'pcsc-tools', 'opensc', 'coolkey'] %}}
{{% elif product in ["sle15"] %}}
{{% set smartcard_packages = ['pam_pkcs11', 'mozilla-nss', 'mozilla-nss-tools', 'pcsc-ccid', 'pcsc-lite', 'pcsc-tools', 'opensc'] %}}
Expand All @@ -13,7 +13,7 @@
<def-group>
<definition class="compliance" id="install_smartcard_packages"
version="1">
{{{ oval_metadata("The " + pkg_system|upper + " packages " + smartcard_packages|join(',') + " should be installed.", affected_platforms=["multi_platform_sle"]) }}}
{{{ oval_metadata("The " + pkg_system|upper + " packages " + smartcard_packages|join(',') + " should be installed.", affected_platforms=["multi_platform_sle", "multi_platform_slmicro"]) }}}
<criteria operator="AND" comment="Make sure all smartcard packages are installed">
{{% for pkg in smartcard_packages %}}
<criterion comment="package {{{ pkg }}} is installed"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{% if product in ["sle12"] %}}
{{% if product in ["sle12", "slmicro5"] %}}
{{% set smartcard_packages = ['pam_pkcs11', 'mozilla-nss', 'mozilla-nss-tools', 'pcsc-ccid', 'pcsc-lite', 'pcsc-tools', 'opensc', 'coolkey'] %}}
{{% elif product in ["sle15"] %}}
{{% set smartcard_packages = ['pam_pkcs11', 'mozilla-nss', 'mozilla-nss-tools', 'pcsc-ccid', 'pcsc-lite', 'pcsc-tools', 'opensc'] %}}
Expand Down Expand Up @@ -44,6 +44,7 @@ identifiers:
cce@rhel10: CCE-86642-6
cce@sle12: CCE-83177-6
cce@sle15: CCE-83292-3
cce@slmicro5: CCE-93761-5

references:
disa: CCI-000765,CCI-001948,CCI-001953,CCI-001954
Expand All @@ -66,7 +67,7 @@ ocil: |-
{{{ ocil_package(package=pkg) }}}
{{% endfor %}}
{{% if product not in ["sle12", "sle15"] %}}
{{% if product not in ["sle12", "sle15", "slmicro5"] %}}
template:
name: package_installed
vars:
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 = false
# strategy = restrict
# complexity = low
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

if rpm -qa pam_pkcs11; then
if grep "^\s*cert_policy" /etc/pam_pkcs11/pam_pkcs11.conf | grep -q "ca"; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ severity: medium
identifiers:
cce@sle12: CCE-83198-2
cce@sle15: CCE-83272-5
cce@slmicro5: CCE-93680-7

references:
disa: CCI-000185,CCI-001991
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_debian
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro,multi_platform_debian
# reboot = false
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ identifiers:
cce@rhel10: CCE-87961-9
cce@sle12: CCE-83050-5
cce@sle15: CCE-85570-0
cce@slmicro5: CCE-93685-6

references:
cis-csc: 1,12,15,16,5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro
# reboot = false
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ identifiers:
cce@rhel10: CCE-89307-3
cce@sle12: CCE-83042-2
cce@sle15: CCE-85720-1
cce@slmicro5: CCE-93683-1

references:
cis-csc: 1,12,15,16,5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_rhel,multi_platform_sle,multi_platform_ol
# platform = multi_platform_rhel,multi_platform_sle,multi_platform_slmicro,multi_platform_ol
# reboot = false
# strategy = restrict
# complexity = low
Expand Down
Loading

0 comments on commit bcf8dae

Please sign in to comment.