mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 19:54:24 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e300b31be5 | ||
|
|
3073e45b0a | ||
|
|
d401bd337a | ||
|
|
1297b41b10 | ||
|
|
d44cb91306 | ||
|
|
efdc7749df | ||
|
|
e78a22e19c | ||
|
|
9cc19ec0f8 | ||
|
|
05c165deb2 | ||
|
|
f6a87ca58c | ||
|
|
73a3cf8afb | ||
|
|
d196b83ca6 | ||
|
|
35f2ea5da2 | ||
|
|
70028079b4 | ||
|
|
c14af5ffdf | ||
|
|
06b1396a2a | ||
|
|
5d3f247d7d | ||
|
|
404dd8e0c0 | ||
|
|
3a1ab48818 | ||
|
|
f5c2b636f3 | ||
|
|
b5ed7ff1b2 | ||
|
|
09007da395 | ||
|
|
d51ce47d86 | ||
|
|
6919447094 | ||
|
|
c3b7932544 | ||
|
|
82e409a434 | ||
|
|
0eb57cbe4d | ||
|
|
3531887941 | ||
|
|
e9ebde73bc | ||
|
|
469cd22f61 | ||
|
|
93e72c215d | ||
|
|
865478bcdc | ||
|
|
d6c0de7c85 | ||
|
|
0266ab8958 | ||
|
|
6b7ab73a52 | ||
|
|
61ee7c58cc |
No files matched your search
@@ -0,0 +1,13 @@
|
||||
name: gitleaks
|
||||
on: [pull_request, push, workflow_dispatch]
|
||||
jobs:
|
||||
scan:
|
||||
name: gitleaks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: gitleaks/gitleaks-action@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
# Contribution guidelines
|
||||
|
||||
## General
|
||||
|
||||
### Issues
|
||||
|
||||
If you have a feature or bug fix you would like to contribute please check if
|
||||
there are any open issues describing your proposed addition. If there are open
|
||||
issues, make a comment stating you are working on fixing or implementing said
|
||||
issue. If not, then please open an issue describing your addition. Make sure to
|
||||
link your PR to an issue.
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Fill out the template as best you can. Make sure your tests pass. If you see a
|
||||
PR that isn't one you opened and want it introduced in the next release,
|
||||
give it a :thumbsup: on the PR description.
|
||||
|
||||
## Adding new Gitleaks rules
|
||||
|
||||
If you want to add a new rule to the [default Gitleaks configuration](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) then follow these steps.
|
||||
|
||||
1. Create a `cmd/generate/config/rules/{provider}.go` file.
|
||||
This file is used to generate a new Gitleaks rule.
|
||||
Let's look at `beamer.go` for example. Comments have been added for context.
|
||||
|
||||
```golang
|
||||
func Beamer() *config.Rule {
|
||||
// Define Rule
|
||||
r := config.Rule{
|
||||
// Human redable description of the rule
|
||||
Description: "Beamer API token",
|
||||
|
||||
// Unique ID for the rule
|
||||
RuleID: "beamer-api-token",
|
||||
|
||||
// Regex capture group for the actual secret
|
||||
SecretGroup: 1,
|
||||
|
||||
|
||||
// Regex used for detecting secrets. See regex section below for more details
|
||||
Regex: generateSemiGenericRegex([]string{"beamer"}, `b_[a-z0-9=_\-]{44}`),
|
||||
|
||||
// Keywords used for string matching on fragments (think of this as a prefilter)
|
||||
Keywords: []string{"beamer"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("beamer", "b_"+secrets.NewSecret(alphaNumericExtended("44"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
```
|
||||
|
||||
Feel free to use this example as a template when writing new rules.
|
||||
This file should be fairly self-explanatory except for a few items;
|
||||
regex and secret generation. To help with maintence, _most_ rules should
|
||||
be uniform. The functions,
|
||||
[`generateSemiGenericRegex`](https://github.com/zricethezav/gitleaks/blob/master/cmd/generate/config/rules/rule.go#L31) and [`generateUniqueTokenRegex`](https://github.com/zricethezav/gitleaks/blob/master/cmd/generate/config/rules/rule.go#L44) will generate rules
|
||||
that follow defined patterns.
|
||||
|
||||
The function signatures look like this:
|
||||
|
||||
```golang
|
||||
func generateSemiGenericRegex(identifiers []string, secretRegex string) *regexp.Regexp
|
||||
|
||||
func generateUniqueTokenRegex(secretRegex string) *regexp.Regexp
|
||||
```
|
||||
|
||||
`generateSemiGenericRegex` accepts a list of identifiers and a regex.
|
||||
The list of identifiers _should_ match the list of `Keywords` in the rule
|
||||
definition above. Both `identifiers` in the `generateSemiGenericRegex`
|
||||
function _and_ `Keywords` act as filters for Gitleaks telling the program
|
||||
"_at least one of these strings must be present to be considered a leak_"
|
||||
|
||||
`generateUniqueToken` just accepts a regex. If you are writing a rule for a
|
||||
token that is unique enough not to require an identifier then you can use
|
||||
this function. For example, Pulumi's API Token has the prefix `pul-` which is
|
||||
unique enough to use `generateUniqueToken`. But something like Beamer's API
|
||||
token that has a `b_` prefix is not unqiue enough to use `generateUniqueToken`,
|
||||
so instead we use `generateSemiGenericRegex` and require a `beamer`
|
||||
identifier is part of the rule.
|
||||
If a token's prefix has more than `3` characters then you could
|
||||
probably get away with using `generateUniqueToken`.
|
||||
|
||||
Last thing you'll want to hit before we move on from this file is the
|
||||
validation part. You can use `generateSampleSecret` to create a secret for the
|
||||
true positives (`tps` in the example above) used in `validate`.
|
||||
|
||||
1. Update `cmd/generate/config/main.go`. Add a line like
|
||||
`configRules = append(configRules, rules.Beamer())` in `main()`. Try and keep
|
||||
this alphabetically pretty please.
|
||||
|
||||
1. Change directories into `cmd/generate/config` and run `go run main.go`
|
||||
|
||||
```
|
||||
cd cmd/generate/config && go run main.go
|
||||
```
|
||||
|
||||
1. Check out your new rules in `config/gitleaks.toml` and see if everything looks good.
|
||||
|
||||
1. Open a PR
|
||||
+2
-11
@@ -4,21 +4,12 @@ COPY . .
|
||||
RUN VERSION=$(git describe --tags --abbrev=0) && \
|
||||
CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
|
||||
|
||||
FROM alpine:3.15.4
|
||||
FROM alpine:3.16
|
||||
RUN adduser -D gitleaks && \
|
||||
apk add --no-cache bash git openssh-client
|
||||
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
|
||||
USER gitleaks
|
||||
|
||||
# default to avoid the follow error:
|
||||
# 11:09PM ERR fatal: unsafe repository ('/path' is owned by someone else)
|
||||
# 11:09PM ERR To add an exception for this directory, call:
|
||||
# 11:09PM ERR
|
||||
# 11:09PM ERR git config --global --add safe.directory /path
|
||||
# This means that when you run gitleaks from docker you must mount to /path
|
||||
# in order to avoid this error.
|
||||
|
||||
# TODO waiting to push this until I've thought a bit more about it
|
||||
# RUN git config --global --add safe.directory /path
|
||||
RUN git config --global --add safe.directory '*'
|
||||
|
||||
ENTRYPOINT ["gitleaks"]
|
||||
@@ -1,4 +1,5 @@
|
||||
# gitleaks
|
||||
|
||||
```
|
||||
┌─○───┐
|
||||
│ │╲ │
|
||||
@@ -7,7 +8,6 @@
|
||||
└─░───┘
|
||||
```
|
||||
|
||||
|
||||
<p align="left">
|
||||
<p align="left">
|
||||
<a href="https://github.com/zricethezav/gitleaks/actions/workflows/test.yml">
|
||||
@@ -16,6 +16,12 @@
|
||||
<a href="https://hub.docker.com/r/zricethezav/gitleaks">
|
||||
<img src="https://img.shields.io/docker/pulls/zricethezav/gitleaks.svg" />
|
||||
</a>
|
||||
<a href="https://www.jit.io/jit-open-source-gitleaks?utm_source=github&utm_medium=badge&utm_campaign=GitleaksReadme&utm_id=oss&items=item-secret-detection">
|
||||
<img src="https://img.shields.io/badge/Secured%20by-Jit-B8287F?style=?style=plastic" />
|
||||
</a>
|
||||
<a href="https://github.com/zricethezav/gitleaks-action">
|
||||
<img alt="gitleaks badge" src="https://img.shields.io/badge/protected%20by-gitleaks-blue">
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=zricethezav">
|
||||
<img src="https://img.shields.io/twitter/follow/zricethezav?label=Follow%20zricethezav&style=social&color=blue" alt="Follow @zricethezav" />
|
||||
</a>
|
||||
@@ -27,6 +33,7 @@ Gitleaks is a SAST tool for **detecting** and **preventing** hardcoded secrets l
|
||||
[](https://asciinema.org/a/455683)
|
||||
|
||||
## Getting Started
|
||||
|
||||
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases). In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo.
|
||||
|
||||
### MacOS
|
||||
@@ -36,32 +43,63 @@ brew install gitleaks
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
#### DockerHub
|
||||
|
||||
```bash
|
||||
docker pull zricethezav/gitleaks:latest
|
||||
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] --source="/path" [OPTIONS]
|
||||
```
|
||||
|
||||
#### ghcr.io
|
||||
|
||||
```bash
|
||||
docker pull ghcr.io/zricethezav/gitleaks:latest
|
||||
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] --source="/path" [OPTIONS]
|
||||
```
|
||||
|
||||
### From Source
|
||||
|
||||
1. Download and install Go from https://golang.org/dl/
|
||||
2. Clone the repo
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zricethezav/gitleaks.git
|
||||
```
|
||||
|
||||
3. Build the binary
|
||||
|
||||
```bash
|
||||
cd gitleaks
|
||||
make build
|
||||
```
|
||||
|
||||
### Github Action
|
||||
|
||||
Check out the official [Gitleaks GitHub Action](https://github.com/gitleaks/gitleaks-action)
|
||||
|
||||
```
|
||||
name: gitleaks
|
||||
on: [pull_request, push, workflow_dispatch]
|
||||
jobs:
|
||||
scan:
|
||||
name: gitleaks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: gitleaks/gitleaks-action@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} # Only required for Organizations, not personal accounts.
|
||||
```
|
||||
|
||||
### Pre-Commit
|
||||
|
||||
1. Install pre-commit from https://pre-commit.com/#install
|
||||
2. Create a `.pre-commit-config.yaml` file at the root of your repository with the following content:
|
||||
|
||||
```
|
||||
repos:
|
||||
- repo: https://github.com/zricethezav/gitleaks
|
||||
@@ -69,22 +107,27 @@ make build
|
||||
hooks:
|
||||
- id: gitleaks
|
||||
```
|
||||
|
||||
for a [native execution of GitLeaks](https://github.com/zricethezav/gitleaks/releases) or use the [`gitleaks-docker` pre-commit ID](https://github.com/zricethezav/gitleaks/blob/master/.pre-commit-hooks.yaml) for executing GitLeaks using the [official Docker images](#docker)
|
||||
|
||||
3. Install with `pre-commit install`
|
||||
4. Now you're all set!
|
||||
|
||||
```
|
||||
➜ git commit -m "this commit contains a secret"
|
||||
Detect hardcoded secrets.................................................Failed
|
||||
```
|
||||
|
||||
Note: to disable the gitleaks pre-commit hook you can prepend `SKIP=gitleaks` to the commit command
|
||||
and it will skip running gitleaks
|
||||
|
||||
```
|
||||
➜ SKIP=gitleaks git commit -m "skip gitleaks check"
|
||||
Detect hardcoded secrets................................................Skipped
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
Usage:
|
||||
gitleaks [command]
|
||||
@@ -116,20 +159,24 @@ Use "gitleaks [command] --help" for more information about a command.
|
||||
```
|
||||
|
||||
### Commands
|
||||
|
||||
There are two commands you will use to detect secrets; `detect` and `protect`.
|
||||
|
||||
#### Detect
|
||||
The `detect` command is used to scan repos, directories, and files. This command can be used on developer machines and in CI environments.
|
||||
|
||||
The `detect` command is used to scan repos, directories, and files. This command can be used on developer machines and in CI environments.
|
||||
|
||||
When running `detect` on a git repository, gitleaks will parse the output of a `git log -p` command (you can see how this executed
|
||||
[here](https://github.com/zricethezav/gitleaks/blob/7240e16769b92d2a1b137c17d6bf9d55a8562899/git/git.go#L17-L25)).
|
||||
[`git log -p` generates patches](https://git-scm.com/docs/git-log#_generating_patch_text_with_p) which gitleaks will use to detect secrets.
|
||||
You can configure what commits `git log` will range over by using the `--log-opts` flag. `--log-opts` accepts any option for `git log -p`.
|
||||
For example, if you wanted to run gitleaks on a range of commits you could use the following command: `gitleaks --source . --log-opts="--all commitA..commitB"`.
|
||||
For example, if you wanted to run gitleaks on a range of commits you could use the following command: `gitleaks detect --source . --log-opts="--all commitA..commitB"`.
|
||||
See the `git log` [documentation](https://git-scm.com/docs/git-log) for more information.
|
||||
|
||||
You can scan files and directories by using the `--no-git` option.
|
||||
|
||||
#### Protect
|
||||
|
||||
The `protect` command is used to uncommitted changes in a git repo. This command should be used on developer machines in accordance with
|
||||
[shifting left on security](https://cloud.google.com/architecture/devops/devops-tech-shifting-left-on-security).
|
||||
When running `protect` on a git repository, gitleaks will parse the output of a `git diff` command (you can see how this executed
|
||||
@@ -140,8 +187,10 @@ as a pre-commit.
|
||||
**NOTE**: the `protect` command can only be used on git repos, running `protect` on files or directories will result in an error message.
|
||||
|
||||
### Verify Findings
|
||||
|
||||
You can verify a finding found by gitleaks using a `git log` command.
|
||||
Example output:
|
||||
|
||||
```
|
||||
{
|
||||
"Description": "AWS",
|
||||
@@ -163,15 +212,19 @@ Example output:
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
We can use the following format to verify the leak:
|
||||
|
||||
```
|
||||
git log -L {StartLine,EndLine}:{File} {Commit}
|
||||
```
|
||||
|
||||
So in this example it would look like:
|
||||
|
||||
```
|
||||
git log -L 37,37:checks_test.go ec2fc9d6cb0954fb3b57201cf6133c48d8ca0d29
|
||||
```
|
||||
|
||||
Which gives us:
|
||||
|
||||
```
|
||||
@@ -190,11 +243,14 @@ diff --git a/checks_test.go b/checks_test.go
|
||||
```
|
||||
|
||||
## Pre-Commit hook
|
||||
|
||||
You can run Gitleaks as a pre-commit hook by copying the example `pre-commit.py` script into
|
||||
your `.git/hooks/` directory.
|
||||
|
||||
## Configuration
|
||||
|
||||
Gitleaks offers a configuration format you can follow to write your own secret detection rules:
|
||||
|
||||
```toml
|
||||
# Title for the gitleaks configuration file.
|
||||
title = "Gitleaks title"
|
||||
@@ -281,26 +337,25 @@ stopwords = [
|
||||
'''endpoint''',
|
||||
]
|
||||
```
|
||||
Refer to the default [gitleaks config](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) for examples and advice on writing regular expressions for secret detection.
|
||||
|
||||
Refer to the default [gitleaks config](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) for examples or follow the [contributing guidelines](https://github.com/zricethezav/gitleaks/blob/master/README.md).
|
||||
|
||||
## Secured by Jit
|
||||
|
||||
We use [Jit](https://www.jit.io/jit-open-source-gitleaks?utm_source=github&utm_medium=readme&utm_campaign=GitleaksReadme&utm_id=oss&items=item-secret-detection) to secure our codebase, to achieve fully automated, full-stack continuous security using the world's best OSS security tools.
|
||||
|
||||
## Sponsorships
|
||||
|
||||
<p align="left">
|
||||
<a href="https://www.tines.com/?utm_source=oss&utm_medium=sponsorship&utm_campaign=gitleaks">
|
||||
<img alt="Tines Sponsorship" src="https://user-images.githubusercontent.com/15034943/146411864-4878f936-b4f7-49a0-b625-f9f40c704bfa.png" width=200>
|
||||
</a>
|
||||
</p>
|
||||
<a href="https://www.typeform.com/">
|
||||
<img src="https://user-images.githubusercontent.com/15034943/146945294-a6473d55-86b8-4f53-941e-7f185ad6b3d7.png" width=200/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
## Exit Codes
|
||||
|
||||
You can always set the exit code when leaks are encountered with the --exit-code flag. Default exit codes below:
|
||||
|
||||
```
|
||||
0 - no leaks present
|
||||
1 - leaks or error encountered
|
||||
|
||||
@@ -16,9 +16,12 @@ const (
|
||||
|
||||
func main() {
|
||||
configRules := []*config.Rule{}
|
||||
configRules = append(configRules, rules.AdafruitAPIKey())
|
||||
configRules = append(configRules, rules.AdobeClientID())
|
||||
configRules = append(configRules, rules.AdobeClientSecret())
|
||||
configRules = append(configRules, rules.AgeSecretKey())
|
||||
configRules = append(configRules, rules.Airtable())
|
||||
configRules = append(configRules, rules.AlgoliaApiKey())
|
||||
configRules = append(configRules, rules.AlibabaAccessKey())
|
||||
configRules = append(configRules, rules.AlibabaSecretKey())
|
||||
configRules = append(configRules, rules.AsanaClientID())
|
||||
@@ -27,41 +30,59 @@ func main() {
|
||||
configRules = append(configRules, rules.AWS())
|
||||
configRules = append(configRules, rules.BitBucketClientID())
|
||||
configRules = append(configRules, rules.BitBucketClientSecret())
|
||||
configRules = append(configRules, rules.BittrexAccessKey())
|
||||
configRules = append(configRules, rules.BittrexSecretKey())
|
||||
configRules = append(configRules, rules.Beamer())
|
||||
configRules = append(configRules, rules.CodecovAccessToken())
|
||||
configRules = append(configRules, rules.CoinbaseAccessToken())
|
||||
configRules = append(configRules, rules.Clojars())
|
||||
configRules = append(configRules, rules.ConfluentAccessToken())
|
||||
configRules = append(configRules, rules.ConfluentSecretKey())
|
||||
configRules = append(configRules, rules.Contentful())
|
||||
configRules = append(configRules, rules.Databricks())
|
||||
configRules = append(configRules, rules.DatadogtokenAccessToken())
|
||||
configRules = append(configRules, rules.DiscordAPIToken())
|
||||
configRules = append(configRules, rules.DiscordClientID())
|
||||
configRules = append(configRules, rules.DiscordClientSecret())
|
||||
configRules = append(configRules, rules.Doppler())
|
||||
configRules = append(configRules, rules.DropBoxAPISecret())
|
||||
configRules = append(configRules, rules.DropBoxLongLivedAPIToken())
|
||||
configRules = append(configRules, rules.DropBoxShortLivedAPIToken())
|
||||
configRules = append(configRules, rules.Doppler())
|
||||
configRules = append(configRules, rules.DroneciAccessToken())
|
||||
configRules = append(configRules, rules.Duffel())
|
||||
configRules = append(configRules, rules.Dynatrace())
|
||||
configRules = append(configRules, rules.EasyPost())
|
||||
configRules = append(configRules, rules.EasyPostTestAPI())
|
||||
configRules = append(configRules, rules.EtsyAccessToken())
|
||||
configRules = append(configRules, rules.Facebook())
|
||||
configRules = append(configRules, rules.FastlyAPIToken())
|
||||
configRules = append(configRules, rules.FinicityClientSecret())
|
||||
configRules = append(configRules, rules.FinicityAPIToken())
|
||||
configRules = append(configRules, rules.FlickrAccessToken())
|
||||
configRules = append(configRules, rules.FinnhubAccessToken())
|
||||
configRules = append(configRules, rules.FlutterwavePublicKey())
|
||||
configRules = append(configRules, rules.FlutterwaveSecretKey())
|
||||
configRules = append(configRules, rules.FlutterwaveSecretKey())
|
||||
configRules = append(configRules, rules.FlutterwaveEncKey())
|
||||
configRules = append(configRules, rules.FrameIO())
|
||||
configRules = append(configRules, rules.FreshbooksAccessToken())
|
||||
configRules = append(configRules, rules.GoCardless())
|
||||
// TODO figure out what makes sense for GCP
|
||||
// configRules = append(configRules, rules.GCPServiceAccount())
|
||||
configRules = append(configRules, rules.GCPAPIKey())
|
||||
configRules = append(configRules, rules.GitHubPat())
|
||||
configRules = append(configRules, rules.GitHubOauth())
|
||||
configRules = append(configRules, rules.GitHubApp())
|
||||
configRules = append(configRules, rules.GitHubRefresh())
|
||||
configRules = append(configRules, rules.Gitlab())
|
||||
configRules = append(configRules, rules.GitterAccessToken())
|
||||
configRules = append(configRules, rules.Hashicorp())
|
||||
configRules = append(configRules, rules.Heroku())
|
||||
configRules = append(configRules, rules.HubSpot())
|
||||
configRules = append(configRules, rules.Intercom())
|
||||
configRules = append(configRules, rules.KrakenAccessToken())
|
||||
configRules = append(configRules, rules.KucoinAccessToken())
|
||||
configRules = append(configRules, rules.KucoinSecretKey())
|
||||
configRules = append(configRules, rules.LaunchDarklyAccessToken())
|
||||
configRules = append(configRules, rules.LinearAPIToken())
|
||||
configRules = append(configRules, rules.LinearClientSecret())
|
||||
configRules = append(configRules, rules.LinkedinClientID())
|
||||
@@ -73,21 +94,33 @@ func main() {
|
||||
configRules = append(configRules, rules.MailGunPrivateAPIToken())
|
||||
configRules = append(configRules, rules.MailGunSigningKey())
|
||||
configRules = append(configRules, rules.MapBox())
|
||||
configRules = append(configRules, rules.MattermostAccessToken())
|
||||
configRules = append(configRules, rules.MessageBirdAPIToken())
|
||||
configRules = append(configRules, rules.MessageBirdClientID())
|
||||
configRules = append(configRules, rules.NetlifyAccessToken())
|
||||
configRules = append(configRules, rules.NewRelicUserID())
|
||||
configRules = append(configRules, rules.NewRelicUserKey())
|
||||
configRules = append(configRules, rules.NewRelicBrowserAPIKey())
|
||||
configRules = append(configRules, rules.NPM())
|
||||
configRules = append(configRules, rules.NytimesAccessToken())
|
||||
configRules = append(configRules, rules.OktaAccessToken())
|
||||
configRules = append(configRules, rules.PlaidAccessID())
|
||||
configRules = append(configRules, rules.PlaidSecretKey())
|
||||
configRules = append(configRules, rules.PlaidAccessToken())
|
||||
configRules = append(configRules, rules.PlanetScalePassword())
|
||||
configRules = append(configRules, rules.PlanetScaleToken())
|
||||
configRules = append(configRules, rules.PlanetScaleAPIToken())
|
||||
configRules = append(configRules, rules.PlanetScaleOAuthToken())
|
||||
configRules = append(configRules, rules.PostManAPI())
|
||||
configRules = append(configRules, rules.PrivateKey())
|
||||
configRules = append(configRules, rules.PulumiAPIToken())
|
||||
configRules = append(configRules, rules.PyPiUploadToken())
|
||||
configRules = append(configRules, rules.RubyGemsAPIToken())
|
||||
configRules = append(configRules, rules.RapidAPIAccessToken())
|
||||
configRules = append(configRules, rules.SendbirdAccessID())
|
||||
configRules = append(configRules, rules.SendbirdAccessToken())
|
||||
configRules = append(configRules, rules.SendGridAPIToken())
|
||||
configRules = append(configRules, rules.SendInBlueAPIToken())
|
||||
configRules = append(configRules, rules.SentryAccessToken())
|
||||
configRules = append(configRules, rules.ShippoAPIToken())
|
||||
configRules = append(configRules, rules.ShopifyAccessToken())
|
||||
configRules = append(configRules, rules.ShopifyCustomAccessToken())
|
||||
@@ -96,12 +129,34 @@ func main() {
|
||||
configRules = append(configRules, rules.SlackAccessToken())
|
||||
configRules = append(configRules, rules.SlackWebHook())
|
||||
configRules = append(configRules, rules.StripeAccessToken())
|
||||
configRules = append(configRules, rules.SquareAccessToken())
|
||||
configRules = append(configRules, rules.SquareSpaceAccessToken())
|
||||
configRules = append(configRules, rules.SumoLogicAccessID())
|
||||
configRules = append(configRules, rules.SumoLogicAccessToken())
|
||||
configRules = append(configRules, rules.TravisCIAccessToken())
|
||||
configRules = append(configRules, rules.Twilio())
|
||||
configRules = append(configRules, rules.TwitchAPIToken())
|
||||
configRules = append(configRules, rules.Twitter())
|
||||
configRules = append(configRules, rules.TwitterAPIKey())
|
||||
configRules = append(configRules, rules.TwitterAPISecret())
|
||||
configRules = append(configRules, rules.TwitterAccessToken())
|
||||
configRules = append(configRules, rules.TwitterAccessSecret())
|
||||
configRules = append(configRules, rules.TwitterBearerToken())
|
||||
configRules = append(configRules, rules.Typeform())
|
||||
configRules = append(configRules, rules.YandexAPIKey())
|
||||
configRules = append(configRules, rules.YandexAWSAccessToken())
|
||||
configRules = append(configRules, rules.YandexAccessToken())
|
||||
configRules = append(configRules, rules.ZendeskSecretKey())
|
||||
configRules = append(configRules, rules.GenericCredential())
|
||||
|
||||
// ensure rules have unique ids
|
||||
ruleLookUp := make(map[string]bool)
|
||||
for _, rule := range configRules {
|
||||
// check if rule is in ruleLookUp
|
||||
if _, ok := ruleLookUp[rule.RuleID]; ok {
|
||||
log.Fatal().Msgf("rule id %s is not unique", rule.RuleID)
|
||||
}
|
||||
ruleLookUp[rule.RuleID] = true
|
||||
}
|
||||
config := config.Config{
|
||||
Rules: configRules,
|
||||
}
|
||||
@@ -110,7 +165,7 @@ func main() {
|
||||
log.Fatal().Err(err).Msg("Failed to parse template")
|
||||
}
|
||||
|
||||
f, err := os.Create("gitleaks.toml")
|
||||
f, err := os.Create("../../../config/gitleaks.toml")
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to create rules.toml")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func AdafruitAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Adafruit API Key",
|
||||
RuleID: "adafruit-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"adafruit"}, alphaNumericExtendedShort("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"adafruit"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("adafruit", secrets.NewSecret(alphaNumericExtendedShort("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func Airtable() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Airtable API Key",
|
||||
RuleID: "airtable-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"airtable"}, alphaNumeric("17")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"airtable"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("airtable", secrets.NewSecret(alphaNumeric("17"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func AlgoliaApiKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Algolia API Key",
|
||||
RuleID: "algolia-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"algolia"}, `[a-z0-9]{32}`),
|
||||
Keywords: []string{"algolia"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
"algolia_key := " + secrets.NewSecret(hex("32")),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -10,9 +10,10 @@ func Atlassian() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "Atlassian API token",
|
||||
RuleID: "atlassian-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"atlassian", "confluence"}, alphaNumeric("24")),
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"atlassian", "confluence", "jira"}, alphaNumeric("24")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"atlassian", "confluence"},
|
||||
Keywords: []string{"atlassian", "confluence", "jira"},
|
||||
}
|
||||
|
||||
// validate
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func BittrexAccessKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bittrex Access Key",
|
||||
RuleID: "bittrex-access-key",
|
||||
Regex: generateSemiGenericRegex([]string{"bittrex"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"bittrex"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("bittrex", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func BittrexSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bittrex Secret Key",
|
||||
RuleID: "bittrex-secret-key",
|
||||
Regex: generateSemiGenericRegex([]string{"bittrex"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"bittrex"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("bittrex", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func CodecovAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "codecov-access-token",
|
||||
Description: "Codecov Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"codecov"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"codecov",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("codecov", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func CoinbaseAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "coinbase-access-token",
|
||||
Description: "Coinbase Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"coinbase"},
|
||||
alphaNumericExtendedShort("64")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"coinbase",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("coinbase",
|
||||
secrets.NewSecret(alphaNumericExtendedShort("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -1,20 +1,23 @@
|
||||
# This file has been auto-generated. Do not edit manually.
|
||||
# If you would like to contribute new rules, please use
|
||||
# cmd/generate/config/main.go and follow the contributing guidelines
|
||||
# at https://github.com/zricethezav/gitleaks/blob/master/CONTRIBUTING.md
|
||||
|
||||
# This is the default gitleaks configuration file.
|
||||
# Rules and allowlists are defined within this file.
|
||||
# Rules instruct gitleaks on what should be considered a secret.
|
||||
# Allowlists instruct gitleaks on what is allowed, i.e. not a secret.
|
||||
|
||||
title = "gitleaks config"
|
||||
|
||||
[allowlist]
|
||||
description = "global allow lists"
|
||||
regexes = [
|
||||
'''219-09-9999''',
|
||||
'''078-05-1120''',
|
||||
'''(9[0-9]{2}|666)-\d{2}-\d{4}''',
|
||||
]
|
||||
paths = [
|
||||
'''gitleaks.toml''',
|
||||
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
|
||||
'''(go.mod|go.sum)$'''
|
||||
'''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket)$''',
|
||||
'''(go.mod|go.sum)$''',
|
||||
'''node_modules''',
|
||||
'''vendor''',
|
||||
]
|
||||
|
||||
{{ range $i, $rule := .Rules }}[[rules]]
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func ConfluentSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "confluent-secret-key",
|
||||
Description: "Confluent Secret Key",
|
||||
Regex: generateSemiGenericRegex([]string{"confluent"}, alphaNumeric("64")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"confluent",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("confluent", secrets.NewSecret(alphaNumeric("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func ConfluentAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "confluent-access-token",
|
||||
Description: "Confluent Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"confluent"}, alphaNumeric("16")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"confluent",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("confluent", secrets.NewSecret(alphaNumeric("16"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func DatadogtokenAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "datadog-access-token",
|
||||
Description: "Datadog Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"datadog"},
|
||||
alphaNumeric("40")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"datadog",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("datadog", secrets.NewSecret(alphaNumeric("40"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func DroneciAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "droneci-access-token",
|
||||
Description: "Droneci Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"droneci"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"droneci",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("droneci", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ func DropBoxAPISecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Dropbox API secret",
|
||||
RuleID: "doppler-api-token",
|
||||
RuleID: "dropbox-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"dropbox"}, alphaNumeric("15")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"dropbox"},
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func EtsyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "etsy-access-token",
|
||||
Description: "Etsy Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"etsy"}, alphaNumeric("24")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"etsy",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("etsy", secrets.NewSecret(alphaNumeric("24"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func FinnhubAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "finnhub-access-token",
|
||||
Description: "Finnhub Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"finnhub"}, alphaNumeric("20")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"finnhub",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("finnhub", secrets.NewSecret(alphaNumeric("20"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func FlickrAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "flickr-access-token",
|
||||
Description: "Flickr Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"flickr"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"flickr",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("flickr", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -26,8 +26,8 @@ func FlutterwavePublicKey() *config.Rule {
|
||||
func FlutterwaveSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Finicity Secret Key",
|
||||
RuleID: "flutterwave-public-key",
|
||||
Description: "Flutterwave Secret Key",
|
||||
RuleID: "flutterwave-secret-key",
|
||||
Regex: regexp.MustCompile(`FLWSECK_TEST-(?i)[a-h0-9]{32}-X`),
|
||||
Keywords: []string{"FLWSECK_TEST"},
|
||||
}
|
||||
@@ -42,8 +42,8 @@ func FlutterwaveSecretKey() *config.Rule {
|
||||
func FlutterwaveEncKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Finicity Secret Key",
|
||||
RuleID: "flutterwave-public-key",
|
||||
Description: "Flutterwave Encryption Key",
|
||||
RuleID: "flutterwave-encryption-key",
|
||||
Regex: regexp.MustCompile(`FLWSECK_TEST-(?i)[a-h0-9]{12}`),
|
||||
Keywords: []string{"FLWSECK_TEST"},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func FreshbooksAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "freshbooks-access-token",
|
||||
Description: "Freshbooks Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"freshbooks"}, alphaNumeric("64")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"freshbooks",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("freshbooks", secrets.NewSecret(alphaNumeric("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package rules
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
@@ -22,3 +23,22 @@ func GCPServiceAccount() *config.Rule {
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func GCPAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "gcp-api-key",
|
||||
Description: "GCP API key",
|
||||
Regex: generateUniqueTokenRegex(`AIza[0-9A-Za-z\\-_]{35}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"AIza",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("gcp", secrets.NewSecret(`AIza[0-9A-Za-z\\-_]{35}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -11,11 +11,11 @@ func GenericCredential() *config.Rule {
|
||||
Description: "Generic API Key",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"key",
|
||||
"api[^Version]",
|
||||
"api",
|
||||
"token",
|
||||
"pat",
|
||||
"secret",
|
||||
"client",
|
||||
"passwd",
|
||||
"password",
|
||||
"auth",
|
||||
}, `[0-9a-z\-_.=]{10,150}`),
|
||||
@@ -26,7 +26,7 @@ func GenericCredential() *config.Rule {
|
||||
"token",
|
||||
"secret",
|
||||
"client",
|
||||
"pat",
|
||||
"passwd",
|
||||
"password",
|
||||
"auth",
|
||||
},
|
||||
@@ -45,6 +45,9 @@ func GenericCredential() *config.Rule {
|
||||
}
|
||||
fps := []string{
|
||||
`client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.client-vpn-endpoint.id`,
|
||||
`password combination.
|
||||
|
||||
R5: Regulatory--21`,
|
||||
}
|
||||
return validate(r, tps, fps)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func GitterAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "gitter-access-token",
|
||||
Description: "Gitter Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"gitter"},
|
||||
alphaNumericExtendedShort("40")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"gitter",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("gitter",
|
||||
secrets.NewSecret(alphaNumericExtendedShort("40"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -9,8 +9,7 @@ func Heroku() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "Heroku API Key",
|
||||
RuleID: "heroku-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"heroku"},
|
||||
`[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}`),
|
||||
Regex: generateSemiGenericRegex([]string{"heroku"}, hex8_4_4_4_12()),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"heroku"},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func KrakenAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "kraken-access-token",
|
||||
Description: "Kraken Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"kraken"},
|
||||
alphaNumericExtendedLong("80,90")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"kraken",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("kraken",
|
||||
secrets.NewSecret(alphaNumericExtendedLong("80,90"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func KucoinAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "kucoin-access-token",
|
||||
Description: "Kucoin Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"kucoin"}, hex("24")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"kucoin",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("kucoin", secrets.NewSecret(hex("24"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func KucoinSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "kucoin-secret-key",
|
||||
Description: "Kucoin Secret Key",
|
||||
Regex: generateSemiGenericRegex([]string{"kucoin"}, hex8_4_4_4_12()),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"kucoin",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("kucoin", secrets.NewSecret(hex8_4_4_4_12())),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func LaunchDarklyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "launchdarkly-access-token",
|
||||
Description: "Launchdarkly Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"launchdarkly"}, alphaNumericExtended("40")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"launchdarkly",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("launchdarkly", secrets.NewSecret(alphaNumericExtended("40"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func MattermostAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mattermost-access-token",
|
||||
Description: "Mattermost Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"mattermost"}, alphaNumeric("26")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"mattermost",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("mattermost", secrets.NewSecret(alphaNumeric("26"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -41,7 +41,7 @@ func MessageBirdClientID() *config.Rule {
|
||||
"messagebird",
|
||||
"message-bird",
|
||||
"message_bird",
|
||||
}, `[a-h0-9]{8}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{12}`),
|
||||
}, hex8_4_4_4_12()),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"messagebird",
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func NetlifyAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "netlify-access-token",
|
||||
Description: "Netlify Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"netlify"},
|
||||
alphaNumericExtended("40,46")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"netlify",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("netlify", secrets.NewSecret(alphaNumericExtended("40,46"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func NytimesAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "nytimes-access-token",
|
||||
Description: "Nytimes Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"nytimes", "new-york-times,", "newyorktimes"},
|
||||
alphaNumericExtended("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"nytimes",
|
||||
"new-york-times",
|
||||
"newyorktimes",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("nytimes", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func OktaAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "okta-access-token",
|
||||
Description: "Okta Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"okta"},
|
||||
alphaNumericExtended("42")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"okta",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("okta", secrets.NewSecret(alphaNumeric("42"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func PlaidAccessID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-client-id",
|
||||
Description: "Plaid Client ID",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("24")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"plaid",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("plaid", secrets.NewSecret(alphaNumeric("24"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func PlaidSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-secret-key",
|
||||
Description: "Plaid Secret key",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("30")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"plaid",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("plaid", secrets.NewSecret(alphaNumeric("30"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func PlaidAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-api-token",
|
||||
Description: "Plaid API Token",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"},
|
||||
fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12())),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"plaid",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("plaid", secrets.NewSecret(fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12()))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -10,7 +10,7 @@ func PlanetScalePassword() *config.Rule {
|
||||
r := config.Rule{
|
||||
RuleID: "planetscale-password",
|
||||
Description: "PlanetScale password",
|
||||
Regex: generateUniqueTokenRegex(`pscale_pw_(?i)[a-z0-9=\-_\.]{43}`),
|
||||
Regex: generateUniqueTokenRegex(`pscale_pw_(?i)[a-z0-9=\-_\.]{32,64}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"pscale_pw_",
|
||||
@@ -19,17 +19,19 @@ func PlanetScalePassword() *config.Rule {
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("planetScalePassword", "pscale_pw_"+secrets.NewSecret(alphaNumericExtended("32"))),
|
||||
generateSampleSecret("planetScalePassword", "pscale_pw_"+secrets.NewSecret(alphaNumericExtended("43"))),
|
||||
generateSampleSecret("planetScalePassword", "pscale_pw_"+secrets.NewSecret(alphaNumericExtended("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func PlanetScaleToken() *config.Rule {
|
||||
func PlanetScaleAPIToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "planetscale-api-token",
|
||||
Description: "PlanetScale API token",
|
||||
Regex: generateUniqueTokenRegex(`pscale_tkn_(?i)[a-z0-9=\-_\.]{43}`),
|
||||
Regex: generateUniqueTokenRegex(`pscale_tkn_(?i)[a-z0-9=\-_\.]{32,64}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"pscale_tkn_",
|
||||
@@ -38,7 +40,30 @@ func PlanetScaleToken() *config.Rule {
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("planetScalePassword", "pscale_tkn_"+secrets.NewSecret(alphaNumericExtended("32"))),
|
||||
generateSampleSecret("planetScalePassword", "pscale_tkn_"+secrets.NewSecret(alphaNumericExtended("43"))),
|
||||
generateSampleSecret("planetScalePassword", "pscale_tkn_"+secrets.NewSecret(alphaNumericExtended("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func PlanetScaleOAuthToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "planetscale-oauth-token",
|
||||
Description: "PlanetScale OAuth token",
|
||||
Regex: generateUniqueTokenRegex(`pscale_oauth_(?i)[a-z0-9=\-_\.]{32,64}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"pscale_oauth_",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("planetScalePassword", "pscale_oauth_"+secrets.NewSecret(alphaNumericExtended("32"))),
|
||||
generateSampleSecret("planetScalePassword", "pscale_oauth_"+secrets.NewSecret(alphaNumericExtended("43"))),
|
||||
generateSampleSecret("planetScalePassword", "pscale_oauth_"+secrets.NewSecret(alphaNumericExtended("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func RapidAPIAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "rapidapi-access-token",
|
||||
Description: "RapidAPI Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"rapidapi"},
|
||||
alphaNumericExtendedShort("50")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"rapidapi",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("rapidapi",
|
||||
secrets.NewSecret(alphaNumericExtendedShort("50"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -16,7 +16,7 @@ const (
|
||||
|
||||
// identifier prefix (just an ignore group)
|
||||
identifierPrefix = `(?:`
|
||||
identifierSuffix = `)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}`
|
||||
identifierSuffix = `)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}`
|
||||
|
||||
// commonly used assignment operators or function call
|
||||
operator = `(?:=|>|:=|\|\|:|<=|=>|:)`
|
||||
@@ -91,6 +91,18 @@ func alphaNumeric(size string) string {
|
||||
return fmt.Sprintf(`[a-z0-9]{%s}`, size)
|
||||
}
|
||||
|
||||
func alphaNumericExtendedShort(size string) string {
|
||||
return fmt.Sprintf(`[a-z0-9_-]{%s}`, size)
|
||||
}
|
||||
|
||||
func alphaNumericExtended(size string) string {
|
||||
return fmt.Sprintf(`[a-z0-9=_\-]{%s}`, size)
|
||||
}
|
||||
|
||||
func alphaNumericExtendedLong(size string) string {
|
||||
return fmt.Sprintf(`[a-z0-9\/=_\+\-]{%s}`, size)
|
||||
}
|
||||
|
||||
func hex8_4_4_4_12() string {
|
||||
return `[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func SendbirdAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sendbird-access-token",
|
||||
Description: "Sendbird Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"sendbird"}, hex("40")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"sendbird",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("sendbird", secrets.NewSecret(hex("40"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func SendbirdAccessID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sendbird-access-id",
|
||||
Description: "Sendbird Access ID",
|
||||
Regex: generateSemiGenericRegex([]string{"sendbird"}, hex8_4_4_4_12()),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"sendbird",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("sendbird", secrets.NewSecret(hex8_4_4_4_12())),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func SentryAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sentry-access-token",
|
||||
Description: "Sentry Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"sentry"}, hex("64")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"sentry",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("sentry", secrets.NewSecret(hex("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func SquareAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "square-access-token",
|
||||
Description: "Square Access Token",
|
||||
Regex: generateUniqueTokenRegex(`sq0atp-[0-9A-Za-z\-_]{22}`),
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("square", secrets.NewSecret(`sq0atp-[0-9A-Za-z\-_]{22}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func SquareSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "square-secret",
|
||||
Description: "Square Secret",
|
||||
Regex: generateUniqueTokenRegex(`sq0csp-[0-9A-Za-z\\-_]{43}`),
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("square", secrets.NewSecret(`sq0csp-[0-9A-Za-z\\-_]{43}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func SquareSpaceAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "squarespace-access-token",
|
||||
Description: "Squarespace Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"squarespace"}, hex8_4_4_4_12()),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"squarespace",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("squarespace", secrets.NewSecret(hex8_4_4_4_12())),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -229,7 +229,7 @@ var DefaultStopWords = []string{
|
||||
"gaia",
|
||||
"display",
|
||||
"universal",
|
||||
"function",
|
||||
"func",
|
||||
"metadata",
|
||||
"hipchat",
|
||||
"under",
|
||||
@@ -1484,4 +1484,6 @@ var DefaultStopWords = []string{
|
||||
"boot",
|
||||
"book",
|
||||
"branch",
|
||||
"combination",
|
||||
"combo",
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func SumoLogicAccessID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sumologic-access-id",
|
||||
Description: "SumoLogic Access ID",
|
||||
Regex: generateSemiGenericRegex([]string{"sumo"},
|
||||
alphaNumeric("14")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"sumo",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("sumo", secrets.NewSecret(alphaNumeric("14"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func SumoLogicAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sumologic-access-token",
|
||||
Description: "SumoLogic Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"sumo"},
|
||||
alphaNumeric("64")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"sumo",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("sumo", secrets.NewSecret(alphaNumeric("64"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func TravisCIAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "travisci-access-token",
|
||||
Description: "Travis CI Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"travis"}, alphaNumeric("22")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"travis",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("travis", secrets.NewSecret(alphaNumeric("22"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func TrelloAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "trello-access-token",
|
||||
Description: "Trello Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"trello"}, `[a-zA-Z-0-9]{32}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"trello",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("trello", secrets.NewSecret(`[a-zA-Z-0-9]{32}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -5,20 +5,87 @@ import (
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func Twitter() *config.Rule {
|
||||
func TwitterAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "twitter",
|
||||
RuleID: "twitter",
|
||||
Regex: generateSemiGenericRegex([]string{"twitter"}, hex("35,44")),
|
||||
Description: "Twitter API Key",
|
||||
RuleID: "twitter-api-key",
|
||||
Regex: generateSemiGenericRegex([]string{"twitter"}, alphaNumeric("25")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"twitter"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
"twitterToken := \"" + secrets.NewSecret(hex("36")) + "aaaa\"",
|
||||
"twitterToken := `" + secrets.NewSecret(hex("36")) + "aaaa`",
|
||||
generateSampleSecret("twitter", secrets.NewSecret(alphaNumeric("25"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func TwitterAPISecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Twitter API Secret",
|
||||
RuleID: "twitter-api-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"twitter"}, alphaNumeric("50")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"twitter"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("twitter", secrets.NewSecret(alphaNumeric("50"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func TwitterBearerToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Twitter Bearer Token",
|
||||
RuleID: "twitter-bearer-token",
|
||||
Regex: generateSemiGenericRegex([]string{"twitter"}, "A{22}[a-zA-Z0-9%]{80,100}"),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"twitter"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("twitter", secrets.NewSecret("A{22}[a-zA-Z0-9%]{80,100}")),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func TwitterAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Twitter Access Token",
|
||||
RuleID: "twitter-access-token",
|
||||
Regex: generateSemiGenericRegex([]string{"twitter"}, "[0-9]{15,25}-[a-zA-Z0-9]{20,40}"),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"twitter"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("twitter", secrets.NewSecret("[0-9]{15,25}-[a-zA-Z0-9]{20,40}")),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func TwitterAccessSecret() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Twitter Access Secret",
|
||||
RuleID: "twitter-access-secret",
|
||||
Regex: generateSemiGenericRegex([]string{"twitter"}, alphaNumeric("45")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"twitter"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("twitter", secrets.NewSecret(alphaNumeric("45"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func YandexAWSAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "yandex-aws-access-token",
|
||||
Description: "Yandex AWS Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"yandex"},
|
||||
`YC[a-zA-Z0-9_\-]{38}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"yandex",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("yandex",
|
||||
secrets.NewSecret(`YC[a-zA-Z0-9_\-]{38}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func YandexAPIKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "yandex-api-key",
|
||||
Description: "Yandex API Key",
|
||||
Regex: generateSemiGenericRegex([]string{"yandex"},
|
||||
`AQVN[A-Za-z0-9_\-]{35,38}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"yandex",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("yandex",
|
||||
secrets.NewSecret(`AQVN[A-Za-z0-9_\-]{35,38}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func YandexAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "yandex-access-token",
|
||||
Description: "Yandex Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"yandex"},
|
||||
`t1\.[A-Z0-9a-z_-]+[=]{0,2}\.[A-Z0-9a-z_-]{86}[=]{0,2}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"yandex",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("yandex",
|
||||
secrets.NewSecret(`t1\.[A-Z0-9a-z_-]+[=]{0,2}\.[A-Z0-9a-z_-]{86}[=]{0,2}`)),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func ZendeskSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "zendesk-secret-key",
|
||||
Description: "Zendesk Secret Key",
|
||||
Regex: generateSemiGenericRegex([]string{"zendesk"}, alphaNumeric("40")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
"zendesk",
|
||||
},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("zendesk", secrets.NewSecret(alphaNumeric("40"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
+500
-83
@@ -1,26 +1,38 @@
|
||||
# This file has been auto-generated. Do not edit manually.
|
||||
# If you would like to contribute new rules, please use
|
||||
# cmd/generate/config/main.go and follow the contributing guidelines
|
||||
# at https://github.com/zricethezav/gitleaks/blob/master/CONTRIBUTING.md
|
||||
|
||||
# This is the default gitleaks configuration file.
|
||||
# Rules and allowlists are defined within this file.
|
||||
# Rules instruct gitleaks on what should be considered a secret.
|
||||
# Allowlists instruct gitleaks on what is allowed, i.e. not a secret.
|
||||
|
||||
title = "gitleaks config"
|
||||
|
||||
[allowlist]
|
||||
description = "global allow lists"
|
||||
regexes = [
|
||||
'''219-09-9999''',
|
||||
'''078-05-1120''',
|
||||
'''(9[0-9]{2}|666)-\d{2}-\d{4}''',
|
||||
]
|
||||
paths = [
|
||||
'''gitleaks.toml''',
|
||||
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
|
||||
'''(go.mod|go.sum)$'''
|
||||
'''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket)$''',
|
||||
'''(go.mod|go.sum)$''',
|
||||
'''node_modules''',
|
||||
'''vendor''',
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Adafruit API Key"
|
||||
id = "adafruit-api-key"
|
||||
regex = '''(?i)(?:adafruit)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"adafruit",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Adobe Client ID (Oauth Web)"
|
||||
id = "adobe-client-id"
|
||||
regex = '''(?i)(?:adobe)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:adobe)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"adobe",
|
||||
@@ -42,6 +54,23 @@ keywords = [
|
||||
"age-secret-key-1",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Airtable API Key"
|
||||
id = "airtable-api-key"
|
||||
regex = '''(?i)(?:airtable)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{17})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"airtable",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Algolia API Key"
|
||||
id = "algolia-api-key"
|
||||
regex = '''(?i)(?:algolia)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
keywords = [
|
||||
"algolia",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Alibaba AccessKey ID"
|
||||
id = "alibaba-access-key-id"
|
||||
@@ -53,7 +82,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Alibaba Secret Key"
|
||||
id = "alibaba-secret-key"
|
||||
regex = '''(?i)(?:alibaba)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:alibaba)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"alibaba",
|
||||
@@ -62,7 +91,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Asana Client ID"
|
||||
id = "asana-client-id"
|
||||
regex = '''(?i)(?:asana)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9]{16})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:asana)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9]{16})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"asana",
|
||||
@@ -71,7 +100,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Asana Client Secret"
|
||||
id = "asana-client-secret"
|
||||
regex = '''(?i)(?:asana)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:asana)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"asana",
|
||||
@@ -80,10 +109,10 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Atlassian API token"
|
||||
id = "atlassian-api-token"
|
||||
regex = '''(?i)(?:atlassian|confluence)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:atlassian|confluence|jira)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"atlassian","confluence",
|
||||
"atlassian","confluence","jira",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
@@ -97,7 +126,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "BitBucket Client ID"
|
||||
id = "bitbucket-client-id"
|
||||
regex = '''(?i)(?:bitbucket)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:bitbucket)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"bitbucket",
|
||||
@@ -106,21 +135,57 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "BitBucket Client Secret"
|
||||
id = "bitbucket-client-secret"
|
||||
regex = '''(?i)(?:bitbucket)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:bitbucket)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"bitbucket",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Bittrex Access Key"
|
||||
id = "bittrex-access-key"
|
||||
regex = '''(?i)(?:bittrex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"bittrex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Bittrex Secret Key"
|
||||
id = "bittrex-secret-key"
|
||||
regex = '''(?i)(?:bittrex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"bittrex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Beamer API token"
|
||||
id = "beamer-api-token"
|
||||
regex = '''(?i)(?:beamer)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(b_[a-z0-9=_\-]{44})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:beamer)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(b_[a-z0-9=_\-]{44})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"beamer",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Codecov Access Token"
|
||||
id = "codecov-access-token"
|
||||
regex = '''(?i)(?:codecov)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"codecov",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Coinbase Access Token"
|
||||
id = "coinbase-access-token"
|
||||
regex = '''(?i)(?:coinbase)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"coinbase",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Clojars API token"
|
||||
id = "clojars-api-token"
|
||||
@@ -129,10 +194,28 @@ keywords = [
|
||||
"clojars",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Confluent Access Token"
|
||||
id = "confluent-access-token"
|
||||
regex = '''(?i)(?:confluent)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{16})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"confluent",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Confluent Secret Key"
|
||||
id = "confluent-secret-key"
|
||||
regex = '''(?i)(?:confluent)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"confluent",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Contentful delivery API token"
|
||||
id = "contentful-delivery-api-token"
|
||||
regex = '''(?i)(?:contentful)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{43})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:contentful)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{43})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"contentful",
|
||||
@@ -146,10 +229,19 @@ keywords = [
|
||||
"dapi",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Datadog Access Token"
|
||||
id = "datadog-access-token"
|
||||
regex = '''(?i)(?:datadog)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"datadog",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Discord API key"
|
||||
id = "discord-api-token"
|
||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"discord",
|
||||
@@ -158,7 +250,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Discord client ID"
|
||||
id = "discord-client-id"
|
||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9]{18})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9]{18})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"discord",
|
||||
@@ -167,37 +259,12 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Discord client secret"
|
||||
id = "discord-client-secret"
|
||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"discord",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Dropbox API secret"
|
||||
id = "doppler-api-token"
|
||||
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{15})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"dropbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Dropbox long lived API token"
|
||||
id = "dropbox-long-lived-api-token"
|
||||
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
keywords = [
|
||||
"dropbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Dropbox short lived API token"
|
||||
id = "dropbox-short-lived-api-token"
|
||||
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(sl\.[a-z0-9\-=_]{135})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
keywords = [
|
||||
"dropbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Doppler API token"
|
||||
id = "doppler-api-token"
|
||||
@@ -206,6 +273,40 @@ keywords = [
|
||||
"doppler",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Dropbox API secret"
|
||||
id = "dropbox-api-token"
|
||||
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{15})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"dropbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Dropbox long lived API token"
|
||||
id = "dropbox-long-lived-api-token"
|
||||
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
keywords = [
|
||||
"dropbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Dropbox short lived API token"
|
||||
id = "dropbox-short-lived-api-token"
|
||||
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(sl\.[a-z0-9\-=_]{135})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
keywords = [
|
||||
"dropbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Droneci Access Token"
|
||||
id = "droneci-access-token"
|
||||
regex = '''(?i)(?:droneci)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"droneci",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Duffel API token"
|
||||
id = "duffel-api-token"
|
||||
@@ -238,10 +339,19 @@ keywords = [
|
||||
"eztk",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Etsy Access Token"
|
||||
id = "etsy-access-token"
|
||||
regex = '''(?i)(?:etsy)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"etsy",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "facebook"
|
||||
id = "facebook"
|
||||
regex = '''(?i)(?:facebook)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:facebook)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"facebook",
|
||||
@@ -250,7 +360,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Fastly API key"
|
||||
id = "fastly-api-token"
|
||||
regex = '''(?i)(?:fastly)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:fastly)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"fastly",
|
||||
@@ -259,7 +369,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Finicity Client Secret"
|
||||
id = "finicity-client-secret"
|
||||
regex = '''(?i)(?:finicity)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{20})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:finicity)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{20})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"finicity",
|
||||
@@ -268,12 +378,30 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Finicity API token"
|
||||
id = "finicity-api-token"
|
||||
regex = '''(?i)(?:finicity)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:finicity)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"finicity",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Flickr Access Token"
|
||||
id = "flickr-access-token"
|
||||
regex = '''(?i)(?:flickr)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"flickr",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Finnhub Access Token"
|
||||
id = "finnhub-access-token"
|
||||
regex = '''(?i)(?:finnhub)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{20})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"finnhub",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Finicity Public Key"
|
||||
id = "flutterwave-public-key"
|
||||
@@ -283,17 +411,17 @@ keywords = [
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Finicity Secret Key"
|
||||
id = "flutterwave-public-key"
|
||||
description = "Flutterwave Secret Key"
|
||||
id = "flutterwave-secret-key"
|
||||
regex = '''FLWSECK_TEST-(?i)[a-h0-9]{32}-X'''
|
||||
keywords = [
|
||||
"flwseck_test",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Finicity Secret Key"
|
||||
id = "flutterwave-public-key"
|
||||
regex = '''FLWSECK_TEST-(?i)[a-h0-9]{32}-X'''
|
||||
description = "Flutterwave Encryption Key"
|
||||
id = "flutterwave-encryption-key"
|
||||
regex = '''FLWSECK_TEST-(?i)[a-h0-9]{12}'''
|
||||
keywords = [
|
||||
"flwseck_test",
|
||||
]
|
||||
@@ -306,15 +434,33 @@ keywords = [
|
||||
"fio-u-",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Freshbooks Access Token"
|
||||
id = "freshbooks-access-token"
|
||||
regex = '''(?i)(?:freshbooks)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"freshbooks",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "GoCardless API token"
|
||||
id = "gocardless-api-token"
|
||||
regex = '''(?i)(?:gocardless)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(live_(?i)[a-z0-9\-_=]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:gocardless)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(live_(?i)[a-z0-9\-_=]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"live_","gocardless",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "GCP API key"
|
||||
id = "gcp-api-key"
|
||||
regex = '''(?i)\b(AIza[0-9A-Za-z\\-_]{35})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"aiza",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "GitHub Personal Access Token"
|
||||
id = "github-pat"
|
||||
@@ -355,6 +501,15 @@ keywords = [
|
||||
"glpat-",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Gitter Access Token"
|
||||
id = "gitter-access-token"
|
||||
regex = '''(?i)(?:gitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"gitter",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "HashiCorp Terraform user/org API token"
|
||||
id = "hashicorp-tf-api-token"
|
||||
@@ -366,7 +521,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Heroku API Key"
|
||||
id = "heroku-api-key"
|
||||
regex = '''(?i)(?:heroku)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:heroku)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"heroku",
|
||||
@@ -375,7 +530,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "HubSpot API Token"
|
||||
id = "hubspot-api-key"
|
||||
regex = '''(?i)(?:hubspot)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:hubspot)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"hubspot",
|
||||
@@ -384,12 +539,48 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Intercom API Token"
|
||||
id = "intercom-api-key"
|
||||
regex = '''(?i)(?:intercom)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{60})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:intercom)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{60})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"intercom",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Kraken Access Token"
|
||||
id = "kraken-access-token"
|
||||
regex = '''(?i)(?:kraken)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9\/=_\+\-]{80,90})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"kraken",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Kucoin Access Token"
|
||||
id = "kucoin-access-token"
|
||||
regex = '''(?i)(?:kucoin)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{24})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"kucoin",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Kucoin Secret Key"
|
||||
id = "kucoin-secret-key"
|
||||
regex = '''(?i)(?:kucoin)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"kucoin",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Launchdarkly Access Token"
|
||||
id = "launchdarkly-access-token"
|
||||
regex = '''(?i)(?:launchdarkly)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"launchdarkly",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Linear API Token"
|
||||
id = "linear-api-key"
|
||||
@@ -401,7 +592,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Linear Client Secret"
|
||||
id = "linear-client-secret"
|
||||
regex = '''(?i)(?:linear)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:linear)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"linear",
|
||||
@@ -410,7 +601,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "LinkedIn Client ID"
|
||||
id = "linkedin-client-id"
|
||||
regex = '''(?i)(?:linkedin|linked-in)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{14})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:linkedin|linked-in)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{14})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"linkedin","linked-in",
|
||||
@@ -419,7 +610,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "LinkedIn Client secret"
|
||||
id = "linkedin-client-secret"
|
||||
regex = '''(?i)(?:linkedin|linked-in)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{16})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:linkedin|linked-in)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{16})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"linkedin","linked-in",
|
||||
@@ -428,7 +619,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Lob API Key"
|
||||
id = "lob-api-key"
|
||||
regex = '''(?i)(?:lob)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}((live|test)_[a-f0-9]{35})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:lob)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}((live|test)_[a-f0-9]{35})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"test_","live_",
|
||||
@@ -437,7 +628,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Lob Publishable API Key"
|
||||
id = "lob-pub-api-key"
|
||||
regex = '''(?i)(?:lob)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}((test|live)_pub_[a-f0-9]{31})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:lob)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}((test|live)_pub_[a-f0-9]{31})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"test_pub","live_pub","_pub",
|
||||
@@ -446,7 +637,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Mailchimp API key"
|
||||
id = "mailchimp-api-key"
|
||||
regex = '''(?i)(?:mailchimp)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32}-us20)(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:mailchimp)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32}-us20)(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"mailchimp",
|
||||
@@ -455,7 +646,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Mailgun public validation key"
|
||||
id = "mailgun-pub-key"
|
||||
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(pubkey-[a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(pubkey-[a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"mailgun",
|
||||
@@ -464,7 +655,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Mailgun private API token"
|
||||
id = "mailgun-private-api-token"
|
||||
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(key-[a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(key-[a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"mailgun",
|
||||
@@ -473,7 +664,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Mailgun webhook signing key"
|
||||
id = "mailgun-signing-key"
|
||||
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"mailgun",
|
||||
@@ -482,16 +673,25 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "MapBox API token"
|
||||
id = "mapbox-api-token"
|
||||
regex = '''(?i)(?:mapbox)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(pk\.[a-z0-9]{60}\.[a-z0-9]{22})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:mapbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(pk\.[a-z0-9]{60}\.[a-z0-9]{22})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"mapbox",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Mattermost Access Token"
|
||||
id = "mattermost-access-token"
|
||||
regex = '''(?i)(?:mattermost)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{26})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"mattermost",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "MessageBird API token"
|
||||
id = "messagebird-api-token"
|
||||
regex = '''(?i)(?:messagebird|message-bird|message_bird)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:messagebird|message-bird|message_bird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"messagebird","message-bird","message_bird",
|
||||
@@ -500,16 +700,25 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "MessageBird client ID"
|
||||
id = "messagebird-client-id"
|
||||
regex = '''(?i)(?:messagebird|message-bird|message_bird)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-h0-9]{8}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:messagebird|message-bird|message_bird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"messagebird","message-bird","message_bird",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Netlify Access Token"
|
||||
id = "netlify-access-token"
|
||||
regex = '''(?i)(?:netlify)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{40,46})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"netlify",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "New Relic user API Key"
|
||||
id = "new-relic-user-api-key"
|
||||
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(NRAK-[a-z0-9]{27})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(NRAK-[a-z0-9]{27})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"nrak",
|
||||
@@ -518,7 +727,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "New Relic user API ID"
|
||||
id = "new-relic-user-api-id"
|
||||
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"new-relic","newrelic","new_relic",
|
||||
@@ -527,7 +736,7 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "New Relic ingest browser API token"
|
||||
id = "new-relic-browser-api-token"
|
||||
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(NRJS-[a-f0-9]{19})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(NRJS-[a-f0-9]{19})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"nrjs-",
|
||||
@@ -542,10 +751,55 @@ keywords = [
|
||||
"npm_",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Nytimes Access Token"
|
||||
id = "nytimes-access-token"
|
||||
regex = '''(?i)(?:nytimes|new-york-times,|newyorktimes)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"nytimes","new-york-times","newyorktimes",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Okta Access Token"
|
||||
id = "okta-access-token"
|
||||
regex = '''(?i)(?:okta)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{42})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"okta",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Plaid Client ID"
|
||||
id = "plaid-client-id"
|
||||
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"plaid",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Plaid Secret key"
|
||||
id = "plaid-secret-key"
|
||||
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"plaid",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Plaid API Token"
|
||||
id = "plaid-api-token"
|
||||
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"plaid",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "PlanetScale password"
|
||||
id = "planetscale-password"
|
||||
regex = '''(?i)\b(pscale_pw_(?i)[a-z0-9=\-_\.]{43})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)\b(pscale_pw_(?i)[a-z0-9=\-_\.]{32,64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"pscale_pw_",
|
||||
@@ -554,12 +808,21 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "PlanetScale API token"
|
||||
id = "planetscale-api-token"
|
||||
regex = '''(?i)\b(pscale_tkn_(?i)[a-z0-9=\-_\.]{43})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)\b(pscale_tkn_(?i)[a-z0-9=\-_\.]{32,64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"pscale_tkn_",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "PlanetScale OAuth token"
|
||||
id = "planetscale-oauth-token"
|
||||
regex = '''(?i)\b(pscale_oauth_(?i)[a-z0-9=\-_\.]{32,64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"pscale_oauth_",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Postman API token"
|
||||
id = "postman-api-token"
|
||||
@@ -603,6 +866,33 @@ keywords = [
|
||||
"rubygems_",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "RapidAPI Access Token"
|
||||
id = "rapidapi-access-token"
|
||||
regex = '''(?i)(?:rapidapi)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{50})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"rapidapi",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Sendbird Access ID"
|
||||
id = "sendbird-access-id"
|
||||
regex = '''(?i)(?:sendbird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"sendbird",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Sendbird Access Token"
|
||||
id = "sendbird-access-token"
|
||||
regex = '''(?i)(?:sendbird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"sendbird",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "SendGrid API token"
|
||||
id = "sendgrid-api-token"
|
||||
@@ -621,6 +911,15 @@ keywords = [
|
||||
"xkeysib-",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Sentry Access Token"
|
||||
id = "sentry-access-token"
|
||||
regex = '''(?i)(?:sentry)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"sentry",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Shippo API token"
|
||||
id = "shippo-api-token"
|
||||
@@ -686,6 +985,50 @@ keywords = [
|
||||
"sk_test","pk_test","sk_live","pk_live",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Square Access Token"
|
||||
id = "square-access-token"
|
||||
regex = '''(?i)\b(sq0atp-[0-9A-Za-z\-_]{22})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
keywords = [
|
||||
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Squarespace Access Token"
|
||||
id = "squarespace-access-token"
|
||||
regex = '''(?i)(?:squarespace)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"squarespace",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "SumoLogic Access ID"
|
||||
id = "sumologic-access-id"
|
||||
regex = '''(?i)(?:sumo)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{14})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"sumo",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "SumoLogic Access Token"
|
||||
id = "sumologic-access-token"
|
||||
regex = '''(?i)(?:sumo)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"sumo",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Travis CI Access Token"
|
||||
id = "travisci-access-token"
|
||||
regex = '''(?i)(?:travis)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{22})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"travis",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Twilio API Key"
|
||||
id = "twilio-api-key"
|
||||
@@ -697,16 +1040,52 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Twitch API token"
|
||||
id = "twitch-api-token"
|
||||
regex = '''(?i)(?:twitch)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:twitch)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"twitch",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "twitter"
|
||||
id = "twitter"
|
||||
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{35,44})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
description = "Twitter API Key"
|
||||
id = "twitter-api-key"
|
||||
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"twitter",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Twitter API Secret"
|
||||
id = "twitter-api-secret"
|
||||
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{50})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"twitter",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Twitter Access Token"
|
||||
id = "twitter-access-token"
|
||||
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9]{15,25}-[a-zA-Z0-9]{20,40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"twitter",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Twitter Access Secret"
|
||||
id = "twitter-access-secret"
|
||||
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{45})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"twitter",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Twitter Bearer Token"
|
||||
id = "twitter-bearer-token"
|
||||
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(A{22}[a-zA-Z0-9%]{80,100})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"twitter",
|
||||
@@ -715,20 +1094,56 @@ keywords = [
|
||||
[[rules]]
|
||||
description = "Typeform API token"
|
||||
id = "typeform-api-token"
|
||||
regex = '''(?i)(?:typeform)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(tfp_[a-z0-9\-_\.=]{59})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:typeform)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(tfp_[a-z0-9\-_\.=]{59})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"tfp_",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Yandex API Key"
|
||||
id = "yandex-api-key"
|
||||
regex = '''(?i)(?:yandex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(AQVN[A-Za-z0-9_\-]{35,38})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"yandex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Yandex AWS Access Token"
|
||||
id = "yandex-aws-access-token"
|
||||
regex = '''(?i)(?:yandex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(YC[a-zA-Z0-9_\-]{38})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"yandex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Yandex Access Token"
|
||||
id = "yandex-access-token"
|
||||
regex = '''(?i)(?:yandex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(t1\.[A-Z0-9a-z_-]+[=]{0,2}\.[A-Z0-9a-z_-]{86}[=]{0,2})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"yandex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Zendesk Secret Key"
|
||||
id = "zendesk-secret-key"
|
||||
regex = '''(?i)(?:zendesk)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"zendesk",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Generic API Key"
|
||||
id = "generic-api-key"
|
||||
regex = '''(?i)(?:key|api[^Version]|token|pat|secret|client|password|auth)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
regex = '''(?i)(?:key|api|token|secret|client|passwd|password|auth)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
entropy = 3.5
|
||||
keywords = [
|
||||
"key","api","token","secret","client","pat","password","auth",
|
||||
"key","api","token","secret","client","passwd","password","auth",
|
||||
]
|
||||
[rules.allowlist]
|
||||
stopwords= [
|
||||
@@ -952,7 +1367,7 @@ stopwords= [
|
||||
"gaia",
|
||||
"display",
|
||||
"universal",
|
||||
"function",
|
||||
"func",
|
||||
"metadata",
|
||||
"hipchat",
|
||||
"under",
|
||||
@@ -2204,4 +2619,6 @@ stopwords= [
|
||||
"boot",
|
||||
"book",
|
||||
"branch",
|
||||
"combination",
|
||||
"combo",
|
||||
]
|
||||
+1
-1
@@ -335,7 +335,7 @@ func (d *Detector) DetectFiles(source string) ([]report.Finding, error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if fInfo.Name() == ".git" {
|
||||
if fInfo.Name() == ".git" && fInfo.IsDir() {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
if fInfo.Mode().IsRegular() {
|
||||
|
||||
@@ -65,7 +65,6 @@ func filter(findings []report.Finding, redact bool) []report.Finding {
|
||||
if strings.Contains(strings.ToLower(f.RuleID), "generic") {
|
||||
for _, fPrime := range findings {
|
||||
if f.StartLine == fPrime.StartLine &&
|
||||
f.EndLine == fPrime.EndLine &&
|
||||
f.Commit == fPrime.Commit &&
|
||||
f.RuleID != fPrime.RuleID &&
|
||||
strings.Contains(fPrime.Secret, f.Secret) &&
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
import os,sys
|
||||
"""Helper script to be used as a pre-commit hook."""
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
|
||||
def gitleaksEnabled():
|
||||
"""Determine if the pre-commit hook for gitleaks is enabled."""
|
||||
out = subprocess.getoutput("git config --bool hooks.gitleaks")
|
||||
if out == "false":
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
if gitleaksEnabled():
|
||||
exitCode = os.WEXITSTATUS(os.system('gitleaks protect -v --staged'))
|
||||
if exitCode == 1:
|
||||
@@ -18,5 +23,5 @@ To disable the gitleaks precommit hook run the following command:
|
||||
''')
|
||||
sys.exit(1)
|
||||
else:
|
||||
print('gitleaks precommit disabled (enable with `git config hooks.gitleaks true`)')
|
||||
|
||||
print('gitleaks precommit disabled\
|
||||
(enable with `git config hooks.gitleaks true`)')
|
||||
Reference in new issue
Block a user