Blame SOURCES/scap-security-guide-0.1.51-cis_hipaa_ansible_fixes_PR_5777.patch

475544
From 31b216f0dbe9e7531f273fbbd618ff8905358497 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 21 May 2020 13:30:24 +0200
475544
Subject: [PATCH 1/3] simplify ansible remediation of no_direct_root_logins
475544
475544
---
475544
 .../root_logins/no_direct_root_logins/ansible/shared.yml    | 6 +-----
475544
 1 file changed, 1 insertion(+), 5 deletions(-)
475544
475544
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/ansible/shared.yml
475544
index e9a29a24d5..6fbb7c72a5 100644
475544
--- a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/ansible/shared.yml
475544
+++ b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/ansible/shared.yml
475544
@@ -3,13 +3,9 @@
475544
 # strategy = restrict
475544
 # complexity = low
475544
 # disruption = low
475544
-- name: Test for existence of /etc/securetty
475544
-  stat:
475544
-    path: /etc/securetty
475544
-  register: securetty_empty
475544
+
475544
 
475544
 - name: "Direct root Logins Not Allowed"
475544
   copy:
475544
     dest: /etc/securetty
475544
     content: ""
475544
-  when: securetty_empty.stat.size > 1
475544
475544
From d12bcac36bac2a84ddf6162946b631c99fa86071 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 21 May 2020 14:21:38 +0200
475544
Subject: [PATCH 2/3] change name of libsemanage python bindings for rhel8
475544
475544
---
475544
 shared/templates/template_ANSIBLE_sebool | 8 +++++++-
475544
 1 file changed, 7 insertions(+), 1 deletion(-)
475544
475544
diff --git a/shared/templates/template_ANSIBLE_sebool b/shared/templates/template_ANSIBLE_sebool
475544
index 29f37081be..38d7c7c350 100644
475544
--- a/shared/templates/template_ANSIBLE_sebool
475544
+++ b/shared/templates/template_ANSIBLE_sebool
475544
@@ -13,11 +13,17 @@
475544
 {{% else %}}
475544
 - (xccdf-var var_{{{ SEBOOLID }}})
475544
 
475544
+{{% if product == "rhel8" %}}
475544
+- name: Ensure python3-libsemanage installed
475544
+  package:
475544
+    name: python3-libsemanage
475544
+    state: present
475544
+{{% else %}}
475544
 - name: Ensure libsemanage-python installed
475544
   package:
475544
     name: libsemanage-python
475544
     state: present
475544
-
475544
+{{% endif %}}
475544
 - name: Set SELinux boolean {{{ SEBOOLID }}} accordingly
475544
   seboolean:
475544
     name: {{{ SEBOOLID }}}
475544
475544
From ccf902082fc4f5abd8fae702e4322c6089773012 Mon Sep 17 00:00:00 2001
475544
From: Vojtech Polasek <vpolasek@redhat.com>
475544
Date: Thu, 21 May 2020 14:57:05 +0200
475544
Subject: [PATCH 3/3] add tests for no_direct_root_logins
475544
475544
---
475544
 .../root_logins/no_direct_root_logins/tests/correct.pass.sh    | 3 +++
475544
 .../root_logins/no_direct_root_logins/tests/missing.fail.sh    | 3 +++
475544
 .../root_logins/no_direct_root_logins/tests/wrong.fail.sh      | 3 +++
475544
 3 files changed, 9 insertions(+)
475544
 create mode 100644 linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/correct.pass.sh
475544
 create mode 100644 linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/missing.fail.sh
475544
 create mode 100644 linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/wrong.fail.sh
475544
475544
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/correct.pass.sh b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/correct.pass.sh
475544
new file mode 100644
475544
index 0000000000..17251f6a98
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/correct.pass.sh
475544
@@ -0,0 +1,3 @@
475544
+#!/bin/bash
475544
+
475544
+echo > /etc/securetty
475544
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/missing.fail.sh b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/missing.fail.sh
475544
new file mode 100644
475544
index 0000000000..c764814b26
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/missing.fail.sh
475544
@@ -0,0 +1,3 @@
475544
+#!/bin/bash
475544
+
475544
+rm -f /etc/securetty
475544
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/wrong.fail.sh b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/wrong.fail.sh
475544
new file mode 100644
475544
index 0000000000..43ac341e87
475544
--- /dev/null
475544
+++ b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/no_direct_root_logins/tests/wrong.fail.sh
475544
@@ -0,0 +1,3 @@
475544
+#!/bin/bash
475544
+
475544
+echo "something" > /etc/securetty