Nexus Void Research

CI/CD Security, GitHub Actions, Pipeline Security, Supply Chain, Merge Gate, ARGUS

How to Secure Your CI/CD Pipeline (GitHub Actions)

How to secure a CI/CD pipeline in GitHub Actions: least-privilege tokens, SHA-pinned actions, scoped secrets, and a merge gate that blocks vulnerable code.

To secure a CI/CD pipeline in GitHub Actions, you lock down four things: the permissions your workflows run with, the third-party actions you depend on, the secrets the pipeline can read, and the gate that decides what is allowed to merge and ship. A CI/CD pipeline is high-value because it has credentials and can push to production, so a poisoned workflow or a compromised action can turn one pull request into a full supply-chain compromise. The recent wave of registry and pipeline attacks makes this a first-order concern, not a later hardening step.

Understanding how to secure a CI/CD pipeline matters because the pipeline sits between your code and your customers with privileged access to both. Attackers increasingly target it directly, through malicious dependencies pulled during a build, tampered third-party actions, or over-privileged tokens, precisely because owning the pipeline means owning everything it ships.

What are the biggest CI/CD security risks?

The OWASP CI/CD Top 10 captures the pattern, and a few risks dominate in practice for GitHub Actions users.

Risk

Mitigation

Over-privileged GITHUB_TOKEN

Set least-privilege permissions per workflow

Unpinned third-party actions

Pin actions to a full commit SHA

Exposed secrets in workflows

Scope secrets, never echo them to logs

Untrusted pull_request_target

Avoid running untrusted code with secrets

Poisoned dependencies at build

Scan and verify what the build installs

How do you harden GitHub Actions specifically?

Start with least privilege: set the permissions key explicitly so GITHUB_TOKEN gets only what each job needs, instead of the broad default. Pin every third-party action to a full commit SHA rather than a mutable tag, so a compromised action cannot silently change under you. Keep secrets scoped and never print them, and be careful with pull_request_target, which runs with secrets and can be abused by a malicious fork. These steps close the most common paths attackers use to hijack a pipeline.

How do you stop vulnerable code from shipping through the pipeline?

Add a security gate to the merge, so the pipeline itself enforces that code, dependencies, and secrets pass before anything reaches the main branch. This is where a pull-request security reviewer becomes a pipeline control: ARGUS reviews each pull request for vulnerable dependencies, hardcoded secrets, and insecure code, prioritizes by reachability, and provides a deterministic merge gate that blocks an exploitable change from merging, while opening the fix as a pull request. That turns your CI/CD pipeline from a place where insecure code passes through into a place where it is caught. ARGUS secures the code and dependencies moving through the pipeline; general workflow hardening like SHA-pinning and token scoping remains a configuration task on your side.

Frequently asked questions

Why pin GitHub Actions to a commit SHA? Because tags are mutable. If you reference an action by tag and its maintainer or an attacker moves that tag to malicious code, your pipeline runs it. A full SHA cannot change under you.

What is a merge gate? A required check that blocks a pull request from merging unless it passes, for example a security review that fails on an exploitable vulnerability or a committed secret.

Is CI/CD security part of supply-chain security? Yes. The pipeline builds and ships your software, so compromising it is a direct supply-chain attack, which is why frameworks like SLSA focus on build integrity.

Our read

The CI/CD pipeline is the most privileged, least-watched part of many startups' stacks, which is exactly why attackers aim at it. Hardening the workflow, least-privilege tokens, SHA-pinned actions, scoped secrets, closes the configuration gaps, but the durable win is making the pipeline enforce security on the code itself through a merge gate that blocks exploitable changes and fixes them in place. A pipeline that verifies what it ships, rather than trusting it, is the supply-chain control that pays off first.

Pipeline risks per the OWASP CI/CD Top 10; hardening steps per GitHub Actions security guidance; build integrity per SLSA. Sources linked above.

Related: CTO guide to securing a startup codebase and how to detect malicious npm packages.

DATA SOURCES

OWASP Top 10 CI/CD Security Risks — https://owasp.org/www-project-top-10-ci-cd-security-risks/ ; GitHub Actions security hardening — https://docs.github.com/actions/security-guides/security-hardening-for-github-actions ; SLSA supply-chain framework — https://slsa.dev/

Liked this post? Share it:

Related posts

Related posts appear on the live page

VIEW ALL RESEARCH ->

PAGE CONTENTS

Contents appear on the live page

// FROM THE LAB

Pentesting is easy and affordable now.

Continuous VAPT you can run every month, with a report built for AI-built apps.

RUN A VAPT ->

// CYBER NETWORK

Shape the next analysis.

A curated network of security practitioners who help set our research agenda. By application.

APPLY TO JOIN ->

Get new research first

We publish original analysis and experiments on how attackers actually move. Follow along: