NetworkPolicy

k8sFirewallk8s-network-policy

Allow list for pod traffic at layer 3 and 4, isolating the pods it selects and enforced by the network plugin.

Provider
k8s
Category
Security
Also known as
netpol
Properties · 3 set by this component
propertytypevaluesrequiredkind defaultthis component
additiveRules · component propertyboolean—notrueinherited
defaultActionenumallow | denyno—▸ deny
intrusionPreventionboolean—no—inherited
loggingboolean—no—inherited
managedboolean—nofalse▸ false
pluginEnforcementRequired · component propertyboolean—notrueinherited
policyScope · component propertyenumingress | egress | ingress-egressnoingressinherited
ruleCountinteger—no—inherited
statefulboolean—no—▸ true
Rules that apply · 0

Every rule whose selector covers this component's kind or its category. Whether a rule fires depends on the design: its properties, its edges and its groups.

No rule reads this kind yet. That is a gap, not a guarantee.
Use it in a design
nodes:
  - { id: "network-policy", component: "k8s-network-policy" }
Other Firewall products · 35
Cloud Firewallalibaba-cloud-firewallalibabacloudfirewallNetwork ACLalibaba-network-aclalibabacloudfirewallECS Security Groupalibaba-security-groupalibabacloudfirewallNetwork ACLaws-network-aclawsfirewallAWS Network Firewallaws-network-firewallawsfirewallAmazon Route 53 Resolver DNS Firewallaws-route53-dns-firewallawsfirewallSecurity groupaws-security-groupawsfirewallMicrosoft Entra Internet Accessazure-entra-internet-accessazurefirewallAzure Firewallazure-firewallazurefirewallNetwork Security Groupazure-network-security-groupazurefirewallNetwork security perimeterazure-network-security-perimeterazurefirewallCloudflare DNS Firewallcloudflare-dns-firewallcloudflarefirewallCloudflare Gatewaycloudflare-gatewaycloudflarefirewallCloudflare Network Firewallcloudflare-network-firewallcloudflarefirewallGeneric firewallfirewallfirewallFirewall appliancefirewall-appliancefirewallFortinet FortiGatefortigatefirewallMikroTik RouterOSmikrotik-routerosfirewallnftablesnftablesfirewallOPNsenseopnsensefirewallPalo Alto Networks NGFWpalo-alto-ngfwfirewallpfSensepfsensefirewallSnortsnortfirewallSuricatasuricatafirewallVyOSvyosfirewallDigitalOcean Cloud Firewallsdigitalocean-cloud-firewalldigitaloceanfirewallCloud IDSgoogle-cloud-idsgcpfirewallCloud NGFWgoogle-cloud-ngfwgcpfirewallSecure Web Proxygoogle-secure-web-proxygcpfirewallIBM Cloud Hardware Firewallibm-firewallibmfirewallVPC Security Groupibm-security-groupibmfirewallNetwork Firewalloci-network-firewallocifirewallNetwork Security Groupoci-network-security-groupocifirewallSecurity Listoci-security-listocifirewallSecurity Groupoutscale-security-groupoutscalefirewall
Source
# yaml-language-server: $schema=../../schema/component.schema.json
# Kubernetes NetworkPolicy: an allow list for pod-to-pod and pod-to-world traffic at OSI layer 3
# or 4. Per "Network Policies" pods are non-isolated until a policy selects them and accept traffic
# from any source; once selected, only connections matching a rule are allowed, reply traffic is
# implicitly allowed, and policies are additive so evaluation order does not matter. If policyTypes
# is omitted, Ingress is always set and Egress only when egress rules exist. Enforcement requires a
# network plugin that supports NetworkPolicy; without one the object has no effect.
schemaVersion: "1"
type: "component"
id: "k8s-network-policy"
kind: "firewall"
provider: "k8s"
docs: "https://kubernetes.io/docs/concepts/services-networking/network-policies/"
aliases: ["netpol"]
defaults:
  managed: false
  defaultAction: "deny"
  stateful: true
properties:
  policyScope:
    type: "enum"
    values: ["ingress", "egress", "ingress-egress"]
    default: "ingress"
  pluginEnforcementRequired:
    type: "boolean"
    default: true
  additiveRules:
    type: "boolean"
    default: true

The same page as markdown, for an agent: /catalogue/components/k8s-network-policy.md