-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDP-136708: AtlasCLI: Support Get/Update Audit configs for projects #3036
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./bin/atlas auditing update --help
To use this command, you must authenticate with a user account or an API key with the Project Owner role.
Usage:
atlas auditing update [flags]
Examples:
# Audit all authentication events for known users:
atlas auditing update --auditFilter "{"atype": "authenticate"}"
# Audit all authentication events for known user via a configuration file:
atlas auditing update -f filter.json
Flags:
--auditAuthorizationSuccess Flag that indicates whether someone set auditing to track successful authentications. This only applies to the "atype" : "authCheck" audit filter. Setting this parameter to true degrades cluster performance.
--auditFilter string JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (\).
--enabled Flag that indicates whether someone enabled database auditing for the specified project.
-f, --file string Path to an optional JSON configuration file that defines auditing filters. To learn more about auditing configuration files for the Atlas CLI, see https://www.mongodb.com/docs/atlas/database-auditing/#example-auditing-filters
-h, --help help for update
-o, --output string Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option.
--projectId string Hexadecimal string that identifies the project to use. This option overrides the settings in the configuration file or environment variable.
Global Flags:
-P, --profile string Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. ./bin/atlas auditing update --auditFilter "{"atype": "authenticate"}" --enabled -o json
{
"auditAuthorizationSuccess": false,
"auditFilter": "{atype: authenticate}",
"configurationType": "FILTER_JSON",
"enabled": true
} ./bin/atlas auditing update -f test.json --enabled --auditAuthorizationSuccess
Auditing configuration successfully updated. cat test.json
{
"atype": "authCheck",
"param.command": {
"$in": [
"insert",
"update",
"delete"
]
}
}
./bin/atlas auditing update -f test.json --enabled --auditAuthorizationSuccess -o json
{
"auditAuthorizationSuccess": true,
"auditFilter": "{\n \"atype\": \"authCheck\",\n \"param.command\": {\n \"$in\": [\n \"insert\",\n \"update\",\n \"delete\"\n ]\n }\n}",
"configurationType": "FILTER_JSON",
"enabled": true
} |
github-actions
bot
added
the
need-doc-review
Improvements or additions to documentation, will be reviewed by the docs team
label
Jun 18, 2024
APIx Bot : a message has been sent to Docs Slack channel 🚀. |
erabil-mdb
previously approved these changes
Jun 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
tibulca
reviewed
Jun 19, 2024
tibulca
reviewed
Jun 19, 2024
tibulca
approved these changes
Jun 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
need-doc-review
Improvements or additions to documentation, will be reviewed by the docs team
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.
Proposed changes
Jira ticket: CLOUDP-136708