Skip to content

Conversation

@llali
Copy link
Contributor

@llali llali commented Dec 12, 2025

Security Hardening for GitHub Actions Workflows

Fixes critical security vulnerabilities in our CI/CD workflows as identified by MSRC.

Critical Fix: pull_request_target Vulnerability

  • Issue: pr-check.yml ran untrusted fork code with access to Azure secrets via npm install/npm run build
  • Fix: Split into two-job architecture - build job runs untrusted code without secrets, deploy job uses pre-built artifacts with secrets

Additional Security Improvements

  • SHA Pinning: Pinned all GitHub Actions to commit SHAs to prevent tag hijacking (checkout, login, upload/download-artifact)
  • Least Privilege: Moved id-token: write from workflow to job-level, added explicit minimal permissions to all jobs
  • Dependency Control:
    • Replaced npm install with npm ci --ignore-scripts to enforce lockfile and prevent malicious scripts
    • Added package-lock.json change detection with reviewer warnings
    • Added package.json lifecycle script scanning
    • Added npm audit for vulnerability scanning
  • Applied across: pr-check.yml, ci.yml, check-lib.yml, adhoc-tests.yml

Files Changed

  • .github/workflows/pr-check.yml - Major security refactor
  • .github/workflows/ci.yml - Hardening improvements
  • .github/workflows/check-lib.yml - Hardening improvements
  • .github/workflows/adhoc-tests.yml - Hardening improvements

@llali llali temporarily deployed to Automation test December 15, 2025 20:53 — with GitHub Actions Inactive
@llali llali temporarily deployed to Automation test December 15, 2025 20:54 — with GitHub Actions Inactive
@llali llali deployed to Automation test December 15, 2025 20:54 — with GitHub Actions Active
@llali llali merged commit 0e9a1d7 into master Dec 15, 2025
12 of 13 checks passed
@llali llali deleted the dev/llali/fixmsrc branch December 15, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants