Skip to content

Commit

Permalink
Merge pull request #2627 from yuumasato/tests_for_ctrlaltdel_burstact…
Browse files Browse the repository at this point in the history
…ion_and_audit_rules_time

Tests for ctrlaltdel burstaction and audit rules time
  • Loading branch information
mpreisler authored Feb 26, 2018
2 parents da9e3bd + a235c73 commit 344c878
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

if grep -q "^CtrlAltDelBurstAction=" /etc/systemd/system.conf; then
sed -i "s/^CtrlAltDelBurstAction.*/CtrlAltDelBurstAction=none/" /etc/systemd/system.conf
else
echo "CtrlAltDelBurstAction=none" >> /etc/systemd/system.conf
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

sed -i "/^CtrlAltDelBurstAction.*/d" /etc/systemd/system.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

if grep -q "^CtrlAltDelBurstAction=" /etc/systemd/system.conf; then
sed -i "s/^CtrlAltDelBurstAction.*/CtrlAltDelBurstAction=poweroff-immediate/" /etc/systemd/system.conf
else
echo "CtrlAltDelBurstAction=poweroff-immediate" >> /etc/systemd/system.conf
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

if grep -qv "^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+adjtimex[\s]+|([\s]+|[,])adjtimex([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$" /etc/audit/rules.d/*.rules; then
echo "-a always,exit -F arch=b32 -S adjtimex -k audit_time_rules" >> /etc/audit/rules.d/time.rules
echo "-a always,exit -F arch=b64 -S adjtimex -k audit_time_rules" >> /etc/audit/rules.d/time.rules
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

sed -i "/^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+adjtimex[\s]+|([\s]+|[,])adjtimex([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$/d" /etc/audit/rules.d/*.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

if grep -qv "^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+settimeofday[\s]+|([\s]+|[,])settimeofday([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$" /etc/audit/rules.d/*.rules; then
echo "-a always,exit -F arch=b32 -S settimeofday -k audit_time_rules" >> /etc/audit/rules.d/time.rules
echo "-a always,exit -F arch=b64 -S settimeofday -k audit_time_rules" >> /etc/audit/rules.d/time.rules
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

sed -i "/^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+settimeofday[\s]+|([\s]+|[,])settimeofday([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$/d" /etc/audit/rules.d/*.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

if grep -qv "^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+stime[\s]+|([\s]+|[,])stime([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$" /etc/audit/rules.d/*.rules; then
echo "-a always,exit -F arch=b32 -S stime -k audit_time_rules" >> /etc/audit/rules.d/time.rules
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# profiles = xccdf_org.ssgproject.content_profile_ospp-rhel7

sed -i "/^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+stime[\s]+|([\s]+|[,])stime([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$/d" /etc/audit/rules.d/*.rules

0 comments on commit 344c878

Please sign in to comment.