Compliance Scanning via GitHub Actions — Broad Policy as Code Across a…

Compliance Scanning via GitHub Actions — Broad Policy as Code Across a Heterogeneous Stack

2026-03-22 · governance-policy security-risk tools-infrastructure · medium · source → · wiki →
key claims
  1. Because the CodeQL support matrix is language-centric, any estate that also needs Terraform, Kubernetes, OpenAPI, AsyncAPI, SQL, or dbt governance must add dedicated artefact scanners instead of expecting GHAS alone to enforce those surfaces. Basis: https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql ; https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/
  2. GitHub separates shared execution from shared enforcement: reusable workflows encapsulate the shared scanning logic, while organisation rulesets and required checks apply merge-blocking governance across targeted repositories. Sources: https://docs.github.com/en/actions/sharing-automations/reusing-workflows ; https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/creating-rulesets-for-repositories-in-your-organization ; https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-workflows-to-pass-before-merging
  3. CodeQL packs are an important extension point for supported languages, but the official pack model still assumes CodeQL-compatible artefacts and therefore cannot replace specialised validation tools for schemas, manifests, and SQL-focused repositories. Sources: https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/publishing-and-using-codeql-packs ; https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/
  4. The open-source toolchain retrieved in this item is already broad enough to cover most of the named estate when organised by artefact type, combining Semgrep and Conftest for generic policy, Checkov and kube-score for IaC and Kubernetes, Spectral and AsyncAPI CLI for API and event contracts, GraphQL Inspector for GraphQL, and SQLFluff plus dbt-project-evaluator for data-platform governance. Sources: https://semgrep.dev/docs/writing-rules/overview ; https://www.conftest.dev/ ; https://github.com/bridgecrewio/checkov ; https://github.com/zegl/kube-score ; https://github.com/stoplightio/spectral ; https://www.asyncapi.com/tools/cli ; https://the-guild.dev/graphql/inspector/docs/index ; https://sqlfluff.com/ ; https://github.com/dbt-labs/dbt-project-evaluator
  5. A central policy-repository model is more maintainable than embedding scanner logic in every application repository, because central rule bundles and reusable workflows reduce drift, simplify ownership, and let policy teams update standards without mass copy-editing downstream repositories. Basis: https://docs.github.com/en/actions/sharing-automations/reusing-workflows ; https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/centralized-custom-checkov-scanning.html ; https://wellarchitected.github.com/library/governance/recommendations/managing-repositories-at-scale/rulesets-best-practices/
  6. A staged rollout with Evaluate mode, soft-fail where appropriate, rule insights, and explicit bypass governance is not just a convenience feature but the operational control that prevents multi-scanner compliance programmes from collapsing under false positives and unstable checks. Basis: https://wellarchitected.github.com/library/governance/recommendations/managing-repositories-at-scale/rulesets-best-practices/ ; https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/centralized-custom-checkov-scanning.html
  7. The minimum viable architecture for this problem is a portfolio of four reusable workflow domains — code, infrastructure, APIs/events, and data — each backed by centrally versioned policies and attached to repository tiers through organisation rulesets. Basis: https://docs.github.com/en/actions/sharing-automations/reusing-workflows ; https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-workflows-to-pass-before-merging ; https://wellarchitected.github.com/library/governance/recommendations/managing-repositories-at-scale/rulesets-best-practices/
  8. GraphQL and event-driven contract governance deserve first-class treatment in the compliance model, because the retrieved evidence shows dedicated schema-aware tools for those artefacts and does not support treating them as a by-product of generic source-code scanning. Basis: https://the-guild.dev/graphql/inspector/docs/index ; https://www.asyncapi.com/tools/cli ; https://github.com/stoplightio/spectral

Research Question

How can GitHub Actions (with GitHub Advanced Security (GHAS) and CodeQL already enabled) be extended to enforce a broad, organisation-wide compliance policy — covering naming conventions, architectural patterns, directory layout, Application Programming Interface (API) specifications, event schemas, and technology-stack-specific usage rules — across a heterogeneous estate of .NET, Kubernetes (k8s), Python, React, Go, Airflow, DBT (Data Build Tool), Snowflake, Relational Database Service (RDS), Terraform, Ansible, Representational State Transfer (REST) APIs, Graph APIs (GraphQL), and event-driven systems, where policies are defined once and shared across multiple enforcement points?

Findings

Executive Summary

Key Findings

  1. [inference][high] Because the CodeQL support matrix is language-centric, any estate that also needs Terraform, Kubernetes, OpenAPI, AsyncAPI, SQL, or dbt governance must add dedicated artefact scanners instead of expecting GHAS alone to enforce those surfaces. Basis: GitHub Docs — About code scanning with CodeQL ; CodeQL docs — Supported languages and frameworks
  2. [fact][high] GitHub separates shared execution from shared enforcement: reusable workflows encapsulate the shared scanning logic, while organisation rulesets and required checks apply merge-blocking governance across targeted repositories. Sources: GitHub Docs — Reusable workflows ; GitHub Docs — Creating organisation rulesets ; GitHub Docs — Available rules for rulesets / require workflows to pass before merging
  3. [fact][high] CodeQL packs are an important extension point for supported languages, but the official pack model still assumes CodeQL-compatible artefacts and therefore cannot replace specialised validation tools for schemas, manifests, and SQL-focused repositories. Sources: GitHub Docs — CodeQL custom queries and packs ; CodeQL docs — Supported languages and frameworks
  4. [fact][high] The open-source toolchain retrieved in this item is already broad enough to cover most of the named estate when organised by artefact type, combining Semgrep and Conftest for generic policy, Checkov and kube-score for IaC and Kubernetes, Spectral and AsyncAPI CLI for API and event contracts, GraphQL Inspector for GraphQL, and SQLFluff plus dbt-project-evaluator for data-platform governance. Sources: Semgrep rule-writing overview ; Open Policy Agent (OPA) / Conftest ; Checkov repository ; kube-score repository ; Spectral repository and documentation entry point ; AsyncAPI Command Line Interface (CLI) ; GraphQL Inspector docs ; SQLFluff documentation ; dbt-project-evaluator repository
  5. [inference][medium] A central policy-repository model is more maintainable than embedding scanner logic in every application repository, because central rule bundles and reusable workflows reduce drift, simplify ownership, and let policy teams update standards without mass copy-editing downstream repositories. Basis: GitHub Docs — Reusable workflows ; AWS Prescriptive Guidance — centralised custom Checkov scanning ; GitHub Well-Architected — Rulesets best practices
  6. [inference][high] A staged rollout with Evaluate mode, soft-fail where appropriate, rule insights, and explicit bypass governance is not just a convenience feature but the operational control that prevents multi-scanner compliance programmes from collapsing under false positives and unstable checks. Basis: GitHub Well-Architected — Rulesets best practices ; AWS Prescriptive Guidance — centralised custom Checkov scanning
  7. [inference][medium] The minimum viable architecture for this problem is a portfolio of four reusable workflow domains — code, infrastructure, APIs/events, and data — each backed by centrally versioned policies and attached to repository tiers through organisation rulesets. Basis: GitHub Docs — Reusable workflows ; GitHub Docs — Available rules for rulesets / require workflows to pass before merging ; GitHub Well-Architected — Rulesets best practices
  8. [inference][medium] GraphQL and event-driven contract governance deserve first-class treatment in the compliance model, because the retrieved evidence shows dedicated schema-aware tools for those artefacts and does not support treating them as a by-product of generic source-code scanning. Basis: GraphQL Inspector docs ; AsyncAPI Command Line Interface (CLI) ; Spectral repository and documentation entry point

Assumptions

Analysis

Risks, Gaps, and Uncertainties

Open Questions


sources


Connected items

Loading…

View full knowledge graph →