A secure CI/CD pipeline is a repeatable control system, not a one-time configuration. This checklist helps web development teams review repository permissions, dependency installation, secrets, build isolation, artifacts, third-party actions, deployment approvals, and audit records on a practical monthly or quarterly schedule.
Overview
Continuous integration and continuous delivery connect source code to production, which makes the pipeline part of the application’s security boundary. A compromised pull request, dependency, build runner, plugin, or deployment credential can affect the final release even when the application code itself passes its tests.
The goal of a secure CI pipeline is not to eliminate every possible risk. It is to reduce unnecessary access, make changes traceable, prevent unreviewed code from reaching sensitive environments, and create useful evidence when something changes. Controls should match the risk of the project: a public marketing site may need a simpler process than a service handling customer data, but both should protect credentials and verify what they deploy.
Use this article as a review worksheet. Record the owner, current control, evidence, and next action for each item. Recheck the list after major changes to the repository, CI provider, runtime, dependency strategy, cloud account, or deployment target.
Pipeline-threat reference table
| Pipeline area | Typical threat | Control to verify |
|---|---|---|
| Repository permissions | A workflow or contributor receives more access than required. | Use a least-privilege permission model and separate write access from read-only jobs. |
| Pull requests | Untrusted code runs with secrets or deployment permissions. | Keep secret-bearing jobs behind review and environment approval boundaries. |
| Dependencies | A compromised or unexpected package runs during installation or build. | Lock versions, review changes, use trusted registries, and limit install-time privileges. |
| Build runners | Build data or credentials persist between jobs. | Prefer isolated or ephemeral runners and clean workspaces after execution. |
| Artifacts | An artifact is replaced or deployed without clear provenance. | Generate once, record its digest or identifying metadata, and promote the reviewed artifact. |
| Third-party actions | An action, plugin, or container gains unintended access. | Review ownership, pin versions appropriately, and minimize permissions. |
| Deployment | A pipeline deploys to production without adequate review. | Use protected environments, approval gates, rollback procedures, and separate credentials. |
| Audit records | Suspicious changes cannot be reconstructed. | Retain workflow, approval, identity, artifact, and deployment logs for an appropriate period. |
What to track
1. Repository and workflow permissions
Start with the permissions granted to the CI platform, individual jobs, deployment identities, and human contributors. A workflow that only checks formatting should not be able to publish a package or modify infrastructure. Set the default permission level as restrictively as the platform allows, then grant a job only what it needs.
Separate validation from release work. Tests for code from a fork or untrusted branch should not automatically receive production credentials. Treat workflow configuration as executable code: require review for changes to pipeline files, reusable workflows, runner definitions, and deployment scripts.
Least-privilege permissions template
Validation job:
- Read source code
- Read dependency metadata
- Write test results only, if required
- No production or package-publishing credentials
Build job:
- Read source code and lockfiles
- Create a short-lived build artifact
- No broad cloud administrator access
Release job:
- Read the approved artifact
- Publish only to the designated registry or environment
- Use a separate identity with narrowly scoped permissions
- Require an approval or equivalent control for sensitive environments
Adapt the template to your provider. Permission names differ, but the principle remains consistent: make every access request explainable by the job’s purpose.
2. Secrets and identity
Do not place API keys, private tokens, certificates, or passwords in source files, logs, build arguments, or committed configuration. Store secrets in the CI provider’s protected secret facility or an approved external secret manager. Review masking behavior rather than assuming that every secret format will be hidden in logs.
Prefer short-lived, workload-specific credentials when the deployment platform supports them. For example, a release job can authenticate for a limited operation instead of receiving a permanent cloud key. Restrict secrets by repository, branch, environment, and job where possible. Rotate credentials after a suspected exposure, not only on a calendar schedule.
3. Dependency installation and software supply chain
Track lockfiles, package-manager configuration, base images, build plugins, and third-party actions as part of the supply chain. Review unexpected lockfile changes in pull requests. Use dependency caches carefully: a cache should improve speed, not become an unreviewed source of executable content. Avoid allowing arbitrary scripts from untrusted input to run in a privileged job.
For containerized builds, review the image base, installed packages, exposed files, and runtime user. The Dockerfile best practices checklist and Dockerfile optimization guide provide related checks for reducing build and deployment risk.
4. Actions, plugins, and reusable workflows
List every external action, plugin, container, reusable workflow, and script invoked by the pipeline. Confirm why it is needed, what it can read or write, and who maintains it. Pin dependencies to reviewed versions; for especially sensitive steps, pin to an immutable commit reference where practical. A version tag can move, so record the reviewed reference and update it deliberately.
Do not copy a workflow into production simply because it is popular or convenient. Review its shell commands, inputs, permissions, secret handling, and network behavior. Keep the set of third-party components small enough that the team can reassess it.
5. Build isolation and artifact integrity
Use isolated runners for sensitive builds when feasible, and avoid sharing workspaces between unrelated repositories or trust levels. Remove temporary credentials and generated files at the end of a job. Separate jobs that process untrusted pull-request code from jobs that can publish or deploy.
Define what makes an artifact acceptable: the source revision, dependency state, build environment, test result, and responsible workflow should be identifiable. Build once and promote the same reviewed artifact through environments instead of rebuilding different output for each destination. Store a digest or equivalent identifier so the deployment can be compared with the artifact that was tested.
6. Pull-request review controls
- Require review for changes to workflow files, deployment manifests, infrastructure code, and dependency lockfiles.
- Check whether new commands accept user-controlled input, especially shell commands and pull-request titles or labels.
- Confirm that fork or external-contributor builds cannot access sensitive secrets.
- Run security, unit, integration, and contract checks appropriate to the application.
- Record why an intentional exception exists and assign an owner and review date.
For API-heavy projects, include contract and authentication regression tests in the pipeline. The REST API testing guide and OpenAPI contract testing workflow can help connect those checks to release decisions.
Cadence and checkpoints
A useful security review has both a recurring schedule and event-based triggers. A monthly lightweight review can catch drift, while a quarterly review can examine permissions and dependencies more deeply.
Monthly checkpoint
- Review failed, skipped, and unusually long-running workflows.
- Check for new secrets, expired credentials, and unexpected authentication events.
- Review changes to workflow files, actions, plugins, runners, and deployment scripts.
- Confirm that production approvals and deployment records are present.
- Remove unused variables, credentials, runners, and permissions.
Quarterly checkpoint
- Re-map each job to its required permissions and reduce any broad access.
- Review dependency, container, action, and runtime versions against the project’s support plan.
- Test credential rotation and, if applicable, the recovery or rollback process.
- Review runner isolation, cache behavior, artifact retention, and log access.
- Perform a sample trace from pull request to deployed artifact.
Event-based checkpoint
Run an immediate review after a security incident, credential exposure, new deployment target, CI provider change, repository migration, major dependency update, or change in production ownership. Do not wait for the next quarterly date when the trust boundary has changed.
How to interpret changes
Not every pipeline change indicates an incident. Interpret changes by asking what changed, which trust boundary it crossed, what access was added, and whether the change is supported by review and evidence.
A sudden increase in privileged jobs may indicate growing technical debt or an overly broad reusable workflow. Repeated secret-related failures may show that environment boundaries are unclear. A growing number of third-party actions can increase review effort even when each individual action appears reasonable. Failed artifact verification, unexplained deployments, or logs that no longer identify the actor should be treated as high-priority investigation signals.
Track findings with a simple status: verified, needs remediation, accepted exception, or unknown. “Unknown” is useful because it distinguishes missing evidence from a control that has been checked. Assign an owner and due date to every remediation item, and document the reason for accepted exceptions.
When to revisit
Review this checklist monthly for operational drift and quarterly for a deeper permissions and supply-chain assessment. Revisit it immediately when a workflow gains a new secret, action, plugin, runner, registry, cloud account, or deployment environment. It also belongs in the change process for repository transfers, runtime upgrades, infrastructure migrations, and incident follow-ups.
At the next review, compare the current pipeline with the previous record rather than starting from memory. Keep a short change log containing the date, reviewer, affected jobs, permission changes, dependency or action updates, open findings, and evidence links. Because hosted CI features and supported runtimes change over time, verify provider documentation and project-specific support requirements before applying a new control.
Action plan for the next review
- Export or record the permissions for every workflow and deployment identity.
- Mark which jobs can access secrets, publish artifacts, or deploy.
- Review the last set of workflow and dependency changes.
- Trace one release from pull request through the exact deployed artifact.
- Remove one unnecessary permission, credential, action, or runner if the evidence supports removal.
- Assign owners and dates for unresolved findings, then schedule the next monthly and quarterly checkpoints.
This process turns CI/CD pipeline security from a one-time configuration task into a maintained part of the DevOps workflow. The result is clearer accountability, fewer standing privileges, and better evidence when a release or investigation requires it.