CI/CD Compliance Framework for Secure Pipelines

Organizations today run hundreds or thousands of CI/CD pipelines. These pipelines access code, secrets, and production environments, yet there is no reliable way to guarantee their pipeline security and compliance at scale.

In this article

  • What CI/CD compliance means and why pipelines are a governance blind spot
  • Why now: supply chain attacks, regulatory pressure (ISO 27001, NIS2, DORA, CRA), and the cost of manual audits
  • A real-world case: hackerbot-claw (Feb 2026), an AI bot that compromised 5 of 7 major repos in 7 days using documented misconfigurations
  • A four-step framework: Define, Verify, Remediate, Prove
  • A 26-point compliance checklist you can use immediately
  • Control guidelines with rationale, grouped by category
  • Regulatory mapping table (ISO 27001 / NIS2 / DORA / CRA)
  • FAQ answering the most common compliance questions

What Does CI/CD Compliance Mean?

CI/CD compliance means that your pipelines (the automation that builds, tests, and deploys your software) meet defined security, quality, and governance requirements. In practice, it answers four questions:

  1. What requirements must we follow? (no hardcoded secrets, trusted images only, required security checks)
  2. Are we actually following those requirements? (automated controls prevent bypassing required checks)
  3. Can we prove it? (evidence for auditors, regulators, or internal governance)
  4. Is it sustainable over time? (continuous verification, not a one-time snapshot)

CI/CD compliance is not paperwork or a one-time checklist. It’s about ensuring that the systems delivering your software are secure, auditable, and aligned with your organization’s risk posture. When your pipelines are compliant, you significantly reduce the risk of supply chain attacks, data leaks, misconfigurations, and regulatory penalties.

Why CI/CD Pipelines Need Compliance Now

Four converging forces make CI/CD compliance and pipeline security urgent today.

  1. Pipelines are a prime attack target

    Attackers have shifted focus to the software supply chain. Compromising one pipeline can expose code, credentials, and production access across many projects. Incidents like the tj-actions/changed-files compromise, the Shai-Hulud campaign, the SolarWinds breach, and most recently the hackerbot-claw campaign (an autonomous AI bot that compromised 5 of 7 targeted repos in 7 days using known misconfigurations) demonstrate that workflow security is no longer a niche concern. See incident details and sources below.

  2. Regulators are asking

    Frameworks like ISO 27001, NIS2, DORA, and the Cyber Resilience Act (CRA) now require organizations to secure the systems that build, test, and deploy software. Auditors expect clear answers: how many pipelines run daily, are they compliant, can you prove it, and how do you detect drift? CI/CD is no longer just an engineering topic. It is a governance and risk issue.

  3. Pipelines escape governance

    A CI/CD pipeline is one of the most privileged systems in your organization: it reads your code, accesses your secrets, and writes to production at scale. Yet security requirements are rarely verified continuously, pipeline code is seldom audited against formal standards, and many organizations still treat CI/CD as a purely technical concern rather than a high-privilege attack surface.

  4. Manual audits don’t scale

    On average, auditing one pipeline takes about 1 hour per month. For 100 pipelines, that’s over one full-time employee, easily exceeding €100,000/year. And in many organizations, even when monitoring exists, it lives in silos outside centralized governance. Non-compliance can represent 2-2.5% of annual revenue, not counting delivery stoppages, regulatory fines, or incident response.

Key takeaway

The question is no longer if a supply chain attack will happen. It is whether you will notice when it does.

Supply Chain Incidents (With Sources)

These well-documented incidents illustrate distinct attack vectors targeting CI/CD infrastructure:

tj-actions/changed-files (March 2025) — 23,000 repos compromised

A widely used GitHub Action was compromised, exfiltrating CI/CD secrets from ~23,000 repositories. Any pipeline referencing a mutable version tag pulled the malicious code. This demonstrated the danger of unpinned action versions and the blast radius of a single compromised dependency.

Analysis on Snyk | Our dedicated article

Shai-Hulud (late 2025) — npm + GitHub Actions exploitation

Malicious npm packages combined with GitHub Actions exploitation to propagate across repositories, leveraging CI runner security weaknesses to exfiltrate secrets and spread laterally. The campaign illustrated how multiple attack vectors can chain together through the CI/CD pipeline.

Analysis on Aikido | Our dedicated article

