Azure / Azure/Azure-Landing-Zones

Audit for mandatory tags on resources should have excludeResourceTypes & excludeResourcegroupPattern

Open
#207 2 comments 0 reactions 1 assignee Claimed by @Springstone View on GitHub
Transfer From: Enterprise-Scale :arrow_right:
Dominant language
PowerShell
Stars
97
Forks
70
Avg merge
3d 1h
Merged PRs (30d)
7

Description

The Policy [Audit for mandatory tags on resources](https://www.azadvertizer.net/azpolicyadvertizer/Audit-Tags-Mandatory.html) should have exclude ResourceTypes Parameter, because some Resources could not be tagged for example "microsoft.advisor/recommendations" which also apears in the list

In the same step we could also add ResourceGroupFilter

Parameter
```json
"excludedResourceTypes": {
"type": "Array",
"metadata": {
"displayName": "Excluded Resource Types",
"description": "Exclude certain resource types from this policy, if all resourceTypes are selected by using an empty resourceTypeList",
"strongType": "ResourceType"
},
"defaultValue": []
},
"excludedResourceGroupPatterns": {
"type": "Array",
"metadata": {
"displayName": "Excluded Resource Groups; wild card patterns are supported. Example: 'rg-*, rg-abc-*'",
"description": "This array contains all excluded RGs from this policy"
},
"defaultValue": []
}
```

add to if-condition
```json
{
"field": "type",
"notIn": "[parameters('excludedResourceTypes')]"
},
"count": {
"value": "[parameters('excludedResourceGroupPatterns')]",
"name": "excludedRG",
"where": {
"value": "[resourceGroup().name]",
"like": "[current('excludedRG')]"
}
},
"equals": 0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.