Skip to content

Commit

Permalink
Merge pull request #2614 from dahaic/fix_audit_kernel_module_rules
Browse files Browse the repository at this point in the history
Fix kernel module loading and unloading rules
  • Loading branch information
yuumasato authored Mar 2, 2018
2 parents 848595e + 2a9d377 commit e4ee6f1
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 96 deletions.
10 changes: 5 additions & 5 deletions shared/fixes/bash/audit_rules_kernel_module_loading.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
# Note: 32-bit kernel modules can't be loaded / unloaded on 64-bit kernel =>
# it's not required on a 64-bit system to check also for the presence
# of 32-bit's equivalent of the corresponding rule. Therefore for
# each system it's enought to check presence of system's native rule form.
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b64")
# Note: 32-bit and 64-bit kernel syscall numbers not always line up =>
# it's required on a 64-bit system to check also for the presence
# of 32-bit's equivalent of the corresponding rule.
# (See `man 7 audit.rules` for details )
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
do
Expand Down
8 changes: 4 additions & 4 deletions shared/fixes/bash/audit_rules_kernel_module_loading_delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
# If the system has a 32-bit processor, only the 32-bit rule is needed.
# If the system has a 64-bit processor, both arch 32 and 64 need to be included in
# the audit file because it is not possible to know if the computer will be booted
# in 64 or 32 bit mode or for which architecture a binary is compiled.
# Note: 32-bit and 64-bit kernel syscall numbers not always line up =>
# it's required on a 64-bit system to check also for the presence
# of 32-bit's equivalent of the corresponding rule.
# (See `man 7 audit.rules` for details )
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
Expand Down
8 changes: 4 additions & 4 deletions shared/fixes/bash/audit_rules_kernel_module_loading_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

# First perform the remediation of the syscall rule
# Retrieve hardware architecture of the underlying system
# If the system has a 32-bit processor, only the 32-bit rule is needed.
# If the system has a 64-bit processor, both arch 32 and 64 need to be included in
# the audit file because it is not possible to know if the computer will be booted
# in 64 or 32 bit mode or for which architecture a binary is compiled.
# Note: 32-bit and 64-bit kernel syscall numbers not always line up =>
# it's required on a 64-bit system to check also for the presence
# of 32-bit's equivalent of the corresponding rule.
# (See `man 7 audit.rules` for details )
[ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64")

for ARCH in "${RULE_ARCHS[@]}"
Expand Down
161 changes: 78 additions & 83 deletions shared/xccdf/system/auditing.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_C2S
# remediation = bash

rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7
# remediation = bash

rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7
# remediation = bash

rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7
# remediation = bash

rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7
# remediation = bash

rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7
# remediation = bash

rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
true

0 comments on commit e4ee6f1

Please sign in to comment.