Kiuwan logo

CI/CD security: How to secure your pipeline

CICD-security-How-to-secure-your-pipeline-blog-image

CI/CD pipelines connect to many of an organization’s most sensitive assets, including source code, credentials, build systems, artifact registries, and production environments. That access makes automated delivery possible, but it also makes the pipeline a valuable target for attackers.


CI/CD security is the practice of protecting software delivery pipelines while embedding automated security checks throughout the build and deployment process. It has two interconnected components: protecting the pipeline itself and applying shift-left security by scanning the code and dependencies that move through it.


According to the 2026 Sembi Software Quality Pulse Report, just 9% of security teams report having fully integrated DevOps toolchains. Security gates can help close that integration gap by turning security policies into enforceable decisions within the delivery workflow.


This article explores common CI/CD risks, explains where security checks belong in the pipeline, and outlines how to implement risk-based security gates.

What is CI/CD security?

CI/CD security includes the policies, controls, processes, and tools used to protect continuous integration, continuous delivery, and continuous deployment workflows.

The exact controls depend on how a team delivers software:

  • Continuous integration frequently merges, builds, and tests code changes. Security checks must provide timely feedback without unnecessarily slowing development.
  • Continuous delivery keeps software in a deployable state, but a person generally decides when to release it to production.
  • Continuous deployment automatically releases changes that pass the pipeline’s required tests and controls. Manual code review or approval can still occur earlier in the workflow, even when the final production deployment is automated.

The OWASP CI/CD Security Cheat Sheet distinguishes continuous delivery from continuous deployment based on whether the final production release is manually initiated or automated.
Effective CI/CD security addresses two related areas: pipeline protection and application security.

Protecting the pipeline

Pipeline protection secures the infrastructure and workflows that make CI/CD possible, including:

  • Source-code repositories
  • Build servers and runners
  • Pipeline configuration
  • Credentials and service accounts
  • Artifact and container registries
  • Build artifacts
  • Deployment environments
  • Third-party actions, plugins, and integrations

Securing the application

Application security evaluates the code and components moving through the pipeline. 

Depending on the application, this may include:

  • Static application security testing (SAST)
  • Software composition analysis (SCA)
  • Secrets detection
  • Container scanning
  • Infrastructure-as-code scanning
  • Dynamic application security testing (DAST)
  • License-policy checks
  • Software bill of materials (SBOM) generation

Security gates connect scan results and pipeline policy. A gate evaluates predefined criteria and determines whether a change can proceed, requires approval, generates a warning, or must be blocked.


However, not every pipeline protection can be reduced to one go/no-go gate. Identity management, runner isolation, credential protection, secure configuration, and monitoring require their own controls.

Common CI/CD security risks

CI/CD systems combine broad access with trusted automation. If a pipeline is compromised, an attacker may be able to alter source code, steal credentials, publish a malicious artifact under a legitimate name, or deploy unauthorized changes.

OWASP identifies inadequate identity and access management, dependency-chain abuse, poisoned pipeline execution, insufficient credential hygiene, improper artifact-integrity validation, and insufficient logging among the most significant CI/CD security risks.

Excessive permissions and exposed credentials

Pipelines often accumulate overly broad service-account permissions, long-lived access tokens, and credentials that remain active after they are no longer needed. Secrets may also be hardcoded in repositories, pipeline configuration files, build scripts, container images, or logs.
Production credentials should not be available to untrusted pull-request or feature-branch builds. If untrusted code can access those credentials, an attacker may be able to exfiltrate them simply by modifying the build.

Reduce credential risk by:

  • Applying least privilege to users, service accounts, runners, and pipeline steps
  • Preferring temporary or short-lived credentials where supported
  • Keeping secrets in an approved secrets-management system
  • Separating development, test, staging, and production credentials
  • Preventing secrets from appearing in build logs and artifacts
  • Reviewing access regularly and promptly deprovisioning unused identities
  • Rotating credentials according to organizational policy and immediately after suspected exposure

Pipeline and workflow manipulation

Attackers may target pipeline definitions, build scripts, self-hosted runners, or third-party workflow components. Malicious code submitted through a pull request may also exploit a pipeline that executes untrusted changes with privileged credentials.

Teams can reduce this risk by:

  • Requiring review for pipeline configuration and build-script changes
  • Protecting primary and release branches
  • Preventing required reviews and status checks from being bypassed
  • Restricting who can trigger production deployments
  • Isolating untrusted builds from trusted runners and environments
  • Avoiding privileged runners unless they are necessary
  • Pinning and reviewing third-party actions and plugins
  • Keeping pipeline configuration under version control
  • Hardening and patching CI/CD servers and runners

Vulnerable or malicious dependencies

Applications rely on direct and transitive third-party components. Those components may contain known vulnerabilities, become compromised, or create license-policy concerns.

Attackers can also exploit dependency-resolution behavior through techniques such as:

  • Dependency confusion
  • Typosquatted package names
  • Compromised maintainer accounts
  • Malicious package updates
  • Tampered packages or registries
  • Unreviewed pipeline plugins and actions

Use software composition analysis (SCA) to identify direct and transitive dependencies, known vulnerabilities, available fixes, and license obligations. Teams should also pin dependencies where appropriate, enforce lockfiles, validate package integrity, and restrict package managers to approved registries.


SCA identifies known component risk, but it does not replace controls that protect the package-resolution and build process itself.

Vulnerabilities in proprietary code

SCA analyzes third-party and open-source components; it does not identify every vulnerability in code written by your team.


Static application security testing (SAST) analyzes proprietary source code for insecure patterns and data flows associated with issues such as injection, cross-site scripting, insecure cryptography, improper input handling, and unsafe API use. Dedicated secrets-detection tools should also be used to identify exposed tokens, passwords, and keys.


Human-written and AI-generated code require the same security controls. The Sembi Software Quality Pulse Report found that respondents estimate an average of 53% of their organizations’ code has been touched by AI. As AI-assisted development increases code volume and velocity, automated security analysis becomes more important—not less.

Weak artifact integrity and provenance

A successful pipeline run does not automatically prove that the deployed artifact is the one the pipeline produced.


Checksums, signatures, attestations, and provenance records can help teams verify that an artifact has not been replaced or modified between build and deployment. Frameworks such as Supply-chain Levels for Software Artifacts (SLSA) provide guidance for improving software artifact integrity and build provenance.


Integrity controls should address:

  • Who or what produced the artifact
  • Which source revision and dependencies were used
  • Which build process produced it
  • Whether the artifact changed after the build
  • Whether the artifact passed required checks
  • Whether the deployment used the approved artifact

Artifact signing is valuable, but signing alone does not prove that an artifact is secure. The signing keys, build system, and approval process must also be protected.

Insufficient logging and auditability

Security teams need to know which code was scanned, which policies it passed, who approved an exception, and which artifact was deployed.


Without that information, incident response and compliance investigations become difficult. Centralized logs and approval histories should capture relevant repository, pipeline, scan, artifact, and deployment events without recording secrets or unnecessary sensitive data.

What are security gates in CI/CD?

A security gate is an automated or approval-based control that determines whether a change can move to the next stage of the pipeline.

A gate may evaluate:

  • Newly introduced critical or high-risk vulnerabilities
  • Vulnerable open-source dependencies
  • Prohibited software licenses
  • Exposed credentials
  • Missing required scans
  • Failed security tests
  • Unapproved pipeline changes
  • Missing artifact signatures or provenance
  • Violations of organization-specific security policy

A security check and a security gate are related but different. A security check identifies a potential issue. A security gate applies policy to that result and takes action.

Depending on the risk and the organization’s policy, a gate might:

  • Block the build or deployment
  • Allow the build but generate a warning
  • Require manual approval
  • Create a remediation ticket
  • Assign an owner and deadline
  • Record a time-limited exception

Design gates around risk

Blocking every release that contains any finding can create unnecessary disruption and encourage teams to bypass controls. A risk-based prioritization approach focuses gates on risks the organization has already defined as unacceptable.


