Security, Governance, and Compliance#
A security audit arrived: a PCI compliance review had examined the firewall change history for the last six months, and the auditors had a clear request: “For each firewall change, we need: who authorized it, what change ticket it was associated with, evidence that deployment validation occurred, and the network state before and after.”
The team started to look at each other. Thanks to the Network Automation Platform (NAP), the number of changes processed had increased (847 during this period), and most of them were successful (e.g., pre- and post-validation, rolled back when needed, no incidents, etc.). However, they were not able to answer these questions.
The workflow execution logs tracked the job runs, but did not record who had requested the change. The Source of Truth showed the current intended state, but did not record a timestamped history of every change in the past. And the device logs recorded the configuration commands applied, but not which pre- and post-validation was executed around them. Finally, the ITSM system had no link to the runs that deployed the changes. The four systems had information that could somehow answer “what happened”, with some correlation effort. But it was impossible to answer the other key questions: “who authorized it”, “was it validated”, or “what was the state before”.
Reconstructing the evidence trail took three weeks. Six engineers dropped their work and focused on it because it was urgent to get the necessary security certification. The result, lucky for them, was that everything worked as expected. The only problem was the waste of their time and the delayed response to the auditors. But the gap was clear: this would not be the last security audit to come.
Security is a process, not a product.
Bruce Schneier
The NAP product did it well. What was missing was the way to prove it: the governance architecture.
This chapter’s subject is not how to make the automation work or how to make it scale (those were Chapter 11 and Chapter 12). Here we focus on how to make the automation trustworthy: who can create a change and authorize it, which policies constrain changes, and the immutable record that provides auditability.
Build it in from the start. Chapter 2 made the case that design properties are much harder to add later. A NAP built without workload identity must retrofit credential issuance into every workflow. Every automation run without an audit trail is a nightmare to track after the fact. Put security into the NAP’s definition of done from its first workflow.
In my experience, security and governance are the most neglected dimension of network automation. They are also the hardest to retrofit. Do not leave them for later.
The chapter starts from the auditors’ questions, because every control in it exists to answer one of them.
The Questions an Auditor Asks#
The auditors in the opening story asked four things about every change: who authorized it, which change ticket it belonged to, whether it was validated before deployment, and what the network looked like before and after. A NAP that answers them for every change, by query, is trustworthy in the sense this chapter means.
The goal behind all four is one rule: every automation action must be traceable to a named human origin, a named authorization, and a verifiable record, even when an Artificial Intelligence (AI) agent proxied the request. Figure 13.1 shows the chain that makes this possible.
The audit record links many things together: the requester, the workflow run, the credential scope, and the device action. It is all that an auditor needs. The record answers who requested the change, who authorized it, who implemented it, and what actually happened. Many functionalities work together: the secrets store from the Internal Developer Platform (IDP) and the workflow run from the NAP (Chapter 11 separates them clearly). This split runs through the whole chapter: the IDP provides security functionalities, and the NAP uses them to deliver network changes.
Each question has its answer at a step of the change path that Chapter 11 walked through in its One Network Change, End-to-End section. Table 13.1 maps them, and it is the map for the rest of this chapter.
| Question | Where on the change path | Controls | Section |
|---|---|---|---|
| Who asked, and who acted? | The request, and every step after it | A named submitter, workload identity, scoped credentials, least privilege | Identity: Who Is Acting |
| Was it allowed? | Intent and promotion | The risk tier, policy-as-code gates, the intent review and the deployment approval | Policy: What May Change |
| Was it validated, and is that what ran? | Validate, simulate, promote | Secure development checks, signed artifacts, the Provenance Chain | Integrity: What Actually Ran |
| What was the state before and after? | Execute, verify, record | Snapshots, a tamper-evident audit trail, drift checks | Evidence: Proving It |
| What happens when it goes wrong? | Anywhere | Containment, runbooks for NAP compromise | Response: When It Goes Wrong |
The chapter follows the table from top to bottom, then closes with the minimum viable security posture: the five stages to build first.
Identity: Who Is Acting#
Identity comes first, because every other control depends on it. A gate cannot enforce separation of duties if it does not know who submitted the change, and an audit record without an identity is just a log line. This section explains why automation breaks the traditional model, then builds the replacement in order. It starts with where a change comes from and the workload identity of each run. Then come authentication and authorization, the access control models, and least privilege. It ends with the secrets the NAP still owns, the data it must protect, and isolation between tenants.
In traditional operations, the engineer who logs into a device is the one accountable for the change, and the device log records both in one line. With network automation, the security problem changes. No human logs into the device (in a well-implemented NAP, none should); a workflow does, often with a shared service account. The audit trail records the run but not who asked for it, what they were authorized to do, or whether the change stayed in scope.
The authenticating entity is now the NAP; the accountable entity is the person or process that instructed it. Connecting the two takes explicit design: a record of the full chain from human authorization through the run to the device change.
This becomes even less clear with AI agents: the requester of an action may not be a human at all. Even then, you must trace accountability to whoever defined the AI orchestration logic.
In automation security, identity is the new perimeter. Applying it starts with knowing where each run came from.
Where a run starts decides how its human origin gets recorded. A change reaches the NAP in one of three ways:
- A request through the Presentation layer. An engineer or operator submits through a form, the Application Programming Interface (API), or the Command Line Interface (CLI), as Chapter 9 describes. The Presentation layer authenticates them and records the submitter and the change ticket with the request. The firewall change in Chapter 11 arrived this way, through an ITSM form.
- A trigger inside the NAP. A merge in the Source of Truth, a commit to an intent repository, a schedule, or an event starts a change workflow, and nobody fills in a form. Drift remediation and closed-loop workflows start this way. The human origin is whoever authored and approved the merge or commit. For a scheduled or event-driven run, it is the engineer who owns the workflow and approved the policy that lets it run unattended.
- An agent acting for a person. An AI agent submits through the same API, often over Model Context Protocol (MCP). It must not use a credential of its own that hides who asked. The request carries both identities, the agent as the actor and the person it acts for, and the audit record names both. The agent’s scope is never wider than the person’s.
The first two usually meet. In Chapter 11, the Presentation request became a Source of Truth proposal, and merging it was the trigger. The run then records both people: the submitter from the request and the reviewer who merged it. Neither replaces the other. A trigger that arrives with no human origin, such as a webhook from a merge nobody approved, is rejected at the same intake gate as an anonymous request.
Wherever the run starts, it needs an identity of its own.
Workload Identity#
Chapter 11 lists workload identity among the capabilities to expect from the IDP. Each workload proves who it is when it starts and receives credentials scoped to that run. It never borrows a person’s credential or a shared service account. This section covers what the NAP adds on top: the scope of each credential, where that scope is enforced, and the run identifier that ties the run to everything it touched.
The alternative shows why it matters. A shared service account has one credential. If it leaks, it reaches everything the NAP can reach: every device, the full Source of Truth (SoT), every artifact. You cannot scope it to a site. It never expires. Rotating it means coordinating every workflow that uses it. And the audit trail records “the automation account” as the actor, not the workflow run, the requester, or the authorization. Workload identity fixes all four: the credential is scoped, short-lived, issued per run, and tied to a run that traces back to the human request.
Workload identity starts when the run does. One of the triggers described above reaches the NAP, and the Orchestrator starts a run of the change workflow. The run executes on the Orchestrator’s workers, which run as workloads on the IDP’s container runtime. Two parties vouch for it. The runtime knows which workload it started. The Orchestrator knows which workflow, which version, and which run that workload is executing. In the GitOps variation, where a commit to an intent repository starts an IDP pipeline, the pipeline runner vouches for its own stages in the same way (Chapter 11 describes both).
That vouching follows the OpenID Connect (OIDC) workload identity pattern. OIDC is an identity layer on top of the OAuth 2.0 authorization framework. It lets the secrets store trust identity assertions from a workload without a static secret shared between them. The runtime’s identity provider signs a short-lived JSON Web Token (JWT, RFC 7519): a signed, tamper-evident token that encodes claims about the workload. Container platforms do this natively for every workload they run, through service account tokens, after a one-time step that registers the platform’s issuer URL in the secrets store’s trust policy. CI systems such as GitLab CI, GitHub Actions, and Jenkins do the same for pipeline jobs. The Orchestrator then adds the run’s own claims: the workflow and its version, the run ID, and the scope the run needs.
Listing 13.1 shows the JWT a run presents at its start: the runtime’s signed claims about the worker, plus the run’s identity and the scope it requests. This is an illustrative example:
{
"iss": "https://runtime.corp.com",
"sub": "vlan-add:1.3",
"jti": "job-20260316-0117",
"iat": 1773619200,
"exp": 1773619320,
"scope": {
"sot": "read:site=bldg-b",
"device": "write:site=bldg-b",
"store": "write:artifact-type=network-change"
}
}The sub claim names the workflow and its version; jti names the run. The scope claims are assertions but not enforcement. A claim of device: write:site=bldg-b constrains nothing on its own: the boundary is enforced at the resource, and where that happens differs for the SoT and for devices.
- The SoT enforces read scope in its own authorization layer. The site attribute in the claim becomes a mandatory filter on every query, so the workflow can only read records tagged
site=bldg-b. This requires the SoT data model to carry the site attribute at the record level, the same attribute-level scoping that Multi-Tenancy and Isolation relies on and that Chapter 4 makes possible. - Devices cannot enforce a scope they do not understand. Most network devices authenticate a credential but have no concept of “site”. Enforcement moves one step earlier, to credential issuance. The secrets store vends credentials only for devices whose SoT site attribute matches the claim, usually as a short-lived TACACS+ or RADIUS account scoped to that site’s device group. A workflow scoped to bldg-b never holds a credential that works outside bldg-b.
The token scope is only as strong as the weaker of these two enforcement points, which is why the secrets store checks the requested scope against the workflow’s registered maximum before issuing anything.
Figure 13.2 shows the whole exchange, from the trigger to the revocation.
The run presents the JWT with the scope it needs. The secrets store verifies the signature, checks the scope against the workflow’s registered maximum, and returns a credential that expires with the run. The JWT’s own lifetime (120 seconds in Listing 13.1) only has to cover the exchange; the credential carries its own expiry. When the run ends, or is canceled, the credential is revoked. The only long-lived trust left is the one between the IDP’s runtime and the secrets store, configured once.
Most of this exchange is the IDP’s machinery. One decision in it belongs to the network automation team: the registered maximum, the largest scope each workflow may ever request. It is set once, when the workflow is onboarded, and recorded in the secrets store’s policy: the vlan-add workflow may write to campus switches, never to core routers. Each run then asks for the narrower scope it needs, such as one building, and the secrets store refuses anything beyond the maximum. The secrets store enforces the ceiling, not the workflow author, so a buggy or manipulated run cannot ask for more.
Expect one to two weeks of integration work for the first workflow, and hours for each one after it. Where the developer productivity team owns the secrets store, the calendar time roughly doubles: registering the runtime’s issuer, provisioning a secret backend, and defining the first scopes all go through that team’s change process. Budget for it. The technical work is straightforward; the coordination is where the time goes.
Not every orchestrator or runtime issues OIDC tokens. Older self-hosted AWX versions, some Jenkins configurations, and custom workers do not. The fallback is a small identity broker: it authenticates the worker through a mechanism it does support (e.g., a per-job API token or a TLS client certificate) and exchanges that for a token the secrets store accepts.
If you are migrating from a shared service account, move one workflow at a time, and run each migrated workflow alongside the shared-account ones for two to four weeks. Revoke the shared account only after the last workflow has moved: rotating it earlier breaks every workflow that still depends on it. Document the timeline, because the audit trail for that period will mix both kinds of record, and an auditor will ask why.
The run identifier does a second job: it makes the run observable. Design the run identity first, and correlation across systems comes with it at no extra cost. The jti propagates as a trace context (the distributed tracing mechanism from Chapter 12) through every system the workflow touches: the SoT query, the artifact store write, the device change. An engineer investigating an incident does not correlate four systems by timestamp and hope the clocks agree. They query by run ID and get the complete causal chain. Chapter 7 made correlation what turns collected data into answers; workload identity makes that correlation available by design, and the Evidence: Proving It section shows why it is also what separates auditability from logging.
Workload identity tells you who is acting. What that identity may do is a separate question.
Authentication and Authorization#
Authentication says who is acting; authorization says what it may do. Network engineers know the split from TACACS+, where a valid login is not permission to run every command. Automation needs the same split. A workflow run with a valid credential and no authorization boundary can do anything the device allows. Its audit trail records only that a credential was accepted, not that the operation stayed in scope. What follows covers the two ways to express permissions, roles and attributes, and the rule that governs both: least privilege.
Authorization in automation requires modeling the permission space explicitly: which workflows can read from the SoT, which can write to it, which can push configuration to which device groups, which can promote artifacts between environments. This model evolves as the NAP grows, so manage it with the same version control and review discipline applied to the automation code itself. Review it at four moments in a workflow’s life, as Figure 13.3 shows.
- At onboarding. Define its scope at registration instead of after it has run in production with an over-broad default.
- When the NAP’s device scope changes. A new site, a new device group, or a decommissioned region means the permission boundaries no longer match the infrastructure.
- Every quarter, at minimum. List the permissions not exercised in the period. A permission unused for 90 days belongs to a workflow that is no longer active or was scoped too broadly. Neither case justifies keeping it.
- At retirement. Revoke its permissions immediately. Unused permissions with active credentials are attack surface.
Modeling the permission space raises the next question: how to express it.
Role-Based and Attribute-Based Access Control#
Access control applies to people and to workflows. For people, the roles from Chapter 9 apply: engineers write and publish workflows, operators request runs, and the same person can hold different roles in different environments. For workflows, the two common models are role-based and attribute-based. Figure 13.4 contrasts them on one workflow.
Role-Based Access Control (RBAC) assigns permissions to roles and assigns roles to workflows or users. A workflow classified as “campus VLAN management” receives the VLAN management role, which grants write access to switch port configurations at campus sites and read access to the relevant SoT records. RBAC is simple to implement, simple to audit (the role definition is the permission record), and simple to revoke (removing the role removes all its permissions at once).
The limitation of RBAC is that roles are static. A workflow either has the VLAN management role or it does not. It cannot have the role only during maintenance windows, only for sites below a certain size, or only when the change has been pre-approved by a network architect. These context-aware constraints require Attribute-Based Access Control (ABAC).
ABAC evaluates permissions at request time against a policy that considers the attributes of the requesting workflow, the requested operation, the target resource, and the environmental context. A policy might read: “a workflow with role VLAN-management is authorized to push configuration changes to campus switches at sites with fewer than 500 devices, during the hours of 22:00 to 06:00 local time, if the change has been approved by a network architect”. This is expressive but harder to reason about: the effective permission set of a given workflow at a given moment depends on the current values of multiple attributes that may not be immediately visible.
Start with RBAC for its auditability and simplicity. Introduce ABAC for specific constraints where the context-sensitivity is necessary and the team has the operational maturity to manage the policy complexity. Do not use ABAC as a general-purpose policy language when RBAC is sufficient; the debugging complexity grows with each attribute dimension added.
Whichever model you choose, the principle for sizing each grant is the same.
Least Privilege#
Least privilege is the principle that each automation component has exactly the permissions it needs for its task, no more. It is the permission-space version of the Bulkhead pattern from Chapter 12: a bulkhead keeps an operational failure inside one site’s share of the NAP, and least privilege keeps a security failure inside one workflow’s permissions.
A workflow that reads SoT data does not need write access to the SoT. Teams grant write access anyway, because “it might be needed later” or “it is easier to set up once”. A buggy or compromised version of that workflow can then corrupt the SoT data that every other workflow depends on.
A workflow that provisions devices at site A does not need credentials for site B. Granting it credentials for the full device inventory because “the workflow is trusted” gives a misbehaving run of that workflow access to devices it was never supposed to touch.
Workload identity enforces this with three nested scopes, as Figure 13.5 shows.
The registered maximum is the outer wall, set once per workflow. Each run asks for less, and the credential the secrets store issues never exceeds the request. A vlan-add run for Building B gets credentials for Building B’s device group only, and the core routers stay out of reach whatever the run asks for.
Least privilege can feel like it slows operations down: more credential scoping, more permission definitions, more onboarding work for each new workflow. The friction is real. The alternative is a NAP where a single compromised credential or a single buggy run can affect everything the NAP can reach. The discipline pays for itself the first time it limits a blast radius that would otherwise have been unlimited.
Least privilege is a design constraint from the start, and it shapes how workflows are defined, how credentials are scoped, and how the permission model is organized. A NAP designed without it must be redesigned, not reconfigured, to adopt it.
Least privilege also applies to the devices themselves. If the NAP is the only path for changes, make it the only path in: the management-plane ACLs admit connections only from the Orchestrator’s worker pool and the break-glass jump hosts, and the AAA server accepts only the NAP’s per-run accounts and the break-glass accounts. Any other login raises an alert, and the drift check catches whatever it changed. Without that, “no human logs into the device” is a convention, and conventions break at 03:00.
Scoped, short-lived credentials remove most secrets from the NAP, but not all.
Secrets Management and Lifecycle#
A secret in a Version Control System (VCS) repository is exposed to every repository user. One in a config file on a decommissioned runner persists on unwiped disks. One unrotated for two years is held by everyone who had access during that period and has since left the organization. None of these is a secret anymore.
The secrets store is the IDP’s. Choosing the product (a self-hosted secrets manager such as HashiCorp Vault, a cloud provider’s secrets manager, or an enterprise privileged access management system) is the developer productivity team’s decision, and Chapter 11 lists what to ask of it. If the choice falls to you, start with whatever your Orchestrator and the IDP’s runtime integrate with natively.
The model is simple: secrets are not stored anywhere in the NAP’s configuration. The secrets store generates them at runtime, scoped to the operation that needs them, and they expire when it ends. One secret still needs long-term care: the credential the NAP uses to authenticate to the secrets store itself. Make it the most carefully managed, most restrictively scoped, and most frequently rotated credential in the system.
The network automation team keeps the lifecycle of the credentials the NAP depends on. It tracks which types are in use and what scope each has, when each was last rotated, which workflows depend on it, and how to rotate it. That belongs in the NAP’s runbook, not in someone’s memory.
One rule saves teams from the most common shortcut: if a system can be backed up and the backup can be copied, it is not a secrets store. A team that keeps device credentials in the database behind its SoT, because the database is access-controlled, learns this the hard way. A routine backup lands on a shared storage system, and every credential is readable by anyone who can open the file. A secrets store logs every read, issues credentials that expire, and can revoke one at once. A database backup does none of that.
Why the Source of Truth Is the Wrong Store#
Chapter 4 establishes that the SoT models the reference to a secret and never the secret itself. The shortcut is tempting: a password is just another field, and the SoT already holds every other field. Three reasons rule it out:
- The SoT is the most widely read system you own. Every workflow, dashboard, and agent queries it, and its consumption design makes that easy. A store designed to be read by everything is the wrong place for the one thing that should be read by almost nothing.
- Rotation becomes a data migration. If the password is a field, changing it every 90 days means rewriting intent on a schedule, and every stale copy and cached view now carries a credential that no longer works.
- The audit trails pull in opposite directions. Intent wants an immutable history that nobody can edit, which is what you do not want for a secret that has to be erasable on compromise.
That last point has a consequence teams often miss: a rendered artifact is not the same retention class as intent. An artifact containing a live credential wants the opposite of intent’s permanent history. Generate it, use it, discard it, and keep it out of logs, caches, diffs, and change records on the way. If you store rendered configurations for audit, store them rendered without the secrets, and audit the references instead.
Pre-change snapshots are the exception that proves the rule. Rollback needs the device’s full configuration, secrets included, so a snapshot cannot be stored redacted the way an audit copy can. Treat it as sensitive data: encrypted, every read logged, and kept only as long as the rollback window needs it. The audit trail keeps a redacted copy and the snapshot’s hash (not the snapshot itself).
Some Source of Truth products have offered built-in secret storage, encrypting credentials in their own database with a key the user supplies. That prevents plaintext exposure in backups. It does not provide per-read audit logging, automatic expiry, or selective revocation, which are the properties the governance model in this chapter requires.
Credentials are the most sensitive data the NAP handles. They are not the only sensitive data.
Data Protection#
Network automation handles data that is sensitive for several reasons. Device configurations may contain pre-shared keys, Simple Network Management Protocol (SNMP) community strings, routing policy that reveals the topology, and service dependencies that are commercially sensitive. Telemetry may contain metadata about traffic patterns, user activity, or infrastructure relationships that data protection regulations cover in some jurisdictions.
Classify what the NAP handles by sensitivity. Most of it is public or internal; only a small part is sensitive, as Figure 13.6 shows.
- Public data, such as routing prefixes already visible in Border Gateway Protocol (BGP) tables, needs no special handling.
- Internal data, such as the device inventory and interface assignments, needs access control.
- Sensitive data, such as device credentials and security policy configurations, needs encryption at rest, encryption in transit, access logging, and retention limits.
Encryption works at two levels, and a NAP that handles secrets needs both. At rest, the artifact store, the SoT data, and the audit log are stored encrypted. In transit, every connection between NAP components, between the NAP and devices, and between the NAP and external systems uses TLS with verified certificates. “The data is inside our network” is not enough for either.
One shortcut feels safe until it is not: skipping TLS between NAP components because they share a management VLAN. Then one packet capture, taken to debug a latency problem, holds artifact store tokens, rendered configurations with SNMP communities and BGP keys, and the identity of every requester, and it sits on a workstation for weeks. TLS protects data in transit; it does not draw a perimeter. The threat includes everyone who can capture traffic on the management network.
Protection keeps data from people outside the NAP. When the NAP serves several teams, the boundary between them needs the same care.
Multi-Tenancy and Isolation#
As the NAP serves more teams, the isolation between tenants becomes a security boundary more than just an organizational convenience. In a single-tenant system, a buggy workflow is a nuisance, but in a multi-tenant system, it degrades database performance for every other team’s workflows simultaneously. This is known as the “noisy neighbor” effect.
Some components the NAP depends on are not the NAP’s. The secrets store, the artifact store, the observability databases, and often the dashboards belong to the IDP and serve the whole organization (Chapter 11). Their isolation is the developer productivity team’s design; your part is to ask for it.
There are two ways to separate tenants, and Figure 13.7 contrasts them.
Soft isolation, where tenants share the same infrastructure with logical separation, is simpler to operate and sufficient for many organizations. The risk is that a failure in one tenant’s workflows can affect shared components: the Orchestrator, the artifact store, the secrets store. Hard isolation, where tenants have separate infrastructure instances, removes that risk at the cost of significantly higher operational overhead. In network terms, hard isolation typically means separate management-plane VRFs or VLANs, separate physical management interfaces, and separate device credential domains (not only separate software deployments).
Start with soft isolation. Move to hard isolation only when a regulatory requirement explicitly mandates physical separation, or when a noisy-neighbor incident has caused a measurable Service Level Objective (SLO) breach that soft isolation cannot address. Hard isolation before either condition adds overhead and cost for a risk the organization has not actually faced.
Infrastructure partitioning leaves a second, more granular problem. A single physical device can carry configuration and telemetry belonging to several tenants at once, and the NAP must decide what each tenant is permitted to see.
A campus core router carrying VRF-A for one organizational unit and VRF-B for another produces a single telemetry stream, a single configuration snapshot, and a single change log. Every interface, every routing table entry, and every configuration event on that device is visible in full to anyone who can query the device or read from the observability store at the device level. The NAP cannot expose the full device snapshot to either tenant without leaking the other’s topology, traffic metadata, and configuration details. A firewall policy for tenant A on a shared firewall may contain ACL entries that reveal what services tenant B is running, or routing policy details that are sensitive under competitive intelligence or regulatory data protection obligations.
Isolate by data attribute, not by device. The SoT assigns tenant membership to interfaces, VRFs, policies, and service records. At query and action time, the NAP evaluates the tenant attribute of every record the workflow touches. A run by team A that queries device state receives only the VRF-A interface records. A compliance query by team A’s auditor returns only the change log entries that touched VRF-A configuration. The device is shared; the data view is not. Without attribute-level scoping built in from the start, the only genuine isolation is one device per tenant, which is often impossible on campus infrastructure consolidated so that it can be shared.
Attribute scoping isolates data but not concurrent access. When two tenants’ workflows target the same device, the per-device lease of Chapter 8 serializes them, so the second tenant waits seconds instead of waiting for the first tenant’s whole verification.
Identity tells the NAP who is acting and what that identity can reach. It does not say whether this particular change should happen. That is policy.
Policy: What May Change#
A permitted identity can still make a change that should not happen, or should not happen without a second look. Policy decides which. This section starts with the decision that sets everything else, the risk tier of each request. It then covers gates and approvals, how policies change over time, and how to keep all of it cheap enough that nobody routes around it.
Tiered Risk Classification#
Not every change deserves the same scrutiny. An interface description carries different risk from a firewall rule that opens a new path to the authentication tier. Apply the full control set to both and you add maximum friction to every change, whatever its actual risk.
The tiers in this section, their names, and the controls in Table 13.2 are one example, matching the rollout policy in Chapter 11. Your organization will draw the lines in its own places. What carries over is the mechanism: the NAP computes a tier for each request, and the tier decides the controls.
Chapter 11 set the rule this section builds on: risk is evaluated per request, not per workflow. The workflow definition declares a risk_tier as a floor and names the policy each request is checked against. A firewall rule that fits the security policy, such as a well-known DNS name on a standard port, stays standard. One outside it becomes high. The tier then decides the controls, as Table 13.2 shows.
| Control | standard | high |
|---|---|---|
| Intent review | None: the policy pre-approves the change | A peer, never the requester |
| Deployment approval | None: promoted when its gates pass | Manual, in the maintenance window |
| Change ticket | A standard change the NAP opens and closes | A normal change, approved before deployment |
| Security checks | Blocking for secrets and policy violations; the rest asynchronous | All blocking |
| Policy evaluation | Cached result with a short TTL | Fresh evaluation for every run |
| Rollout (Listing 11.4) | Stop at 5% failed devices, keep passed waves | Stop at the first failure, unwind every wave |
Two tiers are enough to show the model. Many organizations add a third, such as critical for changes to the core or to the security policy itself, with an extra reviewer and a canary wave. It is one more tier in the rollout policy and one more column here.
The tier is the security decision that matters most, so the NAP computes it; the requester never chooses it. A requester who can label their own change standard has bypassed every control in the table. The NAP computes a baseline from three fields every request carries at intake:
- The workflow, such as firewall-rule-add or vlan-add.
- The target scope, as a device count or a site boundary.
- The configuration domain (security policy, routing policy, operational data), which the workflow definition declares once.
From these three fields the NAP classifies the request without understanding its semantics. A firewall rule that targets more than one site is high by definition. A VLAN on one site’s access ports stays standard. A workflow can add a content check on top, as Chapter 11’s firewall workflow does against the security policy, and that check can only raise the tier, never lower it. A request missing any of the fields is rejected at intake, never defaulted to standard: a default-to-lowest classification is no classification at all.
Rules or an AI assistant can infer the fields for the requester. A change to an ACL implies the workflow and the configuration domain, and the scope follows from which devices reference that ACL. Validate any inferred value against the workflow definitions before the intake gate uses it, because a misclassified high request treated as standard skips every control above.
A request can only name a workflow that has been onboarded, so the taxonomy grows with onboarding: each workflow’s floor tier and configuration domain are reviewed when it is released. If your NAP already runs workflows without tiers, give every active workflow its tier and domain, review them with the security team, and only then switch the intake gate to enforcement. Enabled earlier, the gate holds every unclassified request at once: an outage of your own making rather than a security event.
The tier decides which controls apply. The next question is how these controls are enforced.
Gates and Approvals#
Chapter 11 introduced the golden path: the recommended, well-documented, well-supported route through common workflows. The golden path is a guardrail: it makes the correct behavior easy and the incorrect behavior inconvenient, but it does not prevent the incorrect behavior. An engineer who knows the golden path and chooses not to follow it, perhaps under time pressure, perhaps because their workflow has legitimate differences, can still submit a change that bypasses the golden path’s conventions.
Enforcement gates are different. A gate in the change workflow that rejects a change if it does not reference a valid change ticket cannot be bypassed by an engineer who is in a hurry. A policy check that blocks deployment if the artifact has not passed simulation cannot be skipped by an engineer who is confident the change is correct. The gate either passes or it does not; the distinction between guardrails and enforcement gates is this non-bypassability.
The Policy-as-Code Gate pattern encodes governance rules as machine-executable checks in the change workflow. Every governance requirement that matters enough to enforce, as opposed to merely recommend, should be a gate that the workflow evaluates automatically and that human reviewers cannot override. The gate is consistent: it applies the same rule to every change, every time, regardless of who reviews or how busy they are. The gate is auditable: its definition is in version control, its execution produces a log entry, and its decision is part of the artifact’s provenance record. Policy as code is an established practice, not an idea specific to this book: Open Policy Agent, a graduated project of the Cloud Native Computing Foundation (CNCF), is the most common engine for it.
A very common example is branch protection in a VCS: any change must go through a pull request with a human approval and passing checks.
The list of policy-as-code gates is the governance implementation. When a new regulatory requirement arrives, you add or modify a gate, review the gate definition through the standard code review process, and deploy it as a versioned change to the NAP’s policy configuration.
Gates enforce rules a machine can check. Some decisions still need a person.
Chapter 11 places two approval points on the change path. At the Source of Truth proposal, the intent review has another engineer check that this is the right change. At promotion, the deployment approval releases the validated artifact into the window. Table 13.2 decides which requests need them. Each is an approval gate: the NAP holds the request, records it as pending, notifies the approver, and moves on only with a recorded approver identity.
Compliance frameworks commonly require two controls on top of that. Implement both as NAP automated features:
- Separation of duties: the person who submits a change cannot approve it. The intent reviewer is never the requester. The NAP records the submitter’s identity and rejects any approval from that same identity.
- Four-eyes principle: for
highrequests, two different people approve, the intent reviewer and the deployment approver, and neither of them is the requester. The NAP holds the run until both approvals are recorded. Approvals expire: one given for Saturday’s window should not still be valid a month later.
One gate turns these controls into enforcement, and its absence caused the opening story’s gap. The change-ticket-reference gate checks that every production deployment has an approved change ticket, approved by someone other than the submitter. Figure 13.8 follows a request made through the Presentation layer to the gate and back.
For a standard request, the ticket is the standard change the NAP opened itself, so the gate checks that it exists and references the pre-approved policy. For a high request, it checks the approval in the ITSM system. A change started by a trigger inside the NAP, such as a merge to an intent repository, has no form to carry the ticket. The reference travels in the merge or commit metadata instead, and the gate runs the same check against it.
The gate evaluates identically for every change of this workflow: the same conditions, the same query, the same rejection rule, whoever submitted it and however urgent it feels. The failure message is a design requirement, not a courtesy. A gate that rejects with a generic “policy violation” sends the requester to the network automation team to find out which condition failed, and that support interaction is the handoff the NAP was built to eliminate.
Introduce AI agents into this process carefully. An AI agent should not be an approver. Accountability requires a named human, so when an audit asks who authorized a change, the answer cannot be “a model”. AI has no accountability chain and no regulatory standing. And, obviously, AI cannot be called into an incident review. Use it to make approvers more effective and not to replace them.
The harder question is which changes need an approval at all. Get that wrong and the control becomes the bottleneck, which is where most organizations land. Change control boards are where automation goes to die, and the failure is quiet: the change workflow works, the gate is correct, and the change still takes a week.
Approvals still happen; the NAP automates them. If your Change Advisory Board (CAB) meets weekly to approve adding a VLAN, the NAP is already slower than the manual process it replaced. The ITIL standard change, which Chapter 11 maps to the standard tier and Chapter 15 generalizes as the Pre-Approved Automation Pattern, solves it.
I always repeat this idea: a public cloud (e.g., AWS or Azure) applies this principle of pre-approved changes (in the overlay network). When you request a new network service (e.g., a VPC), no one has to approve it; it goes straight to production because it is a bounded service that is secure enough to release.
So the rule is: changes that fit within clear guardrails proceed automatically; only the guardrail logic itself requires human review and approval. This makes everything much more straightforward and multiplies the value of each review, because you change the logic far less often than you apply the guardrail. Define the minimum guardrail coverage and the maximum impact a change may carry without review, then let the system work. Otherwise the automation is not as effective as it could be.
Urgency is where approval models break, so the emergency routes need their own governance. Chapter 11’s When the Path Is Blocked section gives two:
- The emergency lane keeps the automated gates and compresses the people: the on-call engineer gives both approvals, which suspends separation of duties for that one change. The control moves to after the fact. Another engineer repeats the intent review on the next business day, and the NAP tracks it as an open item until that happens.
- Break-Glass Procedure access bypasses the NAP entirely, so its controls live outside it. The credentials sit in a vault separate from the IDP’s secrets store, because an IDP outage is one of the ways the NAP goes down (Chapter 12). Only named people can check them out. Every use raises an alert and is logged to its own tamper-evident trail, the credentials rotate after each use, and the Source of Truth is reconciled before the NAP touches those devices again.
Count both. A team that uses the emergency lane every week has either a standard change it has not admitted to, or a review process too slow for its work.
Gates and approvals encode today’s policy. Policies do not stay current on their own.
Policy Lifecycle Management#
Policies change. A security policy written when the organization had a single data center may not fit an organization with data centers in three regulatory jurisdictions. A change management policy written before automation, requiring a human to validate every configuration change manually, may need replacing with one that distinguishes changes that passed machine validation from changes that did not.
Four events should prompt a policy review:
- A regulatory requirement changes. A new version of PCI DSS, a new jurisdiction, or a new contractual obligation may require adding, tightening, or relaxing a gate.
- A gate’s false-positive rate rises. A gate that rejects legitimate changes at a high rate is either poorly specified or no longer matched to the workflows it governs. Inspect the gate definition; do not train engineers to work around it.
- An incident reveals a gap. If a change caused a problem an existing gate should have caught, tighten the gate. If no gate covered it, add one.
- A scheduled quarterly review. Gates for retired workflows are dead code, and dead code in a policy engine is a liability, because it creates uncertainty about what is actually enforced. Waiting for a finding or an incident means the review is already late.
Manage policy definitions with the same version control and review discipline as automation code. A policy definition is code: it expresses a rule, the NAP executes it, and changes to it have operational consequences. A policy that changes without review, or exists only as a wiki page, is not a policy the NAP can enforce. Test them like code, too. Every policy gets unit tests with a change it must pass and one it must reject. A new policy version runs in report-only mode, logging what it would have blocked, before it starts blocking.
Versioning also gives the governance system its own audit record: for any point in history, the compliance team can see which policy version was active and what it required.
All of these controls cost something. The last policy question is how to keep that cost below the cost of going around them.
Keeping Controls Cheaper Than Bypassing Them#
Security controls work by adding friction: a check that must pass, a credential that must be issued, a gate that must open. At twenty runs an hour, thirty seconds of policy evaluation per run is noise. At a thousand concurrent runs, it sets the NAP’s throughput. An approval that takes an hour is fine for three requests a day; during a firmware rollout with three hundred, it serializes the work.
Figure 13.9 shows where that leads as volume grows. The curves are illustrative.
Friction at scale produces bypass pressure. A team that must move faster than the controls allow will find a way: disable the gate, reuse a shared credential, approve in bulk without reading. Each bypass recreates the risk the control was meant to remove. Do not weaken the controls; make them cheap enough that using them costs less than bypassing them. If bypassing a control is the path of least resistance, the control has failed, whatever the policy says.
Three mechanisms keep the cost down, and each moves the crossing in Figure 13.9 to the right. Table 13.2 says which tier gets the first two:
- Asynchronous and synchronous checks. A check whose failure must stop the change runs synchronously, as a blocking gate. A check that is informational (a low-severity dependency finding, a style warning in a policy definition) runs asynchronously and reports without blocking. Mixing the two in one undifferentiated list produces gates where engineers cannot tell which failures they must fix now and which can wait for the next sprint.
- Policy decision caching. A policy that evaluates identically for every request of the same workflow can be cached with a TTL (i.e., a cache expiry duration). The TTL is a security parameter: a policy change takes that long to reach every enforcement point. Choose it on purpose; never default to the longest value that avoids cache misses.
- Shift-left security. The earlier a problem is caught, the cheaper it is to fix. A secret caught by a pre-commit hook on the engineer’s workstation costs seconds. Caught in CI, it costs a pipeline run. Found after deployment, it costs an incident response. Run the fastest, cheapest checks first: pre-commit hooks for secrets and obvious policy violations, CI gates for deeper analysis and dependency scanning, deployment gates for final compliance validation.
A multi-region NAP adds one more cost: consistency. A policy enforced in one region only is a suggestion everywhere else. Define policy centrally, in VCS, and distribute it to enforcement agents in each region through the same pipeline as any other NAP artifact. The propagation window, from commit to every agent enforcing the new version, is a security parameter: during it, regions evaluate different versions. Keep it short enough that the security team can reason about the exposure, and monitor it. An agent left on a stale version is a silent security gap, not a visible operational error.
Policy decides whether a change may happen. It assumes that what gets deployed is what was reviewed. Next, we will check that assumption.
Integrity: What Actually Ran#
An authorized, approved change can still deploy something nobody reviewed: a template modified after review, a compromised dependency in the worker image, a build step that injected code. Integrity controls close that gap. This section covers where the NAP’s artifacts come from, the checks the secure development lifecycle adds to the pipeline, and the Provenance Chain pattern that ties them into one record.
You can’t trust code that you did not totally create yourself.
Ken Thompson
Nobody writes every line of the NAP, so integrity controls are how you trust what you did not write. The NAP’s artifacts are themselves a security supply chain. A configuration template renders network configuration from a template engine and a data source. If either is compromised, the rendered configuration reflects that compromise. A container image running the automation workflow contains a base image, a set of installed packages, and the workflow code. If the base image has a known vulnerability, every workflow run in that container is exposed to it.
Both platforms have a supply chain. The IDP builds the NAP’s software: its images and packages. The NAP builds network configuration artifacts. The mechanisms below apply to both. The artifact store and its signing service usually belong to the IDP; the NAP’s part is to sign the configuration artifacts it produces and verify them before deployment.
Three lines of defense apply:
Code signing: every artifact the NAP consumes carries a cryptographic signature proving it was produced by a specific identity and not modified since. A template modified after signing, whether by a legitimate update that was not re-signed or by a malicious change, fails verification and is not used.
Provenance: every artifact carries a record of where it came from, when it was produced, and what process produced it. An artifact promoted to production-approved traces back to the commit or Source of Truth change that triggered it, the workflow run that produced it, the validation stages it passed, and the person who approved its promotion.
Dependency scanning runs with the other development checks in the next section.
The industry reference framework for signing and provenance is SLSA (Supply Chain Levels for Software Artifacts), an open specification originally developed at Google. It defines levels of supply chain integrity, from a documented build that produces a provenance record up to hermetic, reproducible builds with verified provenance. It applies twice in a NAP: to the NAP’s own software, built by IDP pipelines, and to every change artifact, produced by a change workflow run. SLSA level 2 is a practical target for both. A hosted service, a pipeline, or the Orchestrator produces the artifact and a signed provenance attestation for it. You can then verify that it came from the declared process and the declared source. Use the SLSA attestation format as the checklist for what your provenance record must contain, whichever tooling generates it.
Signing and provenance protect the artifacts. The code that produces them needs its own checks.
SSDLC for Automation#
The automation code itself needs the same secure development lifecycle as any software that operates in a sensitive environment. The Secure Software Development Lifecycle (SSDLC) for automation adds four checks, all of which run before any artifact is promoted. The first three run in the CI pipeline that builds the automation code; the last runs in the change workflow, on the rendered configuration:
Secrets scanning: every commit is scanned for patterns that indicate credential material: API keys, passwords, private keys, tokens. A match is a blocking gate: the artifact is not built until the secret is removed and the history cleaned. A secret committed to VCS is visible to everyone with repository access, and it stays in the history after the file is fixed. Tools such as TruffleHog and detect-secrets run as pre-commit hooks or CI steps.
Static analysis: the automation code is checked for known bad patterns without running it, such as a template that renders a wildcard ACL or a script with an injection flaw. For Python, bandit covers the common cases in seconds. Network automation adds one risk general-purpose tools miss: Jinja2 template injection. A malformed SoT value can break a template’s structure and open unintended access, so check that every variable insertion is constrained:
{{ data.vlan_id | int }}forces an integer, while{{ data.description }}inserts the raw string.Dependency scanning: every package, collection, and library is checked against vulnerability databases. A high-severity CVE blocks; lower-severity findings are informational. Dependabot and Renovate automate this: they watch the dependency manifests and open pull requests when a dependency has a known vulnerability, inside the normal code review workflow. A dependency that was safe when the workflow was written may have a known vulnerability six months later, so the scan also runs on a schedule, not only at build time.
Pre-deployment validation: before promotion to production-approved, a final check validates the rendered configuration against the security policy schema. A firewall rule that opens an any-any pass is a policy violation even if the template rendered it correctly from the SoT data that requested it.
The SSDLC checks are the third testing leg. They do not replace the functional testing of Chapter 11 or the resilience testing of Chapter 12. They catch what those miss: a secret committed to VCS, a wildcard ACL that renders correctly, a dependency with a known CVE.
Each of these checks produces a result. The next pattern makes those results one record.
The Provenance Chain Pattern#
Without a provenance chain, the opening story’s gap is unavoidable: the NAP can record that changes were made, but not the chain of authorization, validation, and promotion that preceded them.
The Provenance Chain pattern connects every supply chain and validation mechanism into one traceable record. Every artifact the NAP keeps in the artifact store has a provenance record that answers four questions: who produced it, when, from what inputs, and through what process?
The idea comes from software supply chain attestation, applied here to network changes. in-toto, a graduated CNCF project, records each step of a software supply chain as signed metadata and verifies the whole chain before installation. SLSA defines the provenance a build must produce. The NAP adds the network half: the approvals, the deployment outcome, and the link to the configuration running on the device.
For the firewall change, the chain looks like this. The engineer’s request becomes a proposal in the Source of Truth, and a peer’s intent review merges it on Tuesday. The change workflow run triggered by that merge renders the rule, runs the validation gates and the simulation, and signs the artifact with the worker’s identity. Its provenance record collects the proposal, the requester, the reviewer, the run ID, and each gate that passed, with timestamps. On Saturday, a second engineer gives the deployment approval just before the window, and the record adds the approver, the ticket, and the time. Each wave then adds its device and outcome: the standby unit first, then the active one.
The chain is read backward, from the device to the request, and each link answers one of the auditor’s questions. Figure 13.10 shows it.
The record’s critical field is the artifact ID written into the device’s configuration at deployment, such as fw-dc1-rule-4412-run0042: it links the device back to everything else. That is usually a structured comment in the rendered configuration (for example, ! artifact: fw-dc1-rule-4412-run0042 in IOS-style syntax), a description field on a management interface, or a syslog event emitted at deployment and correlated by the audit system. The mechanism depends on what the device OS supports; the requirement does not. Any device in the fleet can be asked for its current artifact ID, and that ID retrieves the full record from the artifact store. That is the query the PCI auditors needed and could not run: “for fw-dc1-a, show me every change in the last six months, who authorized each, and what validation it passed.”
The record does not need a complex format. Each stage of the run appends its entry (the stage name, a timestamp, the artifact’s hash before and after, and the identity that ran the stage) and signs the accumulated record before the next stage begins. A flat list of stage entries with a chain of signatures is enough.
Integrity ensures the NAP deploys what it validated. Evidence is how you prove that later, to someone who was not there.
Evidence: Proving It#
Evidence turns everything above into answers. This section covers the requirements an audit trail must meet, the compliance map that connects it to a regulation, and continuous compliance: proving that the network still matches what was approved, long after the change.
The data behind the opening story’s gap was all there: device logs, workflow records, Source of Truth state, and tickets. Nothing connected them, and connecting them by hand took three weeks.
Auditability is not the same as logging. Logging produces records of individual events, and auditability produces records that can be correlated, queried, and interpreted by someone who was not present when the events occurred.
The audit trail for every automation action must satisfy three requirements:
Tamper-evident: the record cannot be modified after the fact without the modification being detectable. Write-once storage and cryptographic integrity checks (each record signed, or hashed into a chain) implement it. An audit record that the administrators of the device configurations can also modify is not a reliable audit record.
Complete: there are no gaps. Every change the NAP makes has a record. So does every approval decision and every policy gate evaluation. An auditor who examines a specific date finds a complete account of every automation action on that date.
Queryable: the record answers specific questions. What changed on device X in the past 90 days? Which workflows ran with authorization from person Y in the past 30 days? What was the state of site Z at a given timestamp? These are forensic queries, and the audit infrastructure must answer them.
The Provenance Chain record is a concrete implementation of all three: it is signed and append-only, it exists for every automated change, and it can be queried by run ID, device, requester, or time range. A team building an audit trail from scratch should start there, with the three properties as acceptance criteria.
Send the NAP’s audit records and security alerts to the security team’s SIEM (security information and event management system). A break-glass checkout or a failed signature check then appears next to every other security event, not only on the network automation team’s dashboards.
With it in place, the auditors’ request becomes a query rather than a three-week investigation. For each of the 847 changes, the auditors want the authorizing identity, the ticket, evidence of validation, and the state before and after. The answer is one query, such as artifact-store query --device-group firewall --since 2025-07-01 --include provenance. It returns 847 records, each with the run ID, the requester, the ticket, the simulation result, the approver, the outcome, and the artifact that traces back to its request. The pre-change snapshot from Chapter 11 answers “the state before”, and the post-change verification answers “the state after”. The audit that took three weeks and six engineers now takes an afternoon.
Tamper-evident logs exist off the shelf. Sigstore’s Rekor and Trillian keep signed records in an append-only Merkle tree, where any edit is detectable. Write-once (WORM) object storage, such as S3 Object Lock or MinIO, is simpler, with a weaker query interface.
The audit trail answers an auditor’s questions. The compliance map tells the auditor which questions to ask.
Compliance Mapping#
For most teams, the gap between a regulation’s requirements and the NAP’s implementation is undocumented. The controls exist: simulation gates, approval workflows, dependency scanning, audit logs. But nothing the auditor can read says that “PCI requirement 6.3.3, protect all system components from known vulnerabilities” is implemented, for automation code, by the dependency scanning gate in CI.
The compliance map closes that gap. For each regulatory control that applies, it states which NAP feature, gate, or record implements it, where the evidence is, and who maintains it. It is a living document, updated when the controls, the NAP, or the regulation change. The auditor reads the map, examines the evidence at the stated location, and confirms or disputes the implementation. That is a tractable audit. Asking an auditor to read the NAP’s code and infer which controls it implements is not.
A single entry, in Table 13.3, illustrates the form:
| Field | Value |
|---|---|
| Control | PCI DSS v4.0 Requirement 6.5.1 |
| Requirement | Changes to production system components follow documented procedures: reason, security impact, approval by authorized parties, and testing |
| NAP implementation | Every change carries a named requester (Identity: Who Is Acting) and an approved ticket (Gates and Approvals); the Provenance Chain records the gates passed and the approver (The Provenance Chain Pattern) |
| Evidence location | artifact-store query --device-group cde --include provenance returns all changes with requester, ticket, gates passed, and approver |
| Responsible party | Network automation team (audit trail architecture); security team (quarterly review) |
| Review cadence | Quarterly pull for audit submission; continuous alerting if any change record is missing a provenance entry |
The evidence location is an executable query, not a description of where to look (this is key). An auditor who can run the query and read its output does not need the network automation team in the room. Without it, every audit is a manual and complex process instead of a set of queries the auditor can run independently.
The audit trail and the map prove what happened at the moment of each change. Compliance also has to hold between changes.
Continuous Compliance and Drift Remediation#
Chapter 16 builds the full closed loop for drift: it compares the running configuration and the route state with intent, and decides whether to reconcile or alert. This section covers drift as a security concern, and the rule for when automation may remediate it on its own.
Configuration Drift is the gradual divergence between the desired state recorded in the SoT and the actual state running on the network. Manual changes made outside the NAP cause it, as do rollbacks that did not complete and devices that behave differently from what an automation run expected.
Drift is a security concern as well as an operational one. The network’s security posture is guaranteed only as far as the running configuration matches the authorized, policy-compliant state in the SoT. A firewall rule designed to allow specific traffic becomes unknown the moment the device diverges from that design. The access control list that was reviewed and approved may no longer be the one enforcing access. You cannot assert a security posture you cannot verify.
Chapter 11 checks drift before every wave of a change. Continuous compliance covers the time in between: Observability compares the running state with the desired state on a schedule. When it finds drift, the NAP has two options, and it chooses per policy type. Two questions decide it, as Figure 13.11 shows: would restoring the desired state affect traffic, and could someone have made the change on purpose?
The two options follow from the grid:
Auto-remediation restores the desired state without human involvement. Use it when restoring has no traffic impact and the state is unlikely to have been changed on purpose: Network Time Protocol (NTP) servers, DNS resolvers, interface descriptions, and SNMP community strings that reverted to a vendor default. A community string removed entirely is different: removal can mean an attacker disabling monitoring, so alert. Auto-remediation needs high confidence in the policy definition, because remediating against a stale or wrong policy drives the device further from the correct state.
Alert-and-wait notifies the operations team and waits for a human decision. Use it for anything that touches the forwarding plane or that someone could have changed on purpose outside the NAP. A BGP route-map may have been changed during a vendor support call to fix a live issue, and reverting it reintroduces the issue. A firewall ACL may carry an emergency change made during an incident. Reverting a spanning tree priority on a core switch without understanding the topology can trigger reconvergence. The trade-off is response time.
A NAP that auto-remediates all drift uniformly will eventually restore a configuration that was changed for a reason it did not know about.
Evidence assumes the system producing it can be trusted. The last section covers what to do when it cannot.
Response: When It Goes Wrong#
Security incidents happen. Two kinds involve the NAP: a compromise the NAP must help contain, and a compromise of the NAP itself. The first needs automated containment; the second needs a runbook written before it happens.
When an incident involves the NAP, response time matters. A compromised workflow credential that is not revoked immediately can keep making changes. A device isolated by the security team but still receiving automation updates is receiving them from a potentially compromised process.
The NAP should be able to execute three containment actions without human intervention, triggered by a security event:
Credential revocation: every active credential associated with a compromised run, a compromised service account, or a flagged identity is revoked at once. Runs using those credentials are terminated, and new runs requesting that identity are rejected until the incident is resolved.
Device isolation from automation: a device flagged during an incident is removed from every workflow queue, marked unavailable for new runs, and its management credentials are rotated. The device is not deprovisioned; it is quarantined from the NAP’s reach until the incident review decides to restore access.
Automated rollback: if a compromised run made changes but the NAP itself is clean, the NAP rolls back to the last known good configuration. The rollback uses the Provenance Chain to find the last pre-incident state and applies it through an isolated, verified run. When the compromise window is unclear, such as a slow supply chain attack over weeks, the Provenance Chain provides the history to reason from. No automated system can pick the right target, though: human forensic analysis must set the incident boundary first. When the NAP, or the IDP under it, is suspected, halt all automation first and roll back from the break-glass path, not from the NAP.
Every containment action also notifies two teams at once: the network automation team, which knows the NAP, and the security team, which runs the incident. Figure 13.12 shows the sequence.
Containment assumes the NAP is a trustworthy tool in the response. Sometimes it is the thing that was compromised.
Runbooks for NAP Compromise#
Who will guard the guards themselves?
Juvenal
The NAP guards the network. This section is about who guards the NAP. The most challenging incident for a NAP is one where the NAP itself is the compromised component. A network’s attack surface is the devices and the management plane connections to them. A NAP’s attack surface includes all of that, plus the Orchestrator, the artifact store, the secrets store, the pipeline runners, and every workflow definition in the VCS repository. Three of those belong to the IDP, so write the runbook with the developer productivity team.
A compromised Orchestrator can schedule unauthorized runs. A compromised artifact store can serve modified artifacts that look legitimate but contain backdoors. A compromised pipeline runner can intercept credentials mid-run and exfiltrate them. None of these has an obvious indicator in network operations: the NAP appears to be running, and changes appear to succeed.
You do not know when you will need it, but the runbook for NAP compromise must exist before the incident. It covers four phases:
Detection: how does the network automation team confirm that the NAP, or the IDP under it, is compromised, and not just a downstream target? Indicators include runs that match no submission record, artifacts whose provenance chain is missing or fails signature verification, credentials issued to workflow identities that are not running, and device changes that do not appear in the audit log.
Containment: halt all NAP operations immediately. Name the authority to do this in the runbook beforehand; under incident conditions, the decision cannot wait for a committee. In most organizations, halting the NAP needs CISO- or VP-level authorization, so the runbook names the person pre-authorized to make the call at any hour and an escalation path if they are unreachable. Revoke all active NAP credentials. Isolate the artifact store from writes. Preserve the audit log, every run record, and the IDP pipeline logs before touching anything else: the investigation depends on them.
Evidence preservation: do not restore, wipe, or rebuild any compromised component before its forensic state is captured. A rebuilt runner that was used to exfiltrate credentials no longer has the memory or filesystem state the investigation needs. Containment and evidence preservation run in parallel, not one after the other.
Recovery: restore each component from a known-good state, starting with the IDP’s secrets store, artifact store, and pipeline runners, in that order, then the NAP’s own. Rotate every NAP credential in dependency order. Re-verify every artifact in the artifact store against its provenance chain before re-enabling production deployments. Recovery is complete when a full change workflow run through the restored NAP produces a clean audit record that the security team can verify.
A team without this runbook will write it during the incident, the worst time to think clearly about NAP security boundaries. Write a basic one now. A single page of guidance helps your team act decisively when it matters.
So far, I have explained the complete model, but few teams can build it at once, so next I should help you get started with the fundamental pieces.
The Minimum Viable Security Posture#
You now know the full security architecture. Where do you start, with a NAP already deploying changes? With the five stages in Figure 13.13. Four are built in the NAP; one, the end of static credentials, comes from the IDP. Each closes a gap the opening story exposed. Build them in this order where you can.
No static credentials (IDP). No API keys, tokens, or passwords in pipeline runner or Orchestrator worker configuration, environment variables, or repositories; every run gets its credential from the IDP’s secrets store. It is the foundation the per-run controls rest on: a NAP that uses one shared static credential cannot scope credentials per run, cannot revoke selectively, and cannot produce an audit trail that tells one run from another. This stage is complete when a full audit of pipeline runner configuration, environment variable stores, and VCS history finds no credential material.
A named submitter on every request (NAP). Every request carries a named, authenticated identity, and the NAP rejects requests without one, whatever their content. Without this, the audit trail records that a change was made but not who asked for it, and the PCI finding cannot close: the authorization chain needs a named human at its root. For a
standardrequest, the named submitter is the whole approval, because the policy that classified the request already pre-approved it. This stage is complete when the audit record of every request contains the authenticated submitter, and no run can start without one.The change-ticket gate (NAP). The gate from Gates and Approvals becomes a hard enforcement point: no production deployment proceeds without a valid, approved ticket that the submitter did not approve. For a
standardrequest, the ticket is the standard change the NAP opens and closes itself. Had this gate existed for the 847 firewall changes, each record would carry a ticket reference and an approver automatically, and the finding would have closed. Answering the auditors with one query takes stage 4. This stage is complete when every production deployment in the audit trail has a corresponding approved ticket, verifiable by the NAP without manual correlation across systems.The Provenance Chain (NAP). Every artifact that reaches production-approved carries a signed provenance record with the request, the stages passed, the approver, and the deployment outcome, and every deployed device configuration carries its artifact ID. With it, the auditors’ request becomes one query. This stage is complete when any device in the fleet can be queried for its current artifact ID, and that ID retrieves the full authorization chain from the artifact store without further correlation.
One compliance map (NAP). Stages 1 to 4 put the controls in place. The compliance map connects them to the regulation the organization operates under. Map one framework first: PCI DSS, SOC 2, or NIST CSF. If no regulation applies to you, start with NIST CSF: it is the most framework-agnostic, it maps most directly to the controls in this chapter, and PCI DSS and SOC 2 both build on similar ground. Write the evidence queries an auditor can run without the network automation team. This stage is complete when an external auditor can reproduce the full control evidence for one framework using only the compliance map and the NAP’s query interface.
If your organization must comply with a specific framework, stage 5 is not optional. If it does not, treat a framework as a reference instead of a requirement. PCI DSS, SOC 2, and NIST CSF were written by people who spent years identifying what robust controls look like. Using one as a checklist, even without an external audit in view, closes reasoning gaps that a team building its own control inventory from scratch will miss. A framework is useful less for the certificate than for reminding you of something obvious you overlooked.
The full architecture goes beyond these five stages: ABAC for context-sensitive constraints, SSDLC scanning, incident response playbooks, distributed policy enforcement. But a NAP at stage 3 already removes the opening story’s finding, because the 847 changes each carry a ticket reference and an approver. A NAP at stage 5 is ready for its first external audit without emergency reconstruction.
Summary#
The NAP is built and adapts to complicated scenarios. But is it trustworthy through the security and governance lens? Or, in other words, can you prove it (the typical auditor’s question)?
The foundations are built on a secure IDP that provides proper credential and artifact management that the NAP relies on and adapts to the network scenario with a clear Provenance Chain.
Then, security operations start by identifying the request (who asked, who reviewed, and who approved it) and associating the proper risk to act according to that.
Many times, security is forgotten in the NAP design, and retrofitting it is costly. Adopt it from the beginning, and establish a minimum viable posture to grow on top of it with solid foundations. It pays off, and you will be ready to show evidence when the day comes.
With a rock-solid NAP, reliable and trustworthy, Part 4 turns to the people around it.
References#
- Securing DevOps, Julien Vehent (Manning, 2018). Security in CI/CD pipelines: secrets, audit trails, and dependency scanning.
- Zero Trust Networks, Evan Gilman and Doug Barth (O’Reilly, 2017). Identity-based security, the model behind the Identity: Who Is Acting section.
- Security Engineering, 3rd Edition, Ross Anderson (Wiley, 2020). Least privilege, separation of duties, and audit trails. (Full text free online.)
- The Phoenix Project, Gene Kim, Kevin Behr, and George Spafford (IT Revolution, 2013). How governance applied as friction produces the bypasses this chapter designs out.
- Investments Unlimited, Helen Beal, Bill Bensing, Jason Cox, et al. (IT Revolution, 2022). A novel about audit and compliance as automated governance.
- in-toto: Providing farm-to-table guarantees for bits and bytes, Santiago Torres-Arias, Hammad Afzali, Trishank Karthik Kuppusamy, Reza Curtmola, and Justin Cappos (USENIX Security Symposium, 2019). The paper behind in-toto; with SLSA, the basis for the Provenance Chain pattern. (Full text free online.)
💬 Found something to improve? Send feedback for this chapter