Skip to content

fix(ci): harden workflow security across deploy and release pipelines#1345

Merged
sserrata merged 1 commit intomainfrom
fix/security-hardening
Mar 26, 2026
Merged

fix(ci): harden workflow security across deploy and release pipelines#1345
sserrata merged 1 commit intomainfrom
fix/security-hardening

Conversation

@sserrata
Copy link
Copy Markdown
Member

Summary

Security hardening for CI/CD workflows based on security triage findings.

  • C1 (CRITICAL) — Remove GCP_SA_KEY export to GITHUB_ENV in deploy-live.yml and deploy-preview.yml. The google-github-actions/auth action already exports GOOGLE_APPLICATION_CREDENTIALS via Application Default Credentials (ADC) — the explicit echo "GCP_SA_KEY=$(cat ...)" >> $GITHUB_ENV step was redundant and exposed the full service account JSON in plaintext to every subsequent step and action in the job.
  • H2 (HIGH) — Add --ignore-scripts to yarn --prefer-offline in the deploy-preview.yml build job. The build job checks out PR head code (untrusted) after an environment gate approval, then runs yarn install. Without --ignore-scripts, a malicious postinstall hook in a PR's package.json would execute in the runner. This flag prevents lifecycle scripts from running during install without breaking the build.
  • H3 (HIGH) — Delete combine-dependabot-prs.yml. The workflow was non-functional: it contained JavaScript syntax errors (unmatched braces, single-quoted template literals that didn't expand), used an archived third-party action (machine-learning-apps/actions-app-token) with no security update path, and used stale v3 action versions. Removing it eliminates the archived action supply chain risk.
  • M2 (MEDIUM) — Add permissions: contents: read to the build job in deploy-live.yml, making the permission scope explicit rather than defaulting to repository settings.
  • M3 (MEDIUM) — Replace hardcoded personal git identity (Steven Serrata / sserrata@paloaltonetworks.com) in canary-release.yml with the standard github-actions[bot] identity.

Test plan

  • Verify deploy-preview workflow triggers on a test PR and Firebase preview deploys successfully without firebaseServiceAccount input (ADC via WIF)
  • Verify deploy-live workflow triggers on merge to main and deploys successfully
  • Verify canary release commits no longer attribute to personal identity

🤖 Generated with Claude Code

- Remove GCP_SA_KEY from GITHUB_ENV in deploy-live and deploy-preview;
  google-github-actions/auth already exports GOOGLE_APPLICATION_CREDENTIALS
  via ADC, so the explicit credential export step was unnecessary and
  exposed the SA JSON in plaintext to all subsequent steps
- Add --ignore-scripts to yarn install in deploy-preview build job to
  prevent postinstall lifecycle hooks from executing untrusted PR code
- Delete combine-dependabot-prs.yml: workflow was non-functional due to
  JS syntax errors and depended on an archived third-party action
- Add explicit permissions: contents: read to deploy-live build job
- Replace hardcoded personal git identity in canary-release with
  github-actions[bot] identity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Size Change: 0 B

Total Size: 2.2 MB

ℹ️ View Unchanged
Filename Size
demo/.docusaurus/codeTranslations.json 2 B
demo/.docusaurus/docusaurus.config.mjs 14.7 kB
demo/.docusaurus/globalData.json 65.4 kB
demo/.docusaurus/i18n.json 372 B
demo/.docusaurus/registry.js 94.7 kB
demo/.docusaurus/routes.js 89.6 kB
demo/.docusaurus/routesChunkNames.json 37.1 kB
demo/.docusaurus/site-metadata.json 1.51 kB
demo/build/assets/css/styles.********.css 164 kB
demo/build/assets/js/main.********.js 656 kB
demo/build/assets/js/runtime~main.********.js 22.3 kB
demo/build/index.html 97.6 kB
demo/build/petstore/add-pet/index.html 29.3 kB
demo/build/petstore/create-user/index.html 24 kB
demo/build/petstore/create-users-with-array-input/index.html 24.1 kB
demo/build/petstore/create-users-with-list-input/index.html 24.1 kB
demo/build/petstore/delete-order/index.html 23.8 kB
demo/build/petstore/delete-pet/index.html 24.1 kB
demo/build/petstore/delete-user/index.html 24.3 kB
demo/build/petstore/find-pets-by-status/index.html 24.8 kB
demo/build/petstore/find-pets-by-tags/index.html 25.4 kB
demo/build/petstore/get-inventory/index.html 23.1 kB
demo/build/petstore/get-order-by-id/index.html 24.1 kB
demo/build/petstore/get-pet-by-id/index.html 24.9 kB
demo/build/petstore/get-user-by-name/index.html 24.4 kB
demo/build/petstore/login-user/index.html 24.9 kB
demo/build/petstore/logout-user/index.html 23.7 kB
demo/build/petstore/new-pet/index.html 24.3 kB
demo/build/petstore/pet/index.html 22.5 kB
demo/build/petstore/place-order/index.html 23.3 kB
demo/build/petstore/schemas/apiresponse/index.html 24.6 kB
demo/build/petstore/schemas/cat/index.html 38.8 kB
demo/build/petstore/schemas/category/index.html 25.7 kB
demo/build/petstore/schemas/dog/index.html 39 kB
demo/build/petstore/schemas/honeybee/index.html 39.1 kB
demo/build/petstore/schemas/id/index.html 22.7 kB
demo/build/petstore/schemas/order/index.html 26.8 kB
demo/build/petstore/schemas/pet/index.html 38.6 kB
demo/build/petstore/schemas/tag/index.html 24.1 kB
demo/build/petstore/schemas/user/index.html 40.7 kB
demo/build/petstore/store/index.html 21.5 kB
demo/build/petstore/subscribe-to-the-store-events/index.html 30.2 kB
demo/build/petstore/swagger-petstore-yaml/index.html 30.2 kB
demo/build/petstore/update-pet-with-form/index.html 24.3 kB
demo/build/petstore/update-pet/index.html 24.7 kB
demo/build/petstore/update-user/index.html 24.3 kB
demo/build/petstore/upload-file/index.html 24.1 kB
demo/build/petstore/user/index.html 22.2 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 868d7d9):

https://docusaurus-openapi-36b86--pr1345-mczww90l.web.app

(expires Sat, 25 Apr 2026 19:08:34 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@sserrata sserrata merged commit eafc55c into main Mar 26, 2026
11 checks passed
@sserrata sserrata deleted the fix/security-hardening branch March 26, 2026 19:09
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.

1 participant