Showing posts with label Policy as Code. Show all posts
Showing posts with label Policy as Code. Show all posts

Saturday, July 4, 2026

Network Observability as a Design Primitive: Proving the Path, the Policy, and the Promise

Why modern networks need observability designed into the architecture—not bolted on after the first outage

Published: July 2026
Estimated reading time: 16 min

Modern networks do not fail quietly. A SaaS application slows down, a voice path becomes choppy, a cloud interconnect starts dropping just enough packets to irritate users, or an EVPN fabric learns the wrong thing in the wrong place. The first question is usually simple: what changed? The harder question is more useful: which path, which policy, which device state, and which user-visible outcome changed together?

That is why observability belongs in the architecture. Monitoring tells you whether something is up or down. Observability lets you explain behaviour across layers: control plane, forwarding plane, overlay, underlay, policy, application experience, and change history. It turns “the network looks fine” into evidence: the path changed at 09:14, the BGP best path moved to a backup egress, queue drops increased on class AF41, and the application p95 latency doubled for users behind two branches.

This July 2026 article continues the control-plane arc from IS-IS and BGP hygiene, but shifts the focus from routing correctness to operational proof. You do not have a guarantee unless you can prove it. You do not have policy unless you can show where it applied. You do not have resilience unless you can explain what the network did during failure and recovery.

1) Observability is not a dashboard layer

A dashboard is an output. Observability is a design property. The difference matters. If you build the network first and attach dashboards later, you usually collect what is easy: interface counters, device CPU, maybe BGP session state, maybe flow records. Useful, but incomplete. You can see symptoms without understanding relationships.

Designed observability starts with the operational questions the network must answer. For example: can we prove which path a critical application used? Can we tell whether a policy change affected only the intended segment? Can we distinguish provider loss from local queueing? Can we correlate a control-plane event with user impact? Can we validate that a premium service class stayed within its loss/jitter envelope during maintenance?

  • Monitoring asks: is the interface up?
  • Observability asks: did the application path, policy, and performance stay within the expected envelope?
  • Monitoring asks: did BGP flap?
  • Observability asks: which routes changed, which traffic shifted, and what did users experience?
  • Monitoring asks: is the firewall passing traffic?
  • Observability asks: which contract, rule, or service path allowed or denied the flow?

The practical shift is from device health to service evidence. Device health remains necessary, but it is not enough.

2) The observability contract: path, policy, performance, and change

A useful network observability design gives every important flow four kinds of context: path, policy, performance, and change. Without all four, troubleshooting becomes a series of partial guesses.

  • Path: which underlay, overlay, next-hop, tunnel, SR policy, SD-WAN colour, or EVPN service carried the traffic?
  • Policy: which route policy, contract, firewall rule, QoS class, NAT decision, or ZTNA/SASE rule applied?
  • Performance: what loss, latency, jitter, throughput, queue drops, retransmits, and application response patterns appeared?
  • Change: what config, software, route, topology, maintenance, certificate, identity, or provider event occurred nearby in time?

The value comes from correlation. A route withdrawal is interesting. A route withdrawal plus a traffic shift plus queue drops plus user complaints is an incident narrative. A policy change is interesting. A policy change plus denied flows from one segment plus no impact elsewhere is validation.

Observable flow record (conceptual)
    Who/what:
      user/site/application/tenant/segment
    Path:
      ingress edge -> overlay -> transport -> egress edge -> service path
    Policy:
      route policy / security policy / QoS policy / service chain
    Performance:
      latency, jitter, loss, drops, retransmits, p95/p99 response time
    Change:
      config diff, routing event, failover, software update, provider maintenance

3) Telemetry sources: collect signals with a purpose

Network telemetry is now a broad discipline. The IETF Network Telemetry Framework describes generation, collection, correlation, and consumption of operational data as a system, not as isolated counters. That framing is useful: telemetry does not become observability until it is correlated and consumed in a way that answers operational questions.

3.1 Device and interface telemetry

Interface counters still matter. Errors, discards, drops, optics levels, queue depth, shaping drops, buffer pressure, CPU, and memory remain the basic health signals of the network. The problem is not that counters are old; the problem is that counters are often treated as the whole truth.

For modern networks, polling alone is often too slow or too coarse. Streaming telemetry, model-driven telemetry, and YANG-based data models give operators a more structured way to subscribe to operational state. The important design decision is not “SNMP or streaming telemetry.” It is: what signal do we need, at what granularity, with what labels, and for which operational decision?

3.2 Flow telemetry

Flow data (NetFlow, IPFIX, sFlow, vendor flow logs, cloud flow logs) tells you who talked to whom, how much, and sometimes which application or policy matched. It is invaluable for traffic engineering, security investigation, capacity planning, and proving whether traffic used the expected egress path.

Flow data also has limits. Sampling can hide microbursts. Export delays can blur sequence. NAT, overlays, and encryption can hide identity. Good observability designs enrich flow records with segment, tenant, site, application identity, and path context instead of treating five-tuples as self-explanatory.

3.3 Control-plane telemetry

BGP, IS-IS, OSPF, EVPN, LDP, RSVP-TE, SR policies, and SD-WAN control channels all emit operational truth. If the path changes, the control plane usually knows first. Observability should capture route churn, best-path changes, prefix count shifts, adjacency state, route-target imports, SID advertisements, and policy outcomes.

Control-plane telemetry prevents a common failure mode: application teams see a slowdown, device dashboards look green, and nobody checks whether the traffic quietly moved from a low-latency path to a congested backup path. Routing state is user experience data when you map it to services.

4) Metrics that matter: averages are where incidents hide

Averages are seductive because they are easy to graph. They are also where incidents hide. Users feel the tail: the 95th percentile, the 99th percentile, the bursts of packet loss, the short periods of jitter, and the intermittent retransmit storms. A network can have acceptable average latency and still deliver a poor real-time or SaaS experience.

  • Latency: measure one-way where possible, round-trip where practical, and always label the measurement path.
  • Jitter / delay variation: critical for voice, video, market data, industrial control, and any real-time flow.
  • Loss: track both sustained loss and burst loss; micro-loss matters more than many dashboards admit.
  • Queue drops: prove whether congestion is local, provider-side, or somewhere in a service chain.
  • Goodput: distinguish link utilisation from useful application throughput.
  • Control-plane churn: route changes per minute can explain symptoms that interface graphs miss.

Standards work around IP performance metrics, alternate marking, MPLS loss/delay measurement, and IOAM all exists because operators need more than up/down signals. They need proof of path behaviour under real traffic and real failure conditions.

5) Path proof: show where the packet actually went

Path proof is one of the most valuable observability outcomes. In simple networks, traceroute and routing tables may be enough. In modern networks, they rarely are. Overlays, ECMP, SR policies, EVPN, SD-WAN steering, cloud gateways, firewalls, NAT, proxies, and SASE points of presence can all change the effective path.

A strong design combines multiple sources: forwarding state, control-plane intent, active probes, flow logs, service-chain logs, and where available, in-situ or on-path telemetry. No single method is universal. The goal is to converge on evidence quickly.

  • Routing state: what path should the network choose?
  • Forwarding state: what path is actually programmed?
  • Probes: what do synthetic measurements show from the relevant edge?
  • Flow records: where did real traffic go?
  • Service logs: did a firewall, proxy, ZTNA connector, or load balancer alter the path?
  • On-path telemetry: where supported, what did packets observe while traversing the network?

This is where observability becomes architectural. If your service design includes a firewall, proxy, cloud on-ramp, or SR policy, design the evidence path at the same time as the forwarding path.

6) Policy proof: show why the network made the decision

Policy is the promise the network makes: this segment may talk to that service, this class receives that treatment, this prefix exits through that peer, this user reaches that app through that access path. Observability must prove not only what happened, but why.

In ACI, that means contracts, EPGs, bridge domains, L3Outs, and service graphs. In SD-WAN, it means app-aware routing policy, SLA classes, VPN/VRF segmentation, and security service insertion. In BGP, it means prefix sets, route policies, communities, local preference, AS-path rules, and export/import controls. In SASE and ZTNA, it means identity, device posture, destination, connector, and policy match.

The anti-pattern is familiar: “the policy is there” but nobody can prove whether it matched the specific flow. A better model logs policy decisions as first-class evidence, with enough labels to correlate them to routes, flows, and user impact.

Policy proof examples

    BGP:
      prefix X accepted from peer Y by policy IN-PEER; tagged community A:B:C
    SD-WAN:
      application voice matched SLA class REALTIME; selected MPLS path; internet path violated jitter threshold
    ACI/EVPN:
      endpoint moved to EPG APP-WEB; contract WEB-TO-API allowed TCP/443; RT import matched tenant VRF
    SASE/ZTNA:
      user/device matched policy CORP-MANAGED; private app allowed through connector group NZ-DC-A

7) Change correlation: the missing layer in many NOCs

Many incidents are not mysterious; they are uncorrelated. A change happens in one tool, telemetry lives in another, tickets live somewhere else, and routing events are buried in device logs. By the time engineers assemble the story, the outage is already political.

Treat change as telemetry. Every config deployment, policy update, software upgrade, certificate rotation, cloud route-table change, firewall commit, SD-WAN template push, and provider maintenance notice should become a timestamped event that can be correlated with network signals.

  • Tag deployments: include change ID, owner, scope, intended effect, and rollback reference.
  • Correlate time windows: show telemetry before, during, and after the change.
  • Track blast radius: identify which sites, tenants, prefixes, policies, and apps were in scope.
  • Measure success: prove the intended effect occurred and unintended effects did not.

This is where policy-as-code and observability reinforce each other. A change pipeline should not end with “config pushed.” It should end with “state verified.”

8) Observability by domain

8.1 Service provider and IP transport

In service provider and large transport networks, observability focuses on routing scale, path guarantees, capacity envelopes, and service isolation. The relevant questions are: did the PE learn the expected VPN routes? Did SR policy steer traffic to the intended path? Did a maintenance event push premium traffic into a lower-capacity failure path? Did QoS protect voice, enterprise VPN, or wholesale traffic during congestion?

8.2 Enterprise WAN and SD-WAN

In enterprise WANs, the goal is user experience and deterministic steering. Which transport did the branch use? Did the app match the intended class? Did a SaaS path exit locally, through a SASE PoP, or through a hub? Did cellular failover save the branch but introduce enough jitter to degrade calls? SD-WAN dashboards help, but the architecture should also export evidence into the broader operational system.

8.3 Data centre, EVPN, and campus fabrics

In data centre and campus fabrics, observability must include endpoint location, MAC/IP mobility, route-target imports, multihoming state, ARP/ND suppression behaviour, and BUM containment. A fabric can have healthy switches and still have a broken service if the endpoint sits in the wrong segment, the wrong route target imports, or the wrong border policy exports.

8.4 Cloud and SASE

Cloud networks add another truth source: provider route tables, flow logs, gateways, private endpoints, load balancers, and policy engines. SASE adds PoP selection, proxy decisions, TLS inspection outcomes, identity posture, and connector state. If these signals stay separate from network telemetry, troubleshooting turns into a multi-team relay race.

9) Build the telemetry pipeline deliberately

Collecting more data is easy. Making data useful is harder. A telemetry pipeline should enrich, normalise, reduce, and route signals to the right consumers. Raw device counters, flow exports, cloud logs, SD-WAN events, and application traces need shared labels: site, tenant, segment, service, application, device role, policy domain, and change ID.

  • Enrich: add business and topology context that devices do not know by themselves.
  • Normalise: use consistent names, units, labels, and severity semantics across vendors.
  • Reduce: aggregate where safe, sample where necessary, but preserve high-fidelity data for critical services.
  • Route: send real-time alerts, historical analytics, capacity planning, and security detections to the right systems.
  • Govern: control retention, access, privacy, and cost; observability data can become expensive and sensitive.

This is where OpenTelemetry-style thinking becomes useful even for network teams: common naming, resource attributes, metrics, logs, traces, and cross-signal correlation. The network does not need to mimic application tracing exactly, but it benefits from shared semantics.

10) SLOs for networks: turn telemetry into promises

Observability becomes powerful when it supports service-level objectives. A network SLO should describe an outcome users or services care about, not just a device property. “Interface uptime 99.99%” is weaker than “payment traffic from stores to the processor stays below 40 ms RTT and below 0.1% loss during business hours, excluding planned maintenance.”

  • Real-time SLO: latency, jitter, loss, steering stability, and queue-drop budgets.
  • Cloud interconnect SLO: path availability, throughput, route stability, and failover time.
  • Fabric SLO: endpoint reachability, EVPN route stability, and convergence after leaf/spine failure.
  • Security path SLO: inspection availability, proxy latency, connector health, and policy decision latency.

The point is not to create perfect contracts. The point is to align telemetry with the promises the network makes. If you sell “resilient,” measure recovery. If you sell “segmented,” measure denied cross-segment attempts and approved policy paths. If you sell “premium,” measure the premium class during congestion and failure.

11) Common observability mistakes

  • Collecting everything without context: high volume, low meaning, high cost.
  • Trusting averages: hiding tail latency, burst loss, and intermittent jitter.
  • Separating change from telemetry: forcing engineers to reconstruct timelines manually.
  • Ignoring the control plane: missing the routing event that explains the user symptom.
  • Building vendor islands: leaving SD-WAN, cloud, firewall, and fabric telemetry in separate consoles.
  • Confusing alerting with observability: alerts tell you something may be wrong; observability helps explain why.

The cure is design discipline. Decide what questions matter, what evidence answers them, and what labels make correlation possible. Then build the pipeline around those needs.

12) A practical architecture pattern

Network observability architecture (conceptual)

Sources:
      - device state and counters
      - streaming telemetry / YANG data
      - flow records (NetFlow/IPFIX/sFlow/cloud flow logs)
      - control-plane events (BGP/EVPN/IGP/SR/SD-WAN)
      - policy decisions (firewall, ACI, SASE, ZTNA, QoS)
      - active probes and synthetic transactions
      - change events and deployment metadata

Pipeline:
      - collect -> enrich -> normalise -> correlate -> store -> route

Context:
    - topology, inventory, site, tenant, segment, app, service, owner, change ID

Consumers:
    - NOC/SRE dashboards
    - incident response
    - capacity engineering
    - security analytics
    - service assurance / SLA reporting

This pattern is intentionally boring. It is also effective. The sophistication lives in the labels and correlations, not in the number of charts.

13) Checklist: is observability part of your design?

  • Can you prove the actual path a critical flow used, not just the intended route?
  • Can you show which policy allowed, denied, steered, or transformed the flow?
  • Can you correlate route changes, config changes, and user impact on one timeline?
  • Do you measure percentiles and bursts, not only averages?
  • Do your telemetry labels include site, segment, app, tenant, service, and owner?
  • Do you capture control-plane state for BGP, EVPN, IGP, SR, SD-WAN, and cloud routing where relevant?
  • Can you validate that a change produced the intended state and did not widen blast radius?
  • Do you know what data you retain, where it goes, who can access it, and what it costs?

14) Closing: observability is how architecture becomes accountable

The modern network is too dynamic for confidence based on static diagrams. Paths change, policies evolve, overlays move endpoints, clouds hide infrastructure, and security controls make forwarding decisions outside the traditional router. You need evidence that crosses those boundaries.

Observability is the accountability layer for architecture. It proves that the path matched the design, the policy matched the intent, the performance matched the promise, and the change did not exceed its blast radius. When you design observability this way, troubleshooting becomes less heroic and operations becomes more honest.

References and standards anchors

  • RFC 9232 — Network Telemetry Framework
  • RFC 9378 — In Situ Operations, Administration, and Maintenance (IOAM) Deployment
  • RFC 9341 — Alternate-Marking Method for packet loss, delay, and jitter measurements
  • RFC 9714 — Encapsulation for MPLS Performance Measurement with the Alternate-Marking Method
  • RFC 6374 — Packet Loss and Delay Measurement for MPLS Networks
  • OpenTelemetry Semantic Conventions — common naming for telemetry signals and resources.
Tags: Network Observability, Telemetry, Streaming Telemetry, YANG, OpenTelemetry, IOAM, Alternate Marking, Flow Telemetry, NetFlow, IPFIX, SNMP, BGP, EVPN, Segment Routing, SD-WAN, QoS, SLO, Troubleshooting, Change Correlation, Operations, Policy as Code
Eduardo Wnorowski

Eduardo Wnorowski is a systems architect, technologist, and Director. With over 30 years of experience in IT and consulting, he helps organizations maintain stable and secure environments through proactive auditing, optimization, and strategic guidance.
LinkedIn Profile

Thursday, June 4, 2026

BGP Hygiene in 2026: Preventing Leaks, Containing Blast Radius, and Keeping Policies Human

A practical playbook for route policy design, guardrails, and operations—usable across service provider backbones, enterprise WANs, EVPN fabrics, and cloud interconnects.

Published: June  2026
Estimated reading time: 16 min

BGP keeps modern networks standing. It also keeps operators humble. A single policy mistake can leak routes, black-hole traffic, or turn a private backbone into accidental transit. Most BGP incidents are not caused by exotic protocol flaws—they come from ordinary human and process failure: a filter that is too broad, a community that is misunderstood, a redistribution that escapes, or an automation job that pushes the wrong intent.

In 2026, BGP shows up everywhere: internet edge, inter-DC fabrics (EVPN underlays and overlays), cloud interconnects, campus cores, and SD-WAN hubs. The same hygiene principles apply across all of them. You want policy that stays readable, guardrails that fail safe, and operational signals that tell you what the routing system is doing before customers do.

That broad footprint changes the audience. BGP is no longer only an internet-edge or carrier-core skill. Enterprise teams use it for cloud interconnects, SD-WAN hubs, data-centre borders, EVPN fabrics, and private WAN segmentation. Corporate networks therefore need the same policy hygiene that service providers have learned the hard way, even when the prefix counts are smaller.

This post focuses on hygiene—design patterns and operational disciplines that keep BGP predictable. It gives you practices that reduce incident probability, reduce blast radius when an incident happens, and reduce time-to-truth when you troubleshoot.

1) What “BGP hygiene” means in practice

BGP hygiene is not 'adding more knobs' but the ability to answer four questions consistently:

  • What do I accept? Which prefixes, which families, from which peers, under which conditions?
  • What do I advertise? Which prefixes do I export, and how do I ensure I never export more than I mean to?
  • How do I contain failure? If a peer misbehaves, if a policy deploy goes wrong, or if a RR fails, how far does the impact spread?
  • How do I prove behavior? Can I correlate an incident to a policy change, a peer event, or a churn pattern quickly?

If your routing system can answer those questions with evidence, you operate BGP like an engineered product. If it cannot, you operate it like folklore.

2) Threat model: BGP failures look boring right up until they’re not

BGP failures usually fall into a few categories. Naming them helps you design guardrails that map to reality.

  • Route leaks: unintended export or accidental transit (customer routes to peers/upstreams, lab routes to production, default routes to the wrong place).
  • Origin mistakes: advertising a prefix you do not own or do not intend to announce (fat-finger, stale config, automation mismatch).
  • Policy drift: one device or one region runs a different policy than the rest, often due to manual edits or partial automation rollout.
  • Control-plane overload: churn storms that create CPU pressure, queueing, and delayed convergence.
  • Security failures: sessions that form unexpectedly, weak peer authentication, or acceptance of clearly invalid routes.

Good hygiene acknowledges that you will not prevent every event. The goal is to prevent the common ones and make the uncommon ones survivable.

3) Guardrail #1: default-deny your routing policy

The cleanest BGP policy pattern mirrors security: default deny, explicit allow. You do not accept routes just because a session is up, and you do not advertise routes just because they exist in the RIB.

3.0 Default-deny is not just good taste; it is modern BGP hygiene

RFC 8212 formalises a principle many operators already follow: an eBGP session should not exchange routes unless explicit import and export policy exists. A newly configured eBGP neighbour should be silent by default until policy says otherwise. This turns “forgot to write policy” into “nothing passes,” rather than “everything leaks.”

Not every platform enables this behaviour by default, and brownfield networks may have legacy expectations. Treat that as an audit item. If your platform supports RFC 8212-style behaviour, enable it deliberately and document it. If it does not, emulate the behaviour with explicit deny policies attached to every new peer template.

3.1 Inbound: accept only what the peer role allows

Start by classifying peers by role. Three roles cover most cases: customer, peer, and provider (upstream). Each role implies a different acceptance contract.

  • Customer: accept only the customer’s prefixes (and only the address families you intend). Reject everything else by default.
  • Peer: accept only what your peering policy permits (often internet routes), never internal infrastructure. Apply max-prefix and hygiene checks.
  • Provider: accept routes required for your service (full table for internet edge; constrained sets for private backbones). Apply strict max-prefix and validity checks.

Write filters that match the contract. Make them readable and testable. If you cannot explain an inbound policy in a sentence, you probably cannot operate it safely.

3.2 Outbound: advertise only what you can defend

Outbound policy causes the most expensive incidents because it exports your mistake to other networks. A safe outbound pattern uses explicit prefix-sets that represent “things we are allowed to announce.”

Avoid exporting based on broad tags like “connected” or “static” unless you also apply a strict allow-list. If you must redistribute, redistribute into BGP via controlled policy objects that require explicit prefix approval.

Conceptual export pattern (vendor-neutral)

- Define prefix-set: OUR_PUBLIC_PREFIXES
- Define prefix-set: OUR_INFRA_PREFIXES (if needed for private peering)
- Export policy:
    - If neighbor is upstream/peer: allow OUR_PUBLIC_PREFIXES only
    - If neighbor is customer: allow default + selected services; never full table unless explicitly sold
    - Else: deny

Principle: "export lists are curated, not discovered"

4) Guardrail #2: max-prefix is not optional

Max-prefix (or an equivalent route limit) is a blunt tool that prevents your box from becoming a garbage collector for someone else’s accident. It does not make a bad policy good, but it stops runaway damage.

Set max-prefix per neighbor role. Use conservative thresholds and alert early. Decide what the router should do when the threshold hits: shutdown the session, warn only, or apply a damping behavior. Session shutdown can be safer than accepting a bad flood, but it must align with redundancy and failover design.

  • Customer max-prefix: very small (exactly what they own + growth headroom).
  • Peer max-prefix: bounded; consider separate limits by address family.
  • Upstream max-prefix: full table sized + headroom, with alerting and clear operational procedures.

Max-prefix also catches internal mistakes: a redistribution bug, a route reflector leak, or a testbed prefix-set that escapes into production.

5) Guardrail #3: build a community taxonomy that stays human

BGP communities are powerful because they encode intent without rewriting policies everywhere. They are also dangerous because they can become magic numbers nobody remembers. Hygiene means communities behave like a documented API.

5.1 Prefer structured large communities for scale

Standard communities remain useful, but they can become cramped in large or multi-AS environments. Large Communities give operators a three-field structure that works cleanly with four-octet ASNs and supports human-readable taxonomies. The exact numbers matter less than the rule: encode meaning in a consistent layout, document it, and avoid turning communities into tribal knowledge.

Example large community taxonomy (conceptual)

Category 10xx = ingress source
  1001 = from-customer
  1002 = from-peer
  1003 = from-upstream

Category 20xx = action hints
  2001 = no-export-to-peers
  2002 = no-export-to-upstreams
  2003 = prepend-on-peer-group-A

Category 30xx = service scope
  3001 = internet
  3002 = private-core
  3003 = management-only

Goal: "routes carry their contract"

5.2 Communities should not replace explicit filters

Communities are labels, not safety rails. You still apply prefix filters and max-prefix. Communities help reduce policy repetition, but they should not be the only thing preventing leaks.

A simple rule works well: communities can reduce scope safely, but communities should never be the only mechanism that expands scope. If a single missing community turns a deny into an allow, you build a fragile system.

6) Blast radius control: route reflectors and hierarchy

Route reflectors make BGP scale, but they also create failure domains. Hygiene means you design RR topology so a single RR problem does not become a fleet-wide event.

6.1 RR design principles that keep the system quiet

  • Hierarchy by failure domain: keep regional RRs regional; avoid a single global RR plane unless you truly need it.
  • Redundancy with diversity: provide at least two reflectors per domain and avoid shared fate (same rack/power/ToR).
  • Limit reflection scope: separate internet edge, EVPN, and internal services where it reduces churn coupling.
  • Graceful maintenance: drain sessions deliberately and validate route stability during maintenance windows.

If you run one global RR mesh, treat it like critical infrastructure: strict change control, strict monitoring, and well-rehearsed rollback.

6.2 Contain churn: BGP PIC and add-path where appropriate

Operators increasingly expect faster restoration than “wait for BGP to reconverge.” BGP PIC-style approaches reduce convergence impact by precomputing alternates so a failure does not trigger a full best-path recomputation across the whole network. Add-path can improve multipath behavior and reduce route oscillation in some designs.

Treat these features as engineering tools, not default toggles. Enable them when you can explain what failure mode they improve and how you verify they behave correctly in your topology.

6b) Graceful maintenance: avoid creating your own churn storm

Good BGP hygiene includes maintenance behaviour. Operators create avoidable incidents when they drain links or sessions too abruptly. A safer pattern makes routes less preferred before removing them, waits for traffic to move, then takes the session or device out of service.

  • Use planned de-preference: apply local-preference changes, graceful-shutdown communities where supported, or controlled prepending to move traffic before the hard event.
  • Drain in stages: move one peer, one edge, or one region at a time; validate route counts and traffic shift before continuing.
  • Mind route refresh: policy changes may require route refresh or session resets depending on platform and feature support. Verify Adj-RIB-In/Out behaviour before assuming the change is active.
  • Validate both directions: inbound and outbound path movement may not be symmetrical. Stateful applications and firewalls care about this.

Maintenance is where “human” BGP policy matters most. If the drain procedure requires five engineers to remember five different conventions, it is not hygiene—it is luck.

7) Validity and provenance: accept fewer lies

BGP hygiene improves dramatically when you treat route validity as a first-class property. In internet edge contexts, RPKI origin validation helps you identify whether a prefix is originated by an authorised ASN. That catches a common class of prefix hijack and mis-origination mistakes.

RPKI is not magic. It validates origin, not the entire AS path. A route can be RPKI-valid and still be undesirable due to policy, traffic-engineering risk, or suspicious path shape. Treat RPKI as a strong guardrail, not as a replacement for prefix filters, role-aware policy, monitoring, or operational judgement.

IRR-based filtering remains useful when you need to build and maintain prefix sets from registered routing objects, but IRR data can be stale or inconsistent. Use it as an input to a controlled filter-generation process, not as blind truth. In private networks, the equivalent is a curated source of truth for what each site, tenant, or cloud interconnect is allowed to advertise.

7.1 Route-leak prevention: BGP roles and OTC

Route leaks often happen because a route learned from a peer or provider gets advertised to another peer or provider. BGP roles and the Only-To-Customer (OTC) attribute give the protocol a way to express the business relationship on the session and mark routes so inappropriate propagation can be prevented or detected. Where supported, these mechanisms provide an additional safety layer on top of traditional route policy.

The important part is the relationship model. Every eBGP session should have a defined role: customer, provider, peer, route-server client, or internal/private equivalent. Once you define the role, policy becomes easier to reason about: customer-learned routes may be propagated more broadly; peer/provider-learned routes should not be propagated to other peers/providers unless a deliberate product design says otherwise.

8) Keep BGP policy readable: patterns that scale across vendors

Readable policy follows a few rules: keep it modular, keep it named, and keep it testable. Many outages happen because the policy is correct in one engineer’s head but not obvious in the configuration.

  • Peer-group templates: define policy once per peer role; apply it through templates rather than per-neighbor hand edits.
  • Prefix-sets and AS-path sets: express intent as named sets; avoid long in-line match statements that drift over time.
  • Small, composable policies: prefer multiple small policies in a clear order over one giant route-map that does everything.
  • Document intent: treat policy like code; future you is a customer.
Policy as readable building blocks (conceptual)

- prefix-set CUSTOMER_123_ALLOWED
- policy INBOUND_CUSTOMER:
    - allow CUSTOMER_123_ALLOWED
    - tag :1001:123 (from-customer)
    - else deny
- policy OUTBOUND_TO_PEERS:
    - allow OUR_PUBLIC_PREFIXES
    - deny everything else

9) Operations: detect badness before the world does

You operate BGP with signals. Hygiene means you treat these signals as part of the system design.

  • Route volume anomalies: sudden prefix count changes per neighbor, per AFI/SAFI, and per policy realm.
  • Origin changes: a prefix suddenly originates from a different AS or appears with a different AS-path shape.
  • Churn: update rate spikes, repeated withdraw/announce loops, or unstable next-hop changes.
  • Policy hit counters: unexpected permit/deny shifts that indicate drift or mis-scoped changes.
  • Validity states: shifts in valid/invalid/unknown ratios that indicate upstream issues.

Build alerts that are role-aware. A customer gaining 10 new prefixes may be normal; a customer gaining 10,000 is a fire. An upstream table growing slightly may be normal; an upstream table doubling instantly usually is not.

10) Policy as code: testing beats confidence

The most effective way to reduce BGP incidents is to treat policy as a tested artifact. Policy-as-code requires three disciplines: version control, repeatable validation, and staged rollout.

  • Version control: store policy objects, prefix-sets, and peer templates in a repo; tag releases.
  • Validation: run lint checks and unit tests that prove “this change does not export what it should not export.”
  • Canaries: deploy to a small set of edge devices first; verify route counts, best paths, and export sets; then expand.
  • Rollback: keep a fast path to revert policy and restore last-known-good behavior.

Simulate policy behavior using lab sessions, replayed route dumps, or digital-twin style tooling. The tool matters less than the habit: do not ship a policy change you cannot explain and you cannot test.

11) Incident response: a calm playbook for a loud protocol

When BGP goes wrong, time matters. A calm playbook keeps you from making it worse.

  • Step 1 — classify the event: leak, origin error, churn storm, or control-plane failure? Choose the correct response path.
  • Step 2 — contain the blast radius: shut down the offending export, apply emergency filters, or drop a session if necessary.
  • Step 3 — restore intent: reapply the correct prefix-set/community policy; confirm exports and imports match expected counts.
  • Step 4 — verify reachability: validate customer experience and confirm restoration does not create a second failure (congestion elsewhere).
  • Step 5 — capture evidence: snapshot route tables, policy diffs, and churn metrics for postmortem.

Postmortems should produce one actionable improvement: a tighter filter, a better canary check, a clearer community taxonomy, or a safer rollout practice. If the postmortem produces only blame, the incident repeats.

11b) Hygiene inside EVPN, cloud interconnects, and enterprise fabrics

BGP hygiene is not limited to public internet routing. EVPN fabrics, cloud interconnects, and enterprise WANs all need the same policy discipline, but the failure modes look different.

  • EVPN: validate route-type expectations, route-target import/export, MAC/IP churn, and multihoming behaviour. A bad RT import can create the data-centre equivalent of a route leak.
  • Cloud interconnects: explicitly control which prefixes you advertise to each cloud and which cloud prefixes you accept. Avoid using cloud route tables as an unreviewed source of truth.
  • Enterprise WANs: prevent branches from becoming transit unless the design requires it. Summarise carefully and keep site advertisements role-aware.
  • Campus and data-centre borders: keep redistribution deliberate. Do not let connected, static, or overlay routes enter BGP without an allow-list.

The pattern repeats: name the peer role, define what it may send, define what you may send back, and monitor deviations.

12) A short checklist you can reuse

  • Default deny: inbound and outbound policies accept/advertise only explicit sets.
  • Max-prefix everywhere: role-aware limits with alerting and clear failure behavior.
  • Community taxonomy: documented and structured; used as labels, not sole safety controls.
  • RR blast radius: hierarchy aligns with failure domains; redundancy avoids shared fate.
  • Validity controls: origin/provenance checks where applicable; curated allowed-advertise lists in private networks.
  • Telemetry: route counts, churn, origin changes, and policy hit counters feed alerts.
  • Policy-as-code: versioned, tested, staged; rollback is rehearsed.
  • Incident playbook: containment first, then restoration, then evidence.

BGP stays quiet when the network makes it hard to do the wrong thing and easy to prove the right thing. That is what hygiene looks like in 2026: fewer surprises, smaller blast radius, and faster truth.

References and standards anchors

  • RFC 8212 — Default External BGP Route Propagation Behavior without Policies.
  • RFC 9234 — Route Leak Prevention and Detection Using Roles in Update and Open Messages.
  • RFC 8092 — BGP Large Communities Attribute.
  • RFC 6811 — BGP Prefix Origin Validation.

 

 

Eduardo Wnorowski is a systems architect, technologist, and Director. With over 30 years of experience in IT and consulting, he helps organizations maintain stable and secure environments through proactive auditing, optimization, and strategic guidance.
LinkedIn Profile

Sunday, March 8, 2026

Policy, Not Ports: Designing Cisco ACI for Deterministic Segmentation, Service Insertion, and Multi-Site Resilience

