Skip to content

Forward each build workflow only the secrets it reads, pin the job containers by digest and drop the token from read-only checkouts - #4374

Merged
infeo merged 3 commits into
cryptomator:developfrom
Totara-thib:ci-hardening
Nov 3, 2026
Merged

infeo merged 3 commits into
cryptomator:developfrom
Totara-thib:ci-hardening

Conversation

@Totara-thib

Copy link
Copy Markdown
Contributor

Hi,

The release draft called the Windows, macOS and AppImage builders with secrets: inherit, and the post-publish tasks did the same for the anti-virus allowlisting, so an installer signing job could also read the AUR, Flathub, winget and Slack tokens. Each callee now declares what it reads and each caller forwards exactly that.

The Arch and Flatpak job containers were pulled by tag, the four sites now pull by digest with the tag kept for readability.

Eighteen checkouts stop persisting the token. The three that push to the AUR and Flathub repositories keep it.

Why: a compromised step in these jobs reaches the signing keys and publishing tokens, the way the tj-actions incident (CVE-2025-30066) did.

Judgment calls:

  • mac-dmg-x64.yml says do not edit, it got the same lines as mac-dmg.yml so both stay copies.
  • The secrets are declared required: false, so direct runs keep working.
  • Action references are untouched, already pinned by commit and kept by Dependabot. One step further is GitHub's workflow dependency lockfile, which records the commit every action resolves to, transitive ones included, and is generated with gh actions-lock. Happy to add it in a follow-up if you want it.

Found and fixed by Plumber's analysis, reviewed and submitted by me.

The release draft handed the Windows, macOS and AppImage build workflows
every secret of the repository with secrets: inherit, and the post
publish tasks did the same for the anti virus allowlisting. Each callee
now declares what it reads under workflow_call and each caller forwards
exactly that: the signing material, the GPG key and the release token
to the builders, the two allowlist accounts to the uploader. The AUR,
Flathub, winget, Slack, Gist and Grafana tokens no longer travel into
jobs that never use them. Direct runs of the builders (schedule, dispatch,
push) are unchanged, they read the repository secrets as before.
The AUR and makepkg jobs ran inside archlinux:base-devel and the Flatpak
build inside the freedesktop-26.08 runtime image, both pulled by tag,
so a job ran whatever image was pushed under that tag last. The four
sites now pull the image by its digest, with the tag kept for
readability, so the build environment is the one that was reviewed.
The digests are the multi architecture indexes current on 2026-11-02.
actions/checkout leaves the job token in .git/config by default, where
every later step and tool can read it. Eighteen checkouts opt out. The
three that check out the AUR and Flathub repositories with the cryptobot
token keep it: those jobs commit and push to them from the clone.
@CLAassistant

CLAassistant commented Nov 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1920644b-2765-4932-beec-7a38f096c60a
Commits

Reviewing files that changed from the base of the PR and between 488f5f0 and 2a47598.

Files selected for processing: 15
  • .github/workflows/appimage.yml
  • .github/workflows/aur-bin.yml
  • .github/workflows/av-whitelist.yml
  • .github/workflows/build.yml
  • .github/workflows/debian.yml
  • .github/workflows/draft-release.yml
  • .github/workflows/get-version.yml
  • .github/workflows/linux-flatpak.yml
  • .github/workflows/linux-makepkg.yml
  • .github/workflows/mac-dmg-x64.yml
  • .github/workflows/mac-dmg.yml
  • .github/workflows/post-publish.yml
  • .github/workflows/pullrequest.yml
  • .github/workflows/release-check.yml
  • .github/workflows/win-exe.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Reusable workflows now declare optional secrets, and caller workflows pass selected secrets explicitly. Checkout steps disable persisted credentials. Arch Linux and Flatpak container images are pinned by digest.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: infeo

Merge Risk: Minimal · up to 2a475

The workflow security changes have no identified merge-blocking issue.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly summarizes all three main changes: forwarding only required secrets, pinning job containers by digest, and disabling persisted tokens for read-only checkouts.
Description check Passed The description directly explains the workflow security changes, their purpose, affected workflows, and implementation decisions.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (15 skipped: 15 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • 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

@infeo infeo self-assigned this Nov 3, 2026

@infeo infeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@infeo
infeo merged commit 5afcd55 into cryptomator:develop Nov 3, 2026
3 checks passed
@infeo infeo added this to the 1.20.0 milestone Nov 3, 2026
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