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

This file was deleted.

1 change: 0 additions & 1 deletion ash-linux/el9/RuleById/low/init.sls
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include:
- ash-linux.el9.RuleById.low.content_rule_configure_usbguard_auditbackend
- ash-linux.el9.RuleById.low.content_rule_no_tmux_in_shells
46 changes: 23 additions & 23 deletions ash-linux/el9/STIGbyID/cat2/RHEL-09-291025.sls
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Ref Doc:
# - STIG - RHEL 9 v2r6 (01 Oct 2025)
# - STIG - OEL 9 vXrY (01 Oct 2025)
# - STIG - AlmaLinux 9 vXrY (01 Oct 2025)
# - STIG - AlmaLinux 9 v1r4 (01 Oct 2025)
# Finding ID:
# - RHEL: V-258037
# - OEL: V-271700
# - Alma: V-NNNNNN
# - Alma: V-269465
# Rule ID:
# - RHEL: SV-258037r1014863_rule
# - OEL: SV-271700r1091812_rule
Expand Down Expand Up @@ -44,9 +44,9 @@
{%- set stig_id = stigIdByVendor[salt.grains.get('os')] %}
{%- set helperLoc = tpldir ~ '/files' %}
{%- set skipIt = salt.pillar.get('ash-linux:lookup:skip-stigs', []) %}
{%- set cfgFile ='/etc/usbguard/usbguard-daemon.conf' %}
{%- set cfgFile = '/etc/usbguard/usbguard-daemon.conf' %}
{%- set cfgParm = 'AuditBackend' %}
{%- set cfgValu = salt.pillar.get('ash-linux:lookup:usb_guard:audit_backend', 'LinuxAudit') %}
{%- set cfgValu = salt.pillar.get('ash-linux:lookup:usb_guard:audit_backend', 'LinuxAudit') %}

{{ stig_id }}-description:
test.show_notification:
Expand All @@ -63,37 +63,37 @@ notify_{{ stig_id }}-skipSet:
- text: |
Handler for {{ stig_id }} has been selected for skip.
{%- else %}
Create USBguard config-file ({{ stig_id }}):
file.touch:
- name: '{{ cfgFile }}'
- makedirs: True
- unless:
- 'stat {{ cfgFile }}'

Set permission-bits on {{ cfgFile }} ({{ stig_id }}):
# Establish correct mode and user/group ownership
# - Create a null-file if no file already exists
# - Ensures correct mode & user/group ownership on file (irrespective of
# file's previous existence)
Ensure {{ cfgFile }} exists with strict permissions ({{ stig_id }}):
file.managed:
- name: '{{ cfgFile }}'
- group: 'root'
- makedirs: True
- mode: '0600'
- name: '{{ cfgFile }}'
- replace: False
- selinux:
serange: 's0'
serole: 'object_r'
setype: 'etc_t'
seuser: 'system_u'
- user: 'root'
- watch:
- file: 'Create USBguard config-file ({{ stig_id }})'

# Ensurse STIG-prescribed config-directive exists in file
Enable USBguard audit-logging ({{ stig_id }}):
file.replace:
- name: '{{ cfgFile }}'
- append_if_not_found: True
- name: '{{ cfgFile }}'
- not_found_content: |
# Set per rule {{ stig_id }}
{{ cfgParm }}={{ cfgValu }}
- pattern: '(^(|\s\s*)){{ cfgParm }}.*$'
- repl: '{{ cfgParm }}={{ cfgValu }}'
- watch:
- file: 'Set permission-bits on {{ cfgFile }} ({{ stig_id }})'
- require:
- file: 'Ensure {{ cfgFile }} exists with strict permissions ({{ stig_id }})'

# Bypasses the broken file.managed SELinux parameter on RHEL 9/10 and ensures
# that label matches the rule from `matchpathcon`
Apply SELinux context to {{ cfgFile }} ({{ stig_id }}):
selinux.fcontext_policy_applied:
- name: '{{ cfgFile }}'
- require:
- file: 'Enable USBguard audit-logging ({{ stig_id }})'
{%- endif %}
4 changes: 3 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
audit
firewalld
openssh-server
policycoreutils
policycoreutils-python-utils
rsyslog
salt-minion
firewalld
Loading