Skip to content

Commit

Permalink
[New] Container Registries enable retention policy (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoSoeborgPetersen authored Aug 12, 2023
1 parent 2af83f3 commit fed7fab
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "8b36505e-b96f-4ab9-a5ed-aefd19476d2c",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Container Registries enable retention policy",
"description": "Ensure registry has a retention policy for stored image manifests that don't have any associated tags (untagged manifests), which are then automatically deleted. This feature prevents the registry from filling up with artifacts that aren't needed and helps you save on storage costs.",
"metadata": {
"category": "Container Registry",
"version": "1.0.0"
},
"mode": "Indexed",
"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": [
{
"equals": "Microsoft.ContainerRegistry/registries",
"field": "type"
},
{
"in": [
"disabled",
"Disabled"
],
"field": "Microsoft.ContainerRegistry/registries/policies.retentionPolicy.status"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}
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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"if": {
"allOf": [
{
"equals": "Microsoft.ContainerRegistry/registries",
"field": "type"
},
{
"in": [
"disabled",
"Disabled"
],
"field": "Microsoft.ContainerRegistry/registries/policies.retentionPolicy.status"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}

0 comments on commit fed7fab

Please sign in to comment.