-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #450 from tdefise/SoftDelete7days
New Policy (App Configuration Stores): App Configuration Stores should should have soft delete enabled of 7 days
- Loading branch information
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...pp-configuration-stores-should-should-have-soft-delete-enabled-of-7-days/azurepolicy.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,59 @@ | ||
{ | ||
"name": "3557ee6d-ff74-49a7-8684-b0c83ce44bed", | ||
"type": "Microsoft.Authorization/policyDefinitions", | ||
"properties": { | ||
"displayName": "App Configuration stores should should have soft delete enabled of 7 days", | ||
"description": "Deleting a App Configuration store without soft delete enabled permanently deletes all data it contains", | ||
"metadata": { | ||
"version": "1.0.0", | ||
"category": "App Configuration" | ||
}, | ||
"mode": "All", | ||
"parameters": { | ||
"effect": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Effect", | ||
"description": "Deny, Audit or Disabled the execution of the Policy" | ||
}, | ||
"allowedValues": [ | ||
"Deny", | ||
"Audit", | ||
"Disabled" | ||
], | ||
"defaultValue": "Audit" | ||
} | ||
}, | ||
"policyRule": { | ||
"if": { | ||
"allOf": [ | ||
{ | ||
"field": "type", | ||
"equals": "Microsoft.AppConfiguration/configurationStores" | ||
}, | ||
{ | ||
"not": { | ||
"field": "Microsoft.AppConfiguration/configurationStores/createMode", | ||
"equals": "recover" | ||
} | ||
}, | ||
{ | ||
"anyOf": [ | ||
{ | ||
"field": "Microsoft.AppConfiguration/configurationStores/softDeleteRetentionInDays", | ||
"exists": "false" | ||
}, | ||
{ | ||
"field": "Microsoft.AppConfiguration/configurationStores/softDeleteRetentionInDays", | ||
"notequals": 7 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"then": { | ||
"effect": "[parameters('effect')]" | ||
} | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ation-stores-should-should-have-soft-delete-enabled-of-7-days/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,15 @@ | ||
{ | ||
"effect": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Effect", | ||
"description": "Deny, Audit or Disabled the execution of the Policy" | ||
}, | ||
"allowedValues": [ | ||
"Deny", | ||
"Audit", | ||
"Disabled" | ||
], | ||
"defaultValue": "Audit" | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...figuration-stores-should-should-have-soft-delete-enabled-of-7-days/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,31 @@ | ||
{ | ||
"if": { | ||
"allOf": [ | ||
{ | ||
"field": "type", | ||
"equals": "Microsoft.AppConfiguration/configurationStores" | ||
}, | ||
{ | ||
"not": { | ||
"field": "Microsoft.AppConfiguration/configurationStores/createMode", | ||
"equals": "recover" | ||
} | ||
}, | ||
{ | ||
"anyOf": [ | ||
{ | ||
"field": "Microsoft.AppConfiguration/configurationStores/softDeleteRetentionInDays", | ||
"exists": "false" | ||
}, | ||
{ | ||
"field": "Microsoft.AppConfiguration/configurationStores/softDeleteRetentionInDays", | ||
"notequals": 7 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"then": { | ||
"effect": "[parameters('effect')]" | ||
} | ||
} |