Frameworks3 Nov 202616 min read

Cloud Security Program · Part 5 — Govern & Comply: Policy-as-Code & Continuous Compliance

The finale: version-control your guardrails as tested code, measure posture against ISO 27001, ENS, NIS2, DORA, SOC 2 and GDPR every day, catch drift automatically, and turn the whole program into audit-ready evidence — across AWS, GCP and Azure.

This is Part 5 — the finale of the Cloud Security Program, and the part that decides whether everything before it lasts. The first four parts built the controls: Part 1 gave you an account hierarchy, one governed identity, and preventative guardrails; Part 2 segmented the network and hardened the edge; Part 3 encrypted the data, governed the keys, and killed public exposure; Part 4 stood up centralized logging, threat detection and a rehearsed response. Each was a point-in-time achievement. But a cloud estate is not a building you finish; it is a city that keeps growing — new accounts, new teams, hundreds of engineers shipping daily, each change a chance for the posture you carefully built to erode. Without governance, a security program is a snapshot that starts decaying the moment you stop looking. This part makes it durable: guardrails expressed as version-controlled, tested code so a policy change goes through review like any other change; continuous compliance so your posture is measured against your frameworks every day rather than reconstructed in a panic the week before an audit; drift detection so the gap between intended and actual state is caught and closed automatically; and evidence mapping so the whole program becomes an audit narrative you can hand an assessor instead of a spreadsheet you rebuild each cycle.

This is also where the program stops being a security project and becomes a compliance asset. Everything the previous four parts produced — guardrails, network controls, encryption and key governance, detection and immutable logs — is evidence for a control an auditor will ask about. Part 5 is the discipline that captures it continuously and maps it to the frameworks that matter for European and regulated businesses: ISO 27001, the ENS (Esquema Nacional de Seguridad), NIS2, DORA, SOC 2 and GDPR. As throughout, the mechanics are the same across all three clouds — codify, measure, detect drift, map evidence — so learn it once and apply it everywhere.

Scope of this phase

