---
id: "azure-network-security-group"
type: "component"
kind: "firewall"
provider: "azure"
category: "security"
aliases: "NSG"
docs: "https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview"
url: "https://localhost:3000/catalogue/components/azure-network-security-group"
---

# Network Security Group

Stateful five-tuple allow/deny filter on a subnet or network interface.

| | |
|---|---|
| Provider | [azure](https://localhost:3000/catalogue?provider=azure) |
| Kind | [Firewall](https://localhost:3000/catalogue/kinds/firewall) |
| Category | Security |
| Official docs | [https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) |
| Also known as | NSG |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `defaultAction` | enum | `allow`, `deny` | no | — | **"deny"** |
| `defaultInternetOutboundAllowed` | boolean | — | no | true | inherited |
| `defaultVnetInboundAllowed` | boolean | — | no | true | inherited |
| `intrusionPrevention` | boolean | — | no | — | **false** |
| `logging` | boolean | — | no | — | **false** |
| `managed` | boolean | — | no | false | **true** |
| `ruleCount` | integer | — | no | — | inherited |
| `scope` | enum | `subnet`, `network-interface` | no | — | inherited |
| `stateful` | boolean | — | no | — | **true** |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 35

- [Cloud Firewall](https://localhost:3000/catalogue/components/alibaba-cloud-firewall.md) `alibaba-cloud-firewall` — alibabacloud
- [Network ACL](https://localhost:3000/catalogue/components/alibaba-network-acl.md) `alibaba-network-acl` — alibabacloud
- [ECS Security Group](https://localhost:3000/catalogue/components/alibaba-security-group.md) `alibaba-security-group` — alibabacloud
- [Network ACL](https://localhost:3000/catalogue/components/aws-network-acl.md) `aws-network-acl` — aws
- [AWS Network Firewall](https://localhost:3000/catalogue/components/aws-network-firewall.md) `aws-network-firewall` — aws
- [Amazon Route 53 Resolver DNS Firewall](https://localhost:3000/catalogue/components/aws-route53-dns-firewall.md) `aws-route53-dns-firewall` — aws
- [Security group](https://localhost:3000/catalogue/components/aws-security-group.md) `aws-security-group` — aws
- [Microsoft Entra Internet Access](https://localhost:3000/catalogue/components/azure-entra-internet-access.md) `azure-entra-internet-access` — azure
- [Azure Firewall](https://localhost:3000/catalogue/components/azure-firewall.md) `azure-firewall` — azure
- [Network security perimeter](https://localhost:3000/catalogue/components/azure-network-security-perimeter.md) `azure-network-security-perimeter` — azure
- [Cloudflare DNS Firewall](https://localhost:3000/catalogue/components/cloudflare-dns-firewall.md) `cloudflare-dns-firewall` — cloudflare
- [Cloudflare Gateway](https://localhost:3000/catalogue/components/cloudflare-gateway.md) `cloudflare-gateway` — cloudflare
- [Cloudflare Network Firewall](https://localhost:3000/catalogue/components/cloudflare-network-firewall.md) `cloudflare-network-firewall` — cloudflare
- [Generic firewall](https://localhost:3000/catalogue/components/firewall.md) `firewall` — default
- [Firewall appliance](https://localhost:3000/catalogue/components/firewall-appliance.md) `firewall-appliance` — default
- [Fortinet FortiGate](https://localhost:3000/catalogue/components/fortigate.md) `fortigate` — default
- [MikroTik RouterOS](https://localhost:3000/catalogue/components/mikrotik-routeros.md) `mikrotik-routeros` — default
- [nftables](https://localhost:3000/catalogue/components/nftables.md) `nftables` — default
- [OPNsense](https://localhost:3000/catalogue/components/opnsense.md) `opnsense` — default
- [Palo Alto Networks NGFW](https://localhost:3000/catalogue/components/palo-alto-ngfw.md) `palo-alto-ngfw` — default
- [pfSense](https://localhost:3000/catalogue/components/pfsense.md) `pfsense` — default
- [Snort](https://localhost:3000/catalogue/components/snort.md) `snort` — default
- [Suricata](https://localhost:3000/catalogue/components/suricata.md) `suricata` — default
- [VyOS](https://localhost:3000/catalogue/components/vyos.md) `vyos` — default
- [DigitalOcean Cloud Firewalls](https://localhost:3000/catalogue/components/digitalocean-cloud-firewall.md) `digitalocean-cloud-firewall` — digitalocean
- [Cloud IDS](https://localhost:3000/catalogue/components/google-cloud-ids.md) `google-cloud-ids` — gcp
- [Cloud NGFW](https://localhost:3000/catalogue/components/google-cloud-ngfw.md) `google-cloud-ngfw` — gcp
- [Secure Web Proxy](https://localhost:3000/catalogue/components/google-secure-web-proxy.md) `google-secure-web-proxy` — gcp
- [IBM Cloud Hardware Firewall](https://localhost:3000/catalogue/components/ibm-firewall.md) `ibm-firewall` — ibm
- [VPC Security Group](https://localhost:3000/catalogue/components/ibm-security-group.md) `ibm-security-group` — ibm
- [NetworkPolicy](https://localhost:3000/catalogue/components/k8s-network-policy.md) `k8s-network-policy` — k8s
- [Network Firewall](https://localhost:3000/catalogue/components/oci-network-firewall.md) `oci-network-firewall` — oci
- [Network Security Group](https://localhost:3000/catalogue/components/oci-network-security-group.md) `oci-network-security-group` — oci
- [Security List](https://localhost:3000/catalogue/components/oci-security-list.md) `oci-security-list` — oci
- [Security Group](https://localhost:3000/catalogue/components/outscale-security-group.md) `outscale-security-group` — outscale

## Use it in a design

```yaml
nodes:
  - { id: "azure-network-security-group", component: "azure-network-security-group" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Azure Network Security Group: five-tuple allow/deny filter on a subnet or NIC ("Azure network security
# groups overview"). The default rules end in DenyAllInbound / DenyAllOutbound at priority 65500, a flow
# record makes it stateful, and AllowInternetOutBound (65001) leaves egress to the internet open.
schemaVersion: "1"
type: "component"
id: "azure-network-security-group"
kind: "firewall"
provider: "azure"
docs: "https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview"
aliases: ["NSG"]
defaults:
  managed: true
  defaultAction: "deny"
  stateful: true
  logging: false
  intrusionPrevention: false
properties:
  scope:
    type: "enum"
    values: ["subnet", "network-interface"]
  defaultInternetOutboundAllowed:
    type: "boolean"
    default: true
  defaultVnetInboundAllowed:
    type: "boolean"
    default: true
```

Human page: https://localhost:3000/catalogue/components/azure-network-security-group
