Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES-Deny-Subnets-Without-NSG #38

Closed
pauldotyu opened this issue Feb 16, 2021 · 0 comments · Fixed by #142
Closed

ES-Deny-Subnets-Without-NSG #38

pauldotyu opened this issue Feb 16, 2021 · 0 comments · Fixed by #142
Assignees
Labels
bug Something isn't working

Comments

@pauldotyu
Copy link
Contributor

pauldotyu commented Feb 16, 2021

The following policy does not exclude subnets that do not allow NSGs to be attached to it.

ES-Deny-Subnets-Without-NSG

So far, I know GatewaySubnet, AzureFirewallSubnet, and AzureFirewallManagementSubnet do not support NSG. There may be others...

Proposing the policy rule's "if" condition look like this:

"if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Network/virtualNetworks/subnets"
          },
          {
            "field": "name",
            "notEquals": "AzureFirewallSubnet"
          },
          {
            "field": "name",
            "notEquals": "AzureFirewallManagementSubnet"
          },
          {
            "field": "name",
            "notEquals": "GatewaySubnet"
          },
          {
            "field": "Microsoft.Network/virtualNetworks/subnets/networkSecurityGroup.id",
            "exists": "false"
          }
        ]
      },
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants