ci: make PR Code Security portable (drop prisma-org reusables) - #448
Open
MattJackson wants to merge 3 commits into
Open
ci: make PR Code Security portable (drop prisma-org reusables)#448MattJackson wants to merge 3 commits into
MattJackson wants to merge 3 commits into
Conversation
The workflow called prisma/.github reusable workflows (secret_detection, code_scanning) with `secrets: inherit`. Those live in the prisma org and can't be resolved from tiberius-rs, so PR Code Security failed at startup on every PR to main. Replace them with a portable secret scan (gitleaks, free for public repos, no license needed). Drop the CodeQL code-scanning job: CodeQL has no Rust support, so it never scanned this crate — Rust security/quality is already covered by cargo-deny and the clippy gate.
gitleaks-action refuses to run on repos under a GitHub organization
without a paid license key ("[tiberius-rs] is an organization. License
key is required."), so the Secret Detection job failed at startup.
The gitleaks binary itself is MIT-licensed and free. Install a pinned
release, verify its SHA-256, and run `gitleaks git` over the full
history fetched by checkout. No license, no token, no org gating.
gitleaks flagged 4 private keys under docker/certs/ — the self-signed TLS material that brings up the local SQL Server container the integration tests connect to over TLS. They are throwaway test fixtures committed upstream in 2022, not production secrets. Add a .gitleaks.toml that keeps the full default rule set and allowlists only that fixture path, so the rest of the tree and history stays scanned. Verified locally: 0 leaks with the config, 4 without.
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.
Problem
The
PR Code Securityworkflow calls prisma-org reusable workflows(
secret_detection,code_scanning) withsecrets: inherit. Thoselive in the
prisma/.githuborg repo and cannot be resolved fromtiberius-rs, so the workflow failed at startup on every PR tomain— a permanent red X unrelated to the PR's contents.Fix
Replace the two org reusables with a single portable secret scan:
free). The
gitleaks-actionwrapper requires a paid license forrepos under a GitHub organization, so it can't be used here. The
binary is pinned to
v8.30.1and verified by SHA-256 before use,then scans the full commit history fetched by checkout.
.gitleaks.tomlkeeps the entire default rule set and allowlistsonly
docker/certs/— the self-signed TLS fixtures that bring up thelocal integration-test SQL Server container (throwaway test material
committed upstream in 2022, not production secrets). Everything else
in the tree and history is still scanned.
that job never actually scanned this crate. Rust security/quality is
already covered by
cargo-deny(advisories/bans/sources) and thestrict clippy gate.
All actions are SHA-pinned;
permissionsis least-privilege(
contents: read); checkout runs withpersist-credentials: false.This is a standalone CI-hygiene fix off
main— not part of thesync stack (#445) — so it can land independently and clears the last
red X on every open PR.
Please rebase-merge.