This is article 8 of 10 in Beyond Kubernetes Defaults. Read article 7: Desired State Is Not Enough first, or start with article 1.
NetworkPolicy is one of the most useful security controls available to Kubernetes operators.
It reduces attack surface by limiting which network paths exist.
It does not tell the application who is on the other end of the connection.
Reachability answers one question
A policy can express something like:
Pods with label A may connect to service B on port 443 That is valuable.
It is still different from:
This exact cryptographic workload identity is calling service B under the current generation for an operation it is authorized to perform. The second statement needs identity and authorization.
Labels are not cryptographic principals
Kubernetes labels are operational metadata controlled through the Kubernetes API.
They are excellent selectors for scheduling and policy.
For security-sensitive application protocols, we prefer the caller to present a cryptographically verifiable workload identity over mTLS and then pass an authorization decision appropriate to the operation.
This reduces the amount of authority carried by network location or mutable metadata alone.
Identity and authorization are separate
Even strong workload identity does not automatically imply authority.
A valid replica may be a follower rather than a leader. A workload can authenticate successfully while its authorization data is stale, or while it holds a role that this particular operation does not allow.
The stack therefore becomes complementary:
NetworkPolicy -> can the packet path exist? mTLS/SPIFFE -> which workload is this? authorization -> may this identity perform this action now? Why use all three?
Defense in depth gives each mechanism a smaller job.
If authorization has a bug, NetworkPolicy may still prevent unrelated namespaces from reaching the service. If a network policy is accidentally widened, workload identity and authorization still reject the wrong caller. If a credential is revoked, the network path does not keep that caller authorized.
The layers reinforce rather than duplicate one another.
Do not turn identity into routing metadata
Authorization requirements often change faster than the workloads they apply to.
Teams, environments and policy revisions may have very different lifecycles. Overloading a certificate identity with all of them creates unnecessary cardinality and makes rotation harder.
A stable identity that answers who is calling, combined with authorization that is evaluated per operation, keeps each artifact rotationally simple.
The practical lesson is straightforward:
Use NetworkPolicy aggressively for reachability. Do not confuse reachability with identity or authority.
Service accounts help, but the protocol still matters
Kubernetes service accounts can be strong building blocks for workload identity, especially with projected tokens and external identity integrations.
The broader point remains: the application should know what identity it trusts and how that identity is bound to the protocol it accepts.
For long-lived mTLS sessions, a workload-identity standard such as SPIFFE can make the caller's service and environment explicit, without trusting source IP or label selection alone.
Identity should be narrow enough to remain stable
We found it useful to keep long-lived workload identity separate from fast-changing authorization facts.
A service's identity can stay stable across configuration and policy revisions, while what that service is allowed to do is evaluated from data with its own lifecycle.
That avoids re-issuing certificates every time policy changes, and it avoids authorization decisions silently inheriting stale network assumptions.
Environment restrictions are their own control
Where a workload runs is also worth controlling — but location is usually a policy question, not an identity question.
A deployment may be allowed in one environment and denied in another, even when the caller authenticates perfectly and the operation itself is permitted. Treating that as a separate control keeps each layer simple:
NetworkPolicy -> can the path exist at all? Identity -> who is calling? Authorization -> is this operation allowed? Environment policy -> is this the right place for it? Each layer answers a different question, fails independently, and can be tested with its own negative cases.
Failure tests should cross layers
Useful security negatives include:
- network path allowed but wrong workload identity -> DENY;
- correct identity but insufficient role -> DENY;
- correct identity but stale authorization -> DENY;
- correct identity arriving from an unexpected environment -> DENY;
- unrelated namespace blocked before application handshake where NetworkPolicy applies.
Passing only the NetworkPolicy test or only the mTLS test leaves gaps between layers.
The point of defense in depth is that each mechanism has a precise job and the composition is tested too.