For example, a gate might block a change that introduces:

  • A new critical vulnerability in an internet-facing application
  • A hardcoded production credential
  • A prohibited license
  • A dependency with a confirmed, actively exploited vulnerability
  • An unsigned production artifact
  • An unauthorized pipeline configuration change

A medium-severity finding might be allowed to proceed if it is assigned an owner and remediation deadline. The correct response depends on exploitability, application exposure, affected data, available mitigations, and the organization’s risk tolerance—not severity alone.

How to implement CI/CD security

CI/CD security is an ongoing program rather than a one-time configuration task. The following steps help teams introduce controls without creating an unmanageable number of alerts or blocking every release.

Map the pipeline and define trust boundaries

Before configuring security tools, document the current delivery workflow.
Include:

  • Repositories and protected branches
  • Build systems and runners
  • Artifact and container registries
  • External services, actions, and plugins
  • Credentials and service accounts
  • Test and deployment environments
  • Approval steps
  • Deployment targets

Identify where untrusted input enters the workflow, where credentials become available, where privileges increase, and where artifacts cross system boundaries.


This process often exposes hidden build steps, shared service accounts, unnecessary integrations, or untrusted jobs running on privileged infrastructure.

Define security policies before configuring tools

Do not allow a scanner’s default settings to become the organization’s security policy.
Define:

  • Which findings should block a build or deployment
  • Whether gates apply only to new findings or the full backlog
  • Which licenses and component risks are prohibited
  • Which scans are required for each application type
  • Who can approve an exception
  • How long an exception can remain active
  • Who owns remediation
  • What evidence must be retained
  • How policies differ by application exposure or data sensitivity

Tools should enforce documented policy rather than define it.

Establish a baseline for existing applications

Mature and legacy applications may already contain a backlog of findings. Blocking every release until the entire backlog is resolved is often impractical and can discourage adoption. Establish an approved baseline of known findings, then consider blocking newly introduced risks that exceed the organization’s threshold. Assign ownership for the existing backlog and reduce it according to a documented vulnerability remediation plan.


A baseline should not become a permanent exemption. Review it regularly, especially when an existing issue becomes more exploitable or affects a newly exposed part of the application.

Add SAST for proprietary code

SAST can provide feedback during active development and within the pipeline.
A layered scanning approach may include:

  • IDE feedback while code is being written
  • Pull-request or pre-commit analysis for changed code
  • CI/CD scans during the build
  • Broader scheduled or release-level analysis

When evaluating a SAST tool, consider:

  • Supported languages and frameworks
  • Data-flow and taint-analysis capabilities
  • Scan speed and incremental analysis
  • Code-level remediation guidance
  • CWE and OWASP mappings
  • Custom rules and policy configuration
  • IDE, repository, and CI/CD integrations
  • False-positive management
  • Quality-gate capabilities

Pattern-based rules can identify useful issues, while deeper data-flow analysis may be needed for vulnerabilities that cross files, methods, and framework boundaries. Evaluate both coverage and accuracy using representative code.

Add SCA and continuous dependency monitoring

Use SCA to identify direct and transitive dependencies, known vulnerabilities, component age, available fixed versions, and license obligations.


Build-time scanning is important, but component risk can change after release when a new vulnerability is disclosed. Continuous monitoring can notify teams when an existing dependency becomes newly vulnerable.


SCA can also support SBOM generation and analysis. An SBOM documents the components identified in a particular application or build, but it does not automatically prove which version is currently running in every production environment. Connect SBOM data to release, deployment, and runtime inventory records where that distinction matters.

Protect credentials and pipeline infrastructure

Application security scanning does not protect the pipeline by itself.
Pipeline controls should include:

  • Least-privilege identities
  • Multi-factor authentication for human access
  • Short-lived credentials where possible
  • Environment-specific secrets
  • Isolated and hardened runners
  • Restricted production access
  • Protected pipeline configuration
  • Reviewed and pinned third-party actions
  • Secret masking in logs
  • Artifact integrity verification
  • Centralized security logging

