liveBook · Manning

Enforcement action

As explained in Google Anthos in Action

An enforcement action is a policy configuration that determines how violations are handled, such as by auditing or denying a request.

An enforcement action configures how a policy handles violations. Set enforcementAction: dryrun to audit violations without blocking requests; remove it to enforce denial through the admission controller. section 13.9.1

Use the setting operationally as follows:

  • Deploy a constraint with enforcementAction: dryrun, then inspect its violations output. section 13.9.1
  • After confirming the audit results, remove the enforcementAction: dryrun line and redeploy the constraint. section 13.9.1
  • Expect noncompliant Pod requests to be denied at startup once enforcement is active. section 13.9.1

How Google Anthos in Action covers it

How deep it goes
Explains dry-run testing, violation inspection, and transition to denial, but does not detail policy implementation internals.
Examples
Uses privileged-container, host-namespace, and host-networking constraints tested through dry-run violation output.
What it assumes
Assumes Kubernetes constraints and admission control; teaches the dry-run-to-enforcement operational sequence.
What you can do after
Operate/configure Gatekeeper constraints by testing violations first and then enabling admission denial.
How it connects
Connects policy constraints with admission controllers, namespace exclusions, and audit results.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.