|
1 | | ---- |
2 | 1 | checks: |
3 | | -- code: rg-naming-pattern |
4 | | - description: Custom check to check resource group naming |
5 | | - impact: resource groups should be named consistently |
6 | | - resolution: use the pattern rg-app-env-region |
7 | | - requiredTypes: |
8 | | - - resource |
9 | | - requiredLabels: |
10 | | - - azurerm_resource_group |
11 | | - severity: HIGH |
12 | | - matchSpec: |
13 | | - name: name |
14 | | - action: regexMatches |
15 | | - value: "^rg-[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+" |
16 | | - errorMessage: improperly named resource group |
17 | | - relatedLinks: |
18 | | - - https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming |
19 | | -- code: tags-resources |
20 | | - description: Custom check to ensure the CostCenter tag is applied to Azure Resources |
21 | | - impact: By not having CostCenter we can't keep track of billing |
22 | | - resolution: Add the CostCenter tag |
23 | | - requiredTypes: |
24 | | - - resource |
25 | | - requiredLabels: |
26 | | - - azurerm_subscription |
27 | | - - azurerm_resource_group |
28 | | - - azurerm_linux_web_app |
29 | | - - azurerm_windows_web_app |
30 | | - - azurerm_storage_account |
31 | | - - azurerm_service_plan |
32 | | - - azurerm_app_service |
33 | | - severity: HIGH |
34 | | - matchSpec: |
35 | | - name: tags |
36 | | - action: contains |
37 | | - value: CostCenter |
38 | | - errorMessage: The required CostCenter tag was missing |
39 | | - relatedLinks: |
40 | | - - https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-tagging |
41 | | -- code: app-service-deprecated |
42 | | - description: Custom check to warn on deprecated app service |
43 | | - impact: using deprecated app service resource instead of azurerm_linux_web_app or azurerm_windows_web_app |
44 | | - resolution: Use azurerm_linux_web_app or azurerm_windows_web_app |
45 | | - requiredTypes: |
46 | | - - resource |
47 | | - requiredLabels: |
48 | | - - azurerm_app_service |
49 | | - severity: HIGH |
50 | | - matchSpec: |
51 | | - name: azurerm_app_service |
52 | | - action: isPresent |
53 | | - errorMessage: Using a deprecated resource - azurerm_app_service |
54 | | - relatedLinks: |
55 | | - - https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service |
| 2 | + - { |
| 3 | + code: rg-naming-pattern, |
| 4 | + description: "Custom check to check resource group naming", |
| 5 | + impact: "resource groups should be named consistently", |
| 6 | + resolution: "use the pattern rg-app-env-region", |
| 7 | + requiredTypes: [resource], |
| 8 | + requiredLabels: [azurerm_resource_group], |
| 9 | + severity: HIGH, |
| 10 | + matchSpec: |
| 11 | + { |
| 12 | + action: not, |
| 13 | + predicateMatchSpec: |
| 14 | + [ |
| 15 | + { |
| 16 | + name: name, |
| 17 | + action: regexMatches, |
| 18 | + value: "^rg-[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+", |
| 19 | + }, |
| 20 | + ], |
| 21 | + }, |
| 22 | + errorMessage: "improperly named resource group", |
| 23 | + relatedLinks: |
| 24 | + [ |
| 25 | + "https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming", |
| 26 | + ], |
| 27 | + } |
| 28 | + - { |
| 29 | + code: tags-resources, |
| 30 | + description: "Custom check to ensure the CostCenter tag is applied to Azure Resources", |
| 31 | + impact: "By not having CostCenter we can't keep track of billing", |
| 32 | + resolution: "Add the CostCenter tag", |
| 33 | + requiredTypes: [resource], |
| 34 | + requiredLabels: |
| 35 | + [ |
| 36 | + azurerm_subscription, |
| 37 | + azurerm_resource_group, |
| 38 | + azurerm_linux_web_app, |
| 39 | + azurerm_windows_web_app, |
| 40 | + azurerm_storage_account, |
| 41 | + azurerm_service_plan, |
| 42 | + azurerm_app_service, |
| 43 | + ], |
| 44 | + severity: HIGH, |
| 45 | + matchSpec: { name: tags, action: contains, value: CostCenter }, |
| 46 | + errorMessage: "The required CostCenter tag was missing", |
| 47 | + relatedLinks: |
| 48 | + [ |
| 49 | + "https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-tagging", |
| 50 | + ], |
| 51 | + } |
| 52 | + - { |
| 53 | + code: app-service-deprecated, |
| 54 | + description: "Custom check to warn on deprecated app service", |
| 55 | + impact: "using deprecated app service resource instead of azurerm_linux_web_app or azurerm_windows_web_app", |
| 56 | + resolution: "Use azurerm_linux_web_app or azurerm_windows_web_app", |
| 57 | + requiredTypes: [resource], |
| 58 | + requiredLabels: [azurerm_app_service], |
| 59 | + severity: HIGH, |
| 60 | + matchSpec: { name: azurerm_app_service, action: isPresent }, |
| 61 | + errorMessage: "Using a deprecated resource - azurerm_app_service", |
| 62 | + relatedLinks: |
| 63 | + [ |
| 64 | + "https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service", |
| 65 | + ], |
| 66 | + } |
0 commit comments