Policy-as-Code Gate

Policy-as-Code Gate

A gate nobody can bypass, or it is only advice.

What Is Policy-as-Code Gate?

A policy-as-code check only protects anything if it is a required check nobody can skip. You'll watch a change that reopens a database to the whole internet fail the policy check and merge anyway, because the ruleset only reports and administrators can bypass it. Then you'll make the ruleset enforce, empty the bypass list so a failing check blocks everyone, and replay the exact change to confirm it is now refused, with a documented, time-boxed exception path for genuine emergencies so the gate is used rather than disabled.

What You'll Learn in Policy-as-Code Gate

Policy-as-Code Gate — Training Steps

  1. A change the policy forbids

    Bob holds an administrator account on Corlenna's infrastructure repository. He opens a pull request that reopens the claims database to the whole internet, framed as a partner request. Corlenna processes health claims. It runs a policy-as-code check on every pull request.

  2. Exactly what the gate is for

    The change opens the database port to every address. This is the kind of exposure a policy check exists to catch, no matter how the pull request is described.

  3. The gate sees it

    The policy check runs on the pull request. It does exactly what it should: it fails the change.

  4. Why it will not block

    Bob opens the branch ruleset to confirm what he already suspects: the policy check is defined, but it is advisory, and administrators can merge past it.

  5. Advisory, and bypassable

    The ruleset names the policy check as required, but two settings undo that: it only evaluates, and administrators are allowed to bypass it.

  6. Merge it anyway

    Bob merges the pull request with his administrator privileges. The failing check is reported and overridden, and the change ships to production.

  7. Why the check did not matter

  8. A failing check, merged anyway

    Corlenna's monitoring flags that a change which failed the policy check was merged with an administrator override and deployed, reopening the claims database to the internet.

  9. Open the ruleset

    The fix is not a better scanner; the check already works. It is in the ruleset that decides whether the check binds. Alice opens it.

  10. The two settings that undo it

    The policy check is listed as required, but the ruleset only evaluates and lets administrators bypass it. Those two settings are why a failing check did not block the merge.

Security Framework Coverage

CWE

  • CWE-693 Protection Mechanism Failure
  • CWE-863 Incorrect Authorization

CIS Controls

  • CIS 4 Secure Configuration of Enterprise Assets and Software

NIST CSF

  • PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
  • PR.PS Platform Security

NICE Framework

  • DD-WRL-004 Secure Systems Development
  • IO-WRL-005 Systems Administration