March 2026 - Reading time: 16 min

Cisco ACI promises something operators have wanted for decades: stop configuring networks as a collection of ports and start operating them as a set of policies. In practice, ACI delivers that promise only when you treat the fabric as a system with clear boundaries, explicit intent, and measurable failure behavior. When you treat it like “a better VLAN tool,” you inherit all the old problems—just wrapped in a new UI.

This post focuses on practical design. It explains how to build deterministic segmentation with EPGs and contracts, how to insert L4–L7 services without creating mystery hairpins, and how to scale to multi-site and DR without turning policy into folklore. The theme is simple: policy becomes your control plane, and your job is to keep that policy predictable under change and failure.

1) Determinism in ACI means three things

When teams say they want “deterministic ACI,” they usually mean one of three outcomes. If you separate them, the design becomes clearer.

  • Deterministic segmentation: traffic flows only where contracts allow it, and the allow/deny logic stays consistent across upgrades, node failures, and day‑two changes.
  • Deterministic forwarding: endpoints keep reachability, L3Out behaves predictably, and external routing changes do not create accidental asymmetry or black-holes.
  • Deterministic operations: changes are reviewable, testable, and reversible; troubleshooting starts from intent (“which contract?”) instead of packet archaeology.

2) The ACI mental model that prevents 80% of mistakes

ACI becomes easier when you keep a strict hierarchy in your head: Tenant (ownership), VRF (routing domain), Bridge Domain (L2 boundary + default gateway behavior), EPG (group of endpoints), and Contract (policy that permits specific traffic between EPGs).

You can build anything in ACI without understanding why it works. The cost arrives later when you troubleshoot an outage and you can’t answer basic questions: Is this endpoint in the expected EPG? Does the BD map to the correct VRF? Is the contract direction correct? Which filter entry matches this flow? Determinism starts with making those answers unambiguous.

Quick mapping that stays stable:
  • Tenant: who owns the policy and objects
  • VRF: where routing decisions happen (separation boundary)
  • BD: where subnets live, ARP/ND lives, and flooding/unknown handling is defined
  • EPG: who belongs together (policy group)
  • Contract: what is allowed between groups (filters + subjects + scope)

3) Segmentation that scales: EPG strategy and contract discipline

The fastest way to wreck ACI at scale is to create an EPG for everything and a contract for every pair. That model collapses under its own weight. The opposite failure is to create three giant EPGs (“Prod, Dev, DMZ”) and then try to claw security back with filters. The sweet spot is to segment around trust boundaries and application tiers, then keep policy sparse and intentional.

A simple but effective pattern uses tiered EPGs per application: App‑Web, App‑API, App‑DB, and Shared‑Services. Then define contracts that express the architecture: Web→API on specific ports, API→DB on specific ports, and Shared‑Services provides DNS/NTP/AD or other platform dependencies.

Contract discipline matters more than contract count. Treat contracts as an interface definition, not as a convenience. Name them like APIs: Allow_Web_to_API_https beats web‑api. When an incident happens, that naming gives you a path to root cause.

  • Prefer allow-lists: explicit filters beat “permit all” with an exception list.
  • Keep scopes intentional: global scope feels convenient and becomes a security liability; use VRF/tenant scope deliberately.
  • Use shared services consciously: centralize dependencies (DNS, identity, monitoring) in a shared EPG and expose them through explicit contracts.
  • Guard the default: decide whether unknown communication is implicitly denied; rely on contracts, not on “it probably works.”

4) Microsegmentation: when EPGs are too coarse

EPGs are group policy. Sometimes you need per-workload policy. That is where microsegmentation and attributes matter. You can keep the EPG model simple while still achieving fine-grained control by using endpoint attributes (or tags) and contract rules that map to those attributes.

The trick is to avoid turning microsegmentation into a tax. If every VM has a unique policy, you lose the operational advantages of ACI. Use microsegmentation for the flows that actually matter: east‑west movement between sensitive workloads, privileged management planes, or compliance-driven separation where a tier model is insufficient.

  • Use it for sensitive tiers: DB clusters, management interfaces, jump hosts, and privileged APIs.
  • Keep the audit trail: microsegmentation rules should be explainable; “tag‑based deny” is good, “mystery allow” is not.
  • Don’t fight the app: if the app uses dynamic ephemeral ports, model that explicitly or place a service insertion boundary.

5) External connectivity (L3Out): where most real outages start

Most ACI outages that feel “mysterious” happen at the edge of the fabric: L3Out design, route advertisement, and policy between internal EPGs and external networks. The fabric can be stable while the perimeter behaves unpredictably.

Treat L3Out like a product surface. Define: which VRF owns external routing, which prefixes you import/export, what summarization you enforce, and what route policy prevents accidental transit. Then make that policy measurable: track route counts, churn rates, and the impact of upstream changes.

BGP often becomes the natural external protocol because it gives you clear policy controls and well-understood failure modes. OSPF can work, especially in enterprise environments, but BGP scales better in multi-domain designs and makes prefix filtering more explicit. Regardless of protocol, the rule is the same: do not leak routes you do not mean to leak.

  • Import policy: filter aggressively; do not import the universe because “it’s easier.”
  • Export policy: advertise only what the outside needs; prefer summaries when possible.
  • Default routes: treat default as a deliberate decision; if you inject it, guard it with tracking and failover logic.
  • Asymmetry planning: stateful firewalls and NAT devices care about symmetry; design routing to respect that.

6) L4–L7 service insertion: make the hairpin explicit

ACI makes service insertion appealing because it can steer traffic through firewalls or load balancers based on policy rather than cabling. The risk is that service graphs can create unintended hairpins, asymmetric flows, or “it works until failover” scenarios.

Deterministic service insertion requires you to decide where the service boundary lives. You either place the service inline between EPGs (strict choke point) or you use policy-based redirect (PBR) to steer selected traffic. Both work. The key is to document it as part of the application architecture: which flows hit the firewall, which flows bypass it, and what happens during a node failure.

  • Make direction explicit: define client→server vs server→client behavior; avoid designs that rely on implicit symmetry.
  • Validate failover: test service insertion under node failure and under routing changes; many issues only show up during convergence.
  • Keep graphs small: long service chains multiply failure modes; prefer simple, composable insertion points.
  • Measure outcomes: instrument the service path; if the firewall drops or adds latency, the fabric should show it quickly.

7) Multi-site and DR: design failure domains, not stretched hope

Multi-site ACI succeeds when you treat it as a failure-domain problem, not as a stretching exercise. The goal is consistent policy with controlled reachability, not “everything is everywhere.” Determinism requires you to decide what is global (policy objects, identity, shared services) and what remains local (endpoint learning, fault domains, and site-specific external routing).

