Use the secrets mode to find sensitive data like API keys. It includes built-in support for AWS, GCP, GitHub, and Firebase.
Custom Secret Matchers:
You can provide a JSON file containing custom patterns using the -p/--patterns flag. Each pattern object in the JSON array can include:
name: The name used in the output.severity: One of info, low, medium, or high.value: A Go-syntax regular expression to match against string values.key: A Go-syntax regular expression to match against key names.object: An array of patterns to match against keys and values within an entire object.
Example Pattern File (patterns.json):
[
{
"name": "base64",
"value": "(eyJ|YTo|Tzo|PD[89]|rO0)[%a-zA-Z0-9+/]+={0,2}",
"severity": "low"
}
]
Example Usage:
jsluice secrets -p patterns.json simple-b64.js | jq