By NHI Mgmt Group Editorial TeamDomain: Workload IdentitySource: ngrokPublished March 13, 2026

TL;DR: Kubernetes IP addresses are too fragile to prove workload identity, so ngrok adds pod metadata to Traffic Policy on Kubernetes-bound endpoints in v0.22.1, enabling namespace-scoped deny rules and fail-closed handling when identity cannot be resolved. The real shift is from network-location trust to Kubernetes-attested workload identity, which changes how teams govern internal access.


At a glance

What this is: ngrok's Kubernetes pod identity variables let Traffic Policy evaluate the calling pod's name, namespace, UID, and annotations instead of relying on IP address proxies.

Why it matters: This matters because identity teams need enforceable workload identity controls for Kubernetes services, especially where namespace boundaries and connection-time decisions determine whether access is allowed.

By the numbers:

👉 Read ngrok's pod identity guide for Kubernetes Traffic Policy details


Context

IP addresses are a poor identity signal in Kubernetes because pods are ephemeral, IP ranges are reused, and network-layer location does not describe the workload making the request. That makes internal service access control dependent on stronger workload identity signals, especially for NHI governance in multi-tenant clusters and namespace-separated environments.

ngrok's approach shifts policy decisions to connection time by resolving pod metadata and attaching it to Traffic Policy expressions. That gives IAM and platform teams a way to enforce namespace-scoped access with a real workload identity claim instead of assuming that network position implies trust.


Key questions

Q: Why do workload identities matter in Kubernetes security decisions?

A: Because a pod compromise often becomes a credential problem within minutes. If the workload can reach service accounts, tokens, or cloud credentials, the incident can move from container intrusion to wider access. That is why Kubernetes security and NHI governance need to be reviewed together, not as separate control domains.

Q: Why do IP-based controls fail for Kubernetes workload access?

A: IP-based controls fail because pods are ephemeral, addresses are reused, and a transport address does not identify the workload behind the connection. In Kubernetes, access decisions need a stable identity claim that survives cluster churn and maps to the actual pod, not the node or network segment.

Q: What should teams do when pod identity cannot be resolved?

A: Default to fail-closed for sensitive services and deny the connection until the caller can be identified. Allowing unresolved identity through creates a bypass path that is hard to detect and easy to normalise during rollout or transient CNI issues.

Q: How do namespace-scoped policies change Kubernetes access governance?

A: They turn namespace into an enforceable boundary rather than a naming convention. That helps teams align platform segmentation with identity policy, but only if the namespace value is controlled, reviewed, and used consistently across services and environments.


Technical breakdown

Why IP address-based identity fails in Kubernetes

Kubernetes breaks the assumption that a source IP uniquely identifies a workload. Pods are transient, node networking can blur origin, and CIDR reuse means the same address can map to different workloads over time. In that environment, authentication at the network edge is not enough for internal service authorization. A policy engine needs a workload-bound identity primitive that survives pod churn and reflects the actual caller rather than the transport path it used.

Practical implication: stop using IP address as the authorisation key for east-west service access in Kubernetes.

How pod metadata becomes a policy signal

When a connection arrives on a Kubernetes-bound endpoint, the operator resolves the originating pod and exposes fields such as UID, name, namespace, and annotations in conn.k8s.pod.*. This is not request-by-request re-evaluation. Identity is resolved once at connection establishment, so the policy decision depends on the state available at that moment. That makes the control closer to session admission than to application-layer inspection.

Practical implication: place identity checks at connection admission, not after traffic has already reached the service.

Fail-closed policy for missing pod identity

Pod identity resolution can fail briefly after startup or when the network layer does not preserve source information. In those cases, policies should treat error_code as a security state, not an inconvenience. Fail-open preserves connectivity but creates a bypass path whenever identity cannot be established. Fail-closed removes that ambiguity by denying connections when the caller cannot be resolved, which is the safer default for sensitive internal services.

Practical implication: define explicit deny behaviour for unresolved identities instead of allowing transient resolution failures to bypass policy.


NHI Mgmt Group analysis

Pod identity is becoming the minimum viable control for Kubernetes workload trust. IP-based trust collapses as soon as workloads are ephemeral and namespace boundaries matter. Once policy can evaluate the pod that initiated the connection, the identity plane can finally distinguish between workloads that share infrastructure but should not share access. Practitioners should treat pod identity as a baseline control for service-to-service governance.

Namespace scoping is the right abstraction for many internal service controls, but only when it is enforced at connection time. Kubernetes namespaces already segment operational responsibility, yet that segmentation does not automatically become an access control boundary. Policy that checks conn.k8s.pod.metadata.namespace before forwarding traffic turns a naming construct into an enforceable trust boundary. That matters for NHI governance because service identity often lives inside platform metadata, not human-managed directories.

