Item 5 (leftover from #437): secrets in mobile apps, plus a gap in how gitleaks was called.
Gap: the repository could switch gitleaks rules off
gitleaks ran without --config and therefore read a .gitleaks.toml from the scanned repository. An [allowlist] paths = [".*"] there switched off every rule. It now always runs with compliance-agent/rules/gitleaks.toml ([extend] useDefault = true, plus our rules), written per run into its own temp directory, so concurrent scans don't collide.
New rules (verified against gitleaks 8.21.2 from the image, and 8.30)
Rule
Finds
Severity
android-keystore-password
storePassword / keyPassword as a literal in build.gradle(.kts), but not System.getenv(…) or findProperty(…)
High
android-signing-password-property
*STORE/KEY/SIGNING*PASSWORD=… in gradle.properties
High
firebase-config-api-key
the AIza… key in google-services.jsonandGoogleService-Info.plist (gitleaks' default rules missed the plist)
Low, with an explanation: the key identifies the app and isn't a secret on its own, but it must be restricted to the app and its APIs in the Google Cloud console
gitleaks' own gcp-api-key on the same key in those two files is dropped, so it's reported once and not as High.
Committed keystore files (.jks/.keystore) are already covered by secret-files (#447).
Not changed (verified)
A .gitleaksignore in the repository is still honoured. gitleaks reads it from the scanned directory regardless of --gitleaks-ignore-path (checked on 8.21 and 8.30). That's the same as an inline gitleaks:allow or nosemgrep: a deliberate suppression by the customer. Whether to show those suppressions is a product decision for later.
Side effect
A Firebase key previously reported as gcp-api-key (High) now appears as firebase-config-api-key (Low). With #443, the old finding closes as "nicht mehr gefunden".
Tests
the_firebase_key_is_reported_once.
our_rules_extend_gitleaks_own: the config is valid TOML, useDefault, and the 3 rule IDs.
With real gitleaks (skipped if it isn't installed): planted build.gradle, gradle.properties and google-services.json, plus a repository .gitleaks.toml that allow-lists everything. Result: exactly the keystore password (High), the properties password (High) and the Firebase key (Low). The getenv password is not reported.
fmt and clippy with the CI flags; gitleaks tests 14/14.
Item 5 (leftover from #437): **secrets in mobile apps**, plus a gap in how gitleaks was called.
## Gap: the repository could switch gitleaks rules off
gitleaks ran **without `--config`** and therefore read a `.gitleaks.toml` from the scanned repository. An `[allowlist] paths = [".*"]` there switched off every rule. It now always runs with `compliance-agent/rules/gitleaks.toml` (`[extend] useDefault = true`, plus our rules), written per run into its own temp directory, so concurrent scans don't collide.
## New rules (verified against gitleaks 8.21.2 from the image, and 8.30)
| Rule | Finds | Severity |
|---|---|---|
| `android-keystore-password` | `storePassword` / `keyPassword` as a literal in `build.gradle(.kts)`, but not `System.getenv(…)` or `findProperty(…)` | High |
| `android-signing-password-property` | `*STORE/KEY/SIGNING*PASSWORD=…` in `gradle.properties` | High |
| `firebase-config-api-key` | the `AIza…` key in `google-services.json` **and** `GoogleService-Info.plist` (gitleaks' default rules missed the plist) | **Low**, with an explanation: the key identifies the app and isn't a secret on its own, but it must be restricted to the app and its APIs in the Google Cloud console |
- gitleaks' own `gcp-api-key` on the same key in those two files is dropped, so it's reported once and not as High.
- Committed keystore files (`.jks`/`.keystore`) are already covered by `secret-files` (#447).
## Not changed (verified)
A **`.gitleaksignore`** in the repository is still honoured. gitleaks reads it from the scanned directory regardless of `--gitleaks-ignore-path` (checked on 8.21 and 8.30). That's the same as an inline `gitleaks:allow` or `nosemgrep`: a deliberate suppression by the customer. Whether to show those suppressions is a product decision for later.
## Side effect
A Firebase key previously reported as `gcp-api-key` (High) now appears as `firebase-config-api-key` (Low). With #443, the old finding closes as "nicht mehr gefunden".
## Tests
- `the_firebase_key_is_reported_once`.
- `our_rules_extend_gitleaks_own`: the config is valid TOML, `useDefault`, and the 3 rule IDs.
- **With real gitleaks** (skipped if it isn't installed): planted `build.gradle`, `gradle.properties` and `google-services.json`, plus a repository `.gitleaks.toml` that allow-lists everything. Result: exactly the keystore password (High), the properties password (High) and the Firebase key (Low). The `getenv` password is not reported.
- fmt and clippy with the CI flags; gitleaks tests 14/14.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
gitleaks ran without --config, so it read a `.gitleaks.toml` from the
scanned repository, which could allow-list everything. It now always runs
with rules/gitleaks.toml: gitleaks' own rules plus
- android-keystore-password: storePassword/keyPassword literals in
build.gradle(.kts) (not System.getenv / findProperty);
- android-signing-password-property: *STORE/KEY/SIGNING*PASSWORD in
gradle.properties;
- firebase-config-api-key: the API key in google-services.json and
GoogleService-Info.plist (the default rules missed the plist), at low
severity with what to do: it identifies the app and must be restricted
in the Google Cloud console. gitleaks' own gcp-api-key for the same key
in those files is dropped, so it is reported once.
The config is written per run into its own temp directory.
A `.gitleaksignore` in the repository is still honoured: gitleaks reads it
from the scanned directory whatever it is told (8.21 and 8.30 checked).
Refs #437.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit 6c9756bebf into main2026-10-05 18:31:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Item 5 (leftover from #437): secrets in mobile apps, plus a gap in how gitleaks was called.
Gap: the repository could switch gitleaks rules off
gitleaks ran without
--configand therefore read a.gitleaks.tomlfrom the scanned repository. An[allowlist] paths = [".*"]there switched off every rule. It now always runs withcompliance-agent/rules/gitleaks.toml([extend] useDefault = true, plus our rules), written per run into its own temp directory, so concurrent scans don't collide.New rules (verified against gitleaks 8.21.2 from the image, and 8.30)
android-keystore-passwordstorePassword/keyPasswordas a literal inbuild.gradle(.kts), but notSystem.getenv(…)orfindProperty(…)android-signing-password-property*STORE/KEY/SIGNING*PASSWORD=…ingradle.propertiesfirebase-config-api-keyAIza…key ingoogle-services.jsonandGoogleService-Info.plist(gitleaks' default rules missed the plist)gcp-api-keyon the same key in those two files is dropped, so it's reported once and not as High..jks/.keystore) are already covered bysecret-files(#447).Not changed (verified)
A
.gitleaksignorein the repository is still honoured. gitleaks reads it from the scanned directory regardless of--gitleaks-ignore-path(checked on 8.21 and 8.30). That's the same as an inlinegitleaks:allowornosemgrep: a deliberate suppression by the customer. Whether to show those suppressions is a product decision for later.Side effect
A Firebase key previously reported as
gcp-api-key(High) now appears asfirebase-config-api-key(Low). With #443, the old finding closes as "nicht mehr gefunden".Tests
the_firebase_key_is_reported_once.our_rules_extend_gitleaks_own: the config is valid TOML,useDefault, and the 3 rule IDs.build.gradle,gradle.propertiesandgoogle-services.json, plus a repository.gitleaks.tomlthat allow-lists everything. Result: exactly the keystore password (High), the properties password (High) and the Firebase key (Low). Thegetenvpassword is not reported.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p