Skip to content

Conversation

@OlegSternbergIBM
Copy link
Contributor

@OlegSternbergIBM OlegSternbergIBM commented Oct 8, 2020

Description

In this PR the following commands have been extended to support Event Hub and Log Analytics:

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.

@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 8, 2020
@ghost
Copy link

ghost commented Oct 8, 2020

Thank you for your contribution Oleza1972! We will review the pull request and get back to you soon.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 8, 2020

sql

@yonzhan yonzhan requested review from jsntcy and zhoxing-ms October 8, 2020 13:48
@yonzhan yonzhan added this to the S177 milestone Oct 8, 2020
@Juliehzl
Copy link
Contributor

/azp run

1 similar comment
@OlegSternbergIBM
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 15444 in repo Azure/azure-cli

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@Juliehzl Juliehzl left a 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

in #15549 (comment)

@OlegSternbergIBM OlegSternbergIBM changed the title [Audit policy] - Support Event Hub and Log Analytics in server and database audit policy commands [Audit policy] Support Event Hub and Log Analytics in server and database audit policy commands Oct 18, 2020
Copy link
Contributor

@Juliehzl Juliehzl left a comment

Choose a reason for hiding this comment

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

LGTM in general

@Juliehzl Juliehzl merged commit 4775c1e into Azure:dev Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants