Skip to content
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

Update SRG-OS-000114-GPOS-00059 for RHEL 9 STIG #8505

Merged
merged 15 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_all
# reboot = false
# complexity = low
# strategy = configure
# disruption = low

{{{ ansible_lineinfile(msg='allow HID devices', path='/etc/usbguard/rules.conf', regex='', new_line='allow with-interface match-all { 03:*:* }', create='yes', state='present') }}}
7 changes: 7 additions & 0 deletions linux_os/guide/services/usbguard/usbguard_allow_hid/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ severity: medium

identifiers:
cce@rhel8: CCE-82274-2
cce@rhel9: CCE-85990-0

references:
ospp: FMT_SMF_EXT.1
Expand All @@ -37,3 +38,9 @@ ocil: |-
The output lines should include
<pre>allow with-interface match-all { 03:*:* }</pre>

fixtext: |-
Configure the USBGuard daemon to allow USB Human Interface Devices.

Add or edit the following line in "/etc/usbguard/rules.conf":

allow with-interface match-all { 03:*:* }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_all
# reboot = false
# complexity = low
# strategy = configure
# disruption = low

{{{ ansible_lineinfile(msg='allow HID devices and hubs', path='/etc/usbguard/rules.conf', regex='', new_line='allow with-interface match-all { 03:*:* 09:00:* }', create='yes', state='present') }}}
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ ocil: |-
<pre>$ sudo grep allow /etc/usbguard/rules.conf</pre>
The output lines should include
<pre>allow with-interface match-all { 03:*:* 09:00:* }</pre>

fixtext: |-
Configure the USBGuard daemon to allow USB Human Interface Devices and USB hubs.

Add or edit the following line in "/etc/usbguard/rules.conf":

allow with-interface match-all { 03:*:* 09:00:* }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# platform = multi_platform_all
# reboot = false
# complexity = low
# strategy = configure
# disruption = low

{{{ ansible_lineinfile(msg='allow hubs', path='/etc/usbguard/rules.conf', regex='', new_line='allow with-interface match-all { 09:00:* }', create='yes', state='present') }}}
7 changes: 7 additions & 0 deletions linux_os/guide/services/usbguard/usbguard_allow_hub/rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ ocil: |-
<pre>$ sudo grep allow /etc/usbguard/rules.conf</pre>
One of the output lines should be
<pre>allow with-interface match-all { 09:00:* }</pre>

fixtext: |-
Configure the USBGuard daemon to allow USB hubs.

Add or edit the following line in "/etc/usbguard/rules.conf"

allow with-interface match-all { 09:00:* }
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ template:
name: kernel_module_disabled
vars:
kernmodule: usb-storage

fixtext: |-
Configure {{{ full_name }}} to disable automated loading of the USB storage driver.
{{{ describe_module_disable(module="usb-storage") }}}
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ references:
ocil: |-
{{{ ocil_service_disabled(service="autofs") }}}

ocil_clause: the autofs service is not disabled

platform: machine

template:
name: service_disabled
vars:
servicename: autofs

fixtext: |-
Configure {{{ full_name }}} to disable the ability to automount devices.
{{{ describe_service_disable(service="autofs") }}}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ ocil: |-
AutomaticLoginEnable=false</pre>

fixtext: |-
{{{ fixtext_dconf_ini_file("daemon", "AutomaticLoginEnable", "false") }}}
Configure GDM to disable automatic login.

Set AutomaticLoginEnable to false in the [daemon] section in /etc/gdm/custom.conf. For example:

[daemon]
AutomaticLoginEnable=false

platform: machine
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ description: |-
After the settings have been set, run <tt>dconf update</tt>.

rationale: |-
Automatically mounting file systems permits easy introduction of unknown devices, thereby facilitating malicious activity.
Disabling automatic mounting in GNOME3 can prevent
the introduction of malware via removable media.
It will, however, also prevent desktop users from legitimate use
Expand Down Expand Up @@ -56,3 +57,8 @@ ocil: |-
If properly configured, the output for <tt>automount-open</tt> should be <tt>/org/gnome/desktop/media-handling/automount-open</tt>

platform: machine

fixtext: |-
Configure GNOME 3 to disable automated mount of removable media.

{{{ fixtext_dconf_ini_file("org/gnome/desktop/media-handling", "automount-open", "false") }}}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ description: |-
After the settings have been set, run <tt>dconf update</tt>.

rationale: |-
Automatically mounting file systems permits easy introduction of unknown devices, thereby facilitating malicious activity.
Disabling automatic mount running in GNOME3 can prevent
the introduction of malware via removable media.
It will, however, also prevent desktop users from legitimate use
Expand Down Expand Up @@ -56,3 +57,8 @@ ocil: |-
If properly configured, the output for <tt>autorun-never</tt> should be <tt>/org/gnome/desktop/media-handling/autorun-never</tt>

platform: machine

fixtext: |-
Configure GNOME 3 to disable automated mount of removable media.

{{{ fixtext_dconf_ini_file("org/gnome/desktop/media-handling", "autorun-never", "true") }}}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ ocil: |-
{{% endif %}}

fixtext: |-
{{{ fixtext_dconf_ini_file("/org/gnome/desktop/screensaver/lock-enabled", "lock-enabled", "true") }}}
{{{ fixtext_dconf_ini_file("org/gnome/desktop/screensaver/lock-enabled", "lock-enabled", "true") }}}

platform: machine
12 changes: 9 additions & 3 deletions shared/macros/fixtext.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ The audit daemon must be restarted for the changes to take effect.
#}}
{{%- macro fixtext_dconf_ini_file(section, parameter, value) -%}}
The dconf settings can be edited in the /etc/dconf/db/* location.
Edit or add the {{{ section }}} section of the database file and add or update the following lines:

{{{parameter}}}={{{value}}}
First, add or update the [{{{ section }}}] section of the "/etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines:

Update the system databases:
[{{{ section }}}]
{{{ parameter }}}={{{ value }}}

Then, add the following line to "/etc/dconf/db/local.d/locks/00-security-settings-lock" to prevent user modification:

/{{{ section }}}/{{{ parameter }}}

Finally, update the dconf system databases:

$ sudo dconf update
{{%- endmacro -%}}
Expand Down
1 change: 0 additions & 1 deletion shared/references/cce-redhat-avail.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ CCE-85984-3
CCE-85985-0
CCE-85986-8
CCE-85988-4
CCE-85990-0
CCE-85997-5
CCE-85998-3
CCE-85999-1
Expand Down