gpt4 book ai didi

azure - 通过 ARM 模板在 Azure SQL 数据库上启用审核设置

转载 作者:行者123 更新时间:2023-12-02 23:45:07 26 4
gpt4 key购买 nike

我一直在开发一个部署 SQL/XSS 注入(inject)检测的模板。除了启用审核设置之外,一切都很好。 In the docs I see the following:

{
"name": "default",
"type": "Microsoft.Sql/servers/databases/auditingSettings",
"apiVersion": "2017-03-01-preview",
"properties": {
"state": "string",
"storageEndpoint": "string",
"storageAccountAccessKey": "string",
"retentionDays": "integer",
"auditActionsAndGroups": [
"string"
],
"storageAccountSubscriptionId": "string",
"isStorageSecondaryKeyInUse": boolean
}
}

我相信我已经遵循了这个结构。看我的full code here或此处的片段:

  - apiVersion: 2017-03-01-preview
type: Microsoft.Sql/servers/auditingSettings
name: "[concat(parameters('sqlServerName'), '/auditing-default')]"
dependsOn:
- "[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
properties:
state: Enabled
storageEndpoint: "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')),
'2018-03-01-preview').PrimaryEndpoints.Blob]"
storageAccountAccessKey: "[listKeys(resourceId('Microsoft.Storage/storageAccounts',
parameters('storageAccountName')), '2018-03-01-preview').keys[0].value]"
retentionDays: 0
storageAccountSubscriptionId: "[subscription().subscriptionId]"
isStorageSecondaryKeyInUse: false'

我发现服务器/数据库与类型的/servers 之间存在差异,但实际上我从 Azure 快速入门和 specific file here 借用了此代码。其中代码如下:

{
"apiVersion": "2017-03-01-preview",
"type": "Microsoft.Sql/servers/auditingSettings",
"name": "[concat(parameters('sqlServerName'), '/', 'default')]",
"properties": {
"state": "Enabled",
"storageEndpoint": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2018-03-01-preview').PrimaryEndpoints.Blob]",
"storageAccountAccessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2018-03-01-preview').keys[0].value]",
"retentionDays": 0,
"auditActionsAndGroups": null,
"storageAccountSubscriptionId": "[subscription().subscriptionId]",
"isStorageSecondaryKeyInUse": false
}
}

官方文档似乎没有有关在服务器级别添加auditingSettings的信息,但是这里的类型直接在服务器下,所以我有点迷失。我还没有研究过这个模式,但是任何关于这里可能发生的事情的帮助/指导将不胜感激!

最佳答案

我们最近发布了一个模板,演示如何部署启用服务器审核的 Azure SQL Server。

完整的示例在这里:https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.sql/sql-auditing-server-policy-to-blob-storage

关于azure - 通过 ARM 模板在 Azure SQL 数据库上启用审核设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52639290/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com