SolarWinds (December 2020) — 18,000+ organizations affected

Attackers injected code into the build process of SolarWinds Orion, affecting 18,000+ organizations and demonstrating that build provenance and artifact integrity are critical. The attack went undetected for months, highlighting the need for continuous monitoring of build systems.

hackerbot-claw (February 2026) — 5 of 7 major repos compromised in 7 days

An autonomous AI-powered bot scanned public repositories for exploitable GitHub Actions workflows and compromised 5 of 7 targeted repositories in one week. Targets included Aqua Security’s Trivy (25k+ stars, 178 releases deleted), awesome-go (140k+ stars, GITHUB_TOKEN with write permissions exfiltrated), CNCF’s akri, Microsoft’s ai-discovery-agent, and DataDog’s iac-scanner. Every exploit used a known, documented misconfiguration: pull_request_target with untrusted checkout, unescaped ${{ }} expressions in run: blocks, missing author_association checks, and excessive token permissions. No zero-days were involved.

StepSecurity Analysis | Our dedicated article | Trivy incident write-up 🇫🇷

For a broader view, see our Top 5 Software Supply Chain Security Incidents and the OWASP Top 10 CI/CD Security Risks.

A Four-Step Compliance Framework

Ensuring CI/CD compliance follows four continuous steps:

  1. Define requirements (security rules, quality, governance standards). The OWASP Top 10 CI/CD Security Risks provide a useful starting reference. Map these to your regulatory obligations (ISO 27001, NIS2, DORA, CRA).

  2. Verify posture (analyze pipelines, detect violations, identify configuration drift). This includes workflow security checks, CI runner security audits, and artifact integrity verification.

  3. Remediate issues (close gaps and realign pipelines with defined requirements).

  4. Prove compliance (audit-ready evidence, continuous monitoring to demonstrate compliance over time).

CI/CD Compliance Checklist

Use this checklist to quickly assess your pipeline security posture. Each control maps to the detailed guidelines and regulatory mapping below.

Container images & supply chain

  1. Pin all CI/CD container images to digest or explicit version (no latest tags)
  2. Use only trusted, approved image registries
  3. Scan container images for known vulnerabilities before use

Secrets & variables

  1. Never hardcode secrets in pipeline configuration files
  2. Store secrets in a dedicated secret manager or CI/CD protected variables
  3. Mask all sensitive values in pipeline logs
  4. Restrict secret access to protected branches and environments only

Pipeline composition

  1. Require mandatory security scans (SAST, secret detection, dependency checks) in every pipeline
  2. Pin all pipeline templates, includes, and reusable actions to explicit versions
  3. Detect and alert on template overrides or bypasses
  4. Maintain a Pipeline Bill of Materials (PBOM) documenting runner images, templates, actions, plugins, and their versions

Access & authorization

  1. Protect critical branches (disable force push, require code owner approval)
  2. Enforce minimum merge request approvals
  3. Restrict merge and push access to authorized roles only
  4. Restrict sensitive workflow triggers (e.g., pull_request_target, comment dispatches) to trusted contributors only — never check out or execute untrusted fork code in privileged trigger contexts
  5. Verify contributor trust level (author_association) before executing workflows triggered by external actors such as issue comments or PR reviews
  6. Never interpolate externally-controlled values (branch names, PR titles, filenames, issue bodies) directly into shell commands; always assign them to environment variables first

Policy, monitoring & evidence

  1. Define and enforce a CI/CD security policy at the organization level
  2. Maintain audit logs for all pipeline executions and configuration changes
  3. Monitor for configuration drift continuously (not just periodic snapshots)
  4. Generate SBOM or build provenance attestations for release artifacts
  5. Scope CI/CD tokens to minimum required permissions
  6. Isolate CI runner environments (avoid shared runners for sensitive workloads)
  7. Review and rotate CI/CD credentials on a defined schedule
  8. Validate artifact integrity with signing or attestations before deployment
  9. Document evidence retention policy for compliance audits

Control Categories and Guidelines

Each checklist item above is detailed here with its rationale. Use the links to jump to a category.

1. CI/CD Container Images

Pipelines run in containers. Untrusted or poorly configured images introduce supply chain risk and compromise artifact integrity.

GuidelineRationale
Use only trusted image sourcesUntrusted registries can deliver malicious images that steal credentials, exfiltrate code, or alter artifacts.
Avoid mutable tags (e.g. latest)Floating tags can pull compromised or breaking images without notice. Pin to explicit versions or digests.
Scan images for vulnerabilitiesIntegrate scanning into the pipeline before deployment. This supports build provenance and artifact integrity.

2. CI/CD Variables and Secrets

Variables and secrets grant access to sensitive resources. Exposure or misuse leads to breaches.

GuidelineRationale
Never hardcode secrets in pipeline configSecrets in .gitlab-ci.yml or similar files are visible to anyone with repo access. Use CI/CD variables or external secret managers.
Protect sensitive variablesRestrict variables to protected branches/tags so they are not exposed on forks or feature branches.
Mask sensitive values in logsUnmasked variables appear in pipeline logs and can be exfiltrated.
Scope CI/CD tokens to minimum permissionsOverly broad tokens increase the blast radius of a compromise. Apply least-privilege to all pipeline credentials.

3. Pipeline Composition

How pipelines are built (templates, components, hardcoded jobs) affects maintainability, workflow security, and compliance.

GuidelineRationale
Prefer templates and components over hardcoded jobsHardcoded jobs are harder to audit, update, and standardize. They increase technical debt and compliance risk.
Require mandatory templatesSecurity scans (SAST, secret detection, dependency checks) must be present and not overridable.
Pin template and include versionsAvoid main or default branches. Use explicit versions to prevent pulling compromised or breaking changes.
Detect and limit overridesOverriding required templates can bypass security checks. Overrides should be explicit and justified.
Generate SBOM / signing / attestationsBuild provenance records and software bill of materials support traceability and regulatory evidence.
Maintain a Pipeline Bill of Materials (PBOM)A PBOM inventories the components that make up your CI/CD pipeline itself: runner images, templates, reusable actions, plugins, and their versions. While SBOM tracks what is inside your artifacts, PBOM tracks what built them, enabling auditors to verify the integrity and provenance of the build process.

4. Access and Authorization

Who can change code and pipelines directly impacts pipeline security and compliance.

GuidelineRationale
Protect critical branchesUnprotected branches allow anyone to push or merge without review.
Disable force push on protected branchesForce push can erase history and hide malicious changes.
Enforce code owner approvalMerges without code owner review increase the risk of bugs and security issues.
Restrict merge and push accessLimit who can merge or push to protected branches.
Enforce merge request approval rulesRequire a minimum number of approvals before merge.
Secure GitHub Actions tokens and CI/CD credentialsDefault tokens often have write permissions. Scope them down and rotate them regularly.
Restrict pull_request_target to trusted code onlyWorkflows using pull_request_target run with repository secrets and full permissions, even when triggered by a fork. Never check out or execute code from untrusted contributors in this context. The hackerbot-claw campaign exploited this pattern to exfiltrate PATs and GITHUB_TOKEN from major open-source projects.
Verify contributor trust level for comment-triggered workflowsComment-triggered or dispatch-based workflows without author_association checks allow any external user to trigger privileged CI execution. Restrict to OWNER, MEMBER, or COLLABORATOR as appropriate.
Never interpolate externally-controlled values directly in shell commandsBranch names, PR titles, filenames, and issue bodies are attacker-controlled input. Always assign them to environment variables before use in run: blocks to prevent shell injection. This class of vulnerability was used across multiple hackerbot-claw targets.

5. Security Policy and Visibility

Compliance requires defined policies and continuous visibility across all pipelines and CI runners.

GuidelineRationale
Define a security policy sourceProjects must reference the organization’s security policy to ensure consistent checks.
Maintain logging and visibilityWithout logs and monitoring, drift and compromise go undetected.
Isolate CI runner environmentsShared CI runners can leak data between projects. Dedicated or ephemeral runners improve CI runner security.

Control Mapping (ISO 27001 / NIS2 / DORA / CRA)

This table maps CI/CD compliance control categories to high-level regulatory requirements. Use it to demonstrate coverage during audits and gap assessments.

