Who Gets to Run the Pipeline: Hard Lessons in Securing Open Source CI/CD

Open source maintainers must tightly control CI/CD permissions to prevent supply chain attacks. The latest CNCF guidance details practical steps for GitHub Actions, least-privilege workflows, and hardened triggers. Small teams can adopt these measures without dedicated security staff.
Who Gets to Run the Pipeline: Hard Lessons in Securing Open Source CI/CD
Written by Victoria Mossi

Maintenance of open source projects often falls to a handful of volunteers. They review code, merge pull requests, and keep releases flowing. Yet one area receives less attention than it deserves: the systems that actually build, test, and ship the software. A single compromised workflow can hand attackers the keys to publish malicious versions that millions download.

The CNCF blog laid this out clearly on June 4. Control who runs what. That simple directive cuts through layers of configuration files and permission matrices. Projects ignore it at their peril.

GitHub Actions remains the default choice for many open source repositories. Its convenience comes with trade-offs. Workflows trigger on events such as pull requests from forks. They run on shared runners. Secrets might leak. Or worse, a malicious pull request could execute code that steals credentials or alters release artifacts.

But the problem runs deeper. Contributors submit changes. Maintainers approve them. The pipeline executes with elevated rights. This pattern repeats across thousands of repositories. And attackers have noticed.

Recent guidance from the OWASP Top 10 CI/CD Security Risks project catalogs the most common failure modes. Insufficient credential hygiene sits near the top. So does overly permissive workflow triggers. Teams that treat pipelines as trusted internal tools expose them to external manipulation.

Consider a typical pull request from an unknown contributor. The workflow checks out the code, installs dependencies, runs tests. If the workflow uses the pull_request_target event without proper safeguards, it gains access to repository secrets. A clever attacker injects commands that exfiltrate those secrets. Game over.

Projects can close this door. Require approval for workflows from first-time contributors. Pin actions to specific commit hashes instead of floating tags. Review every .github/workflows change as carefully as application code. These steps sound basic. They prevent real incidents.

The CNCF post stresses role-based controls inside the repository. Not every maintainer needs admin rights. Some handle only documentation. Others manage releases. Limit the blast radius. Use GitHub’s fine-grained permissions for workflows. Grant only the tokens a job actually needs.

Self-hosted runners introduce another vector. They offer performance and control. They also run code from untrusted sources on infrastructure the project owns. Isolate them. Never allow them to access production credentials. Rotate tokens frequently. Monitor for anomalous behavior.

Dependency management adds complexity. A pipeline that pulls the latest version of an action or library risks supply-chain compromise. Lock versions. Verify signatures where possible. Tools like Sigstore and Cosign help here, though adoption in open source CI remains patchy.

Earlier this year, analyses of popular CI/CD tools highlighted persistent gaps. A January 2026 overview from SentinelOne listed Trivy, OWASP ZAP, and Sonatype Lifecycle among recommended scanners. These catch vulnerabilities in containers, web apps, and open source dependencies. Yet many projects run them inconsistently or ignore the results.

Static analysis tools such as CodeQL, integrated into GitHub’s security features, scan pull requests automatically. They surface potential issues before merge. The catch? Someone must review the alerts. Small teams often lack bandwidth. Automated enforcement becomes essential.

Policy-as-code approaches offer a path forward. Tools like Kyverno or OPA can gate pipeline execution based on defined rules. But for open source projects without dedicated security staff, the overhead proves daunting. Simpler patterns work better.

Require that all release workflows trigger only on tags pushed by trusted maintainers. Disable workflow runs from forks by default. Use OIDC federation to obtain short-lived cloud credentials instead of long-lived secrets. These changes reduce attack surface without demanding full-time security expertise.

CNCF itself supports dozens of projects with infrastructure credits and shared runners. Its contributor resources page details partnerships with GitHub, AWS, and others to expand build capacity while maintaining controls. Larger projects leverage these offerings. Smaller ones struggle with rate limits and manual processes.

A May 2025 examination of pipeline security from OX Security noted the rise of software composition analysis in CI/CD. Scanning for known vulnerabilities in dependencies is no longer optional. Projects that ship frequently must automate this check or risk distributing compromised code.

Yet automation alone falls short. Human review of pipeline changes matters. A maintainer who approves a workflow that checks out arbitrary code and runs curl | bash has effectively granted execution rights to the internet. Documentation helps. Templates help more.

Provide approved workflow templates that contributors can reference. Centralize common jobs. Update them in one place. This reduces duplication and ensures consistent security posture across repositories.

Monitoring adds another layer. Track workflow failures. Watch for unusual permission requests. Log token usage. When something looks off, investigate promptly. In open source, transparency cuts both ways. Public logs help defenders. They also inform attackers.

The industry has learned from past breaches. SolarWinds, CodeCov, and other incidents showed how trusted build systems become vectors. Open source projects cannot assume immunity. Their code runs everywhere.

So what does effective control look like in practice? Start with least privilege. Every job gets the minimal permissions required. Use environments to protect production secrets. Require manual approval for sensitive workflows.

Next, harden triggers. Avoid running untrusted code with write access. Separate build and release pipelines. Sign artifacts. Publish provenance data so consumers can verify what they install.

Education closes the loop. Contributors need to understand why certain patterns are forbidden. Maintainers need training on reviewing workflow files. Security becomes part of the contribution process, not an afterthought.

Recent discussions on X underscore the urgency. Developers shared examples of eBPF-based sensors for monitoring GitHub Actions and GitLab runners. Others highlighted AI-assisted red teaming of popular open source projects, stressing the need for strong CI/CD practices to avoid compromise.

The CNCF guidance arrives at a pivotal moment. Cloud native adoption continues to accelerate. The number of open source components in production environments grows. Each depends on secure delivery pipelines.

Organizations consuming these projects bear responsibility too. They should verify SBOMs, check signatures, and understand the supply chain. Blind trust in community-maintained software carries risk.

Progress is visible. More projects adopt SLSA principles. Sigstore sees wider use. GitHub has improved default security settings for repositories. Still, the gap between best practices and common reality remains wide.

Controlling who runs what sounds administrative. In truth it forms the foundation of software supply chain integrity. Ignore it, and all other security measures rest on sand. Apply it consistently, and open source projects gain resilience against the next wave of targeted attacks.

The volunteers who maintain these projects already give their time. Asking them to master workflow security feels like one more burden. Yet the alternative costs far more. A single incident can erode user trust for years. Better to secure the pipeline before the breach makes headlines.

Subscribe for Updates

SecurityProNews Newsletter

News, updates and trends in IT security.

By signing up for our newsletter you agree to receive content related to ientry.com / webpronews.com and our affiliate partners. For additional information refer to our terms of service.

Notice an error?

Help us improve our content by reporting any issues you find.

Get the WebProNews newsletter delivered to your inbox

Get the free daily newsletter read by decision makers

Subscribe
Advertise with Us

Ready to get started?

Get our media kit

Advertise with Us