A healthy multi-site strategy starts with a few clear questions: Do you stretch L2, or keep L2 local and use L3 for site-to-site reachability? Where do you place default gateways? How do you prevent a site failure from causing a routing storm? Which applications truly need active-active?

  • Prefer L3 between sites: it reduces flood domains and makes failure behavior more predictable.
  • Keep endpoints local when possible: stretching endpoint learning increases blast radius and troubleshooting complexity.
  • Define DR modes per app: active-active is not a default; choose active-standby when it simplifies state and security.
  • Make egress consistent: decide whether traffic exits locally or via a preferred site; keep security policy aligned with that choice.

8) Operations: policy as code and safe change pipelines

ACI is policy-driven, but it is not automatically safe. Centralized policy amplifies both good and bad changes. A single mis-scoped contract can open a hole across the fabric. A single L3Out change can withdraw reachability from multiple tiers. Deterministic operations require a change pipeline.

Treat ACI objects as versioned artifacts. Export configurations, keep a source-of-truth for tenants/VRFs/EPGs/contracts, and apply changes via reviewed templates where possible. Even a lightweight workflow—design review, staged deployment, post-change validation—reduces incident rates dramatically.

  • Staging: apply risky changes to a canary tenant or non-production site first.
  • Pre-change validation: check that new contracts do not over-permit; check that L3Out policy does not leak routes.
  • Post-change verification: validate endpoint reachability, contract hits, and external route tables.
  • Rollback readiness: know what “undo” looks like before you apply the change.

9) Troubleshooting: start from intent, then prove with evidence

Troubleshooting in ACI is fast when you start from intent. Ask: which EPGs should communicate, which contract should permit it, and which external boundary should carry it. Then prove each step with evidence: endpoint learning, contract counters or hits, routing tables, and external advertisements.

A useful troubleshooting structure mirrors the determinism goals: (1) segmentation correctness (EPG/contract), (2) forwarding correctness (BD/VRF/L3Out), (3) service insertion correctness (graphs/PBR), and (4) failure-mode correctness (what changed, what failed, what converged). This keeps teams from chasing symptoms like “the firewall looks busy” when the real issue is a route import mistake.

11) Policy resolution mechanics: why “it should allow” sometimes still denies

ACI feels magical until a flow disappears. Then you discover that “contract exists” is not the same as “contract applies.” Deterministic design treats policy resolution as a predictable algorithm, not as a guess.

At a high level, ACI applies these ideas:

  • EPG membership is the starting point: if the endpoint lands in the wrong EPG, every downstream policy decision becomes wrong. Make EPG membership deterministic by using consistent VLAN bindings, VMM integration rules, and naming conventions that match workload intent.
  • Contracts govern inter-EPG traffic: contracts act like allow-lists between groups. Filters define L4/L7 attributes (protocol/ports), and subjects bind filters to contract intent.
  • Intra-EPG behavior is separate: many teams assume “same EPG = allowed.” You can choose that, but you should choose it explicitly. If you require stricter east-west control within a tier, use microsegmentation or split tiers into multiple EPGs.
  • Scope influences reach: contract scope defines where policy applies (for example, within a VRF, within a tenant, or globally). Over-broad scope becomes a security risk; over-narrow scope becomes an availability risk if the app crosses boundaries.

Make these choices visible. Document them per tenant and treat them as architectural constraints. When a new application arrives, you avoid accidental design drift because the policy model is already clear.

12) Bridge Domains and subnets: the hidden levers of stability

Engineers often focus on EPGs and contracts and forget that Bridge Domains and subnets define key forwarding behaviors: gateway placement, ARP/ND behavior, unknown traffic handling, and where L2 boundaries really end. A BD design that looks “fine” in a lab can create unpredictable flooding or endpoint learning behavior at scale.

  • Unknown unicast and flooding: if the BD allows broad flooding, one misbehaving endpoint can create noisy churn that looks like a fabric problem. Prefer designs that keep flood domains small, and use control-plane learning mechanisms where available.
  • Subnets and default gateways: subnets define where the default gateway lives. Place them intentionally. If you move gateways between BDs or VRFs, treat it as a migration with explicit cutover steps.
  • Endpoint learning stability: endpoint move events happen in real environments (VM churn, container churn, host NIC changes). Keep BD and EPG design stable so moves remain local events, not fabric-wide storms.

Think of BDs as “forwarding containers” that must remain boring. When BDs behave predictably, the rest of your policy model becomes easier to trust.

13) L3Out design patterns: predictable routing without accidental transit

L3Out is where ACI meets the rest of the world: upstream routers, firewalls, WAN edge, and cloud gateways. Most “surprise outages” show up here because external routing changes faster than internal policy teams expect.

A deterministic L3Out pattern includes:

  • Clear ownership: one VRF owns external routing for a given security domain. If multiple VRFs require egress, define whether they share an L3Out (with policy controls) or use separate L3Outs per domain.
  • Route control as a contract: treat import/export rules like security policy. Summarize where possible, filter aggressively, and avoid importing default routes “just because.”
  • Symmetry for stateful services: firewalls and NAT devices punish asymmetry. If the design requires stateful inspection, pin egress points and avoid per-site randomness in the path selection.
  • Failure-mode predictability: define what happens if an upstream peer fails. Do you withdraw default? Do you prefer an alternate? Do you keep local-only routes stable? These should be written as explicit requirements.

If you treat L3Out policy as an afterthought, it becomes the single biggest threat to fabric determinism.

14) Service insertion without surprises: validate direction, symmetry, and failure

Service graphs and policy-based redirect make ACI powerful, but they also make it easy to create a flow that works only in one direction or only in steady state. Deterministic insertion starts with a strict rule: document the path and test the failure.

  • Direction matters: client→server and server→client may traverse different nodes if you do not pin them. Make that pinning explicit when stateful inspection exists.
  • Hairpins are not always bad: hairpinning becomes bad when it is accidental. If you need centralized inspection, design for the extra latency and capacity and monitor it.
  • Failover is a feature: test node failure, link failure, and routing change while the service is active. Many “works in lab” designs fail only when the first maintenance window hits production.

When you measure service-path latency and drop behavior, you can treat service insertion as a product with predictable outcomes.

15) Multi-site resilience: policy consistency with controlled blast radius

A multi-site ACI strategy succeeds when you define which things stay global and which things stay local. “Global everything” expands blast radius; “local everything” defeats the purpose of consistent policy.

A practical pattern looks like this:

  • Global policy objects: tenants, VRFs, EPG naming conventions, contract models, and shared-services patterns remain consistent across sites.
  • Local forwarding realities: endpoint learning, local failure detection, and site-specific external routing remain local. When a site fails, other sites should not thrash their forwarding state.
  • L3 between sites by default: keep L2 stretch as the exception, not the default. L3 reduces flood domains and makes failover behavior more predictable.
  • DR modes per application: choose active-active only when the application supports it. Otherwise, treat DR as a controlled cutover with rehearsed runbooks.

