|
|
fe0dde |
From 464a9095156228c2d965344ef35b7ff3873f06b5 Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Gabriel Becker <ggasparb@redhat.com>
|
|
|
fe0dde |
Date: Tue, 8 Sep 2020 14:17:50 +0200
|
|
|
fe0dde |
Subject: [PATCH] Fix bash remediation for rule accounts_no_uid_except_zero.
|
|
|
fe0dde |
|
|
|
fe0dde |
When multiple offending accounts were found in the system, xargs
|
|
|
fe0dde |
couldn't process properly each account found.
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../root_logins/accounts_no_uid_except_zero/bash/rhel6.sh | 2 --
|
|
|
fe0dde |
.../root_logins/accounts_no_uid_except_zero/bash/shared.sh | 4 ++--
|
|
|
fe0dde |
2 files changed, 2 insertions(+), 4 deletions(-)
|
|
|
fe0dde |
delete mode 100644 linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/rhel6.sh
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/rhel6.sh b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/rhel6.sh
|
|
|
fe0dde |
deleted file mode 100644
|
|
|
fe0dde |
index 18d83405b1..0000000000
|
|
|
fe0dde |
--- a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/rhel6.sh
|
|
|
fe0dde |
+++ /dev/null
|
|
|
fe0dde |
@@ -1,2 +0,0 @@
|
|
|
fe0dde |
-# platform = Red Hat Enterprise Linux 6
|
|
|
fe0dde |
-awk -F: '$3 == 0 && $1 != "root" { print $1 }' /etc/passwd | xargs passwd -l
|
|
|
fe0dde |
diff --git a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/shared.sh b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/shared.sh
|
|
|
fe0dde |
index 016bb43b34..496e9e10df 100644
|
|
|
fe0dde |
--- a/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/shared.sh
|
|
|
fe0dde |
+++ b/linux_os/guide/system/accounts/accounts-restrictions/root_logins/accounts_no_uid_except_zero/bash/shared.sh
|
|
|
fe0dde |
@@ -1,2 +1,2 @@
|
|
|
fe0dde |
-# platform = multi_platform_wrlinux,Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_ol,multi_platform_rhv
|
|
|
fe0dde |
-awk -F: '$3 == 0 && $1 != "root" { print $1 }' /etc/passwd | xargs passwd -l
|
|
|
fe0dde |
+# platform = multi_platform_wrlinux,Red Hat Enterprise Linux 6,Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_ol,multi_platform_rhv
|
|
|
fe0dde |
+awk -F: '$3 == 0 && $1 != "root" { print $1 }' /etc/passwd | xargs --max-lines=1 passwd -l
|