Last active
September 28, 2021 10:56
-
-
Save ljtill/12505089b12f4dfcaca07a721910b01f to your computer and use it in GitHub Desktop.
Provides the ability to modify Security Rules upon Resource updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"displayName": "", | |
"policyType": "Custom", | |
"mode": "All", | |
"parameters": {}, | |
"policyRule": { | |
"if": { | |
"allOf": [ | |
{ | |
"field": "type", | |
"equals": "Microsoft.Network/networkSecurityGroups" | |
}, | |
{ | |
"count": { | |
"field": "Microsoft.Network/networkSecurityGroups/securityRules[*]", | |
"where": { | |
"allOf": [ | |
{ | |
"field": "Microsoft.Network/networkSecurityGroups/securityRules[*].name", | |
"equals": "" | |
} | |
] | |
} | |
}, | |
"equals": 0 | |
} | |
] | |
}, | |
"then": { | |
"effect": "append", | |
"details": [ | |
{ | |
"field": "Microsoft.Network/networkSecurityGroups/securityRules[*]", | |
"value": { | |
"name": "", | |
"properties": { | |
"protocol": "*", | |
"sourcePortRange": "*", | |
"destinationPortRange": "*", | |
"sourceAddressPrefix": "", | |
"sourceAddressPrefixes": [ | |
"10.1.0.0/16" | |
], | |
"destinationAddressPrefix": "VirtualNetwork", | |
"destinationAddressPrefixes": [], | |
"access": "Deny", | |
"priority": "4096", | |
"direction": "Inbound" | |
} | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment