From edc8dc45c6e660b6f0f48c5ee35e433c57512c06 Mon Sep 17 00:00:00 2001 From: Jussi Elo Date: Tue, 10 Nov 2026 05:41:33 +0000 Subject: [PATCH] ci(security): allow the model-name and runtime-key test fixtures gitleaks reports as API keys The generic-api-key rule fires on identifiers that contain the word key. The unit tests of serve_summary.rs and runtime_install_finalize.rs assign model names and a made-up runtime key to runtime_key and api_model, and gitleaks reports them on every pull request whose branch point contains those lines. Allowlist the two field names, anchored on the assignment, in the same way as the existing entries for dummy variable names. Signed-off-by: Jussi Elo --- .github/scan_tools_configs/gitleaks.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/scan_tools_configs/gitleaks.toml b/.github/scan_tools_configs/gitleaks.toml index f50c51eb9d..28c3ac1645 100644 --- a/.github/scan_tools_configs/gitleaks.toml +++ b/.github/scan_tools_configs/gitleaks.toml @@ -71,6 +71,18 @@ regexes = [ '''(?i)\bexample_secret\s*=''' ] +[[allowlists]] +description = "Model names and runtime keys: identifiers, not credentials" +# `generic-api-key` fires on any identifier containing "key" that is followed by +# a high-entropy-looking string. These field names hold a model name +# ("Qwen3-0.6B-GGUF") or the key that names an installed runtime +# ("wheel-gfx942-7.13.0"); the Rust unit tests assign literal values to them. +# Anchored on the identifier and the assignment, like the entry above. +regexTarget = "match" +regexes = [ + '''(?i)\b(runtime_key|api_model)\s*[:=]\s*"''', +] + [[allowlists]] description = "Public artifact digests (variable names ending in SHA256/512/MD5)" # SHA-256/512/MD5 hashes of public artifacts are not secrets.