-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
SQL Auditing fixes #5052
SQL Auditing fixes #5052
Conversation
- Blob auditing storage account key must be set from secondary storage account key when StorageKeyType 'Secondary' is provided. - Fixes for issue: #5046
@@ -485,7 +485,7 @@ private BlobAuditingCreateOrUpdateParameters PolicizeBlobAuditingModel(BaseBlobA | |||
|
|||
private static IList<string> ExtractAuditActionsAndGroups(BaseBlobAuditingPolicyModel model) | |||
{ | |||
var dbPolicyModel = model as DatabaseBlobAuditingPolicyModel; | |||
var dbPolicyModel = model as DatabaseBlobAuditingSettingsModel; | |||
var actionsAndGroups = new List<string>(); | |||
if (dbPolicyModel != null) |
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.
do we want to add a trace for
if (dbPolicyModel == null)
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.
It's expected for server level
@@ -470,7 +470,7 @@ private BlobAuditingCreateOrUpdateParameters PolicizeBlobAuditingModel(BaseBlobA | |||
if (!IgnoreStorage && (model.AuditState == AuditStateType.Enabled)) | |||
{ | |||
properties.StorageEndpoint = ExtractStorageAccountName(model, storageEndpointSuffix); | |||
properties.StorageAccountAccessKey = ExtractStorageAccountKey(model.StorageAccountName); | |||
properties.StorageAccountAccessKey = ExtractStorageAccountKey(model.StorageAccountName, model.StorageKeyType); |
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.
we need tests for this change
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.
Added a check for AuditAction value. Regarding the storage account access key, the value is not returned thus it cannot be checked.
Update TestBlobAuditingOnDatabase tests to check for AuditAction value
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.
@ranisha2 please update the Sql change log to reflect the changes being made in this PR
@cormacpayne updated the change log. |
@yaakoviyun Hey Yaakov, any additional comments? |
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines