From 276d4b923a989d98680d364a56fbc901a1c21778 Mon Sep 17 00:00:00 2001 From: Jan Lieskovsky Date: Thu, 11 Jun 2015 12:18:22 +0200 Subject: [PATCH 1/2] [BugFix] [RHEL/7] [Fedora] Update XCCDF prose for "display_login_attempts" rule for RHEL-7 and Fedora products to provide correct recommendation wrt to pam_lastlog settings on these products Fixes issue reported in: https://lists.fedorahosted.org/pipermail/scap-security-guide/2015-June/006449.html --- Fedora/input/system/accounts/pam.xml | 9 ++++++--- RHEL/7/input/system/accounts/pam.xml | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Fedora/input/system/accounts/pam.xml b/Fedora/input/system/accounts/pam.xml index 3ca7a372b81..b78c91d9c22 100644 --- a/Fedora/input/system/accounts/pam.xml +++ b/Fedora/input/system/accounts/pam.xml @@ -58,13 +58,16 @@ frequently. Set Last Logon/Access Notification To configure the system to notify users of last logon/access -using pam_lastlog, add the following line immediately after session required pam_limits.so: -
session       required     pam_lastlog.so showfailed
+using pam_lastlog, add or correct the pam_lastlog settings in +/etc/pam.d/postlogin to read as follows: +
session     [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet
+session     [default=1]   pam_lastlog.so nowtmp showfailed
+session     optional      pam_lastlog.so silent noupdate showfailed
To ensure that last logon/access notification is configured correctly, run the following command: -
$ grep pam_lastlog.so /etc/pam.d/system-auth
+
$ grep pam_lastlog.so /etc/pam.d/postlogin
The output should show output showfailed.
diff --git a/RHEL/7/input/system/accounts/pam.xml b/RHEL/7/input/system/accounts/pam.xml index 9e54a00af4e..ab660afa8b3 100644 --- a/RHEL/7/input/system/accounts/pam.xml +++ b/RHEL/7/input/system/accounts/pam.xml @@ -59,13 +59,16 @@ frequently. Set Last Logon/Access Notification To configure the system to notify users of last logon/access -using pam_lastlog, add the following line immediately after session required pam_limits.so: -
session       required     pam_lastlog.so showfailed
+using pam_lastlog, add or correct the pam_lastlog settings in +/etc/pam.d/postlogin to read as follows: +
session     [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet
+session     [default=1]   pam_lastlog.so nowtmp showfailed
+session     optional      pam_lastlog.so silent noupdate showfailed
To ensure that last logon/access notification is configured correctly, run the following command: -
$ grep pam_lastlog.so /etc/pam.d/system-auth
+
$ grep pam_lastlog.so /etc/pam.d/postlogin
The output should show output showfailed.
From 28c5758bb5e7a89f669fbf46260d0f80c77c0950 Mon Sep 17 00:00:00 2001 From: Jan Lieskovsky Date: Thu, 11 Jun 2015 14:26:28 +0200 Subject: [PATCH 2/2] [Enhancement] [RHEL/7] [Fedora] Add /shared version of 'display_login_attempts' OVAL check for RHEL-7 and Fedora products Testing report: --------------- Verified manually on both products the proposed OVAL works fine (=> added test attestations for RHEL-7 && Fedora 20) --- Fedora/input/profiles/common.xml | 1 + Fedora/input/system/accounts/pam.xml | 2 +- RHEL/7/input/profiles/pci-dss.xml | 2 +- shared/oval/display_login_attempts.xml | 31 ++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 shared/oval/display_login_attempts.xml diff --git a/Fedora/input/profiles/common.xml b/Fedora/input/profiles/common.xml index 61c7575ea44..c7f5bf3319f 100644 --- a/Fedora/input/profiles/common.xml +++ b/Fedora/input/profiles/common.xml @@ -28,6 +28,7 @@ diff --git a/Fedora/input/system/accounts/pam.xml b/Fedora/input/system/accounts/pam.xml index b78c91d9c22..00f0a6a0b1f 100644 --- a/Fedora/input/system/accounts/pam.xml +++ b/Fedora/input/system/accounts/pam.xml @@ -77,7 +77,7 @@ of unsuccessful attempts that were made to login to their account allows the user to determine if any unauthorized activity has occurred and gives them an opportunity to notify administrators. - +
diff --git a/RHEL/7/input/profiles/pci-dss.xml b/RHEL/7/input/profiles/pci-dss.xml index bc1d986eec7..d896ff899f7 100644 --- a/RHEL/7/input/profiles/pci-dss.xml +++ b/RHEL/7/input/profiles/pci-dss.xml @@ -73,7 +73,7 @@ - + diff --git a/shared/oval/display_login_attempts.xml b/shared/oval/display_login_attempts.xml new file mode 100644 index 00000000000..fe64a49218b --- /dev/null +++ b/shared/oval/display_login_attempts.xml @@ -0,0 +1,31 @@ + + + + Set Last Login/Access Notification + + Red Hat Enterprise Linux 7 + multi_platform_fedora + + Configure the system to notify users of last login/access using pam_lastlog. + + + + + + + + + + + + + + + + /etc/pam.d/postlogin + [\n][\s]*session[\s]+\[default=1\][\s]+pam_lastlog.so[\s\w\d\=]+showfailed[\s\w\d\=]*\n[\s]*session[\s]+optional[\s]+pam_lastlog.so[\s\w\d\=]+showfailed[\s\w\d\=]*[\n] + 1 + + +