forked from Azure/CanadaPubSecALZ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Defender Plan for Cosmos DB (Azure#200)
Add CosmosDB Defender Plan and custom policy to deploy Defender Plan for Cosmos DB
- Loading branch information
1 parent
81eccd1
commit 27363b7
Showing
6 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../definitions/policy/DefenderForCloud-Deploy-DefenderPlan-CosmosDB/azurepolicy.config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "Configure Microsoft Defender for Cosmos DB to be enabled", | ||
"mode": "all" | ||
} |
26 changes: 26 additions & 0 deletions
26
...initions/policy/DefenderForCloud-Deploy-DefenderPlan-CosmosDB/azurepolicy.parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"pricingTier": { | ||
"type": "string", | ||
"metadata": { | ||
"displayName": "Azure Defender pricing tier", | ||
"description": "Azure Defender pricing tier" | ||
}, | ||
"allowedValues": [ | ||
"Standard", | ||
"Free" | ||
], | ||
"defaultValue": "Standard" | ||
}, | ||
"effect": { | ||
"type": "string", | ||
"metadata": { | ||
"displayName": "Effect", | ||
"description": "Enable or disable the execution of the policy" | ||
}, | ||
"allowedValues": [ | ||
"DeployIfNotExists", | ||
"Disabled" | ||
], | ||
"defaultValue": "DeployIfNotExists" | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
...m/definitions/policy/DefenderForCloud-Deploy-DefenderPlan-CosmosDB/azurepolicy.rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"if": { | ||
"allOf": [ | ||
{ | ||
"field": "type", | ||
"equals": "Microsoft.Resources/subscriptions" | ||
} | ||
] | ||
}, | ||
"then": { | ||
"effect": "[parameters('effect')]", | ||
"details": { | ||
"type": "Microsoft.Security/pricings", | ||
"name": "CosmosDbs", | ||
"deploymentScope": "Subscription", | ||
"existenceScope": "Subscription", | ||
"roleDefinitionIds": [ | ||
"/providers/Microsoft.Authorization/roleDefinitions/fb1c8493-542b-48eb-b624-b4c8fea62acd" | ||
], | ||
"existenceCondition": { | ||
"allOf": [ | ||
{ | ||
"field": "Microsoft.Security/pricings/pricingTier", | ||
"equals": "[parameters('pricingTier')]" | ||
}, | ||
{ | ||
"field": "type", | ||
"equals": "Microsoft.Security/pricings" | ||
} | ||
] | ||
}, | ||
"deployment": { | ||
"location": "canadacentral", | ||
"properties": { | ||
"mode": "incremental", | ||
"parameters": { | ||
"pricingTier": { | ||
"value": "[parameters('pricingTier')]" | ||
} | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"pricingTier": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Azure Defender pricing tier" | ||
} | ||
} | ||
}, | ||
"variables": {}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Security/pricings", | ||
"apiVersion": "2018-06-01", | ||
"name": "CosmosDbs", | ||
"properties": { | ||
"pricingTier": "[parameters('pricingTier')]" | ||
} | ||
} | ||
], | ||
"outputs": {} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
policy/custom/definitions/policyset/DefenderForCloud.parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": {} | ||
"parameters": { | ||
"policyDefinitionManagementGroupId": { | ||
"value": "{{var-topLevelManagementGroupName}}" | ||
} | ||
} | ||
} |