Skip to content

Commit 2c398de

Browse files
Merge pull request #429 from gumoden/master
Azure Policy - Ensure Resource Specific Logs are enabled on Application Gateway WAFs
2 parents 0334f82 + c33ecfa commit 2c398de

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"properties": {
3+
"displayName": "Ensure Resource Specific Logs are Enabled on Application Gateway WAF",
4+
"policyType": "Custom",
5+
"mode": "All",
6+
"description": "This Policy ensures that the Resource Specific Logs are enabled while configuring the diagnostic settings for Application Gateway WAF.",
7+
"metadata": {
8+
"version": "1.0.0",
9+
"category": "Network"
10+
},
11+
"parameters": {
12+
"effect": {
13+
"type": "String",
14+
"metadata": {
15+
"displayName": "Effect",
16+
"description": "Enable or disable the execution of the policy"
17+
},
18+
"allowedValues": [
19+
"AuditIfNotExists"
20+
],
21+
"defaultValue": "AuditIfNotExists"
22+
}
23+
},
24+
"policyRule": {
25+
"if": {
26+
"field": "type",
27+
"equals": "Microsoft.Network/applicationGateways"
28+
},
29+
"then": {
30+
"effect": "[parameters('effect')]",
31+
"details": {
32+
"type": "Microsoft.Insights/diagnosticSettings",
33+
"existenceCondition": {
34+
"allOf": [
35+
{
36+
"count": {
37+
"field": "Microsoft.Insights/diagnosticSettings/logs[*]",
38+
"where": {
39+
"field": "Microsoft.Insights/diagnosticSettings/logs[*].enabled",
40+
"equals": true
41+
}
42+
},
43+
"greater": 0
44+
},
45+
{
46+
"field": "Microsoft.Insights/diagnosticSettings/logAnalyticsDestinationType",
47+
"equals": "Dedicated"
48+
}
49+
]
50+
}
51+
}
52+
}
53+
}
54+
}
55+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Ensure Resource Specific Logs are Enabled on Application Gateway WAF - JSON
2+
3+
These are the Azure Policy Definition scripts to find all AppGWs (Includes WAF Logs) and flag as non-compliant if logs, metrics and workspace is not configured in diagnostic settings to use the Resource Specific destination table.
4+
5+
## Contributing
6+
7+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
8+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
9+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
10+
11+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
12+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
13+
provided by the bot. You will only need to do this once across all repos using our CLA.
14+
15+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
16+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
17+
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

0 commit comments

Comments
 (0)