liveBook · Manning

Policy engine

As explained in Google Anthos in Action

A policy engine is a software evaluation system that decides whether requests satisfy declarative rules.

A policy engine evaluates requests against configured rules and decides whether they may proceed. With the ACM Policy Controller enabled, a ValidatingWebHook registers Gatekeeper as a Kubernetes admission controller. The API server sends object requests to Gatekeeper before admitting them. section 13.4.1

For a Pod creation request, Gatekeeper checks the configured policies for violations. A denial prevents the API server from creating the Pod and returns the policy error. Policies use constraint templates and constraints; a constraint can match Pod objects and specify dry-run enforcement. section 13.4.1

Evaluation typically takes about one millisecond, but a poorly performing policy can add system latency. Check policy performance when introducing custom rules. section 13.4.1

Table 13.2 Namespace exemption options (view table figure)

Process option

Results of exemption

Audit

Namespace(s) will not report audit results but will still be part of the webhook and sync processes.

Webhook

Namespace(s) will be exempt from the admission controller but will still be part of the audit and sync processes.

Sync

Namespace(s) resources will not be reported into Gatekeeper but will still be part of the audit and webhook processes.

*

Exempts the namespace(s) from all Gatekeeper processes.

Namespace exemptions can apply separately to audit, webhook admission, and sync, or to all Gatekeeper processes. Choose the process deliberately: a webhook exemption does not also suppress audit results. section 13.4.1

How Google Anthos in Action covers it

How deep it goes
Explains request routing, denial, latency, and configuration examples, but defers policy creation.
Examples
Uses a denied Pod request, dry-run privileged-container violations, and namespace exemption configurations.
What it assumes
Assumes a Kubernetes cluster with ACM installed and Policy Controller enabled for the admission workflow.
What you can do after
Operate/configure it through constraints and scoped exemptions while accounting for denial behavior and latency.
How it connects
Connects admission controllers, ValidatingWebHook, Gatekeeper, constraint templates, and constraints.

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.