Ingress-style network controls are not enough when the caller is a workload. The article shows that the upstream service should never see traffic from unresolved or out-of-scope pods. That is a governance position as much as a technical one: if the identity cannot be resolved, the connection should be treated as unauthorized by default. Teams that still rely on transport-layer segregation are leaving workload identity to inference rather than policy.

Workload identity in Kubernetes should be evaluated as part of identity lifecycle, not only runtime access. Pod name, namespace, UID, and annotations are useful only if teams can govern what those fields mean over time. If namespaces are reused loosely or annotations are unmanaged, the policy surface becomes noisy and brittle. The practical conclusion is that runtime enforcement and metadata governance have to move together.

Pod metadata policies sharpen the identity blast radius inside clusters. A compromised pod should not inherit the trust of its node, namespace peers, or application tier by default. By forcing explicit workload claims at connection time, security teams can reduce the lateral movement window that comes from assuming cluster internal traffic is inherently trusted. The implication is tighter separation between platform convenience and access authority.

From our research:

What this signals

Pod identity is where Kubernetes governance starts to look like real identity management. When service access depends on workload metadata instead of IP locality, platform teams have to think about ownership, lifecycle, and policy drift together. That is especially relevant in environments where machine identities already outnumber human identities, because unmanaged growth quickly overwhelms informal controls.

Namespace scoping will only hold up if teams manage annotations, exceptions, and endpoint bindings as part of the identity program, not as ad hoc platform settings. Readers who already rely on the Ultimate Guide to NHIs should extend that thinking into Kubernetes admission and connection policy, where workload trust actually becomes enforceable.


For practitioners

  • Define namespace-scoped allow rules Use pod namespace as the first policy boundary for Kubernetes-bound endpoints, and deny any connection whose namespace does not match the service's trust boundary.
  • Fail closed when identity cannot be resolved Treat conn.k8s.pod.metadata.error_code as a deny condition for sensitive services so transient registration gaps or CNI issues do not create silent bypasses.
  • Restrict policies to Kubernetes-bound endpoints Apply pod identity enforcement only where kubernetes binding exists, and document that public or internal endpoints do not receive these variables.
  • Audit annotation usage before relying on it Inventory which k8s.ngrok.com annotations are security-relevant, then validate that teams are not using mutable metadata as an implicit trust signal.
  • Review hostNetwork exceptions separately Exclude hostNetwork: true workloads from pod identity assumptions and require a different control path for those services because node IP sharing breaks unique identification.

Key takeaways

  • Kubernetes IPs do not prove workload identity, so access control based on address alone is too weak for service-to-service governance.
  • Connection-time pod metadata lets teams enforce namespace boundaries and reject unresolved callers before traffic reaches upstream services.
  • Fail-closed policy is the safer model for sensitive endpoints because unresolved identity should be treated as unauthorized, not tolerated.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-01The article is about workload identity rather than IP-based trust.
NIST CSF 2.0PR.AC-4Namespace-scoped policy enforces least-privilege access between workloads.
NIST Zero Trust (SP 800-207)Connection-time verification fits zero trust principles for internal traffic.
NIST SP 800-53 Rev 5AC-6Least privilege is the control principle behind namespace-restricted access.

Treat each pod connection as untrusted until identity is resolved and policy is evaluated.


Key terms

  • Workload Identity: The identity assigned to a software workload — such as a containerised application, serverless function, or microservice — enabling it to authenticate to other services without storing static credentials.
  • Namespace-Scoped Policy: Namespace-scoped policy is an access control pattern that allows or denies traffic based on the Kubernetes namespace a pod belongs to. It becomes useful only when the namespace is treated as governed identity metadata rather than a loose organisational label.
  • Fail-Closed Access Control: Fail-closed access control denies traffic when the system cannot verify the caller's identity. It is the safer posture for sensitive services because an inability to resolve identity is handled as a security condition, not as a reason to continue.
  • Request-time Authorisation: Request-time authorisation is the practice of checking policy at the moment an action is attempted rather than only at login or provisioning. For AI agents, this matters because identity context and tool choice can change during a session, so earlier decisions may no longer be valid.

What's in the full article

ngrok's full post covers the operational detail this post intentionally leaves for the source:

  • The exact Traffic Policy expressions for namespace allowlisting and deny conditions.
  • The full list of pod identity variables available under conn.k8s.pod.* and how each one behaves.
  • Guidance for handling resolution failures, hostNetwork edge cases, and rollout choices between fail-open and fail-closed.
  • Examples of allowlisting specific pods by name and using annotations in multi-tenant cluster designs.

👉 ngrok's full post includes policy examples, identity variable behaviour, and rollout considerations for Kubernetes-bound endpoints.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org