Kubernetes NetworkPolicy - is this a stateful firewall?

3/22/2021

Is NetworkPolicy a stateful firewall?

For example, if I allow ingress from a certain IPs on certain ports, is the return traffic automatically allowed on ephemeral? Ditto for allowed egress.

How does this play with a default block policy in place?

Are there any other considerations here?

-- Ilya Ayzenshtok
kubernetes
kubernetes-networkpolicy
security

1 Answer

3/22/2021

NetworkPolicy is stateful and will allow an established connection to communicate both ways.

-- Shai Katz
Source: StackOverflow