Skip to content

Comments

PSMDB-1922 Require authorization for auditGetOptions command#1667

Merged
igorsol merged 1 commit intov8.0from
psmdb-1922
Jan 29, 2026
Merged

PSMDB-1922 Require authorization for auditGetOptions command#1667
igorsol merged 1 commit intov8.0from
psmdb-1922

Conversation

@igorsol
Copy link

@igorsol igorsol commented Jan 27, 2026

With these changes auditGetOptions command will require admin db and getParameter action privilege.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds authorization requirements to the auditGetOptions command for enhanced security. Previously, the command had no authorization checks and simply returned OK for any user.

Changes:

  • Added adminOnly() method to restrict command execution to the admin database
  • Implemented proper authorization check requiring getParameter action privilege on cluster resource
  • Added parameter names to checkAuthForOperation method signature for clarity

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@plebioda plebioda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. However, I would suggest to add a some test for this change.

Copy link

@ktrushin ktrushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. It would be nice to have a test, though.

@igorsol
Copy link
Author

igorsol commented Jan 29, 2026

jstests/audit/audit_getoptions_command.js‎ added for testing

@igorsol igorsol merged commit c3fd291 into v8.0 Jan 29, 2026
3 of 4 checks passed
@igorsol igorsol deleted the psmdb-1922 branch January 29, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants