liveBook · Manning

Policy as code

Policy as code is the practice of expressing organizational, security, authorization, or compliance policies as machine-readable, version-controlled rules that can be tested and enforced automatically.

How 3 Manning books explain it

Authorization in Action

Policy as code is an approach that represents policy as machine-readable, version-controlled, and testable software artifacts.

How it is used
Externalizes authorization rules for runtime, context-aware access decisions across applications.
How deep it goes
Explains authoring, repositories, stores, CI/CD deployment, testing, analysis, rollback, and governance rather than policy-language internals.
Examples
Uses Cedar forbid rules for critical-resource device posture and department-based resource access.
What you can do after
Operate/configure it through repositories, CI/CD validation, policy stores, monitoring, and rollback.

Read how Authorization in Action explains policy as code →

Effective Platform Engineering

Policy-as-code is the practice of representing organizational policies as machine-readable code that can be evaluated and enforced automatically.

How it is used
Enforces governance and trust requirements at platform boundaries without taking development orchestration away from teams.
How deep it goes
Explains enforcement placements and implementation trade-offs, including admission controllers and service-mesh checks, without detailing a complete policy implementation.
Examples
Uses required Kubernetes deployment labels, signed software artifacts, and service-mesh authorization checks as operational examples.
What you can do after
Apply it via Gatekeeper or OPA to place compliance or authorization checks at deployment and service-access boundaries.

Read how Effective Platform Engineering explains policy as code →

Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

Policy as code is the practice of expressing security and compliance rules in executable or declarative form so infrastructure changes can be evaluated automatically.

How it is used
Gates infrastructure changes with automated security and compliance checks before production.
How deep it goes
Explains metadata parsing, field assertions, enforcement categories, reuse, and failure handling without detailing policy-engine internals.
Examples
Uses a Python pytest check that rejects GCP 0.0.0.0/0 database access and maps the pattern to AWS and Azure firewall resources.
What you can do after
Build and operate preproduction policy checks that diagnose insecure metadata and block noncompliant infrastructure changes.

Read how Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform explains policy as code →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.