Skip to content

ci: make PR Code Security portable (drop prisma-org reusables) - #448

Open
MattJackson wants to merge 3 commits into
mainfrom
ci/portable-pr-code-security
Open

ci: make PR Code Security portable (drop prisma-org reusables)#448
MattJackson wants to merge 3 commits into
mainfrom
ci/portable-pr-code-security

Conversation

@MattJackson

@MattJackson MattJackson commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The PR Code Security workflow calls prisma-org reusable workflows
(secret_detection, code_scanning) with secrets: inherit. Those
live in the prisma/.github org repo and cannot be resolved from
tiberius-rs, so the workflow failed at startup on every PR to
main — a permanent red X unrelated to the PR's contents.

Fix

Replace the two org reusables with a single portable secret scan:

  • Secret Detection runs the gitleaks CLI directly (MIT-licensed,
    free). The gitleaks-action wrapper requires a paid license for
    repos under a GitHub organization, so it can't be used here. The
    binary is pinned to v8.30.1 and verified by SHA-256 before use,
    then scans the full commit history fetched by checkout.
  • .gitleaks.toml keeps the entire default rule set and allowlists
    only docker/certs/ — the self-signed TLS fixtures that bring up the
    local 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.
  • CodeQL code-scanning is dropped: CodeQL has no Rust support, so
    that job never actually scanned this crate. Rust security/quality is
    already covered by cargo-deny (advisories/bans/sources) and the
    strict clippy gate.

All actions are SHA-pinned; permissions is least-privilege
(contents: read); checkout runs with persist-credentials: false.

This is a standalone CI-hygiene fix off mainnot part of the
sync stack (#445) — so it can land independently and clears the last
red X on every open PR.

Please rebase-merge.

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.
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