SAST and SCA cannot replace identity and access management, secrets management, runner hardening, artifact signing, DAST, or cloud infrastructure security.

Protect build artifacts

Treat artifacts as security-sensitive outputs.
Depending on the delivery model, controls may include:

  • Generating checksums
  • Signing artifacts
  • Recording build provenance
  • Storing artifacts in restricted registries
  • Preventing artifacts from being overwritten
  • Verifying signatures before deployment
  • Promoting the same tested artifact between environments
  • Retaining the relationship among source revision, build, scan results, and deployment

Avoid rebuilding separately for each environment when doing so breaks the evidence chain between the tested artifact and the deployed one.

Create an exception and remediation process

Legitimate exceptions will occur, even with carefully tuned gates.
When a gate blocks a build, the failure message should explain:

  • Which policy failed
  • Where the issue appears
  • Why it violates policy
  • How to remediate it
  • Whether an exception is available
  • Who can approve the exception
  • When the exception will expire

Exceptions should be documented, assigned, time-bound, and auditable. Otherwise, temporary approvals can quietly become permanent policy bypasses.

CI/CD security checklist

Use this checklist when designing a pipeline, introducing new security gates, or reviewing existing controls.

Pipeline protection

  • Require MFA and least-privilege access.
  • Prefer short-lived credentials and keep secrets out of repositories and logs.
  • Separate production permissions from development and test access.
  • Protect primary, release, and pipeline-configuration branches.
  • Isolate untrusted builds from privileged runners.
  • Review and pin third-party actions, plugins, and dependencies.
  • Sign and verify production artifacts where appropriate.
  • Confirm that untrusted pull-request builds cannot access production credentials or privileged runners.

Application security

  • Run SAST on proprietary code.
  • Run SCA on direct and transitive dependencies.
  • Apply the same security checks to human-written and AI-generated code.
  • Use dedicated secrets detection.
  • Review open-source license risk.
  • Generate an SBOM for relevant builds.
  • Add container, infrastructure-as-code, and dynamic testing where appropriate.
  • Re-scan fixes to verify remediation and identify regressions.

Security gates

  • Define clear, risk-based blocking thresholds.
  • Focus initial enforcement on new, unacceptable risk.
  • Test new gates in monitoring mode before enabling blocking behavior.
  • Consider exploitability, reachability, and application criticality—not severity alone.
  • Establish and review a baseline for existing findings.
  • Provide actionable failure messages.
  • Require owners and deadlines for exceptions.
  • Apply stricter policies to higher-risk applications and environments.

Monitoring and governance

  • Track remediation time and overdue findings.
  • Monitor dependencies for newly disclosed vulnerabilities.
  • Record scan, approval, artifact, and deployment histories.
  • Review identities and service-account permissions.
  • Monitor changes to pipeline configuration.
  • Evaluate gate failures, bypasses, exception volume, remediation time, and false-positive rates regularly.

How Kiuwan supports CI/CD security

Kiuwan supports the application-security side of CI/CD security by analyzing proprietary code and open-source dependencies and providing findings that teams can incorporate into automated workflows and security gates.


However, Kiuwan does not replace identity and access management, secrets management, runner hardening, artifact signing, DAST, or cloud infrastructure security. Those remain separate requirements for protecting the pipeline itself.

Kiuwan Code Security

Kiuwan Code Security provides SAST for proprietary source code and supports more than 30 modern and legacy programming languages.


Teams can use Kiuwan Code Security to:

  • Analyze code locally or in CI/CD workflows
  • Receive feedback through supported IDE integrations
  • Review code-level remediation guidance
  • Customize analysis rules
  • Map findings to standards such as CWE and OWASP
  • Apply quality gates based on defined vulnerability thresholds

Kiuwan documents integrations with Jenkins and Azure DevOps, GitLab CI analysis through the Local Analyzer, and command-line use with other CI/CD platforms. Its product page also states that quality gates can fail builds when high-severity vulnerabilities appear.


Kiuwan Local Analyzer processes source code within the organization’s infrastructure. Teams should confirm where findings and metadata will be stored based on their selected deployment configuration and data-residency requirements.


