Skip to content

Commit

Permalink
Merge branch 'master' into debian12
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Rensing committed Oct 27, 2023
2 parents a8263eb + f5af13c commit 255573e
Show file tree
Hide file tree
Showing 81 changed files with 3,562 additions and 2,266 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# platform = multi_platform_all
# reboot = false
# strategy = restrict
# complexity = low
# disruption = low

- name: {{{ rule_title }}} - Ensure a Final Rule Denying Everything
ansible.builtin.copy:
content: |
# Red Hat KCS 7003854 (https://access.redhat.com/solutions/7003854)
deny perm=any all : all
dest: /etc/fapolicyd/rules.d/99-deny-everything.rules
owner: root
group: fapolicyd
mode: '0644'
register: result_fapolicyd_final_rule

- name: {{{ rule_title }}} - Ensure fapolicyd is Not Permissive
ansible.builtin.lineinfile:
path: /etc/fapolicyd/fapolicyd.conf
regexp: '^(permissive\s*=).*$'
line: '\1 0'
backrefs: true
register: result_fapolicyd_enforced

- name: "{{{ rule_title }}} - Restart fapolicyd If Permissive Mode or Final Rule is Changed"
ansible.builtin.service:
name: fapolicyd
state: restarted
when:
- result_fapolicyd_final_rule is changed or result_fapolicyd_enforced is changed
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# platform = multi_platform_all
# reboot = false
# strategy = restrict
# complexity = low
# disruption = low

cat > /etc/fapolicyd/rules.d/99-deny-everything.rules << EOF
# Red Hat KCS 7003854 (https://access.redhat.com/solutions/7003854)
deny perm=any all : all
EOF

chmod 644 /etc/fapolicyd/rules.d/99-deny-everything.rules
chgrp fapolicyd /etc/fapolicyd/rules.d/99-deny-everything.rules

{{{ set_config_file(path="/etc/fapolicyd/fapolicyd.conf",
parameter="permissive",
value="0",
create=true,
insensitive=true,
separator=" = ",
separator_regex="\s*=\s*",
prefix_regex="^\s*") }}}

systemctl restart fapolicyd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,3 @@ fixtext: |-
permissive = 0
srg_requirement: 'The {{{ full_name }}} fapolicy module must be configured to employ a deny-all, permit-by-exception policy to allow the execution of authorized software programs.'

warnings:
- general:
This rule doesn't come with a remediation. Before remediating the system administrator needs to create an allowlist of authorized software.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
# packages = fapolicyd
# remediation = none

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "1", "true") }}}

if [ -f /etc/fapolicyd/compiled.rules ]; then
active_rules_file="/etc/fapolicyd/compiled.rules"
Expand All @@ -11,8 +8,14 @@ else
fi

truncate -s 0 $active_rules_file

echo "allow exe=/usr/bin/python3.7 : ftype=text/x-python" >> $active_rules_file
echo "allow perm=any all : all" >> $active_rules_file

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "0", "true") }}}
{{{ set_config_file(path="/etc/fapolicyd/fapolicyd.conf",
parameter="permissive",
value="0",
create=true,
insensitive=true,
separator=" = ",
separator_regex="\s*=\s*",
prefix_regex="^\s*") }}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
# packages = fapolicyd
# remediation = none

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "1", "true") }}}

if [ -f /etc/fapolicyd/compiled.rules ]; then
active_rules_file="/etc/fapolicyd/compiled.rules"
Expand All @@ -11,8 +8,14 @@ else
fi

truncate -s 0 $active_rules_file

echo "allow exe=/usr/bin/python3.7 : ftype=text/x-python" >> $active_rules_file
echo "deny perm=any all : all" >> $active_rules_file

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "0", "true") }}}
{{{ set_config_file(path="/etc/fapolicyd/fapolicyd.conf",
parameter="permissive",
value="0",
create=true,
insensitive=true,
separator=" = ",
separator_regex="\s*=\s*",
prefix_regex="^\s*") }}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
# packages = fapolicyd
# remediation = none

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "1", "true") }}}

if [ -f /etc/fapolicyd/compiled.rules ]; then
active_rules_file="/etc/fapolicyd/compiled.rules"
Expand All @@ -11,6 +8,14 @@ else
fi

truncate -s 0 $active_rules_file

echo "allow exe=/usr/bin/python3.7 : ftype=text/x-python" >> $active_rules_file
echo "deny perm=any all : all" >> $active_rules_file

