DEV Community

johnettagaweraks
johnettagaweraks

Posted on

Consul intentions fail open when the default policy is unclear

Consul intentions fail open when the default policy is unclear

Consul Connect uses service identities and intentions to decide whether one workload may connect to another. The model looks simple until an intention does not match. That gap is where a default policy decides the outcome. If the default is allow, a missing rule permits traffic. If the default is deny, a missing rule blocks it. The same policy may also inherit behavior from the ACL default policy when no explicit default intention exists.

The Consul security guidance recommends a default deny posture with explicit allows. That recommendation is not a preference about UI design. It determines whether a typo, a renamed service, or a delayed configuration synchronization produces an outage or an unauthorized connection. A failure that blocks traffic is visible and can be corrected. A failure that opens traffic may not produce an error at all.

Intentions also need a useful identity source. Consul service identity is carried through the mesh and can be expressed through service names, namespaces, partitions, and other scope. An allow rule for a name is not automatically safe if an untrusted workload can register that name. Limit service registration to trusted operators. Review which identities can create or change service definitions. Then check that the intention refers to the intended scope, not a broad name that another team can claim.

Layer 4 intentions control connections. Application-layer intentions can evaluate HTTP methods, paths, and headers. Do not use a broad L4 allow for an administrative service and assume the application will enforce the rest. If a rule needs an HTTP-path restriction, test a denied path through the actual sidecar or gateway. Header-based rules are only as trustworthy as the proxy path that supplies and protects those headers.

The default policy should be explicit in configuration management. Avoid relying on a server default that may differ between a new cluster and an older installation. Put the intended default, the ACL default, and the exception list in the same reviewed artifact. Generate a diff before applying it. Alert when the number of allow intentions or wildcard sources changes unexpectedly.

Break-glass access needs its own path. A temporary broad allow is easier to audit than an emergency change to the global default. Give it an expiry, an owner, and a reason. Remove it when the incident closes. Do not leave a blanket source in place because the original change ticket is hard to reconstruct later.

Test negative cases, not only successful connections. A service that should be denied should fail after its identity is changed, after the source namespace changes, and after the destination is redeployed. If the denial does not survive those changes, the policy is not doing the work the team thinks it is doing.

Intentions are an authorization layer for service communication. The safest implementation starts from deny, uses narrow identities, and treats every allow rule as a reviewed exception.

References

Top comments (0)