Every part of this program is scope-bounded so you know exactly when you are done.

  • In scope: policy-as-code (guardrails and configuration rules authored, version-controlled, tested and deployed as software); continuous compliance (daily automated measurement of posture against named frameworks, with a real score and owned gaps); drift detection and remediation (catching and closing the divergence between intended and actual state, automatically where safe); and evidence & framework mapping (turning the whole program's controls into continuous, assessor-ready audit evidence).
  • Explicitly out of scope: nothing downstream — this is the finale. What is deliberately not here is one-time hardening; the entire point of this phase is that governance is continuous, not a project with an end date.
  • Definition of done: the exit checklist at the end of this part. When every box is ticked across all three clouds, the program is complete — and, more importantly, self-sustaining.

Govern & comply, across three clouds

Building blockAWSGCPAzure
Policy-as-codeService Control Policies (SCPs)Organization PoliciesAzure Policy + Management Groups
Continuous complianceAWS ConfigPolicy Analyzer + Security Command CenterAzure Policy compliance + Resource Graph
Drift detectionCloudTrail + Config snapshotsCloud Audit Logs + SCC findingsActivity Audit + Defender for Cloud
Evidence & mappingCompliance Hub + artifactsCompliance Workbench + workbooksCompliance Manager + audit-ready workbooks

Same four controls on every cloud — codify policy, measure compliance, catch drift, and map evidence.

The four building blocks — policy-as-code, continuous compliance, drift detection, and evidence mapping — form a governance loop: policy defines intended state, compliance measures against it, drift detection catches divergence, and evidence records the whole thing for attestation. Unlike the earlier parts, this loop never finishes running; that is the feature.

Building block 1 — Policy-as-code

The guardrails from Part 1 were the right idea; hand-editing them in a console is the wrong way to keep them. Policy-as-code takes every preventative and detective rule — SCPs, Organization Policies, Azure Policy, config rules — and treats it as software: authored in a repository, reviewed via pull request, tested in a pipeline, and deployed through automation. The payoff is that a change to your security posture now has a diff, an author, a reviewer, and a rollback, exactly like application code.

ConceptAWSGCPAzure
Preventative policyService Control Policies (SCPs)Organization Policy ServiceAzure Policy (deny/audit)
Config rules / detectiveAWS Config rules + Conformance PacksCustom Org Policy / SCC modulesAzure Policy + Regulatory Compliance
Policy engine (cross-cloud)OPA / Conftest, CloudFormation GuardOPA / ConftestOPA / Conftest
DeploymentIaC pipeline (Terraform / CDK)IaC pipeline (Terraform)IaC pipeline (Bicep / Terraform)

The two moves that make this real are authoring policy declaratively and testing it in CI before it ships. Keep the native org-level controls (SCPs, Organization Policies, Azure Policy) in your infrastructure repo and deploy them through the same pipeline as everything else. Then, for the checks that guard infrastructure changes, add a cloud-agnostic policy engine — Open Policy Agent with Conftest, or CloudFormation Guard — that evaluates every Terraform/CloudFormation plan against your rules before it is applied, so a change that would open a security group to the world or create a public bucket fails the pipeline rather than the production account. This is the same shift-left discipline the DevSecOps program applies to application code, applied to infrastructure. A policy that denies any storage bucket lacking encryption or permitting public access, evaluated at plan time:

cloud-guardrails.rego
package cloud.storage

# Fail the plan if any bucket is public or unencrypted — before it is created.
deny[msg] {
    bucket := input.resource_changes[_]
    bucket.type == "aws_s3_bucket"
    not bucket.change.after.server_side_encryption_configuration
    msg := sprintf("bucket %q has no encryption configured", [bucket.address])
}

deny[msg] {
    acl := input.resource_changes[_]
    acl.type == "aws_s3_bucket_public_access_block"
    acl.change.after.block_public_acls == false
    msg := sprintf("public access block disabled on %q", [acl.address])
}

Wire that engine into the pipeline so failure blocks the merge. Now your guardrails are version-controlled, peer-reviewed, tested, and enforced at the earliest possible point — and the history of why a policy exists lives in the same place as the policy itself.

Building block 2 — Continuous compliance

Codified policy tells you what should be true; continuous compliance tells you, every day, how much of it is — expressed against the frameworks your business actually answers to. Each cloud can map its posture findings directly onto regulatory standards, so instead of a generic "you have 40 misconfigurations" you get "you are 92% conformant with CIS, with these three ISO 27001 controls failing." That reframing is what turns a security backlog into a compliance status a CISO can report and an auditor can read.

ConceptAWSGCPAzure
Compliance dashboardsSecurity Hub standards (CIS, PCI, NIST)SCC compliance / Assured WorkloadsDefender for Cloud — Regulatory Compliance
Framework packsConfig Conformance PacksPosture / benchmark modulesBuilt-in initiatives (ISO, SOC 2, NIST)
ScoringSecurity Hub compliance scoreSCC / Security Health scoreSecure Score + compliance %
Custom controlsCustom Config rules → standardCustom modulesCustom policy initiatives

The work here is selecting the frameworks that matter and mapping your controls to them. Enable the built-in standards packs — Security Hub's CIS/NIST standards, SCC compliance, Defender for Cloud's Regulatory Compliance initiatives — and turn on the specific frameworks relevant to your business. For a European or Spain-based company that typically means ISO 27001 (the baseline certification), the ENS (mandatory for public-sector work and increasingly expected by their suppliers), NIS2 (for essential and important entities), DORA (for financial services and their ICT providers), SOC 2 (for selling to enterprises, especially US), and GDPR (universal). The providers' packs cover the common standards natively; the ENS and the finer points of NIS2/DORA usually need custom controls mapping your Config/policy findings onto specific requirements — which is exactly what building block 1 lets you author. The daily output is a compliance score per framework, a list of failing controls with named owners, and a trend line: is posture improving or decaying? That number, not a point-in-time audit, is your real compliance state. The gap between a provider's generic benchmark and a specific regulatory framework is where a purpose-built GRC platform earns its place — it holds the crosswalk from a cloud finding to the exact ISO 27001 Annex A control or ENS medida it satisfies, so the mapping is maintained once rather than rebuilt every audit.

Building block 3 — Drift detection & remediation

Codified policy and daily scoring assume the running estate matches the intended state. It won't, unless you enforce it. Drift is the silent divergence between what your code says and what actually exists — someone makes an emergency console change and never codifies it, a resource is created outside the pipeline, a policy is loosened "temporarily." Left alone, drift accumulates until your infrastructure-as-code is fiction and your compliance score is measuring the wrong thing. This building block catches drift and closes it, automatically where it is safe to do so.

ConceptAWSGCPAzure
Drift detectionConfig + CloudFormation drift detectionTerraform plan diff / Config ValidatorAzure Policy compliance + Terraform diff
Auto-remediationConfig remediation (SSM Automation)Cloud Functions / Workflows on findingAzure Policy deployIfNotExists / remediation
IaC reconciliationTerraform plan in CI (detect out-of-band)Terraform plan in CITerraform / Bicep what-if in CI
Guardrail enforcementSCP prevents the drift at sourceOrg Policy prevents at sourceAzure Policy deny at source

Three layers of defense, strongest first. Prevent at source: the best drift is the drift that cannot happen — the SCPs, Organization Policies and Azure Policy deny rules from Part 1 stop the non-compliant change from ever being made, which is why preventative guardrails outrank detective ones. Auto-remediate the rest: for the drift that slips through, wire remediation so a non-compliant resource is fixed automatically — AWS Config remediation via SSM Automation, Azure Policy deployIfNotExists, a GCP function triggered on an SCC finding — turning a security group that got opened back to closed, re-enabling an encryption setting that got switched off, without a human in the loop. Reconcile continuously: run a terraform plan (or CloudFormation drift detection, or Azure what-if) on a schedule in CI so any resource that has diverged from code surfaces as a diff a human reviews and either codifies or reverts. An auto-remediation rule that snaps a drifted public-access setting back to compliant the moment Config sees it:

config-remediation.yaml
# AWS Config: any S3 bucket that loses its public-access block is auto-fixed.
ConfigRuleName: s3-bucket-level-public-access-prohibited
RemediationConfiguration:
  TargetType: SSM_DOCUMENT
  TargetId: AWS-DisableS3BucketPublicReadWrite
  Automatic: true
  MaximumAutomaticAttempts: 3
  RetryAttemptSeconds: 60

The combination — prevent what you can, auto-fix what you cannot prevent, and reconcile everything else against code on a schedule — is what keeps the estate honest as it scales past the point where any human can watch it.

Building block 4 — Evidence & framework mapping

The final building block is what makes the whole program legible to the outside world: turning your controls into continuous, assessor-ready evidence. An auditor does not want to hear that you have guardrails; they want to see the policy, the enforcement, the daily compliance record, and the exceptions log, mapped to the specific control they are testing. Done manually, this is the annual scramble — screenshots, spreadsheets, a month of an engineer's life reconstructing a story the systems already know. Done continuously, the evidence is a byproduct of the systems already running.

ConceptAWSGCPAzure
Evidence collectionAudit ManagerAssured Workloads / SCC exportsDefender for Cloud compliance exports
Control mappingAudit Manager frameworksCompliance reportsRegulatory Compliance assessments
Continuous exportSecurity Hub → S3 / partner GRCSCC → BigQuery / GRCContinuous export → Log Analytics / GRC
Exceptions & risk registerDocumented, time-boxed, reviewedDocumented, time-boxed, reviewedDocumented, time-boxed, reviewed

The disciplines here are continuous collection and honest exception management. Use the native evidence tooling — AWS Audit Manager, GCP compliance exports, Azure's Regulatory Compliance and continuous export — to gather control evidence automatically and route it, along with the daily compliance scores from building block 2 and the immutable logs from Part 4, into a system of record. And keep a real exceptions register: every control you cannot meet yet, documented with a risk owner, a compensating control, and an expiry date, reviewed on a cadence — because auditors trust a program that knows its own gaps far more than one claiming perfection. This is the natural home of a GRC platform, and it is exactly what ISMShed is built to do: it ingests findings and evidence from all three clouds and maps them continuously to ISO 27001, ENS, NIS2, DORA, SOC 2 and GDPR, so the crosswalk from "AWS Config rule X passed today" to "ISO 27001 Annex A control Y is satisfied, here is the evidence" is maintained automatically. The point of the whole program lands here: security work that was going to happen anyway becomes, at no extra effort, the audit evidence that used to cost a month a year to assemble.

Definition of done — Govern & Comply exit checklist

The program is complete when every one of these is true, in each cloud you run:

  • Policy-as-code: every guardrail and config rule authored in a repository, reviewed via pull request, and deployed through a pipeline; a cloud-agnostic policy engine (OPA/Conftest or CFN-Guard) evaluating infrastructure changes at plan time and blocking non-compliant merges.
  • Continuous compliance: built-in framework packs enabled for the standards that matter (ISO 27001, ENS, NIS2, DORA, SOC 2, GDPR), with custom controls filling the gaps the native packs miss; a daily compliance score per framework, failing controls with named owners, and a visible trend.
  • Drift detection & remediation: preventative guardrails stopping drift at source; auto-remediation closing the non-compliant changes that slip through; a scheduled IaC reconciliation (terraform plan / drift detection / what-if) surfacing out-of-band changes for review.
  • Evidence & framework mapping: control evidence collected continuously (Audit Manager / compliance exports / continuous export) and mapped to each framework's specific controls; the program's guardrails, network, data, and detection controls all represented as evidence.
  • Exceptions & risk register: every unmet control documented with a risk owner, a compensating control, and an expiry date, reviewed on a cadence.
  • Ownership & cadence: the governance loop has an owner and a review rhythm — this is not a project that ends but a process that runs.

Tick every box and the program is self-sustaining: your posture is defined as code, measured every day, self-healing against drift, and continuously producing the evidence that proves it. That is the difference between a cloud that was secured once and a cloud that stays secure while it grows.

The program, complete

That closes the Cloud Security Program. Five parts, one arc: a foundation of accounts, identity and guardrails (Part 1); a segmented, private network (Part 2); encrypted, key-governed, non-public data (Part 3); a detection-and-response layer that sees what gets through (Part 4); and the governance loop that keeps all of it true as the estate grows (Part 5). Each part was scope-bounded with an exit checklist, each was the same set of concepts across AWS, GCP and Azure, and each built on the one before — which is why the order mattered and why the whole is far more than the sum of the parts.

The through-line of the finale is worth stating plainly: security done well is compliance done cheaply. Every control this program produced is evidence for a framework your business already has to satisfy, and the governance layer captures it continuously instead of annually. That is precisely the seam a GRC platform is built for — ISMShed maps your live, multi-cloud posture to ISO 27001, ENS, NIS2, DORA, SOC 2 and GDPR as continuous audit evidence, so the certification and the security are one effort rather than two. And if you would like experienced hands to stand up the policy-as-code pipeline, wire the compliance mapping, and run the governance loop across your own AWS, GCP and Azure estate — or to design and deliver any phase of this program end to end — Axelia's cloud-security and GRC consultants do exactly this. You have the map; the destination is a cloud that is secure by design and compliant by default, and stays that way.

Talk to an expert

Don't wait for the guide. Book a call with our AI-CISO team and get a tailored roadmap to ISO 27001, NIS2, ENS or DORA compliance.