{{{ set_config_file(path="/etc/fapolicyd/fapolicyd.conf",
parameter="permissive",
value="1",
create=true,
insensitive=true,
separator=" = ",
separator_regex="\s*=\s*",
prefix_regex="^\s*") }}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
# packages = fapolicyd
# remediation = none

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "1", "true") }}}

if [ -f /etc/fapolicyd/compiled.rules ]; then
active_rules_file="/etc/fapolicyd/compiled.rules"
Expand All @@ -11,8 +8,14 @@ else
fi

truncate -s 0 $active_rules_file

echo "allow exe=/usr/bin/python3.7 : ftype=text/x-python" >> $active_rules_file
echo "# deny perm=any all : all" >> $active_rules_file

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "0", "true") }}}
{{{ set_config_file(path="/etc/fapolicyd/fapolicyd.conf",
parameter="permissive",
value="0",
create=true,
insensitive=true,
separator=" = ",
separator_regex="\s*=\s*",
prefix_regex="^\s*") }}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash
# packages = fapolicyd
# remediation = none

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "1", "true") }}}

if [ -f /etc/fapolicyd/compiled.rules ]; then
active_rules_file="/etc/fapolicyd/compiled.rules"
Expand All @@ -11,8 +8,14 @@ else
fi

truncate -s 0 $active_rules_file

echo "deny perm=any all : all" >> $active_rules_file
echo "allow exe=/usr/bin/python3.7 : ftype=text/x-python" >> $active_rules_file

