Skip to main content

OWASP Top 10 CI/CD Security Controls

Type: Initiative
ID: OWASP-TOP10-CICD-SC-GH
Version: ``
Bundle-Version: v2
Source: v2/initiatives/owasp-top10-cicd-gh.yaml
Help: https://owasp.org/www-project-top-10-ci-cd-security-risks/

OWASP Top 10 CI/CD Security Controls - GitHub

Description

This initiative provides a set of security controls for CI/CD pipelines implementing the OWASP Top 10 CI/CD Security Risks framework.

Required Evidence

This initiative requires the following evidence types:

Evidence Defaults

FieldValue
signedFalse

Rule Parameters

To configure this initiative for your organization needs, the following parameters should be specified:

  • [CICD-SEC-1] Insufficient Flow Control Mechanisms
    • Require Branch Protection
      • branches: array - List of branches to be protected.
        Default: ['main', 'master'].
    • Pull request approval policy check
      • approvals_required_min: number - Minimum number of approvals required for pull requests.
        Default: 1.
  • [CICD-SEC-2] Inadequate Identity and Access Management
    • Limit Admin Number
      • max_admins: integer - Maximum number of admins allowed.
        Default: 4.
    • Allowed GitHub Organization Admins
      • allowed_admins: array - List of allowed GitHub organization admins.
    • Allowed GitHub Organization Users
      • allowed_users: array - List of allowed users.
    • 'Create repositories' permissions check
    • Limit Public Repositories
      • allowed_repo_names: array - List of repository pattern allowed to be visible.
  • [CICD-SEC-3] Dependency Chain Abuse
    • Ensure that base images are from an approved source
      • approved_sources: array - A list of approved base image registry URL prefixes.
        Default: ['index.docker.io/library/.*', 'gcr.io/.*'].
    • Verify NPM Packages Origin
      • allowed_registries: array - A list of allowed NPM registries.
        Default: ['https://registry.npmjs.org/'].
  • [CICD-SEC-4] Poisoned Pipeline Execution
    • Restrict Pipeline Script Modification
      • files: array - The list of files that are allowed to be committed to the repository.
        Default: ['.github/workflow/*.yml', '.github/workflow/*.yaml'].
      • ids: array - The list of user (commit.author) IDs allowed to commit to the repository.
    • Require Branch Protection
      • branches: array - List of branches to be protected.
        Default: ['main', 'master'].
  • [CICD-SEC-6] Insufficient Credential Hygiene
    • Verify No Old Secrets Exist in Organization
      • max_secret_age: integer - Maximum age of secrets in months.
        Default: 6.
    • Verify No Old Secrets Exist in Repository
      • max_secret_age: integer - Maximum age of secrets in months.
        Default: 6.
    • Verify Trivy Secret Scan Report
      • rule_names: array - List of rule names to check for in the Trivy SARIF report.
        Default: ['Secret'].
      • max_allowed: integer - The maximum number of allowed violations.

Controls Overview

Control NameControl DescriptionMitigation
[CICD-SEC-1] Insufficient Flow Control MechanismsEnsure that the CI/CD pipeline has sufficient flow control mechanisms to prevent unauthorized pushing of malicious code into artifacts.Implement branch protection rules to prevent unauthorized changes. Require signed commits to maintain code integrity.
[CICD-SEC-2] Inadequate Identity and Access ManagementEnsure that the CI/CD pipeline has adequate identity and access management to prevent unauthorized access to the pipeline and artifacts.Implement strong identity and access management practices. Enforce multi-factor authentication (MFA) for all users. Limit the number of administrators to the minimum required. Ensure repositories are private to prevent unauthorized access.
[CICD-SEC-3] Dependency Chain AbuseEnsure that the CI/CD pipeline has mechanisms to prevent dependency chain abuse.
[CICD-SEC-4] Poisoned Pipeline ExecutionEnsure that the pipeline script cannot be tampered withRestrict access to the pipeline script to prevent unauthorized modifications. Implement strict permissions and review processes for any changes to the pipeline script.
[CICD-SEC-5] Insufficient Pipeline Access ControlsEnsure that the CI/CD pipeline has sufficient access controls to prevent unauthorized access to the pipeline and artifacts. Implement strict access controls for the CI/CD pipeline to prevent unauthorized access. Use ephemeral runners to ensure a clean environment for each pipeline run. Ensure that secrets are not shared across pipelines and are scoped to the minimum required.
[CICD-SEC-6] Insufficient Credential HygieneEnsure that the CI/CD pipeline has sufficient credential hygiene to prevent unauthorized access to the pipeline and artifacts.
[CICD-SEC-7] Insecure System ConfigurationEnsure that the CI/CD pipeline has secure system configuration to prevent unauthorized access to the pipeline and artifacts.
[CICD-SEC-8] Ungoverned Usage of 3rd Party ServicesEnsure that the CI/CD pipeline has mechanisms to prevent ungoverned usage of 3rd party services.
[CICD-SEC-9] Improper Artifact Integrity ValidationEnsure that the CI/CD pipeline has mechanisms to validate the integrity of artifacts.Implement processes and technologies to validate the integrity of resources all the way from development to production.
[CICD-SEC-10] Insufficient Logging and VisibilityEnsure that the CI/CD pipeline has sufficient logging and visibility to detect unauthorized access to the pipeline and artifacts.Identify and build an inventory of all the systems in use within the organization, containing every instance of these systems.

Detailed Controls

[CICD-SEC-1] Insufficient Flow Control Mechanisms

Ensure that the CI/CD pipeline has sufficient flow control mechanisms to prevent unauthorized pushing of malicious code into artifacts.

Mitigation

Implement branch protection rules to prevent unauthorized changes. Require signed commits to maintain code integrity.

Rules

Rule IDRule NameRule Description
github-repo-branch-protectionRequire Branch ProtectionConfigure branch protection rules on branches hosting code which is used in production and other sensitive systems.
github-repo-pr-approvalPull request approval policy checkEnsure that the repository's PR approval policy requires a minimum number of approvals.
github-repo-signed-commitsAccept Signed CommitsEnsure all commits signing is required by branch protection, in order to maintain code integrity.
github-repo-web-commit-signoffRequire Signoff on Web CommitsEnsure that the GitHub repository requires signoff on web commits.
sbom-signedRequire Image and Git SBOMs to be signedVerify images and git SBOMs are signed.

[CICD-SEC-2] Inadequate Identity and Access Management

Ensure that the CI/CD pipeline has adequate identity and access management to prevent unauthorized access to the pipeline and artifacts.

Mitigation

Implement strong identity and access management practices. Enforce multi-factor authentication (MFA) for all users. Limit the number of administrators to the minimum required. Ensure repositories are private to prevent unauthorized access.

Rules

Rule IDRule NameRule Description
github-org-2faEnforce MFAMandate multi-factor authentication.
github-org-max-adminsLimit Admin NumberLimit the number of admins to the minimum required.
github-org-allowed-adminsAllowed GitHub Organization AdminsVerify only users in the Allowed List have admin privileges.
github-org-allowed-usersAllowed GitHub Organization UsersVerify only users in the Allowed List have user access to the GitHub organization.
github-org-create-repos'Create repositories' permissions checkEnsure only allowed users can create repositories in the GitHub organization.
github-org-repo-visibilityLimit Public RepositoriesVerify only repositories in the Allowed List are public in the GitHub organization.

[CICD-SEC-3] Dependency Chain Abuse

Ensure that the CI/CD pipeline has mechanisms to prevent dependency chain abuse.

Rules

Rule IDRule NameRule Description
allowed-base-imageEnsure that base images are from an approved sourceVerify that every base image is from an approved source.
allowed-npm-registriesVerify NPM Packages OriginVerify that NPM packages are pulled from an approved registry.

[CICD-SEC-4] Poisoned Pipeline Execution

Ensure that the pipeline script cannot be tampered with

Mitigation

