Bicep 資源定義
工作區/vulnerabilityAssessments 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Synapse/workspaces/vulnerabilityAssessments 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Synapse/workspaces/vulnerabilityAssessments@2021-05-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
recurringScans: {
emails: [
'string'
]
emailSubscriptionAdmins: bool
isEnabled: bool
}
storageAccountAccessKey: 'string'
storageContainerPath: 'string'
storageContainerSasKey: 'string'
}
}
屬性值
Microsoft.Synapse/workspaces/vulnerabilityAssessments
| 名字 | 描述 | 價值 |
|---|---|---|
| 名字 | 資源名稱 | 'default' (必要) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型的資源符號名稱:工作區 |
| 性能 | 資源屬性。 | ServerVulnerabilityAssessmentProperties |
ServerVulnerabilityAssessmentProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 週期性掃描 | 週期性掃描設定 | VulnerabilityAssessmentRecurringScansProperties |
| storageAccountAccessKey | 指定記憶體帳戶的識別碼金鑰,以取得弱點評估掃描結果。 如果未指定 『StorageContainerSasKey』,則需要 storageAccountAccessKey。 | 字串 |
| storageContainerPath | 用來保存掃描結果的 Blob 記憶體容器路徑(例如 https://myStorage.blob.core.windows.net/VaScans/)。 |
字串 (必要) |
| storageContainerSasKey | 共用存取簽章 (SAS 金鑰)具有 'storageContainerPath' 參數中所指定 Blob 容器的讀取和寫入許可權。 如果未指定 『storageAccountAccessKey』,則需要 StorageContainerSasKey。 | 字串 |
VulnerabilityAssessmentRecurringScansProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 電子郵件 | 指定掃描通知傳送至的電子郵件地址陣列。 | 字串[] |
| 電子郵件訂閱管理員 | 指定排程掃描通知將傳送給訂用帳戶管理員。 | 布爾 (bool) |
| 已啟用 | 週期性掃描狀態。 | 布爾 (bool) |
ARM 樣本資源定義
工作區/vulnerabilityAssessments 資源類型可以使用目標作業來部署:
使用範例
資源格式
若要建立 Microsoft.Synapse/workspaces/vulnerabilityAssessments 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Synapse/workspaces/vulnerabilityAssessments",
"apiVersion": "2021-05-01",
"name": "string",
"properties": {
"recurringScans": {
"emails": [ "string" ],
"emailSubscriptionAdmins": "bool",
"isEnabled": "bool"
},
"storageAccountAccessKey": "string",
"storageContainerPath": "string",
"storageContainerSasKey": "string"
}
}
屬性值
Microsoft.Synapse/workspaces/vulnerabilityAssessments
| 名字 | 描述 | 價值 |
|---|---|---|
| apiVersion | API 版本 | '2021-05-01' |
| 名字 | 資源名稱 | 'default' (必要) |
| 性能 | 資源屬性。 | ServerVulnerabilityAssessmentProperties |
| 型別 | 資源類型 | “Microsoft.Synapse/workspaces/vulnerabilityAssessments” |
ServerVulnerabilityAssessmentProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 週期性掃描 | 週期性掃描設定 | VulnerabilityAssessmentRecurringScansProperties |
| storageAccountAccessKey | 指定記憶體帳戶的識別碼金鑰,以取得弱點評估掃描結果。 如果未指定 『StorageContainerSasKey』,則需要 storageAccountAccessKey。 | 字串 |
| storageContainerPath | 用來保存掃描結果的 Blob 記憶體容器路徑(例如 https://myStorage.blob.core.windows.net/VaScans/)。 |
字串 (必要) |
| storageContainerSasKey | 共用存取簽章 (SAS 金鑰)具有 'storageContainerPath' 參數中所指定 Blob 容器的讀取和寫入許可權。 如果未指定 『storageAccountAccessKey』,則需要 StorageContainerSasKey。 | 字串 |
VulnerabilityAssessmentRecurringScansProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 電子郵件 | 指定掃描通知傳送至的電子郵件地址陣列。 | 字串[] |
| 電子郵件訂閱管理員 | 指定排程掃描通知將傳送給訂用帳戶管理員。 | 布爾 (bool) |
| 已啟用 | 週期性掃描狀態。 | 布爾 (bool) |
Terraform (AzAPI 提供者) 資源定義
工作區/vulnerabilityAssessments 資源類型可以使用目標作業來部署:
- 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
Terraform 範例
部署 Synapse 工作區弱點評定的基本範例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westus"
}
variable "sql_administrator_login_password" {
type = string
sensitive = true
description = "The SQL administrator login password for the Synapse workspace"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "storageAccount" {
type = "Microsoft.Storage/storageAccounts@2023-05-01"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}sa1"
location = var.location
body = {
kind = "StorageV2"
properties = {
accessTier = "Hot"
allowBlobPublicAccess = true
allowCrossTenantReplication = false
allowSharedKeyAccess = true
defaultToOAuthAuthentication = false
dnsEndpointType = "Standard"
encryption = {
keySource = "Microsoft.Storage"
services = {
queue = {
keyType = "Service"
}
table = {
keyType = "Service"
}
}
}
isHnsEnabled = true
isLocalUserEnabled = true
isNfsV3Enabled = false
isSftpEnabled = false
minimumTlsVersion = "TLS1_2"
networkAcls = {
bypass = "AzureServices"
defaultAction = "Allow"
ipRules = []
resourceAccessRules = []
virtualNetworkRules = []
}
publicNetworkAccess = "Enabled"
supportsHttpsTrafficOnly = true
}
sku = {
name = "Standard_LRS"
}
}
}
resource "azapi_resource" "storageAccount_1" {
type = "Microsoft.Storage/storageAccounts@2023-05-01"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}sa2"
location = var.location
body = {
kind = "StorageV2"
properties = {
accessTier = "Hot"
allowBlobPublicAccess = true
allowCrossTenantReplication = false
allowSharedKeyAccess = true
defaultToOAuthAuthentication = false
dnsEndpointType = "Standard"
encryption = {
keySource = "Microsoft.Storage"
services = {
queue = {
keyType = "Service"
}
table = {
keyType = "Service"
}
}
}
isHnsEnabled = true
isLocalUserEnabled = true
isNfsV3Enabled = false
isSftpEnabled = false
minimumTlsVersion = "TLS1_2"
networkAcls = {
bypass = "AzureServices"
defaultAction = "Allow"
ipRules = []
resourceAccessRules = []
virtualNetworkRules = []
}
publicNetworkAccess = "Enabled"
supportsHttpsTrafficOnly = true
}
sku = {
name = "Standard_LRS"
}
}
}
resource "azapi_resource" "filesystem" {
type = "Microsoft.Storage/storageAccounts/blobServices/containers@2023-05-01"
parent_id = "${azapi_resource.storageAccount.id}/blobServices/default"
name = "filesystem"
body = {
properties = {
publicAccess = "None"
}
}
}
resource "azapi_resource" "workspace" {
type = "Microsoft.Synapse/workspaces@2021-06-01"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}-workspace"
location = var.location
identity {
type = "SystemAssigned"
identity_ids = []
}
body = {
properties = {
azureADOnlyAuthentication = false
defaultDataLakeStorage = {
accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs
filesystem = azapi_resource.filesystem.name
}
managedResourceGroupName = ""
managedVirtualNetwork = ""
publicNetworkAccess = "Enabled"
sqlAdministratorLogin = "sqladminuser"
sqlAdministratorLoginPassword = var.sql_administrator_login_password
workspaceRepositoryConfiguration = {}
}
}
depends_on = [azapi_resource.filesystem]
}
resource "azapi_resource_action" "storageAccountKeys" {
type = "Microsoft.Storage/storageAccounts@2023-05-01"
resource_id = azapi_resource.storageAccount_1.id
action = "listKeys"
response_export_values = ["keys"]
}
resource "azapi_resource" "securityAlertPolicy" {
type = "Microsoft.Synapse/workspaces/securityAlertPolicies@2021-06-01"
parent_id = azapi_resource.workspace.id
name = "Default"
body = {
properties = {
state = "Enabled"
storageAccountAccessKey = azapi_resource_action.storageAccountKeys.output.keys[0].value
storageEndpoint = azapi_resource.storageAccount_1.output.properties.primaryEndpoints.blob
}
}
}
resource "azapi_resource" "vulnerabilityAssessment" {
type = "Microsoft.Synapse/workspaces/vulnerabilityAssessments@2021-06-01"
parent_id = azapi_resource.workspace.id
name = "default"
body = {
properties = {
storageAccountAccessKey = azapi_resource_action.storageAccountKeys.output.keys[0].value
storageContainerPath = "${azapi_resource.storageAccount_1.output.properties.primaryEndpoints.blob}vulnerability-assessment"
}
}
depends_on = [azapi_resource.securityAlertPolicy]
}
資源格式
若要建立 Microsoft.Synapse/workspaces/vulnerabilityAssessments 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Synapse/workspaces/vulnerabilityAssessments@2021-05-01"
name = "string"
parent_id = "string"
body = {
properties = {
recurringScans = {
emails = [
"string"
]
emailSubscriptionAdmins = bool
isEnabled = bool
}
storageAccountAccessKey = "string"
storageContainerPath = "string"
storageContainerSasKey = "string"
}
}
}
屬性值
Microsoft.Synapse/workspaces/vulnerabilityAssessments
| 名字 | 描述 | 價值 |
|---|---|---|
| 名字 | 資源名稱 | 'default' (必要) |
| 父項識別碼 | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:工作區 |
| 性能 | 資源屬性。 | ServerVulnerabilityAssessmentProperties |
| 型別 | 資源類型 | “Microsoft.Synapse/workspaces/vulnerabilityAssessments@2021-05-01” |
ServerVulnerabilityAssessmentProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 週期性掃描 | 週期性掃描設定 | VulnerabilityAssessmentRecurringScansProperties |
| storageAccountAccessKey | 指定記憶體帳戶的識別碼金鑰,以取得弱點評估掃描結果。 如果未指定 『StorageContainerSasKey』,則需要 storageAccountAccessKey。 | 字串 |
| storageContainerPath | 用來保存掃描結果的 Blob 記憶體容器路徑(例如 https://myStorage.blob.core.windows.net/VaScans/)。 |
字串 (必要) |
| storageContainerSasKey | 共用存取簽章 (SAS 金鑰)具有 'storageContainerPath' 參數中所指定 Blob 容器的讀取和寫入許可權。 如果未指定 『storageAccountAccessKey』,則需要 StorageContainerSasKey。 | 字串 |
VulnerabilityAssessmentRecurringScansProperties
| 名字 | 描述 | 價值 |
|---|---|---|
| 電子郵件 | 指定掃描通知傳送至的電子郵件地址陣列。 | 字串[] |
| 電子郵件訂閱管理員 | 指定排程掃描通知將傳送給訂用帳戶管理員。 | 布爾 (bool) |
| 已啟用 | 週期性掃描狀態。 | 布爾 (bool) |