-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Audit policy] Support Event Hub and Log Analytics in server and database audit policy commands #15444
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
Conversation
AssertionError: You need to call 'result' or 'wait' on all LROPoller you have created
Server tests still failed.
server tests pass now
|
Thank you for your contribution Oleza1972! We will review the pull request and get back to you soon. |
|
sql |
|
/azp run |
1 similar comment
|
/azp run |
|
Commenter does not have sufficient privileges for PR 15444 in repo Azure/azure-cli |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Juliehzl
left a comment
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.
please resolve all my comments and change the title format.
And edit the history notes part in description, e.g.
History Notes
[Compute] sig image-definition create: add --features
[Compute] New API version of gallery_images 2020-09-30
Juliehzl
left a comment
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 in general
Description
In this PR the following commands have been extended to support Event Hub and Log Analytics:
az sql server audit-policy show:
az sql db audit-policy show:
An extended JSON body is returned now.
See:
https://docs.microsoft.com/en-us/rest/api/sql/server%20auditing%20settings/get
https://docs.microsoft.com/en-us/rest/api/sql/database%20auditing%20settings/get
az sql server audit-policy update,
az sql db audit-policy update:
A new command line arguments have been added:
--blob-storage-target-state - enables\disables blob storage as auditing logs target
--log-analytics-target-state - enables\disables log analytics as auditing logs target
--log-analytics-workspace-resource-id - log analytics workspace resource id
--event-hub-target-state - enables\disables event hub as auditing logs target
--event-hub-authorization-rule-id - event hub authorization rule id
--event-hub - event hub name
Examples of commands:
sql db audit-policy update -g my_resource_group -s my_server -n my_database --state Enabled --blob-storage-target-state Enabled --storage-endpoint https://mystorageaccount.blob.core.windows.net/
sql db audit-policy update -g my_resource_group -s my_server -n my_database --state Enabled --blob-storage-target-state Disabled
sql server audit-policy update -g my_resource_group -n my_server --state Enabled --log-analytics-target-state Enabled --log-analytics-workspace-resource-id /subscriptions/1111-2222-3333-444-5555555/resourcegroups/my_resource_group/providers/microsoft.operationalinsights/workspaces/my_workspace
sql server audit-policy update -g my_resource_group -n my_server --state Enabled --log-analytics-target-state Disabled --event-hub-target-state Enabled --event-hub-authorization-rule-id /subscriptions/1111-2222-3333-4444/resourceGroups/my_resource_group/providers/Microsoft.EventHub/namespaces/my_eventhub_namespace/authorizationrules/my_eventhub_auth_rule_name --event-hub my_event_hub_name
Testing Guide
Unit tests test_sql_server_security_mgmt and test_sql_db_security_mgmt cover the test for the change.
History Notes
[SQL] az sql db audit-policy show: extend to show database's audit policy including LA and EH data
[SQL] az sql db audit-policy update: extend to allow LA and EH update along with database's audit policy
[SQL] az sql db audit-policy wait: place the CLI in a waiting state until a condition of the database's audit policy is met.
[SQL] az sql server audit-policy show: extend to show servers's audit policy including LA and EH data
[SQL] az sql server audit-policy update: extend to allow LA and EH update along with server's audit policy
[SQL] az sql server audit-policy wait: place the CLI in a waiting state until a condition of the server's audit policy is met.