# Prüfwerk's gitleaks configuration: gitleaks' own rules plus the ones below. # Always passed with --config, so a `.gitleaks.toml` in a scanned repository # cannot switch rules off. title = "Prüfwerk" [extend] useDefault = true # Android release signing: a keystore or key password written into a Gradle # build file signs every build with a secret everyone with the code has. [[rules]] id = "android-keystore-password" description = "Android signing password in a Gradle build file" regex = '''(?i)\b(?:storePassword|keyPassword)\b\s*(?:=|\()?\s*["']([^"'$\s]{4,})["']''' path = '''(?i)\.gradle(?:\.kts)?$''' secretGroup = 1 keywords = ["storepassword", "keypassword"] # The same, kept in gradle.properties (RELEASE_STORE_PASSWORD=…). [[rules]] id = "android-signing-password-property" description = "Android signing password in gradle.properties" regex = '''(?im)^\s*[\w.]*(?:store|key|keystore|signing)[\w.]*password\s*[=:]\s*([^\s$]{4,})\s*$''' path = '''(?i)(?:^|/)gradle\.properties$''' secretGroup = 1 keywords = ["password"] # The API key in a Firebase configuration (google-services.json, # GoogleService-Info.plist). It identifies the app rather than authorising # anything on its own, but it must be restricted to the app in the Google # Cloud console; reported at low severity. [[rules]] id = "firebase-config-api-key" description = "Firebase API key in the app's Firebase configuration" regex = '''(AIza[\w-]{35})''' path = '''(?i)(?:^|/)(?:google-services\.json|GoogleService-Info\.plist)$''' secretGroup = 1 keywords = ["aiza"] # Firebase Storage download URLs (`…/o/?alt=media&token=`): the # token makes one stored file publicly readable, it is meant to be shipped in # the app with the file's URL, and it grants nothing else. gitleaks' generic # rule reads it as an API key in every app that shows images this way. A line # holding such a URL is not reported; a real key elsewhere on it is rare # enough to accept. (`[allowlist]` rather than `[[allowlists]]`, which the # gitleaks release in the image does not read yet.) [allowlist] description = "Firebase Storage download URLs" regexTarget = "line" regexes = [ '''firebasestorage\.googleapis\.com/v0/b/[^/\s"']+/o/[^?\s"']+\?alt=media&(?:amp;)?token=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''', ]