Skip to content

Instantly share code, notes, and snippets.

@ebibibi
Created January 13, 2020 14:04
Show Gist options
  • Select an option

  • Save ebibibi/c3bfd900527ce5766e11662e9a224013 to your computer and use it in GitHub Desktop.

Select an option

Save ebibibi/c3bfd900527ce5766e11662e9a224013 to your computer and use it in GitHub Desktop.
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/networkSecurityGroups/securityRules"
},
{
"allOf": [
{
"field": "Microsoft.Network/networkSecurityGroups/securityRules/access",
"equals": "Allow"
},
{
"field": "Microsoft.Network/networkSecurityGroups/securityRules/direction",
"equals": "Inbound"
},
{
"anyOf": [
{
"field": "Microsoft.Network/networkSecurityGroups/securityRules/sourceAddressPrefix",
"in": [
"*",
"Internet"
]
},
{
"not": {
"field": "Microsoft.Network/networkSecurityGroups/securityRules/sourceAddressPrefixes[*]",
"notIn": [
"*",
"Internet"
]
}
}
]
}
]
}
]
},
"then": {
"effect": "deny"
}
},
"parameters": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment