Interview Prep/DevSecOps/Pipeline Security Scanning

How do you secure a GitHub Actions workflow that uses many third-party actions?

IntermediateScenarioPipeline Security Scanning
Answer

Situation read → A compromised action runs with your secrets. Tag references like @v3 can be moved by the owner or an attacker.

What I'd do →

  1. Pin third-party actions to a full commit SHA with a comment for the version: uses: actions/checkout@<40-char-sha> # v4.
  2. Set least-privilege permissions: at the workflow top, for example contents: read.
  3. Allow only approved actions in org settings.
  4. Use Dependabot or Renovate to bump the SHAs.
  5. Use OIDC to cloud instead of long-lived keys.

Why → A SHA is immutable, a tag is not.

Interview tip → Cite the tj-actions/changed-files incident of March 2025 as a real example.

All DevSecOps questions Roadmap: Security in the pipeline

More on Pipeline Security Scanning