fix(security): set up SSH so classpath jobs can clone private git deps - #3
Merged
Merged
Conversation
clj-kondo and clj-watson build the full classpath (`clojure -Spath` / clj-watson scan), which must clone private git dependencies. The reusable workflow had no SSH setup, so those jobs only succeeded when a warm ~/.gitlibs cache happened to already contain the dep; on a cold cache (e.g. after any deps.edn change) they failed with a "Permission denied (publickey)" clone error. clj-holmes, gitleaks, shellcheck and semgrep don't build the classpath and are unaffected. Add an optional, scoped `private-git-ssh-key` workflow_call secret and, only in the two classpath-building jobs, a "Set up SSH" step that mirrors the consumer build workflows (write the deploy key to ~/.ssh/id_ed25519, ssh-keyscan github.com). The step self-skips when the secret is unset, so consumers without private git deps (and the self-test) are unaffected. Scoped on purpose — not a return to blanket `secrets: inherit`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft for review — do not merge yet.
Problem
clj-kondoandclj-watsonbuild the full classpath (clojure -Spath/clj-watson scan -p deps.edn), which forces resolution of private git dependencies. The reusable workflow has no SSH setup, so those two jobs only pass when a warm~/.gitlibscache already contains the dep. On a cold cache — which happens after anydeps.ednchange — they fail with:clj-holmes,gitleaks,shellcheck, andsemgrepdon't build the classpath and are unaffected.Fix
private-git-ssh-keyworkflow_callsecret (not a return to blanketsecrets: inherit).clj-kondo,clj-watson). It mirrors the consumers' existing build workflows: write the deploy key to~/.ssh/id_ed25519,chmod 600,ssh-keyscan github.com.::notice::no private-git-ssh-key provided), so consumers without private git deps — and this repo's ownself-test.yml(nodeps.edn) — are unaffected.Consumer usage
Consumer wrapper passes its existing SSH deploy-key secret through explicitly:
Rollout / proof
Consumers pin
@v1. To prove this end-to-end, a downstream consumer's wrapper is temporarily pointed at this fix branch and its security run goes fully green (all six jobs, including the now-enforcing clj-watson + semgrep). Final state re-pins consumers to@v1once this merges andv1is re-tagged to include it — the temporary branch pin is reverted before the downstream PR merges.actionlint clean on
security.ymlandself-test.yml.