Skip to content

Commit

Permalink
Audit Logging for NamedRoutes
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Mierzwa <[email protected]>
  • Loading branch information
DarshitChanpura authored Jun 27, 2023
2 parents 2edd319 + 3c397e2 commit e7d10c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public void logMissingPrivileges(String privilege, String effectiveUser, RestReq
msg.addRemoteAddress(remoteAddress);
msg.addRestRequestInfo(request, auditConfigFilter);
msg.addEffectiveUser(effectiveUser);
msg.addPrivilege(privilege);
save(msg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ private boolean authorizeRequest(RestHandler original, RestRequest request, Rest
}
if (pres.isAllowed()) {
log.debug("Request has been granted");
// auditLog.logGrantedPrivileges(action, request, task);
auditLog.logGrantedPrivileges(user.getName(), request);
} else {
// auditLog.logMissingPrivileges(action, request, task);
auditLog.logMissingPrivileges(route.name(), user.getName(), request);
String err;
if (!pres.getMissingSecurityRoles().isEmpty()) {
err = String.format("No mapping for %s on roles %s", user, pres.getMissingSecurityRoles());
Expand Down

0 comments on commit e7d10c7

Please sign in to comment.