Restrict access to the pipeline script to prevent unauthorized modifications. Implement strict permissions and review processes for any changes to the pipeline script.

Rules

Rule IDRule NameRule Description
git-coding-permissionsRestrict Pipeline Script ModificationRestrict access to the pipeline script to prevent tampering.
github-repo-branch-protectionRequire Branch ProtectionImplement branch protection rules to prevent unauthorized changes.

[CICD-SEC-5] Insufficient Pipeline Access Controls

Ensure that the CI/CD pipeline has sufficient access controls to prevent unauthorized access to the pipeline and artifacts. Implement strict access controls for the CI/CD pipeline to prevent unauthorized access. Use ephemeral runners to ensure a clean environment for each pipeline run. Ensure that secrets are not shared across pipelines and are scoped to the minimum required.

Rules

Rule IDRule NameRule Description
github-repo-ephemeral-runners-onlyUse Ephemeral GitHub RunnerUse ephemeral runners to ensure a clean environment for each pipeline run.
github-repo-no-org-secretsSeparate Repo SecretsAvoid sharing the same set of credentials across multiple contexts.

[CICD-SEC-6] Insufficient Credential Hygiene

Ensure that the CI/CD pipeline has sufficient credential hygiene to prevent unauthorized access to the pipeline and artifacts.

Rules

Rule IDRule NameRule Description
github-org-old-secretsVerify No Old Secrets Exist in OrganizationVerify secrets in the GitHub organization are not older than the specified threshold.
github-repo-old-secretsVerify No Old Secrets Exist in RepositoryVerify secrets in the GitHub repository are not older than the specified threshold.
github-repo-no-org-secretsSeparate Repo SecretsAvoid sharing the same set of credentials across multiple contexts.
github-repo-secret-scanningVerify secret_scanning settingDetect secrets pushed to and stored on code repositories.
trivy-secret-scanVerify Trivy Secret Scan ReportVerify the Trivy report for exposed secrets.

[CICD-SEC-7] Insecure System Configuration

Ensure that the CI/CD pipeline has secure system configuration to prevent unauthorized access to the pipeline and artifacts.

Rules

Rule IDRule NameRule Description
github-repo-ephemeral-runners-onlyUse Github RunnerUse ephemeral runners to ensure a clean environment for each pipeline run.

[CICD-SEC-8] Ungoverned Usage of 3rd Party Services

Ensure that the CI/CD pipeline has mechanisms to prevent ungoverned usage of 3rd party services.

warning

This control not currently supported on this platform.

[CICD-SEC-9] Improper Artifact Integrity Validation

Ensure that the CI/CD pipeline has mechanisms to validate the integrity of artifacts.

Mitigation

Implement processes and technologies to validate the integrity of resources all the way from development to production.

Rules

Rule IDRule NameRule Description
sbom-signedArtifact verification software (Image SBOM)Verify image SBOMs are signed.
git-sbom-signedArtifact verification software (Git SBOM)Verify Git SBOMs are signed.
SLSA.L2Artifact verification software (SLSA)Verify SLSA Provenance attestations are signed.
git-disallow-unsigned-commitsCode signing (Git SBOM)Verify all commits are signed.
github-repo-signed-commitsCode signing (GitHub repo)Verify all commits are verified on GitHub.
github-repo-web-commit-signoffVerify GitHub Repository Requires Signoff on Web CommitsEnsure that the GitHub repository requires signoff on web commits.

[CICD-SEC-10] Insufficient Logging and Visibility

Ensure that the CI/CD pipeline has sufficient logging and visibility to detect unauthorized access to the pipeline and artifacts.

Mitigation

Identify and build an inventory of all the systems in use within the organization, containing every instance of these systems.

Rules

Rule IDRule NameRule Description
github-repo-existsGitHub repository evidenceIdentify and build an inventory of all the systems in use within the organization, containing every instance of these systems.
workflows-discoveredRepo Workflows and Pipelines DiscoveredRepository workflows scan helps to keep track of the repo workflows, pipeline runs, run reasons, authors and other relevant information.