This is an automated email from the ASF dual-hosted git repository.

lmccay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new 139f01751 KNOX-3104 - Add groups to the RemoteAuthProvider audit entry 
(#1000)
139f01751 is described below

commit 139f017512000cdac8285126bd0bfdcbf9bf43d5
Author: lmccay <[email protected]>
AuthorDate: Sun Mar 2 10:59:06 2025 -0500

    KNOX-3104 - Add groups to the RemoteAuthProvider audit entry (#1000)
---
 .../main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java
 
b/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java
index c669c9a94..8932b3873 100755
--- 
a/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java
+++ 
b/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java
@@ -178,7 +178,11 @@ public class RemoteAuthFilter implements Filter {
           context.setUsername( principalName );
           auditService.attachContext(context);
           String sourceUri = (String)request.getAttribute( 
AbstractGatewayFilter.SOURCE_REQUEST_CONTEXT_URL_ATTRIBUTE_NAME );
-          auditor.audit( Action.AUTHENTICATION , sourceUri, ResourceType.URI, 
ActionOutcome.SUCCESS );
+          auditor.audit(Action.AUTHENTICATION, sourceUri, ResourceType.URI,
+                  ActionOutcome.SUCCESS, "Groups: " + 
Arrays.toString(subject.getPrincipals(GroupPrincipal.class)
+                          .stream()
+                          .map(GroupPrincipal::getName)
+                          .toArray(String[]::new)));
         }
 
         continueWithEstablishedSecurityContext(subject, httpRequest, 
httpResponse, filterChain);

Reply via email to