Skip to content

ci: set least-privilege permissions and harden workflow jobs - #5754

Merged
lvrach merged 2 commits into
developfrom
ci/sec-818-harden-workflows
Oct 31, 2026
Merged

lvrach merged 2 commits into
developfrom
ci/sec-818-harden-workflows

Conversation

@lvrach

@lvrach lvrach commented Oct 31, 2026

Copy link
Copy Markdown
Member

What changed

The repo already pinned every action, ran harden-runner and gave almost every job its own permissions block. This PR closes the gaps.

  • All workflows: workflow-level permissions go from contents: read to {}.
  • Jobs without a block get one: live-integration-tests detect-affected and discover, verify secret-paths, sync-secret-path-manifest sync (contents: read), prepare-for-prod-ut-deploy notify-control-plane ({}).
  • sync-secret-path-manifest.yml: harden-runner moves to the first step.
  • persist-credentials: false on every checkout, except jobs that run git with the checkout token later: draft-new-release, publish-new-release, update-ingestion-service, live-integration-tests detect-affected, housekeeping branches, and the seven devops and operator PR jobs that run ryancyq/github-signed-commit. Each kept checkout has a comment.
  • No job loses a GITHUB_TOKEN scope.

Why

https://linear.app/rudderstack/issue/SEC-818 sets one GitHub Actions security baseline for every org repo (pass 1: permissions, harden-runner, SHA pins, checkout credentials).

How to verify

  • verify, commitlint, dt-test-and-report-code-coverage, verify-server-start, build-pr-artifacts and live-integration-tests pass on this PR as on develop.
  • Deploy and release workflows (prepare-for-*, publish-new-release, draft-new-release, update-ingestion-service) cannot fully run on this PR. Their permission blocks do not change, and their git-pushing checkouts keep credentials.

Not covered (pass 2)

  • timeout-minutes and concurrency on jobs and workflows.
  • Pre-existing zizmor findings outside this scope (cache-poisoning, template-injection, dependabot cooldown, self-repository).
  • Dependabot repo check and .github/actionlint.yaml (self-hosted labels still fail actionlint, as on the base branch).

🤖 Generated with Claude Code

SEC-818 sets one security baseline for every workflow in the org. This
repo already pinned every action, ran harden-runner and gave almost every
job its own permissions block. Gaps closed here:

- All workflows: workflow-level permissions go from contents: read to {}.
- Jobs without a block get one: live-integration-tests detect-affected
  and discover, verify secret-paths, sync-secret-path-manifest sync
  (contents: read); prepare-for-prod-ut-deploy notify-control-plane ({}).
- sync-secret-path-manifest.yml: harden-runner moves to the first step.
- persist-credentials: false on every checkout, except jobs that run git
  with the checkout token later: draft-new-release, publish-new-release,
  update-ingestion-service, live-integration-tests detect-affected,
  housekeeping branches, and the seven devops/operator PR jobs that run
  ryancyq/github-signed-commit. Each kept checkout has a comment.

No job loses a GITHUB_TOKEN scope.

Verify: verify, commitlint, dt-test, verify-server-start, build-pr-artifacts
and live-integration-tests pass on this PR as on develop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.30.1
Copilot AI balanced review requested due to automatic review settings October 31, 2026 16:55
@lvrach
lvrach requested review from a team as code owners October 31, 2026 16:55
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b43dbf5f-c3be-4fb6-a0b2-a374f68d0da6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

The Verify job runs prettier on workflow files. Prettier wants one space
before an inline comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.30.1
Copilot AI balanced review requested due to automatic review settings October 31, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (0f4947b) to head (70b3c9e).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5754   +/-   ##
========================================
  Coverage    92.42%   92.42%           
========================================
  Files          741      741           
  Lines        41048    41048           
  Branches      9635     9640    +5     
========================================
  Hits         37938    37938           
  Misses        2848     2848           
  Partials       262      262           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arpl arpl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by the SEC-784 chore review loop at this commit.

Checked here: CI is green; every pin resolves to its tag; each job's permissions were read against what its steps use, and no job lost a scope or checkout credential it needs; nothing else in the workflows changed structurally.
Not run: jobs on release, deploy, schedule or dispatch triggers do not run on a PR. They were read, not executed, so watch their first run after merge.

@lvrach
lvrach merged commit 3ee605e into develop Oct 31, 2026
51 of 52 checks passed
@lvrach
lvrach deleted the ci/sec-818-harden-workflows branch October 31, 2026 19:07
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