Initial commit

This commit is contained in:
Jurjen Ladenius
2020-07-09 10:28:42 +02:00
parent f912178afb
commit 34b041dc2e
16 changed files with 825 additions and 20 deletions

View File

@@ -0,0 +1,52 @@
{
"properties": {
"displayName": "Service Bus Queue must have Time to Live (TTL) of 14 days.",
"policyType": "Custom",
"mode": "All",
"description": "This policy enables you to restrict service bus queues with TTL other than 2 weeks.",
"metadata": {
"category": "Service Bus",
"createdBy": "c6025a2e-416c-42da-96ef-dd507382793a",
"createdOn": "2020-04-01T13:25:04.7464348Z",
"updatedBy": "c6025a2e-416c-42da-96ef-dd507382793a",
"updatedOn": "2020-04-03T11:50:29.9215728Z"
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"audit",
"deny",
"disabled"
],
"defaultValue": "audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ServiceBus/namespaces/queues"
},
{
"not": {
"field": "Microsoft.ServiceBus/namespaces/queues/defaultMessageTimeToLive",
"equals": "P14D"
}
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
},
"id": "/providers/Microsoft.Management/managementGroups/e9792fd7-4044-47e7-a40d-3fba46f1cd09/providers/Microsoft.Authorization/policyDefinitions/b8e823fc-5c2b-4ebe-b9fc-2d4524bc5ae5",
"type": "Microsoft.Authorization/policyDefinitions",
"name": "b8e823fc-5c2b-4ebe-b9fc-2d4524bc5ae5"
}

View File

@@ -0,0 +1,52 @@
{
"properties": {
"displayName": "Service Bus Subscription must have Time to Live (TTL) of 14 days.",
"policyType": "Custom",
"mode": "All",
"description": "This policy enables you to restrict service bus queue subscriptions with TTL other than 2 weeks.",
"metadata": {
"category": "Service Bus",
"createdBy": "c6025a2e-416c-42da-96ef-dd507382793a",
"createdOn": "2020-04-03T11:50:04.4806377Z",
"updatedBy": null,
"updatedOn": null
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"audit",
"deny",
"disabled"
],
"defaultValue": "audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ServiceBus/namespaces/topics/subscriptions"
},
{
"not": {
"field": "Microsoft.ServiceBus/namespaces/topics/subscriptions/defaultMessageTimeToLive",
"equals": "P14D"
}
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
},
"id": "/providers/Microsoft.Management/managementGroups/ManagementGroup_SurveySoftware/providers/Microsoft.Authorization/policyDefinitions/60f3692c-286d-4184-8e2b-52d76716d947",
"type": "Microsoft.Authorization/policyDefinitions",
"name": "60f3692c-286d-4184-8e2b-52d76716d947"
}

View File

@@ -0,0 +1,66 @@
{
"properties": {
"displayName": "Service Bus Topic must have Time to Live (TTL) of equal or less than 14 days",
"policyType": "Custom",
"mode": "All",
"description": "This policy enables you to restrict services bus topic and subscriptions with TTL more than 2 weeks.",
"metadata": {
"category": "Effectory",
"createdBy": null,
"createdOn": null,
"updatedBy": null,
"updatedOn": null
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"audit",
"deny",
"disabled"
],
"defaultValue": "audit"
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.ServiceBus/namespaces/topics"
},
{
"field": "Microsoft.ServiceBus/namespaces/topics/defaultMessageTimeToLive",
"greater": "PW2"
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.ServiceBus/namespaces/topics/subscriptions"
},
{
"field": "Microsoft.ServiceBus/namespaces/topics/subscriptions/defaultMessageTimeToLive",
"greater": "PW2"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
},
"id": "/providers/Microsoft.Management/managementGroups/e9792fd7-4044-47e7-a40d-3fba46f1cd09/providers/Microsoft.Authorization/policyDefinitions/bab116a2-dffc-4740-9935-187dede2d2b0",
"type": "Microsoft.Authorization/policyDefinitions",
"name": "bab116a2-dffc-4740-9935-187dede2d2b0"
}