diff --git a/SOURCES/0002-Issue-6112-RFE-add-new-operation-note-for-MFA-authen.patch b/SOURCES/0002-Issue-6112-RFE-add-new-operation-note-for-MFA-authen.patch new file mode 100644 index 0000000..ad60607 --- /dev/null +++ b/SOURCES/0002-Issue-6112-RFE-add-new-operation-note-for-MFA-authen.patch @@ -0,0 +1,237 @@ +From 3cd7d30628007f839436c417af6dd8a056c6a165 Mon Sep 17 00:00:00 2001 +From: Mark Reynolds +Date: Fri, 1 Mar 2024 11:28:17 -0500 +Subject: [PATCH 2/3] Issue 6112 - RFE - add new operation note for MFA + authentications + +Add a new operation note to indicate that a MFA plugin performed the +BIND. This implies that the plugin must set the note itself as there is +no other way to detect this: + + slapi_pblock_set_flag_operation_notes(pb, SLAPI_OP_NOTE_MFA_AUTH); + +The purpose for this is for auditing needs + +Fixes: https://github.com/389ds/389-ds-base/issues/6112 + +Reviewed by: spichugi(Thanks!) +--- + ldap/admin/src/logconv.pl | 37 ++++++++++++++++++------------- + ldap/servers/slapd/log.c | 6 ++++- + ldap/servers/slapd/result.c | 2 +- + ldap/servers/slapd/slapi-plugin.h | 1 + + 4 files changed, 28 insertions(+), 18 deletions(-) + +diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl +index 5ba91e99c..10bd5d2aa 100755 +--- a/ldap/admin/src/logconv.pl ++++ b/ldap/admin/src/logconv.pl +@@ -2,11 +2,11 @@ + # + # BEGIN COPYRIGHT BLOCK + # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. +-# Copyright (C) 2022 Red Hat, Inc. ++# Copyright (C) 2010-2024 Red Hat, Inc. + # All rights reserved. + # + # License: GPL (version 3 or any later version). +-# See LICENSE for details. ++# See LICENSE for details. + # END COPYRIGHT BLOCK + # + +@@ -218,6 +218,7 @@ my $sslClientFailedCount = 0; + my $objectclassTopCount= 0; + my $pagedSearchCount = 0; + my $invalidFilterCount = 0; ++my $mfaCount = 0; + my $bindCount = 0; + my $filterCount = 0; + my $baseCount = 0; +@@ -407,7 +408,7 @@ sub statusreport { + ########################################## + # # + # Parse Access Logs # +-# # ++# # + ########################################## + + if ($files[$#files] =~ m/access.rotationinfo/) { +@@ -709,7 +710,7 @@ if($endTime){ + + # + # Get the start time in seconds +-# ++# + my $logStart = $start; + my $startTotal = convertTimeToNanoseconds($logStart); + +@@ -890,6 +891,7 @@ $etimeAvg = $totalEtime / $etimeCount; + print sprintf "Average etime (elapsed time): %.9f\n", $etimeAvg; + + print "\n"; ++print "Multi-factor Authentications: $mfaCount\n"; + print "Proxied Auth Operations: $proxiedAuthCount\n"; + print "Persistent Searches: $persistentSrchCount\n"; + print "Internal Operations: $internalOpCount\n"; +@@ -1758,7 +1760,7 @@ if ($usage =~ /j/i || $verb eq "yes"){ + $recCount++; + } + if ($objectclassTopCount > ($srchCount *.25)){ +- print "\n $recCount. You have a high number of searches that query the entire search base. Although this is not necessarily bad, it could be resource intensive if the search base contains many entries.\n"; ++ print "\n $recCount. You have a high number of searches that query the entire search base. Although this is not necessarily bad, it could be resource intensive if the search base contains many entries.\n"; + $recCount++; + } + if ($recCount == 1){ +@@ -1792,7 +1794,7 @@ sub displayUsage { + + print " -h, --help help/usage\n"; + print " -d, --rootDN default is \"cn=directory manager\"\n"; +- print " -D, --data default is \"/tmp\"\n"; ++ print " -D, --data default is \"/tmp\"\n"; + print " -s, --sizeLimit default is 20\n"; + print " -X, --excludeIP E.g. Load balancers\n"; + print " -v, --version show version of tool\n"; +@@ -1800,8 +1802,8 @@ sub displayUsage { + print " E.g. \"[28/Mar/2002:13:14:22 -0800]\"\n"; + print " -E, --endTime