Origin/feature/audit log read #22213
Open
+13
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scope & Purpose
Add audit logging for all read operations on the
_userssystem collection. Implementing FRB-419.1. Core Audit Event Implementation
Files Modified:
arangod/Utils/Events.hReadUser()function declarationarangod/Utils/Events.cpp(Community Edition)ReadUser()enterprise/Enterprise/Audit/EventsEE.cpp(Enterprise Edition)ReadUser()audit eventDOCUMENTtopic atINFOlevelread user '<username>' | ok/failedarangod/RestHandler/RestUsersHandler.cpp#include "Utils/Events.h"events::ReadUser()calls to all GET endpoints:GET /_api/user→ logs asread user '*'GET /_api/user/<user>→ logs asread user '<user>'GET /_api/user/<user>/database→ logs user readGET /_api/user/<user>/database/<dbname>→ logs user readGET /_api/user/<user>/database/<dbname>/<collection>→ logs user readGET /_api/user/<user>/config→ logs user read2. Test Implementation
Files Modified:
enterprise/tests/js/common/audit/audit.jstoSkipregex to allow "read user" events while filtering other_usersoperationstestReadUser- Read specific usertestReadUserFailed- Read non-existent usertestReadAllUsers- List all userstestReadUserDatabasePermissions- Read user DB permissionstestReadUserSpecificDatabasePermission- Read specific DB permissiontestReadUserCollectionPermission- Read collection permissiontestReadUserConfig- Read user configenterprise/tests/js/client/audit/audit.jstestReadUsertestReadAllUsersenterprise/tests/js/server/audit/audit.js3. Documentation Updates
Files Modified:
docs-hugo/site/content/arangodb/4.0/operations/security/audit-logging.mdAdded New Section: "User Management"
Checklist
Related Information
(Please reference tickets / specification / other PRs etc)
Note
Implements audit logging for reads from the users API.
events::ReadUser(username, result, context)inUtils/Events.h/.cppevents::ReadUserinRestUsersHandler::getRequestfor: listing all users, fetching a user, and reading database/collection permissions andconfigdataCHANGELOGwith FRB-419 entryWritten by Cursor Bugbot for commit 9a1f28f. This will update automatically on new commits. Configure here.