-
Type: Investigation
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
Original Downstream Change Summary
We have introduced a new action and built-in role called "querySettings".
Description of Linked Ticket
We need to ensure that only users with the allowed permissions are able to invoke the query settings commands and agg stage.
One way of doing it is through modification of the idl definition.
What we need to is:
- introduce a new action_type query_settings in action_type.idl file
- modify the query settings commands idl file to include the permission check as described in the code snippet
# in query_settings_cmds.idl - "mongo/db/auth/access_checks.idl" - "mongo/db/auth/action_type.idl" ... access_check: simple: privilege: resource_pattern: cluster action_type: query_settings
- perform the authorisation check as described in the following code snippet
auto authzSession = AuthorizationSession::get(Client::getCurrent()); authzSession->verifyContract(&SetQuerySettingsCommandRequest::kAuthorizationContract);
- for agg stage the privilege has to be defined in aggregate_command.idl as follows
... - privilege: # $querySettings resource_pattern: cluster action_type: query_settings
- adjust the privilege vector definition for the $querySettings agg stage
- extend the existing permission tests to ensure that authorization is performed accordingly in commands_lib.js
- depends on
-
SERVER-77551 Ensure only users with allowed permissions may invoke query settings commands
- Closed