Skip to content

Commit

Permalink
Generate audit trail for when middleware session changes cred (#15357)
Browse files Browse the repository at this point in the history
We were not generating an audit log entry when an authenticated
middleware session calls auth.login* endpoints to change its
effective credential.
  • Loading branch information
anodos325 authored Jan 15, 2025
1 parent aa3b74a commit 2e22eab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/middlewared/middlewared/plugins/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ async def login(self, app, credentials):
if app.authenticated:
self.sessions[app.session_id].credentials = credentials
app.authenticated_credentials = credentials
await self.middleware.log_audit_message(app, "AUTHENTICATION", {
"credentials": dump_credentials(credentials),
"error": None,
}, True)
return

session = Session(self, credentials, app)
Expand Down

0 comments on commit 2e22eab

Please sign in to comment.