This model keeps policy predictable while keeping failures contained.

16) Policy-as-code workflow for ACI: how to avoid “UI drift”

Central controllers tempt teams into manual UI changes because it feels fast. At scale, that becomes drift: two operators make similar changes in different ways, and the fabric becomes inconsistent. A policy-as-code approach does not require heavy tooling; it requires discipline.

  • Source of truth: maintain a canonical representation of tenants, EPGs, contracts, and L3Out intent. Even if the canonical form is exported config + documented templates, it is better than “whatever is in the UI.”
  • Review gates: treat security-affecting changes (contracts, scopes, route policy, service insertion) as reviewed items. Use naming conventions that force clarity.
  • Staged rollout: apply changes first to non-production or to a canary tenant, then to production. Validate endpoints, contracts, and routing after each stage.
  • Automated verification: define a small set of post-change checks (expected route counts, expected contract hits, expected endpoint states) and run them every time.

When you do this consistently, ACI becomes safer precisely because it is centralized.

17) Quick architecture checklist: is your ACI design deterministic?

  • EPG model: do EPGs represent real trust boundaries and tiers, or are they accidental groupings?
  • Contract model: do contracts read like interfaces (allow-lists), and are scopes deliberate?
  • BD/VRF: are BDs boring and bounded, and do VRFs map cleanly to routing domains?
  • L3Out: do you control import/export with explicit intent and avoid accidental transit?
  • Service insertion: is direction/symmetry documented and tested under failure?
  • Multi-site: do you keep endpoint learning local and policy consistent, with L3 between sites by default?
  • Operations: do you have staged change and rollback practices, or do you rely on “UI edits and hope”?

If you can answer these with confidence and evidence, you are operating ACI as an intent-based fabric rather than as a GUI for VLANs.

10) The practical takeaway

ACI delivers strong outcomes when you treat policy as the control plane, not as decoration. Deterministic segmentation comes from clean EPG models and disciplined contracts. Deterministic forwarding comes from explicit L3Out design and clear route policy. Deterministic security comes from intentional service insertion and measurable enforcement. Deterministic operations come from treating policy changes as reviewed artifacts with verification and rollback.

If you build ACI this way, you get what SDN promised: fewer “snowflake ports”, fewer accidental cross-talk events, faster change delivery, and a fabric that remains understandable even as it scales.


 

Eduardo Wnorowski is a systems architect, technologist, and Director. With over 30 years of experience in IT and consulting, he helps organizations maintain stable and secure environments through proactive auditing, optimization, and strategic guidance.
LinkedIn Profile

Friday, April 1, 2022

Policy as Code: Architecture Strategies for Enforcing Consistency at Scale

April, 2022 — 7 min read

Introduction

In 2022, enterprises are under increasing pressure to balance agility with governance. As teams embrace infrastructure-as-code and automate their deployment pipelines, the risk of misconfiguration, noncompliance, and drift grows rapidly. To combat this, architects are embracing Policy as Code — the practice of expressing organizational rules and compliance logic in machine-readable form, enforced automatically across platforms.

What Is Policy as Code?

Policy as Code (PaC) refers to the use of declarative policy definitions that govern system behavior, access, and configuration — all stored in version-controlled repositories and evaluated by automation. Much like infrastructure-as-code revolutionized provisioning, PaC brings repeatability and auditability to operational rules. It decouples enforcement from documentation, ensuring policies are applied consistently and transparently.

The Architectural Need for Policy as Code

Distributed systems and cloud-native stacks introduce complexity that cannot be managed by human processes alone. Whether it’s restricting unencrypted storage, enforcing tagging conventions, or blocking public-facing databases, organizations need an enforcement mechanism embedded into the fabric of their architecture. Relying on reviews and approvals doesn’t scale — but automation does.

Key Use Cases in 2022

Policy as Code is increasingly used in the following domains:

  • Cloud Security Posture Management: Preventing misconfigurations in cloud infrastructure using tools like Sentinel, OPA, and Azure Policy.
  • Kubernetes Admission Control: Validating pod specs, container images, and resource quotas before deployment.
  • CI/CD Pipeline Governance: Enforcing compliance checks before code merges or artifact promotions.
  • Access Control: Defining and evaluating who can do what under which conditions, using dynamic policies.

Designing for Enforceability

Policies must be unambiguous and context-aware. Good policy design includes:

  • Declarative Syntax: Simple to author, easy to review.
  • Policy Evaluation Engine: Lightweight, scalable, and embeddable.
  • Fail-Closed Defaults: Prevent unsafe operations when evaluations are unavailable.
  • Audit Trails: Comprehensive logs of what policy was enforced, why, and when.

Popular Tools and Frameworks

In 2022, several mature platforms enable Policy as Code:

  • Open Policy Agent (OPA): General-purpose engine with Rego language, used in Kubernetes, Terraform, and APIs.
  • HashiCorp Sentinel: Embedded in Terraform Enterprise and Vault for provisioning governance.
  • Kyverno: Kubernetes-native policy engine, declarative and YAML-friendly.
  • Azure Policy & AWS Config Rules: Platform-native tools for enforcing policies in public cloud environments.

Architecture Considerations

Policy evaluation must be embedded at the right interception points — admission controllers, CI hooks, API gateways, or runtime layers. Policies should be versioned alongside code and tested in staging before reaching production. Integration with developer workflows is key. Policies must empower teams, not block them. Overly rigid policies lead to workarounds and policy erosion.

Challenges and Pitfalls

As with any automation, poor policy design can create more problems than it solves. Common issues include:

  • Overly complex rules that are hard to debug or maintain.
  • Lack of context awareness, causing false positives.
  • Policy sprawl without clear ownership or review.
  • Misalignment between written policies and real-world operations.

Architecture must account for these realities, treating policy systems as critical infrastructure components with their own lifecycle and SLOs.

Conclusion

Policy as Code is no longer optional for organizations operating at scale. It brings governance closer to the infrastructure, accelerates compliance, and reduces operational risk. In April 2022, architects must design systems that don’t just run — but also regulate themselves. Embedding policy into the architecture enforces consistency, ensures safety, and builds the foundation for scalable operations in modern environments.



Eduardo Wnorowski is a network infrastructure consultant and Director.
With over 27 years of experience in IT and consulting, he helps organizations maintain stable and secure environments through proactive auditing, optimization, and strategic guidance.
LinkedIn Profile

Network Reliability Engineering: Turning Modern Network Operations into a Discipline Network Reliability Engineering: Turning ...