Control CategoryEvidenceISO 27001NIS2DORACRA
Access control (branch protection, role management, approval rules)Merge request logs, role audit exports, branch protection configAccess control, Change managementSecurity of network and information systemsICT access managementSecure development lifecycle
Secret management (no hardcoded secrets, masking, protected variables)Secret scan reports, variable config exportsInformation classification, Cryptographic controlsIncident handling, Risk managementICT risk managementVulnerability handling
Container image security (trusted sources, pinned versions, scanning)Image scan reports, registry allow-listsSupplier relationships, Vulnerability managementSupply chain securityThird-party ICT riskProduct security requirements
Pipeline composition (mandatory templates, pinned includes, override detection, PBOM)Template compliance reports, override alerts, PBOM exportsChange management, Configuration managementRisk management measuresICT change managementSecure by default
Build provenance (SBOM, signing, attestations)SBOM exports, signed artifacts, attestation logsAsset management, Supplier securitySupply chain securityDigital operational resilience testingTransparency, Vulnerability disclosure
Logging and monitoring (pipeline execution logs, drift detection)Audit logs, drift detection reports, dashboardsMonitoring, Audit loggingMonitoring obligationsICT-related incident reportingReporting obligations
CI runner security (isolation, ephemeral runners, scoped tokens)Runner configuration exports, token permission auditsOperations securitySecurity of network and information systemsICT operational securitySecure development lifecycle

Note

This mapping is high-level and intended as a starting point. For precise article/annex references, consult the full text of each regulation with your compliance team.

Key Takeaways

What to remember from this guide

  1. CI/CD pipelines are high-privilege systems that read code, access secrets, and deploy to production. They deserve the same governance as any critical infrastructure.
  2. Compliance is not optional. ISO 27001, NIS2, DORA, and the CRA all now scope CI/CD pipelines as part of the software supply chain.
  3. Follow four steps: Define your requirements, Verify your posture continuously, Remediate gaps, and Prove compliance with audit-ready evidence.
  4. Automate everything. Manual audits do not scale. Continuous, automated checks are the only way to keep pace with pipeline changes.
  5. Start with the 26-point checklist above, then map controls to your regulatory framework using the mapping table.
  6. The threat is real and automated. The hackerbot-claw campaign (Feb 2026) showed an autonomous AI bot compromising 5 of 7 major repositories in 7 days using only known, documented misconfigurations. Every exploit in that campaign is addressed in this checklist.

FAQ

What is CI/CD compliance?

CI/CD compliance means your pipelines meet defined security, quality, and governance standards. It covers how code is built, tested, and deployed, and ensures that these processes are auditable, repeatable, and aligned with regulatory frameworks like ISO 27001, NIS2, or DORA.

How do you prove CI/CD compliance to auditors?

By producing audit-ready evidence: pipeline execution logs, configuration snapshots, secret scan reports, template compliance checks, and drift detection records. Continuous monitoring tools can generate this evidence automatically, rather than relying on manual spot checks.

What evidence should be retained for CI/CD compliance?

Retain pipeline execution logs, security scan results (SAST, secret detection, dependency checks), branch protection configurations, merge request approval records, image scan reports, SBOM exports, and any drift detection alerts. Define a retention policy aligned with your regulatory requirements.

How do you avoid bypassing required checks in CI/CD?

Enforce mandatory pipeline templates that cannot be overridden. Protect critical branches with approval rules and disable force push. Use automated controls to detect when required security scans are missing or when pipeline configurations deviate from the approved baseline.

How do you secure GitHub Actions tokens and CI/CD credentials?

Scope tokens to the minimum permissions required for each workflow. Use short-lived, automatically rotated credentials where possible. Restrict secret access to protected branches and environments. Monitor for overly broad token permissions across your CI runner security configuration.

What is build provenance and why does it matter?

Build provenance is a verifiable record of how a software artifact was built: what source code, what tools, what environment. It supports artifact integrity and traceability, which regulators increasingly require. SBOM generation and signing/attestations are practical ways to implement it.

What regulations require CI/CD compliance?

ISO 27001 (information security management), NIS2 (network and information security), DORA (digital operational resilience for financial services), and the Cyber Resilience Act (CRA, product security for EU market) all include requirements that apply to CI/CD pipelines as part of the software supply chain.

How often should CI/CD compliance be assessed?

Continuously. Point-in-time assessments miss configuration drift, new vulnerabilities, and evolving threats. Automated, continuous compliance monitoring is the only scalable approach for organizations running dozens or hundreds of pipelines.

Regulatory references: ISO/IEC 27001:2022 · NIS2 Directive · CRA