Blame SOURCES/scap-security-guide-0.1.53-update_rule_disable_ctrlaltdel_reboot-PR_6043.patch

fe0dde
From 3f1fdf77f923bb9f25a1c154873dbca7db8d8573 Mon Sep 17 00:00:00 2001
fe0dde
From: Vojtech Polasek <vpolasek@redhat.com>
fe0dde
Date: Thu, 3 Sep 2020 18:07:37 +0200
fe0dde
Subject: [PATCH 1/2] update ocil
fe0dde
fe0dde
---
fe0dde
 .../disable_ctrlaltdel_reboot/rule.yml        | 19 ++++++++++++-------
fe0dde
 1 file changed, 12 insertions(+), 7 deletions(-)
fe0dde
fe0dde
diff --git a/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/rule.yml b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/rule.yml
fe0dde
index 12aa2bc108..09a9af5176 100644
fe0dde
--- a/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/rule.yml
fe0dde
+++ b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/rule.yml
fe0dde
@@ -72,15 +72,20 @@ ocil_clause: 'the system is configured to reboot when Ctrl-Alt-Del is pressed'
fe0dde
 ocil: |-
fe0dde
 {{% if product == "rhel6" %}}
fe0dde
     To ensure the system is configured to log a message instead of rebooting the
fe0dde
-    system when Ctrl-Alt-Del is pressed, ensure the following line is in
fe0dde
-    <tt>/etc/init/control-alt-delete.conf</tt>:
fe0dde
+    system when Ctrl-Alt-Del is pressed, run the following command:
fe0dde
+    
sudo grep logger /etc/init/control-alt-delete.conf
fe0dde
+    The output should contain a line resembling the following one:
fe0dde
     
exec /usr/bin/logger -p security.info "Control-Alt-Delete pressed"
fe0dde
 {{% else %}}
fe0dde
-    To ensure the system is configured to mask the Ctrl-Alt-Del sequence,
fe0dde
-    enter the following command:
fe0dde
-    
$ sudo ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target
fe0dde
-    or
fe0dde
-    
$ sudo systemctl mask ctrl-alt-del.target
fe0dde
+    To ensure the system is configured to mask the Ctrl-Alt-Del sequence, Check
fe0dde
+    that the ctrl-alt-del.target is masked and not active with the following
fe0dde
+    command:
fe0dde
+    
sudo systemctl status ctrl-alt-del.target
fe0dde
+    The output should indicate that the target is masked and not active. It
fe0dde
+    might resemble following output:
fe0dde
+    
ctrl-alt-del.target
fe0dde
+    Loaded: masked (/dev/null; bad)
fe0dde
+    Active: inactive (dead)
fe0dde
 {{% endif %}}
fe0dde
 
fe0dde
 warnings:
fe0dde
fe0dde
From b8fe86828425bdd423fabb2e6950b2d7f7f636a5 Mon Sep 17 00:00:00 2001
fe0dde
From: Vojtech Polasek <vpolasek@redhat.com>
fe0dde
Date: Thu, 3 Sep 2020 18:07:54 +0200
fe0dde
Subject: [PATCH 2/2] add tests
fe0dde
fe0dde
---
fe0dde
 .../disable_ctrlaltdel_reboot/tests/masked.pass.sh            | 4 ++++
fe0dde
 .../disable_ctrlaltdel_reboot/tests/not_masked.fail.sh        | 4 ++++
fe0dde
 2 files changed, 8 insertions(+)
fe0dde
 create mode 100644 linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/masked.pass.sh
fe0dde
 create mode 100644 linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/not_masked.fail.sh
fe0dde
fe0dde
diff --git a/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/masked.pass.sh b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/masked.pass.sh
fe0dde
new file mode 100644
fe0dde
index 0000000000..79a1398a4e
fe0dde
--- /dev/null
fe0dde
+++ b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/masked.pass.sh
fe0dde
@@ -0,0 +1,4 @@
fe0dde
+#!/bin/bash
fe0dde
+# platform = Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_fedora
fe0dde
+
fe0dde
+systemctl mask ctrl-alt-del.target
fe0dde
diff --git a/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/not_masked.fail.sh b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/not_masked.fail.sh
fe0dde
new file mode 100644
fe0dde
index 0000000000..74342f0251
fe0dde
--- /dev/null
fe0dde
+++ b/linux_os/guide/system/accounts/accounts-physical/disable_ctrlaltdel_reboot/tests/not_masked.fail.sh
fe0dde
@@ -0,0 +1,4 @@
fe0dde
+#!/bin/bash
fe0dde
+# platform = Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_fedora
fe0dde
+
fe0dde
+systemctl unmask ctrl-alt-del.target