Enforcing SAST and DAST Across Every Team Pipeline

·

Enforcing SAST and DAST Tools at Enterprise Level

The original post asked how to enforce SAST and DAST scans when each engineering team maintains its own CI/CD pipeline. In a custom pipeline environment, tool versions, scan targets, failure criteria, and exception conditions may vary. Without shared execution criteria like these, security testing enforcement risks depending on tool-specific execution rates or individual teams’ cooperation.

The original post was published as a question about how to ensure Snyk, Trivy, IaC, and other scans run within team pipelines. The author wrote in the software section that GitHub’s enforcement features alone are not sufficient. Controlling repositories through configuration alone makes it difficult to prevent manually modified pipelines, bypassed deployments, and unverified exceptions. One approach is to connect organizational policies to a shared execution path and deployment approval structure.

First, define security testing enforcement criteria as policy

The first decision is not whether to block every vulnerability immediately, but which changes require which scans and which results should prevent deployment. Define the repositories in scope, deployment artifacts, IaC and dependency scan coverage, environments subject to DAST, approval authorities, and exception expiration conditions in a version-controlled policy file. This file should undergo code review alongside application code and retain a record of changes.

Decisions should not rely on severity alone. They should also account for asset criticality, potential internet exposure, remediation difficulty, and active exceptions. A reasonable starting point is to block high-risk vulnerabilities and warn on medium-risk findings, but manage the criteria as enforceable policy rather than documentation to prevent teams from disabling scans or accumulating excessive exceptions. Immediately failing the pipeline for every vulnerability creates excessive operational strain and eventually leads to workarounds.

A shared pipeline should do more than invoke scans

A shared pipeline module centrally manages tool versions, scan configuration, result uploads, policy evaluation, and failure decisions. Team pipelines provide only the minimum repository-specific configuration and invoke the shared stages. In an environment that uses Trivy, for example, the scan results can be passed into policy evaluation as follows.

trivy image --format sarif --output trivy-results.sarif IMAGE_NAME

※ Note: The following is a conceptual simulation example (Illustrative Example, not official spec).
It must be adjusted to match the actual image reference and execution environment.

The shared module should preserve metadata beyond execution logs, including the target commit, tool version, policy version, results, decision, and exception identifier. Without this information, it is impossible to determine after the fact which scans a specific deployment passed. Merely confirming that a results dashboard exists does not establish whether enforcement is in place.

Separate deployment gates from pipelines

If scans run only inside a team-owned pipeline, security stages may be removed when the pipeline changes. A safer architecture uses an independent deployment gate. Link scan status, policy version, and exception expiration status to deployment requests and artifacts, and prevent approval or promotion whenever the required status is missing or a policy violation exists.

In this architecture, security testing enforcement is determined by whether an artifact is eligible for deployment promotion, rather than by whether a pipeline execution succeeded. A central service verifies that the scans were executed by the pipeline, that the target commit and artifact match, and that the policy used for the decision remains valid. Even when a pipeline changes, artifacts that skipped testing cannot automatically move into a deployment environment.

Run SAST and DAST differently within the same gate

SAST, dependency scans, and IaC scans can target code and configuration, but DAST requires a running application. DAST needs an isolated test environment, credentials, test data, and execution-time management. Define target and network scopes to prevent arbitrary requests from reaching production, and normalize scan results into a shared result model.

Share the common policy and approval system while separating the execution layer. Run static scans quickly on every commit, and perform dynamic scans in a deployable test environment once the application is ready. Because the two scan types have different characteristics, one may block the other before it finishes. The policy should therefore specify which stage is a prerequisite for the other.

Treat exceptions as managed objects, not permanent bypasses

A security exception is not something to fear; it is a temporary mitigation that can be controlled. Record the justification, owner, remediation deadline, applicable tools and scope, and exception identifier for every exception. Automatically transition expired exceptions to a blocked state and require reevaluation before expiration. Repeated use of the same exception identifies a tool configuration or shared pipeline that should be improved.

Periodically review artifacts deployed without scans, bypasses of failed pipelines, expired exceptions, and repeated exceptions together. These metrics show the practical effectiveness of security testing enforcement more accurately than tool-specific execution rates. Policies, pipelines, deployment gates, and exception lifecycles must be integrated into one operating system to preserve standards even in uncooperative teams and mutable pipelines.

This issue originates from the original discussion about CI/CD security enforcement, with its central concern being an architecture that guarantees execution across distributed development organizations rather than the tools themselves.

What to try now

  • Inventory every repository and deployment pipeline currently in use, and mark gaps in SAST, DAST, and IaC scan coverage.
  • Manage a policy file in your repositories that defines scan targets, blocking criteria, approval authorities, and exception expiration dates.
  • Create a shared pipeline module that manages tool versions, result collection, and policy decisions, then connect one team to it.
  • Verify that artifacts without scan status or a policy version are blocked during the deployment promotion stage.
  • Record the justification, owner, expiration date, and scope of existing security exceptions, and classify repeated exceptions as candidates for improvement.

Source

This article was written after reviewing the following original source: r/devops — Enforcing SAST and DAST Tools at Enterprise Level

Leave a Reply

Your email address will not be published. Required fields are marked *