Bicep 리소스 정의
profiles/securityPolicies 리소스 종류는 다음을 대상으로 하는 작업으로 배포할 수 있습니다.
각 API 버전에서 변경된 속성 목록은 변경 로그참조하세요.
사용 예제
Bicep 샘플
Front Door(표준/프리미엄) 보안 정책을 배포하는 기본 예제입니다.
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource profile 'Microsoft.Cdn/profiles@2021-06-01' = {
name: resourceName
location: 'global'
sku: {
name: 'Premium_AzureFrontDoor'
}
properties: {
originResponseTimeoutSeconds: 120
}
}
resource securityPolicy 'Microsoft.Cdn/profiles/securityPolicies@2021-06-01' = {
name: resourceName
parent: profile
properties: {
parameters: {
associations: [
{
domains: [
{
id: customDomain.id
}
]
patternsToMatch: [
'/*'
]
}
]
type: 'WebApplicationFirewall'
wafPolicy: {
id: frontDoorWebApplicationFirewallPolicy.id
}
}
}
}
resource frontDoorWebApplicationFirewallPolicy 'Microsoft.Network/FrontDoorWebApplicationFirewallPolicies@2020-11-01' = {
name: resourceName
location: 'global'
sku: {
name: 'Premium_AzureFrontDoor'
}
properties: {
customRules: {
rules: [
{
action: 'Block'
enabledState: 'Enabled'
matchConditions: [
{
matchValue: [
'192.168.1.0/24'
'10.0.0.0/24'
]
matchVariable: 'RemoteAddr'
negateCondition: false
operator: 'IPMatch'
}
]
name: 'Rule1'
priority: 1
rateLimitDurationInMinutes: 1
rateLimitThreshold: 10
ruleType: 'MatchRule'
}
]
}
managedRules: {
managedRuleSets: [
{
ruleGroupOverrides: [
{
ruleGroupName: 'PHP'
rules: [
{
action: 'Block'
enabledState: 'Disabled'
ruleId: '933111'
}
]
}
]
ruleSetAction: 'Block'
ruleSetType: 'DefaultRuleSet'
ruleSetVersion: 'preview-0.1'
}
{
ruleSetAction: 'Block'
ruleSetType: 'BotProtection'
ruleSetVersion: 'preview-0.1'
}
]
}
policySettings: {
customBlockResponseBody: 'PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=='
customBlockResponseStatusCode: 403
enabledState: 'Enabled'
mode: 'Prevention'
redirectUrl: 'https://www.fabrikam.com'
}
}
}
resource dnsZone 'Microsoft.Network/dnsZones@2018-05-01' = {
name: '${resourceName}.com'
location: 'global'
}
resource customDomain 'Microsoft.Cdn/profiles/customDomains@2021-06-01' = {
name: resourceName
parent: profile
properties: {
azureDnsZone: {
id: dnsZone.id
}
hostName: 'fabrikam.${resourceName}.com'
tlsSettings: {
certificateType: 'ManagedCertificate'
minimumTlsVersion: 'TLS12'
}
}
}
Azure 확인된 모듈
다음 Azure 확인된 모듈 사용하여 이 리소스 유형을 배포할 수 있습니다.
Azure 빠른 시작 샘플
다음 Azure 빠른 시작 템플릿에는 이 리소스 유형을 배포하기 위한 Bicep 샘플이 포함되어 있습니다.
Microsoft.Cdn/profiles/securityPolicies 리소스를 만들려면 템플릿에 다음 Bicep을 추가합니다.
resource symbolicname 'Microsoft.Cdn/profiles/securityPolicies@2020-09-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
parameters: {
type: 'string'
// For remaining properties, see SecurityPolicyParameters objects
}
}
}
SecurityPolicyParameters 개체
형식 속성을 설정하여 개체의 형식을 지정합니다.
WebApplicationFirewall의 경우 다음을 사용합니다.
{
associations: [
{
domains: [
{
id: 'string'
}
]
patternsToMatch: [
'string'
]
}
]
type: 'WebApplicationFirewall'
wafPolicy: {
id: 'string'
}
}
속성 값
Microsoft.Cdn/profiles/securityPolicies
| 이름 |
설명 |
가치 |
| 이름 |
리소스 이름 |
string(필수) |
| 부모 |
Bicep에서 자식 리소스에 대한 부모 리소스를 지정할 수 있습니다. 자식 리소스가 부모 리소스 외부에서 선언된 경우에만 이 속성을 추가해야 합니다.
자세한 내용은 부모 리소스외부의 자식 리소스 참조하세요. |
형식의 리소스에 대한 기호 이름: 프로필 |
| 속성 |
보안 정책을 만드는 데 필요한 속성이 포함된 json 개체 |
보안 정책 속성 |
ResourceReference
| 이름 |
설명 |
가치 |
| 아이디 |
리소스 ID입니다. |
문자열 |
SecurityPolicy매개 변수
보안 정책 속성
SecurityPolicyWebApplication방화벽연결
| 이름 |
설명 |
가치 |
| 도메인 |
도메인 목록입니다. |
리소스 참조[] |
| patternsToMatch |
경로 목록 |
문자열[] |
SecurityPolicyWebApplicationFirewall매개 변수
ARM 템플릿 리소스 정의
profiles/securityPolicies 리소스 종류는 다음을 대상으로 하는 작업으로 배포할 수 있습니다.
사용 예제
Azure 빠른 시작 템플릿
다음 Azure 빠른 시작 템플릿은 이 리소스 유형을 배포할 있습니다.
Microsoft.Cdn/profiles/securityPolicies 리소스를 만들려면 템플릿에 다음 JSON을 추가합니다.
{
"type": "Microsoft.Cdn/profiles/securityPolicies",
"apiVersion": "2020-09-01",
"name": "string",
"properties": {
"parameters": {
"type": "string"
// For remaining properties, see SecurityPolicyParameters objects
}
}
}
SecurityPolicyParameters 개체
형식 속성을 설정하여 개체의 형식을 지정합니다.
WebApplicationFirewall의 경우 다음을 사용합니다.
{
"associations": [
{
"domains": [
{
"id": "string"
}
],
"patternsToMatch": [ "string" ]
}
],
"type": "WebApplicationFirewall",
"wafPolicy": {
"id": "string"
}
}
속성 값
Microsoft.Cdn/profiles/securityPolicies
| 이름 |
설명 |
가치 |
| API버전 |
api 버전 |
'2020-09-01' |
| 이름 |
리소스 이름 |
string(필수) |
| 속성 |
보안 정책을 만드는 데 필요한 속성이 포함된 json 개체 |
보안 정책 속성 |
| 유형 |
리소스 종류 |
'Microsoft.Cdn/profiles/securityPolicies' |
ResourceReference
| 이름 |
설명 |
가치 |
| 아이디 |
리소스 ID입니다. |
문자열 |
SecurityPolicy매개 변수
보안 정책 속성
SecurityPolicyWebApplication방화벽연결
| 이름 |
설명 |
가치 |
| 도메인 |
도메인 목록입니다. |
리소스 참조[] |
| patternsToMatch |
경로 목록 |
문자열[] |
SecurityPolicyWebApplicationFirewall매개 변수
profiles/securityPolicies 리소스 종류는 다음을 대상으로 하는 작업으로 배포할 수 있습니다.
-
자원 그룹 각 API 버전에서 변경된 속성 목록은 변경 로그를 참조하세요.
사용 예제
Front Door(표준/프리미엄) 보안 정책을 배포하는 기본 예제입니다.
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 = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "dnsZone" {
type = "Microsoft.Network/dnsZones@2018-05-01"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}.com"
location = "global"
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "profile" {
type = "Microsoft.Cdn/profiles@2021-06-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = "global"
body = {
properties = {
originResponseTimeoutSeconds = 120
}
sku = {
name = "Premium_AzureFrontDoor"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "FrontDoorWebApplicationFirewallPolicy" {
type = "Microsoft.Network/FrontDoorWebApplicationFirewallPolicies@2020-11-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = "global"
body = {
properties = {
customRules = {
rules = [
{
action = "Block"
enabledState = "Enabled"
matchConditions = [
{
matchValue = [
"192.168.1.0/24",
"10.0.0.0/24",
]
matchVariable = "RemoteAddr"
negateCondition = false
operator = "IPMatch"
},
]
name = "Rule1"
priority = 1
rateLimitDurationInMinutes = 1
rateLimitThreshold = 10
ruleType = "MatchRule"
},
]
}
managedRules = {
managedRuleSets = [
{
ruleGroupOverrides = [
{
ruleGroupName = "PHP"
rules = [
{
action = "Block"
enabledState = "Disabled"
ruleId = "933111"
},
]
},
]
ruleSetAction = "Block"
ruleSetType = "DefaultRuleSet"
ruleSetVersion = "preview-0.1"
},
{
ruleSetAction = "Block"
ruleSetType = "BotProtection"
ruleSetVersion = "preview-0.1"
},
]
}
policySettings = {
customBlockResponseBody = "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="
customBlockResponseStatusCode = 403
enabledState = "Enabled"
mode = "Prevention"
redirectUrl = "https://www.fabrikam.com"
}
}
sku = {
name = "Premium_AzureFrontDoor"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "customDomain" {
type = "Microsoft.Cdn/profiles/customDomains@2021-06-01"
parent_id = azapi_resource.profile.id
name = var.resource_name
body = {
properties = {
azureDnsZone = {
id = azapi_resource.dnsZone.id
}
hostName = "fabrikam.${var.resource_name}.com"
tlsSettings = {
certificateType = "ManagedCertificate"
minimumTlsVersion = "TLS12"
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "securityPolicy" {
type = "Microsoft.Cdn/profiles/securityPolicies@2021-06-01"
parent_id = azapi_resource.profile.id
name = var.resource_name
body = {
properties = {
parameters = {
associations = [
{
domains = [
{
id = azapi_resource.customDomain.id
},
]
patternsToMatch = [
"/*",
]
},
]
type = "WebApplicationFirewall"
wafPolicy = {
id = azapi_resource.FrontDoorWebApplicationFirewallPolicy.id
}
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Microsoft.Cdn/profiles/securityPolicies 리소스를 만들려면 템플릿에 다음 Terraform을 추가합니다.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Cdn/profiles/securityPolicies@2020-09-01"
name = "string"
parent_id = "string"
body = {
properties = {
parameters = {
type = "string"
// For remaining properties, see SecurityPolicyParameters objects
}
}
}
}
SecurityPolicyParameters 개체
형식 속성을 설정하여 개체의 형식을 지정합니다.
WebApplicationFirewall의 경우 다음을 사용합니다.
{
associations = [
{
domains = [
{
id = "string"
}
]
patternsToMatch = [
"string"
]
}
]
type = "WebApplicationFirewall"
wafPolicy = {
id = "string"
}
}
속성 값
Microsoft.Cdn/profiles/securityPolicies
| 이름 |
설명 |
가치 |
| 이름 |
리소스 이름 |
string(필수) |
| 부모 ID |
이 리소스의 부모인 리소스의 ID입니다. |
형식 리소스의 ID: 프로필 |
| 속성 |
보안 정책을 만드는 데 필요한 속성이 포함된 json 개체 |
보안 정책 속성 |
| 유형 |
리소스 종류 |
"Microsoft.Cdn/프로필/securityPolicies@2020-09-01" |
ResourceReference
| 이름 |
설명 |
가치 |
| 아이디 |
리소스 ID입니다. |
문자열 |
SecurityPolicy매개 변수
보안 정책 속성
SecurityPolicyWebApplication방화벽연결
| 이름 |
설명 |
가치 |
| 도메인 |
도메인 목록입니다. |
리소스 참조[] |
| patternsToMatch |
경로 목록 |
문자열[] |
SecurityPolicyWebApplicationFirewall매개 변수