1. Home
  2. Learn
  3. Policy as code

Guide

Policy as code, tested before it counts

Policy as code means writing your security rules as code: versioned, reviewed and tested like any other change. It replaces a rules document nobody reads with checks that run the same way every time, and a history of who changed what.

Policies you can test firstThe policy in force beside a proposed version, simulated against real findings before anyone turns it on.POLICY V12 · IN FORCEPROPOSED V13 · SIMULATED3 findings would changebefore anyone turns it on
01

Rules that run the same way twice

A policy in code gives the same answer for the same input, wherever it runs.

02

Changes you can review

Turning a rule off is a diff with an author and a reason, not a quiet setting.

03

No surprises on rollout

Simulating a policy against real results shows its effect before it is enforced.

The idea

Rules as versioned code

A policy is a rule such as “storage must not allow public access.” Written as code, it takes structured input, such as a resource’s configuration or a planned change, and returns a result: pass, fail or unknown.

Because the rule is code, it lives in version control, has tests, goes through review and can be traced to the framework controls it supports.

Controls mapped to checksA layer of framework controls for PCI DSS, NIST, ISO, SOC 2 and CIS sits above the layer of checks that evaluate them; one failing check is traced to the control it affects.PCINISTISOSOC 2CISCONTROLSeach framework versioned and signedCHECKSone check can satisfy many controls

Where policies run

Three places to enforce

01

In the pipeline

Against a planned infrastructure change, before it deploys. Catches problems before they exist.

02

At admission

Against a workload as a cluster admits it. Stops a non-compliant manifest at the door.

03

Against live state

Against the cloud as it is now. Catches drift and console changes the pipeline never saw.

A healthy lifecycle

From draft to enforced

  1. Write and testWrite the rule with fixtures for passing, failing and unknown cases.
  2. SimulateRun it against recent real results to see how many resources it would flag and how scores would move.
  3. Review and approveLoosening a rule should need a second person. Tightening one can apply at once.
  4. Roll out and recordApply the new version, record which version each result came from, and keep the history.
Nobody approves their own changeTwo people, a risk owner and a security approver, each confirm one change with step-up MFA. Neither of them wrote it.RISK OWNERSECURITY APPROVER✓ step-up mfa✓ step-up mfaONE CHANGEtwo people · neither of them the author

Pitfalls

Where policy quietly fails

01

Unknown as pass

A rule that can’t read its input returns pass by default, and the gap looks like compliance.

02

Silent disabling

A rule turned off with no reason or approval, so the score improves for the wrong reason.

03

Two sets of rules

The pipeline and the live checks drift apart, so a change passes one and fails the other.

04

Exceptions in comments

An accepted risk recorded only in a code comment, with no owner and no expiry.

How ACSE approaches it

One policy, from scan to fix

ACSE’s checks are policy as code, evaluated by an open-source policy engine in your runtime. The same policy that raises a finding re-checks the planned state of every proposed fix, so a fix can’t pass review while failing the rule it was meant to satisfy.

On the Policies screen your team simulates a change first: would-flag counts and score effects, without creating findings. Turning a check off needs a second person, and its controls then read not evaluated and count as unknown. Framework content arrives as signed packs, and adopting a new version takes two people.

  • Unknown never counts as a pass
  • Every policy version recorded and applied per scan
  • Thresholds set within the bounds each check declares
Built to the regulator’s barA cloud estate held inside a boundary of controls, with one fixed resource verified and sealed, and the three questions an examiner asks: authorized, tested, reversible.PROVE IT TO THE REGULATORauthorized · tested · reversiblefixed · verified · sealed

Questions

What people ask us

Is policy as code only for infrastructure as code?

No. The same rules can check a planned change in a pipeline and the live configuration of the cloud. Using one set of rules for both avoids drift between them.

Why should loosening a rule need two people?

Because it weakens a control. Tightening a rule makes you safer and can apply at once; loosening one should have a reason and a second approver on record.

Can I write my own checks in ACSE?

You can set the thresholds each check declares, within its bounds, and build custom frameworks from existing checks. Uploading your own policy code is not offered today.

Talk to us

See ACSE on your cloud.

Tell us what you run and what your auditors ask for. We’ll show you the loop end to end: a real finding, a fix as code, an approval with MFA and the sealed record.