Compliance mappings and reports can support audit preparation, but using Kiuwan does not itself guarantee compliance or audit approval.

Kiuwan Insights

Kiuwan Insights provides SCA for third-party and open-source components.
It can help teams:

  • Identify direct and transitive dependencies
  • Detect known component vulnerabilities
  • Analyze open-source licenses
  • Generate and export SBOM data
  • Monitor components for newly disclosed vulnerabilities
  • Integrate dependency analysis into CI/CD workflows

Kiuwan Insights supports component and license analysis, but teams should confirm the exact enforcement options available for license and dependency policies in their chosen CI/CD integration.

Using Kiuwan findings in security gates

Kiuwan Code Security findings can feed pipeline decisions through built-in quality gates and SARIF exports.


For example, teams can configure workflows that:

  • Block a build when it introduces findings above an approved severity threshold
  • Surface findings in developer and security workflows
  • Route lower-priority findings into remediation rather than blocking the release
  • Apply different policies to applications with different risk profiles
  • Retain findings as part of the organization’s security evidence

Kiuwan identifies and prioritizes potential issues; developers still need to review findings and remediate the underlying code or dependency risk.

Secure the pipeline without blocking every release

CI/CD security requires both protection for the delivery pipeline and automated analysis of the code and components moving through it.


Effective teams define unacceptable risk clearly, integrate appropriate security checks, and use gates to enforce policy without treating every finding as equally urgent. They also protect credentials, runners, pipeline configuration, artifacts, and deployment permissions independently of application scans.


Kiuwan helps teams add SAST and SCA to development workflows so proprietary code, open-source dependencies, license obligations, and security findings can be evaluated before release.


Start a free 14-day Kiuwan trial to evaluate Kiuwan within your existing development and CI/CD workflows.


FAQ

What is CI/CD security?

CI/CD security combines protection for pipeline infrastructure—including identities, credentials, runners, configurations, artifacts, and deployment workflows—with security testing for the code and dependencies moving through the pipeline.

Which security scans should run in a CI/CD pipeline?

Many pipelines should include SAST for proprietary code, SCA for third-party dependencies, and secrets detection. Container scanning, infrastructure-as-code scanning, DAST, API security testing, and other checks may also be appropriate depending on the application and deployment model.

The required scans should be based on the organization’s architecture and risk—not a universal checklist alone.

What is the difference between SAST and SCA?

SAST analyzes proprietary application code for insecure patterns and data flows. SCA analyzes third-party and open-source components for known vulnerabilities, license obligations, and related dependency risks.

SAST and SCA address different parts of application risk and are typically used together.

What is the difference between a security check and a security gate?

A security check identifies potential risk. A security gate evaluates the check’s result against policy and determines what happens next, such as blocking the build, issuing a warning, creating a ticket, or requiring approval.

Do security gates slow development?

Poorly configured gates can slow development by blocking on low-risk or inaccurate findings. Risk-based gates focus on clearly unacceptable conditions and give developers actionable feedback.

Track gate failure rates, false positives, exception volume, and remediation time to determine whether the policy is protecting releases without creating unnecessary friction.

Should security gates block existing vulnerabilities?

Not necessarily. For applications with an existing backlog, teams may begin by establishing a documented baseline and blocking newly introduced vulnerabilities above a defined threshold.
The existing backlog should still have assigned owners, remediation targets, and periodic review.

Does an SBOM show what is running in production?

An SBOM documents the components associated with a particular application or build. It does not automatically confirm what is running in every production environment. Connect SBOM records to artifact, release, deployment, and runtime inventory data when production verification is required.

In This Article:

Request Your Free Kiuwan Demo Today!

Get Your FREE Demo of Kiuwan Application Security Today!

Identify and remediate vulnerabilities with fast and efficient scanning and reporting. We are compliant with all security standards and offer tailored packages to mitigate your cyber risk within the SDLC.

Related Posts

CICD security How to secure your pipeline
© 2026 Kiuwan. All Rights Reserved.