{{{ bash_shell_file_set("/etc/fapolicyd/fapolicyd.conf", "permissive", "0", "true") }}}
{{{ set_config_file(path="/etc/fapolicyd/fapolicyd.conf",
parameter="permissive",
value="0",
create=true,
insensitive=true,
separator=" = ",
separator_regex="\s*=\s*",
prefix_regex="^\s*") }}}
4 changes: 2 additions & 2 deletions linux_os/guide/services/ntp/group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ description: |-
{{% elif product == "rhel7" %}}
{{{ weblink(link="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_ntp_using_the_chrony_suite") }}}
{{% elif product == "rhel8" %}}
{{{ weblink(link="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/using-chrony-to-configure-ntp_configuring-basic-system-settings") }}}
{{{ weblink(link="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/configuring-time-synchronization_configuring-basic-system-settings") }}}
{{% elif product == "rhel9" %}}
{{{ weblink(link="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/using-chrony-to-configure-ntp_configuring-basic-system-settings#doc-wrapper") }}}
{{{ weblink(link="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/configuring-time-synchronization_configuring-basic-system-settings") }}}
{{% elif "ubuntu" in product %}}
{{{ weblink(link="https://help.ubuntu.com/lts/serverguide/NTP.html") }}}
{{% elif "debian" in product %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if ! grep -q "^${var_pam_wheel_group_for_su}:[^:]*:[^:]*:[^:]*" /etc/group; then
fi

# group must be empty
groupmems -g ${var_pam_wheel_group_for_su} -p
gpasswd -M '' ${var_pam_wheel_group_for_su}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

GRP_NAME=sugroup
groupadd ${GRP_NAME}
groupmems -g ${GRP_NAME} -p
gpasswd -M '' ${GRP_NAME}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,4 @@ template:
name: rsyslog_logfiles_attributes_modify
vars:
attribute: groupowner
{{% if "ubuntu" in product or "debian" in product %}}
value: 4
{{% else %}}
value: 0
{{% endif %}}
value: {{{ target_group }}}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ template:
name: rsyslog_logfiles_attributes_modify
vars:
attribute: owner
value: 0
value@ubuntu2004: 104
value@ubuntu2204: 104
value: root
value@ubuntu2004: syslog
value@ubuntu2204: syslog
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

<ind:textfilecontent54_object id="obj_sudo_selinux_elevation_type" version="1">
<ind:filepath operation="pattern match">^/etc/sudoers(\.d/.*)?$</ind:filepath>
<ind:pattern operation="pattern match">^\s*%wheel.*TYPE=(\w+).*$</ind:pattern>
<ind:pattern operation="pattern match">^\s*%\w+.*TYPE=(\w+).*$</ind:pattern>
<ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
</ind:textfilecontent54_object>

<ind:textfilecontent54_object id="obj_sudo_selinux_elevation_role" version="1">
<ind:filepath operation="pattern match">^/etc/sudoers(\.d/.*)?$</ind:filepath>
<ind:pattern operation="pattern match">^\s*%wheel.*ROLE=(\w+).*$</ind:pattern>
<ind:pattern operation="pattern match">^\s*%\w+.*ROLE=(\w+).*$</ind:pattern>
<ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
</ind:textfilecontent54_object>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# platform = multi_platform_ol
#!/bin/bash

# platform = multi_platform_all
# packages = sudo
# remediation = none

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# platform = multi_platform_ol
#!/bin/bash

# platform = multi_platform_all
# packages = sudo

echo '%wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL' >> /etc/sudoers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# platform = multi_platform_ol
#!/bin/bash

# platform = multi_platform_all
# packages = sudo

echo '%wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL' >> /etc/sudoers.d/01-complianceascode.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# platform = multi_platform_all
# packages = sudo

group_add sudoers

echo '%sudoers ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL' >> /etc/sudoers.d/01-complianceascode.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# platform = multi_platform_ol
#!/bin/bash

# platform = multi_platform_all
# packages = sudo
# remediation = none

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# platform = multi_platform_ol
#!/bin/bash

# platform = multi_platform_all
# packages = sudo
# remediation = none

Expand Down
4 changes: 2 additions & 2 deletions products/rhel7/profiles/stig.profile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
documentation_complete: true

metadata:
version: V3R12
version: V3R13
SMEs:
- ggbecker

Expand All @@ -11,7 +11,7 @@ title: 'DISA STIG for Red Hat Enterprise Linux 7'

description: |-
This profile contains configuration checks that align to the
DISA STIG for Red Hat Enterprise Linux V3R12.
DISA STIG for Red Hat Enterprise Linux V3R13.

In addition to being applicable to Red Hat Enterprise Linux 7, DISA recognizes this
configuration baseline as applicable to the operating system tier of
Expand Down
4 changes: 2 additions & 2 deletions products/rhel7/profiles/stig_gui.profile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
documentation_complete: true

metadata:
version: V3R12
version: V3R13
SMEs:
- ggbecker

Expand All @@ -11,7 +11,7 @@ title: 'DISA STIG with GUI for Red Hat Enterprise Linux 7'

description: |-
This profile contains configuration checks that align to the
DISA STIG with GUI for Red Hat Enterprise Linux V3R12.
DISA STIG with GUI for Red Hat Enterprise Linux V3R13.

In addition to being applicable to Red Hat Enterprise Linux 7, DISA recognizes this
configuration baseline as applicable to the operating system tier of
Expand Down
4 changes: 2 additions & 2 deletions products/rhel8/profiles/stig.profile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
documentation_complete: true

metadata:
version: V1R11
version: V1R12
SMEs:
- mab879
- ggbecker
Expand All @@ -12,7 +12,7 @@ title: 'DISA STIG for Red Hat Enterprise Linux 8'

description: |-
This profile contains configuration checks that align to the
DISA STIG for Red Hat Enterprise Linux 8 V1R11.
DISA STIG for Red Hat Enterprise Linux 8 V1R12.

In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes this
configuration baseline as applicable to the operating system tier of
Expand Down
4 changes: 2 additions & 2 deletions products/rhel8/profiles/stig_gui.profile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
documentation_complete: true

metadata:
version: V1R11
version: V1R12
SMEs:
- mab879
- ggbecker
Expand All @@ -12,7 +12,7 @@ title: 'DISA STIG with GUI for Red Hat Enterprise Linux 8'

description: |-
This profile contains configuration checks that align to the
DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R11.
DISA STIG with GUI for Red Hat Enterprise Linux 8 V1R12.

In addition to being applicable to Red Hat Enterprise Linux 8, DISA recognizes this
configuration baseline as applicable to the operating system tier of
Expand Down
1 change: 1 addition & 0 deletions products/ubuntu2004/profiles/cis_level1_server.profile
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ selections:
- var_nftables_base_chain_types=chain_types
- var_nftables_base_chain_hooks=chain_hooks
- var_nftables_base_chain_priorities=chain_priorities
- var_nftables_base_chain_policies=chain_policies
- set_nftables_base_chain

#### 3.5.2.6 Ensure loopback traffic is configured (Automated)
Expand Down
1 change: 1 addition & 0 deletions products/ubuntu2204/profiles/cis_level1_server.profile
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ selections:
- var_nftables_base_chain_types=chain_types
- var_nftables_base_chain_hooks=chain_hooks
- var_nftables_base_chain_priorities=chain_priorities
- var_nftables_base_chain_policies=chain_policies
- set_nftables_base_chain

#### 3.5.2.6 Ensure nftables loopback traffic is configured (Automated)
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 255573e

Please sign in to comment.