mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
Compare commits
59
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7804d652c0 | ||
|
|
7911ac60d7 | ||
|
|
463d24618f | ||
|
|
86197b0848 | ||
|
|
3f894cbafc | ||
|
|
7f53b033fe | ||
|
|
7dc9ba40a7 | ||
|
|
c101fa88d2 | ||
|
|
257c703add | ||
|
|
b1d59bf890 | ||
|
|
fab4f4e97d | ||
|
|
289062acd8 | ||
|
|
91ff8f9b70 | ||
|
|
0dbdde837f | ||
|
|
bc599446dc | ||
|
|
a685551299 | ||
|
|
ab5fc21e82 | ||
|
|
d6fccc87d3 | ||
|
|
6f75511665 | ||
|
|
190ac977be | ||
|
|
6dbb0c5af5 | ||
|
|
6705461b33 | ||
|
|
9869eab4c2 | ||
|
|
16f1ec0f1e | ||
|
|
8d80a5a5a2 | ||
|
|
146f69e51b | ||
|
|
51ca0f89b9 | ||
|
|
81cf30855c | ||
|
|
bd8b145bea | ||
|
|
839f114f2b | ||
|
|
63c3076ea2 | ||
|
|
b5a726e96a | ||
|
|
56079dc9ea | ||
|
|
9c6650d14a | ||
|
|
6fa63f41d8 | ||
|
|
fe9fb37c36 | ||
|
|
c3b7a98911 | ||
|
|
6c4a88c5a4 | ||
|
|
27481a9071 | ||
|
|
9701bf1724 | ||
|
|
a5b9c24779 | ||
|
|
db79d8194f | ||
|
|
8a31f4a4be | ||
|
|
6b0c303b26 | ||
|
|
1fb3a77eb8 | ||
|
|
765bcd5854 | ||
|
|
11c2ad01a4 | ||
|
|
e55d3975ec | ||
|
|
2dd9946052 | ||
|
|
4b5e8e1829 | ||
|
|
343e69399b | ||
|
|
0060ab636a | ||
|
|
025908808f | ||
|
|
088f8b8074 | ||
|
|
afdccad46f | ||
|
|
e002920355 | ||
|
|
d805fb9144 | ||
|
|
391d4d75f6 | ||
|
|
f77493274a |
No files matched your search
@@ -27,3 +27,11 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|
||||||
cc @zricethezav
|
cc @zricethezav
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
Check out the Secret Scanning Discord Server for live discussions:
|
||||||
|
|
||||||
|
https://discord.gg/sydS6AHTUP
|
||||||
|
|
||||||
|
--->
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name: gitleaks
|
name: gitleaks
|
||||||
on: [pull_request, push, workflow_dispatch]
|
on: [push, workflow_dispatch]
|
||||||
jobs:
|
jobs:
|
||||||
scan:
|
scan:
|
||||||
name: gitleaks
|
name: gitleaks
|
||||||
@@ -11,3 +11,4 @@ jobs:
|
|||||||
- uses: gitleaks/gitleaks-action@v2
|
- uses: gitleaks/gitleaks-action@v2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
name: Test
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "*"
|
- "*"
|
||||||
@@ -9,7 +12,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ build
|
|||||||
.gitleaks.toml
|
.gitleaks.toml
|
||||||
cmd/generate/config/gitleaks.toml
|
cmd/generate/config/gitleaks.toml
|
||||||
|
|
||||||
|
# test results
|
||||||
|
testdata/expected/report/*.got.*
|
||||||
|
|
||||||
# Test binary
|
# Test binary
|
||||||
*.out
|
*.out
|
||||||
|
|
||||||
|
|||||||
@@ -716,6 +716,9 @@ testdata/expected/git/small-branch-foo.txt:aws-access-token:15
|
|||||||
testdata/expected/git/small.txt:aws-access-token:15
|
testdata/expected/git/small.txt:aws-access-token:15
|
||||||
testdata/expected/git/small.txt:aws-access-token:44
|
testdata/expected/git/small.txt:aws-access-token:44
|
||||||
testdata/repos/nogit/main.go:aws-access-token:20
|
testdata/repos/nogit/main.go:aws-access-token:20
|
||||||
|
testdata/repos/nogit/api.go:aws-access-token:20
|
||||||
|
testdata/repos/small/api/ignoreCommit.go:aws-access-token:20
|
||||||
|
testdata/repos/small/api/ignoreGlobal.go:aws-access-token:20
|
||||||
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:513
|
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:513
|
||||||
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:492
|
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:492
|
||||||
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:414
|
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:414
|
||||||
@@ -749,4 +752,17 @@ acce01f2338434a78f6a4a06a097b0fd23280484:README.md:aws-access-token:220
|
|||||||
111c8b47b65627db117bd20be85ff0aee8961eb9:detect/detect_test.go:private-key:567
|
111c8b47b65627db117bd20be85ff0aee8961eb9:detect/detect_test.go:private-key:567
|
||||||
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:512
|
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:512
|
||||||
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:513
|
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:513
|
||||||
|
69f161c0a0cc0f7858f7d0609d656f4edcedd84c:detect/detect_test.go:discord-api-token:326
|
||||||
|
9701bf1724d822c0d5bbb7627535dd639a37bf56:testdata/repos/staged/api/api.go:aws-access-token:7
|
||||||
|
9701bf1724d822c0d5bbb7627535dd639a37bf56:detect/detect_test.go:aws-access-token:505
|
||||||
|
9701bf1724d822c0d5bbb7627535dd639a37bf56:detect/detect_test.go:aws-access-token:506
|
||||||
|
9701bf1724d822c0d5bbb7627535dd639a37bf56:detect/detect_test.go:aws-access-token:507
|
||||||
|
9701bf1724d822c0d5bbb7627535dd639a37bf56:testdata/repos/staged/api/api.go:aws-access-token:6
|
||||||
|
9701bf1724d822c0d5bbb7627535dd639a37bf56:testdata/repos/staged/api/api.go:aws-access-token:7
|
||||||
|
91ff8f9b7020a16dac9b8b9ef98560ea1cb464f8:testdata/repos/small/api/ignoreCommit.go:aws-access-token:20
|
||||||
|
91ff8f9b7020a16dac9b8b9ef98560ea1cb464f8:testdata/repos/small/api/ignoreGlobal.go:aws-access-token:20
|
||||||
|
91ff8f9b7020a16dac9b8b9ef98560ea1cb464f8:testdata/repos/nogit/api.go:aws-access-token:20
|
||||||
|
adf617b3b4628e1160fa3d135b4c3dfd45c05e15:testdata/repos/nogit/api.go:aws-access-token:20
|
||||||
|
adf617b3b4628e1160fa3d135b4c3dfd45c05e15:testdata/repos/small/api/ignoreGlobal.go:aws-access-token:20
|
||||||
|
adf617b3b4628e1160fa3d135b4c3dfd45c05e15:testdata/repos/small/api/ignoreCommit.go:aws-access-token:20
|
||||||
|
|
||||||
+2
-2
@@ -28,7 +28,7 @@ If you want to add a new rule to the [default Gitleaks configuration](https://gi
|
|||||||
func Beamer() *config.Rule {
|
func Beamer() *config.Rule {
|
||||||
// Define Rule
|
// Define Rule
|
||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
// Human redable description of the rule
|
// Human readable description of the rule
|
||||||
Description: "Beamer API token",
|
Description: "Beamer API token",
|
||||||
|
|
||||||
// Unique ID for the rule
|
// Unique ID for the rule
|
||||||
@@ -78,7 +78,7 @@ If you want to add a new rule to the [default Gitleaks configuration](https://gi
|
|||||||
token that is unique enough not to require an identifier then you can use
|
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
|
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
|
unique enough to use `generateUniqueToken`. But something like Beamer's API
|
||||||
token that has a `b_` prefix is not unqiue enough to use `generateUniqueToken`,
|
token that has a `b_` prefix is not unique enough to use `generateUniqueToken`,
|
||||||
so instead we use `generateSemiGenericRegex` and require a `beamer`
|
so instead we use `generateSemiGenericRegex` and require a `beamer`
|
||||||
identifier is part of the rule.
|
identifier is part of the rule.
|
||||||
If a token's prefix has more than `3` characters then you could
|
If a token's prefix has more than `3` characters then you could
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
<a href="https://hub.docker.com/r/zricethezav/gitleaks">
|
<a href="https://hub.docker.com/r/zricethezav/gitleaks">
|
||||||
<img src="https://img.shields.io/docker/pulls/zricethezav/gitleaks.svg" />
|
<img src="https://img.shields.io/docker/pulls/zricethezav/gitleaks.svg" />
|
||||||
</a>
|
</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">
|
<a href="https://github.com/zricethezav/gitleaks-action">
|
||||||
<img alt="gitleaks badge" src="https://img.shields.io/badge/protected%20by-gitleaks-blue">
|
<img alt="gitleaks badge" src="https://img.shields.io/badge/protected%20by-gitleaks-blue">
|
||||||
</a>
|
</a>
|
||||||
@@ -28,6 +25,8 @@
|
|||||||
</p>
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
### Join our Discord! [](https://discord.gg/sydS6AHTUP)
|
||||||
|
|
||||||
Gitleaks is a SAST tool for **detecting** and **preventing** hardcoded secrets like passwords, api keys, and tokens in git repos. Gitleaks is an **easy-to-use, all-in-one solution** for detecting secrets, past or present, in your code.
|
Gitleaks is a SAST tool for **detecting** and **preventing** hardcoded secrets like passwords, api keys, and tokens in git repos. Gitleaks is an **easy-to-use, all-in-one solution** for detecting secrets, past or present, in your code.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -68,16 +67,16 @@ docker pull zricethezav/gitleaks:latest
|
|||||||
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] --source="/path" [OPTIONS]
|
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] --source="/path" [OPTIONS]
|
||||||
|
|
||||||
# Docker (ghcr.io)
|
# Docker (ghcr.io)
|
||||||
docker pull ghcr.io/zricethezav/gitleaks:latest
|
docker pull ghcr.io/gitleaks/gitleaks:latest
|
||||||
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] --source="/path" [OPTIONS]
|
docker run -v ${path_to_host_folder_to_scan}:/path ghcr.io/gitleaks/gitleaks:latest [COMMAND] --source="/path" [OPTIONS]
|
||||||
|
|
||||||
# From Source
|
# From Source
|
||||||
git clone https://github.com/zricethezav/gitleaks.git
|
git clone https://github.com/gitleaks/gitleaks.git
|
||||||
cd gitleaks
|
cd gitleaks
|
||||||
make build
|
make build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Github Action
|
### GitHub Action
|
||||||
|
|
||||||
Check out the official [Gitleaks GitHub Action](https://github.com/gitleaks/gitleaks-action)
|
Check out the official [Gitleaks GitHub Action](https://github.com/gitleaks/gitleaks-action)
|
||||||
|
|
||||||
@@ -105,8 +104,8 @@ jobs:
|
|||||||
|
|
||||||
```
|
```
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/zricethezav/gitleaks
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
rev: v8.12.0
|
rev: v8.16.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: gitleaks
|
- id: gitleaks
|
||||||
```
|
```
|
||||||
@@ -155,11 +154,12 @@ Flags:
|
|||||||
-h, --help help for gitleaks
|
-h, --help help for gitleaks
|
||||||
-l, --log-level string log level (trace, debug, info, warn, error, fatal) (default "info")
|
-l, --log-level string log level (trace, debug, info, warn, error, fatal) (default "info")
|
||||||
--max-target-megabytes int files larger than this will be skipped
|
--max-target-megabytes int files larger than this will be skipped
|
||||||
|
--no-color turn off color for verbose output
|
||||||
--no-banner suppress banner
|
--no-banner suppress banner
|
||||||
--redact redact secrets from logs and stdout
|
--redact redact secrets from logs and stdout
|
||||||
-f, --report-format string output format (json, csv, sarif) (default "json")
|
-f, --report-format string output format (json, csv, junit, sarif) (default "json")
|
||||||
-r, --report-path string report file
|
-r, --report-path string report file
|
||||||
-s, --source string path to source (default: $PWD) (default ".")
|
-s, --source string path to source (default ".")
|
||||||
-v, --verbose show verbose output from scan
|
-v, --verbose show verbose output from scan
|
||||||
|
|
||||||
Use "gitleaks [command] --help" for more information about a command.
|
Use "gitleaks [command] --help" for more information about a command.
|
||||||
@@ -184,7 +184,7 @@ You can scan files and directories by using the `--no-git` option.
|
|||||||
|
|
||||||
#### Protect
|
#### Protect
|
||||||
|
|
||||||
The `protect` command is used to uncommitted changes in a git repo. This command should be used on developer machines in accordance with
|
The `protect` command is used to scan 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).
|
[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
|
When running `protect` on a git repository, gitleaks will parse the output of a `git diff` command (you can see how this executed
|
||||||
[here](https://github.com/zricethezav/gitleaks/blob/7240e16769b92d2a1b137c17d6bf9d55a8562899/git/git.go#L48-L49)). You can set the
|
[here](https://github.com/zricethezav/gitleaks/blob/7240e16769b92d2a1b137c17d6bf9d55a8562899/git/git.go#L48-L49)). You can set the
|
||||||
@@ -272,7 +272,7 @@ Gitleaks offers a configuration format you can follow to write your own secret d
|
|||||||
title = "Gitleaks title"
|
title = "Gitleaks title"
|
||||||
|
|
||||||
# Extend the base (this) configuration. When you extend a configuration
|
# Extend the base (this) configuration. When you extend a configuration
|
||||||
# the base rules take precendence over the extended rules. I.e, if there are
|
# the base rules take precedence over the extended rules. I.e., if there are
|
||||||
# duplicate rules in both the base configuration and the extended configuration
|
# duplicate rules in both the base configuration and the extended configuration
|
||||||
# the base rules will override the extended rules.
|
# the base rules will override the extended rules.
|
||||||
# Another thing to know with extending configurations is you can chain together
|
# Another thing to know with extending configurations is you can chain together
|
||||||
@@ -335,6 +335,10 @@ paths = [
|
|||||||
'''go\.mod''',
|
'''go\.mod''',
|
||||||
'''go\.sum'''
|
'''go\.sum'''
|
||||||
]
|
]
|
||||||
|
# note: (rule) regexTarget defaults to check the _Secret_ in the finding.
|
||||||
|
# if regexTarget is not specified then _Secret_ will be used.
|
||||||
|
# Acceptable values for regexTarget are "match" and "line"
|
||||||
|
regexTarget = "match"
|
||||||
regexes = [
|
regexes = [
|
||||||
'''process''',
|
'''process''',
|
||||||
'''getenv''',
|
'''getenv''',
|
||||||
@@ -357,6 +361,12 @@ paths = [
|
|||||||
'''gitleaks\.toml''',
|
'''gitleaks\.toml''',
|
||||||
'''(.*?)(jpg|gif|doc)'''
|
'''(.*?)(jpg|gif|doc)'''
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# note: (global) regexTarget defaults to check the _Secret_ in the finding.
|
||||||
|
# if regexTarget is not specified then _Secret_ will be used.
|
||||||
|
# Acceptable values for regexTarget are "match" and "line"
|
||||||
|
regexTarget = "match"
|
||||||
|
|
||||||
regexes = [
|
regexes = [
|
||||||
'''219-09-9999''',
|
'''219-09-9999''',
|
||||||
'''078-05-1120''',
|
'''078-05-1120''',
|
||||||
@@ -370,7 +380,7 @@ stopwords = [
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
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).
|
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) if you would like to contribute to the default configuration. Additionally, you can check out [this gitleaks blog post](https://blog.gitleaks.io/stop-leaking-secrets-configuration-2-3-aeed293b1fbf) which covers advanced configuration setups.
|
||||||
|
|
||||||
### Additional Configuration
|
### Additional Configuration
|
||||||
|
|
||||||
@@ -387,11 +397,7 @@ class CustomClass:
|
|||||||
|
|
||||||
#### .gitleaksignore
|
#### .gitleaksignore
|
||||||
|
|
||||||
You can ignore specific findings by creating a `.gitleaksignore` file at the root of your repo. In release v8.10.0 Gitleaks added a `Fingerprint` value to the Gitleaks report. Each leak, or finding, has a Fingerprint that uniquely identifies a secret. Add this fingerprint to the `.gitleaksignore` file to ignore that specific secret. See Gitleaks' [.gitleaksignore](https://github.com/zricethezav/gitleaks/blob/master/.gitleaksignore) for an example. Note: this feature is expirmental and is subject to change in the future.
|
You can ignore specific findings by creating a `.gitleaksignore` file at the root of your repo. In release v8.10.0 Gitleaks added a `Fingerprint` value to the Gitleaks report. Each leak, or finding, has a Fingerprint that uniquely identifies a secret. Add this fingerprint to the `.gitleaksignore` file to ignore that specific secret. See Gitleaks' [.gitleaksignore](https://github.com/zricethezav/gitleaks/blob/master/.gitleaksignore) for an example. Note: this feature is experimental and is subject to change in the future.
|
||||||
|
|
||||||
## 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
|
## Sponsorships
|
||||||
|
|
||||||
|
|||||||
+23
-2
@@ -20,7 +20,7 @@ func init() {
|
|||||||
detectCmd.Flags().Bool("no-git", false, "treat git repo as a regular directory and scan those files, --log-opts has no effect on the scan when --no-git is set")
|
detectCmd.Flags().Bool("no-git", false, "treat git repo as a regular directory and scan those files, --log-opts has no effect on the scan when --no-git is set")
|
||||||
detectCmd.Flags().Bool("pipe", false, "scan input from stdin, ex: `cat some_file | gitleaks detect --pipe`")
|
detectCmd.Flags().Bool("pipe", false, "scan input from stdin, ex: `cat some_file | gitleaks detect --pipe`")
|
||||||
detectCmd.Flags().Bool("follow-symlinks", false, "scan files that are symlinks to other files")
|
detectCmd.Flags().Bool("follow-symlinks", false, "scan files that are symlinks to other files")
|
||||||
|
detectCmd.Flags().StringP("gitleaks-ignore-path", "i", ".", "path to .gitleaksignore file or folder containing one")
|
||||||
}
|
}
|
||||||
|
|
||||||
var detectCmd = &cobra.Command{
|
var detectCmd = &cobra.Command{
|
||||||
@@ -76,6 +76,27 @@ func runDetect(cmd *cobra.Command, args []string) {
|
|||||||
if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil {
|
if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil {
|
||||||
log.Fatal().Err(err).Msg("")
|
log.Fatal().Err(err).Msg("")
|
||||||
}
|
}
|
||||||
|
// set color flag
|
||||||
|
if detector.NoColor, err = cmd.Flags().GetBool("no-color"); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("")
|
||||||
|
}
|
||||||
|
|
||||||
|
gitleaksIgnorePath, err := cmd.Flags().GetString("gitleaks-ignore-path")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not get .gitleaksignore path")
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileExists(gitleaksIgnorePath) {
|
||||||
|
if err = detector.AddGitleaksIgnore(gitleaksIgnorePath); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileExists(filepath.Join(gitleaksIgnorePath, ".gitleaksignore")) {
|
||||||
|
if err = detector.AddGitleaksIgnore(filepath.Join(gitleaksIgnorePath, ".gitleaksignore")); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if fileExists(filepath.Join(source, ".gitleaksignore")) {
|
if fileExists(filepath.Join(source, ".gitleaksignore")) {
|
||||||
if err = detector.AddGitleaksIgnore(filepath.Join(source, ".gitleaksignore")); err != nil {
|
if err = detector.AddGitleaksIgnore(filepath.Join(source, ".gitleaksignore")); err != nil {
|
||||||
@@ -86,7 +107,7 @@ func runDetect(cmd *cobra.Command, args []string) {
|
|||||||
// ignore findings from the baseline (an existing report in json format generated earlier)
|
// ignore findings from the baseline (an existing report in json format generated earlier)
|
||||||
baselinePath, _ := cmd.Flags().GetString("baseline-path")
|
baselinePath, _ := cmd.Flags().GetString("baseline-path")
|
||||||
if baselinePath != "" {
|
if baselinePath != "" {
|
||||||
err = detector.AddBaseline(baselinePath)
|
err = detector.AddBaseline(baselinePath, source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Msgf("Could not load baseline. The path must point of a gitleaks report generated using the default format: %s", err)
|
log.Error().Msgf("Could not load baseline. The path must point of a gitleaks report generated using the default format: %s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ func main() {
|
|||||||
configRules = append(configRules, rules.AsanaClientID())
|
configRules = append(configRules, rules.AsanaClientID())
|
||||||
configRules = append(configRules, rules.AsanaClientSecret())
|
configRules = append(configRules, rules.AsanaClientSecret())
|
||||||
configRules = append(configRules, rules.Atlassian())
|
configRules = append(configRules, rules.Atlassian())
|
||||||
|
configRules = append(configRules, rules.Authress())
|
||||||
configRules = append(configRules, rules.AWS())
|
configRules = append(configRules, rules.AWS())
|
||||||
configRules = append(configRules, rules.BitBucketClientID())
|
configRules = append(configRules, rules.BitBucketClientID())
|
||||||
configRules = append(configRules, rules.BitBucketClientSecret())
|
configRules = append(configRules, rules.BitBucketClientSecret())
|
||||||
@@ -41,6 +42,7 @@ func main() {
|
|||||||
configRules = append(configRules, rules.Contentful())
|
configRules = append(configRules, rules.Contentful())
|
||||||
configRules = append(configRules, rules.Databricks())
|
configRules = append(configRules, rules.Databricks())
|
||||||
configRules = append(configRules, rules.DatadogtokenAccessToken())
|
configRules = append(configRules, rules.DatadogtokenAccessToken())
|
||||||
|
configRules = append(configRules, rules.DefinedNetworkingAPIToken())
|
||||||
configRules = append(configRules, rules.DigitalOceanPAT())
|
configRules = append(configRules, rules.DigitalOceanPAT())
|
||||||
configRules = append(configRules, rules.DigitalOceanOAuthToken())
|
configRules = append(configRules, rules.DigitalOceanOAuthToken())
|
||||||
configRules = append(configRules, rules.DigitalOceanRefreshToken())
|
configRules = append(configRules, rules.DigitalOceanRefreshToken())
|
||||||
@@ -77,7 +79,9 @@ func main() {
|
|||||||
configRules = append(configRules, rules.GitHubOauth())
|
configRules = append(configRules, rules.GitHubOauth())
|
||||||
configRules = append(configRules, rules.GitHubApp())
|
configRules = append(configRules, rules.GitHubApp())
|
||||||
configRules = append(configRules, rules.GitHubRefresh())
|
configRules = append(configRules, rules.GitHubRefresh())
|
||||||
configRules = append(configRules, rules.Gitlab())
|
configRules = append(configRules, rules.GitlabPat())
|
||||||
|
configRules = append(configRules, rules.GitlabPipelineTriggerToken())
|
||||||
|
configRules = append(configRules, rules.GitlabRunnerRegistrationToken())
|
||||||
configRules = append(configRules, rules.GitterAccessToken())
|
configRules = append(configRules, rules.GitterAccessToken())
|
||||||
configRules = append(configRules, rules.GrafanaApiKey())
|
configRules = append(configRules, rules.GrafanaApiKey())
|
||||||
configRules = append(configRules, rules.GrafanaCloudApiToken())
|
configRules = append(configRules, rules.GrafanaCloudApiToken())
|
||||||
@@ -112,6 +116,7 @@ func main() {
|
|||||||
configRules = append(configRules, rules.NPM())
|
configRules = append(configRules, rules.NPM())
|
||||||
configRules = append(configRules, rules.NytimesAccessToken())
|
configRules = append(configRules, rules.NytimesAccessToken())
|
||||||
configRules = append(configRules, rules.OktaAccessToken())
|
configRules = append(configRules, rules.OktaAccessToken())
|
||||||
|
configRules = append(configRules, rules.OpenAI())
|
||||||
configRules = append(configRules, rules.PlaidAccessID())
|
configRules = append(configRules, rules.PlaidAccessID())
|
||||||
configRules = append(configRules, rules.PlaidSecretKey())
|
configRules = append(configRules, rules.PlaidSecretKey())
|
||||||
configRules = append(configRules, rules.PlaidAccessToken())
|
configRules = append(configRules, rules.PlaidAccessToken())
|
||||||
@@ -138,8 +143,16 @@ func main() {
|
|||||||
configRules = append(configRules, rules.ShopifySharedSecret())
|
configRules = append(configRules, rules.ShopifySharedSecret())
|
||||||
configRules = append(configRules, rules.SidekiqSecret())
|
configRules = append(configRules, rules.SidekiqSecret())
|
||||||
configRules = append(configRules, rules.SidekiqSensitiveUrl())
|
configRules = append(configRules, rules.SidekiqSensitiveUrl())
|
||||||
configRules = append(configRules, rules.SlackAccessToken())
|
configRules = append(configRules, rules.SlackBotToken())
|
||||||
configRules = append(configRules, rules.SlackWebHook())
|
configRules = append(configRules, rules.SlackUserToken())
|
||||||
|
configRules = append(configRules, rules.SlackAppLevelToken())
|
||||||
|
configRules = append(configRules, rules.SlackConfigurationToken())
|
||||||
|
configRules = append(configRules, rules.SlackConfigurationRefreshToken())
|
||||||
|
configRules = append(configRules, rules.SlackLegacyBotToken())
|
||||||
|
configRules = append(configRules, rules.SlackLegacyWorkspaceToken())
|
||||||
|
configRules = append(configRules, rules.SlackLegacyToken())
|
||||||
|
configRules = append(configRules, rules.SlackWebHookUrl())
|
||||||
|
configRules = append(configRules, rules.Snyk())
|
||||||
configRules = append(configRules, rules.StripeAccessToken())
|
configRules = append(configRules, rules.StripeAccessToken())
|
||||||
configRules = append(configRules, rules.SquareAccessToken())
|
configRules = append(configRules, rules.SquareAccessToken())
|
||||||
configRules = append(configRules, rules.SquareSpaceAccessToken())
|
configRules = append(configRules, rules.SquareSpaceAccessToken())
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package rules
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||||
|
"github.com/zricethezav/gitleaks/v8/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Authress() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Authress Service Client Access Key",
|
||||||
|
RuleID: "authress-service-client-access-key",
|
||||||
|
SecretGroup: 1,
|
||||||
|
Regex: generateUniqueTokenRegex(`(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc_[a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120}`),
|
||||||
|
Keywords: []string{"sc_", "ext_", "scauth_", "authress_"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
// https://authress.io/knowledge-base/docs/authorization/service-clients/secrets-scanning/#1-detection
|
||||||
|
service_client_id := "sc_" + alphaNumeric("10")
|
||||||
|
access_key_id := alphaNumeric("4")
|
||||||
|
account_id := "acc_" + alphaNumeric("10")
|
||||||
|
signature_key := alphaNumericExtendedShort("40")
|
||||||
|
|
||||||
|
tps := []string{
|
||||||
|
generateSampleSecret("authress", secrets.NewSecret(fmt.Sprintf(`%s\.%s\.%s\.%s`, service_client_id, access_key_id, account_id, signature_key))),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
@@ -16,7 +16,11 @@ paths = [
|
|||||||
'''gitleaks.toml''',
|
'''gitleaks.toml''',
|
||||||
'''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket)$''',
|
'''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket)$''',
|
||||||
'''(go.mod|go.sum)$''',
|
'''(go.mod|go.sum)$''',
|
||||||
|
'''gradle.lockfile''',
|
||||||
'''node_modules''',
|
'''node_modules''',
|
||||||
|
'''package-lock.json''',
|
||||||
|
'''pnpm-lock.yaml''',
|
||||||
|
'''Database.refactorlog''',
|
||||||
'''vendor''',
|
'''vendor''',
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -57,4 +61,4 @@ keywords = [
|
|||||||
{{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
|
{{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
|
||||||
]
|
]
|
||||||
|
|
||||||
{{end}}{{end}}
|
{{end}}{{end}}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package rules
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||||
|
"github.com/zricethezav/gitleaks/v8/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DefinedNetworkingAPIToken() *config.Rule {
|
||||||
|
// Define Rule
|
||||||
|
r := config.Rule{
|
||||||
|
// Human redable description of the rule
|
||||||
|
Description: "Defined Networking API token",
|
||||||
|
|
||||||
|
// Unique ID for the rule
|
||||||
|
RuleID: "defined-networking-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{"dnkey"}, `dnkey-[a-z0-9=_\-]{26}-[a-z0-9=_\-]{52}`),
|
||||||
|
|
||||||
|
// Keywords used for string matching on fragments (think of this as a prefilter)
|
||||||
|
Keywords: []string{"dnkey"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
generateSampleSecret("dnkey", "dnkey-"+secrets.NewSecret(alphaNumericExtended("26"))+"-"+secrets.NewSecret(alphaNumericExtended("52"))),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ func EasyPost() *config.Rule {
|
|||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "EasyPost API token",
|
Description: "EasyPost API token",
|
||||||
RuleID: "easypost-api-token",
|
RuleID: "easypost-api-token",
|
||||||
Regex: regexp.MustCompile(`EZAK(?i)[a-z0-9]{54}`),
|
Regex: regexp.MustCompile(`\bEZAK(?i)[a-z0-9]{54}`),
|
||||||
Keywords: []string{"EZAK"},
|
Keywords: []string{"EZAK"},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ func EasyPostTestAPI() *config.Rule {
|
|||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "EasyPost test API token",
|
Description: "EasyPost test API token",
|
||||||
RuleID: "easypost-test-api-token",
|
RuleID: "easypost-test-api-token",
|
||||||
Regex: regexp.MustCompile(`EZTK(?i)[a-z0-9]{54}`),
|
Regex: regexp.MustCompile(`\bEZTK(?i)[a-z0-9]{54}`),
|
||||||
Keywords: []string{"EZTK"},
|
Keywords: []string{"EZTK"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
func Facebook() *config.Rule {
|
func Facebook() *config.Rule {
|
||||||
// define rule
|
// define rule
|
||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Facebook",
|
Description: "Facebook Access Token",
|
||||||
RuleID: "facebook",
|
RuleID: "facebook",
|
||||||
Regex: generateSemiGenericRegex([]string{"facebook"}, hex("32")),
|
Regex: generateSemiGenericRegex([]string{"facebook"}, hex("32")),
|
||||||
SecretGroup: 1,
|
SecretGroup: 1,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/zricethezav/gitleaks/v8/config"
|
"github.com/zricethezav/gitleaks/v8/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Gitlab() *config.Rule {
|
func GitlabPat() *config.Rule {
|
||||||
// define rule
|
// define rule
|
||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "GitLab Personal Access Token",
|
Description: "GitLab Personal Access Token",
|
||||||
@@ -22,3 +22,35 @@ func Gitlab() *config.Rule {
|
|||||||
}
|
}
|
||||||
return validate(r, tps, nil)
|
return validate(r, tps, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GitlabPipelineTriggerToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "GitLab Pipeline Trigger Token",
|
||||||
|
RuleID: "gitlab-ptt",
|
||||||
|
Regex: regexp.MustCompile(`glptt-[0-9a-f]{40}`),
|
||||||
|
Keywords: []string{"glptt-"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
generateSampleSecret("gitlab", "glptt-"+secrets.NewSecret(hex("40"))),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GitlabRunnerRegistrationToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "GitLab Runner Registration Token",
|
||||||
|
RuleID: "gitlab-rrt",
|
||||||
|
Regex: regexp.MustCompile(`GR1348941[0-9a-zA-Z\-\_]{20}`),
|
||||||
|
Keywords: []string{"GR1348941"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
generateSampleSecret("gitlab", "GR1348941"+secrets.NewSecret(alphaNumeric("20"))),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
@@ -9,12 +9,12 @@ func JWT() *config.Rule {
|
|||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "JSON Web Token",
|
Description: "JSON Web Token",
|
||||||
RuleID: "jwt",
|
RuleID: "jwt",
|
||||||
Regex: generateUniqueTokenRegex(`ey[0-9a-z]{30,34}\.ey[0-9a-z-\/_]{30,500}\.[0-9a-zA-Z-\/_]{10,200}`),
|
Regex: generateUniqueTokenRegex(`ey[0-9a-z]{30,34}\.ey[0-9a-z-\/_]{30,500}\.[0-9a-zA-Z-\/_]{10,200}={0,2}`),
|
||||||
Keywords: []string{"ey"},
|
Keywords: []string{"ey"},
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
tps := []string{`eyJhbGciOieeeiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwic3ViZSI6IjEyMzQ1Njc4OTAiLCJuYW1lZWEiOiJKb2huIERvZSIsInN1ZmV3YWZiIjoiMTIzNDU2Nzg5MCIsIm5hbWVmZWF3ZnciOiJKb2huIERvZSIsIm5hbWVhZmV3ZmEiOiJKb2huIERvZSIsInN1ZndhZndlYWIiOiIxMjM0NTY3ODkwIiwibmFtZWZ3YWYiOiJKb2huIERvZSIsInN1YmZ3YWYiOiIxMjM0NTY3ODkwIiwibmFtZndhZSI6IkpvaG4gRG9lIiwiaWZ3YWZhYXQiOjE1MTYyMzkwMjJ9.a_5icKBDo-8EjUlrfvz2k2k-FYaindQ0DEYNrlsnRG0`, // gitleaks:allow
|
tps := []string{`eyJhbGciOieeeiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwic3ViZSI6IjEyMzQ1Njc4OTAiLCJuYW1lZWEiOiJKb2huIERvZSIsInN1ZmV3YWZiIjoiMTIzNDU2Nzg5MCIsIm5hbWVmZWF3ZnciOiJKb2huIERvZSIsIm5hbWVhZmV3ZmEiOiJKb2huIERvZSIsInN1ZndhZndlYWIiOiIxMjM0NTY3ODkwIiwibmFtZWZ3YWYiOiJKb2huIERvZSIsInN1YmZ3YWYiOiIxMjM0NTY3ODkwIiwibmFtZndhZSI6IkpvaG4gRG9lIiwiaWZ3YWZhYXQiOjE1MTYyMzkwMjJ9.a_5icKBDo-8EjUlrfvz2k2k-FYaindQ0DEYNrlsnRG0==`, // gitleaks:allow
|
||||||
`JWT := eyJhbGciOieeeiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwic3ViZSI6IjEyMzQ1Njc4OTAiLCJuYW1lZWEiOiJKb2huIERvZSIsInN1ZmV3YWZiIjoiMTIzNDU2Nzg5MCIsIm5hbWVmZWF3ZnciOiJKb2huIERvZSIsIm5hbWVhZmV3ZmEiOiJKb2huIERvZSIsInN1ZndhZndlYWIiOiIxMjM0NTY3ODkwIiwibmFtZWZ3YWYiOiJKb2huIERvZSIsInN1YmZ3YWYiOiIxMjM0NTY3ODkwIiwibmFtZndhZSI6IkpvaG4gRG9lIiwiaWZ3YWZhYXQiOjE1MTYyMzkwMjJ9.a_5icKBDo-8EjUlrfvz2k2k-FYaindQ0DEYNrlsnRG0`, // gitleaks:allow
|
`JWT := eyJhbGciOieeeiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwic3ViZSI6IjEyMzQ1Njc4OTAiLCJuYW1lZWEiOiJKb2huIERvZSIsInN1ZmV3YWZiIjoiMTIzNDU2Nzg5MCIsIm5hbWVmZWF3ZnciOiJKb2huIERvZSIsIm5hbWVhZmV3ZmEiOiJKb2huIERvZSIsInN1ZndhZndlYWIiOiIxMjM0NTY3ODkwIiwibmFtZWZ3YWYiOiJKb2huIERvZSIsInN1YmZ3YWYiOiIxMjM0NTY3ODkwIiwibmFtZndhZSI6IkpvaG4gRG9lIiwiaWZ3YWZhYXQiOjE1MTYyMzkwMjJ9.a_5icKBDo-8EjUlrfvz2k2k-FYaindQ0DEYNrlsnRG0`, // gitleaks:allow
|
||||||
}
|
}
|
||||||
return validate(r, tps, nil)
|
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 OpenAI() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
RuleID: "openai-api-key",
|
||||||
|
Description: "OpenAI API Key",
|
||||||
|
Regex: generateUniqueTokenRegex(`sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20}`),
|
||||||
|
SecretGroup: 1,
|
||||||
|
Keywords: []string{
|
||||||
|
"T3BlbkFJ",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
generateSampleSecret("openaiApiKey", "sk-"+secrets.NewSecret(alphaNumeric("20"))+"T3BlbkFJ"+secrets.NewSecret(alphaNumeric("20"))),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ func PrivateKey() *config.Rule {
|
|||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Private Key",
|
Description: "Private Key",
|
||||||
RuleID: "private-key",
|
RuleID: "private-key",
|
||||||
Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY----`),
|
Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----`),
|
||||||
Keywords: []string{"-----BEGIN"},
|
Keywords: []string{"-----BEGIN"},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,6 +23,9 @@ anything
|
|||||||
abcdefghijklmnopqrstuvwxyz
|
abcdefghijklmnopqrstuvwxyz
|
||||||
-----END RSA PRIVATE KEY-----
|
-----END RSA PRIVATE KEY-----
|
||||||
`,
|
`,
|
||||||
|
`-----BEGIN PRIVATE KEY BLOCK-----
|
||||||
|
anything
|
||||||
|
-----END PRIVATE KEY BLOCK-----`,
|
||||||
} // gitleaks:allow
|
} // gitleaks:allow
|
||||||
return validate(r, tps, nil)
|
return validate(r, tps, nil)
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ const (
|
|||||||
identifierSuffix = `)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}`
|
identifierSuffix = `)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}`
|
||||||
|
|
||||||
// commonly used assignment operators or function call
|
// commonly used assignment operators or function call
|
||||||
operator = `(?:=|>|:=|\|\|:|<=|=>|:)`
|
operator = `(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)`
|
||||||
|
|
||||||
// boundaries for the secret
|
// boundaries for the secret
|
||||||
// \x60 = `
|
// \x60 = `
|
||||||
@@ -75,7 +75,7 @@ func validate(r config.Rule, truePositives []string, falsePositives []string) *c
|
|||||||
}
|
}
|
||||||
for _, fp := range falsePositives {
|
for _, fp := range falsePositives {
|
||||||
if len(d.DetectString(fp)) != 0 {
|
if len(d.DetectString(fp)) != 0 {
|
||||||
log.Fatal().Msgf("Failed to validate (fp) [%s]", r.RuleID)
|
log.Fatal().Msgf("Failed to validate. For rule ID [%s], false positive [%s] was detected by regexp [%s]", r.RuleID, fp, r.Regex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &r
|
return &r
|
||||||
|
|||||||
@@ -1,42 +1,264 @@
|
|||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||||
"github.com/zricethezav/gitleaks/v8/config"
|
"github.com/zricethezav/gitleaks/v8/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SlackAccessToken() *config.Rule {
|
// https://api.slack.com/authentication/token-types#bot
|
||||||
|
func SlackBotToken() *config.Rule {
|
||||||
// define rule
|
// define rule
|
||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Slack token",
|
Description: "Slack Bot token",
|
||||||
RuleID: "slack-access-token",
|
RuleID: "slack-bot-token",
|
||||||
Regex: regexp.MustCompile(
|
Regex: regexp.MustCompile(
|
||||||
"xox[baprs]-([0-9a-zA-Z]{10,48})"),
|
`(xoxb-[0-9]{10,13}\-[0-9]{10,13}[a-zA-Z0-9-]*)`),
|
||||||
Keywords: []string{
|
Keywords: []string{
|
||||||
"xoxb",
|
"xoxb",
|
||||||
"xoxa",
|
|
||||||
"xoxp",
|
|
||||||
"xoxr",
|
|
||||||
"xoxs",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
tps := []string{
|
tps := []string{
|
||||||
"\"slackToken\": \"xoxb-" + secrets.NewSecret(alphaNumeric("30")) + "\"",
|
// https://github.com/metabase/metabase/blob/74cfb332140680425c7d37d347854160cc997ea8/frontend/src/metabase/admin/settings/slack/components/SlackForm/SlackForm.tsx#L47
|
||||||
|
`"bot_token1": "xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD"`, // gitleaks:allow
|
||||||
|
// https://github.com/jonz-secops/TokenTester/blob/978e9f3eabc7e9978769cfbba10735afa3bf627e/slack#LL44C27-L44C86
|
||||||
|
`"bot_token2": "xoxb-263594206564-2343594206574-FGqddMF8t08v8N7Oq4i57vs1MBS"`, // gitleaks:allow
|
||||||
|
`"bot_token3": "xoxb-4614724432022-5152386766518-O5WzjWGLG0wcCm2WPrjEmnys"`, // gitleaks:allow
|
||||||
|
`"bot_token4": ` + fmt.Sprintf(`"xoxb-%s-%s-%s"`, secrets.NewSecret(numeric("13")), secrets.NewSecret(numeric("12")), secrets.NewSecret(alphaNumeric("24"))),
|
||||||
|
}
|
||||||
|
fps := []string{
|
||||||
|
"xoxb-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx",
|
||||||
|
"xoxb-xxx",
|
||||||
|
"xoxb-12345-abcd234",
|
||||||
|
"xoxb-xoxb-my-bot-token",
|
||||||
|
}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://api.slack.com/authentication/token-types#user
|
||||||
|
func SlackUserToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack User",
|
||||||
|
RuleID: "slack-user-token",
|
||||||
|
// The last segment seems to be consistently 32 characters. I've made it 28-34 just in case.
|
||||||
|
Regex: regexp.MustCompile(`(xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34})`),
|
||||||
|
Keywords: []string{"xoxp-", "xoxe-"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
// https://github.com/jonz-secops/TokenTester/blob/978e9f3eabc7e9978769cfbba10735afa3bf627e/slack#L25
|
||||||
|
`"user_token1": "xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef"`, // gitleaks:allow
|
||||||
|
// https://github.com/praetorian-inc/noseyparker/blob/16e0e5768fd14ea54f6c9a058566184d88343bb4/crates/noseyparker/data/default/rules/slack.yml#L29
|
||||||
|
`"user_token2": "xoxp-283316862324-298911817009-298923149681-44f585044dace54f5701618e97cd1c0b"`, // gitleaks:allow
|
||||||
|
// https://github.com/CloudBoost/cloudboost/blob/7ba2ed17099fa85e6fc652302822601283c6fa13/user-service/services/mailService.js#LL248C17-L248C92
|
||||||
|
`"user_token3": "xoxp-11873098179-111402824422-234336993777-b96c9fb3b69f82ebb79d12f280779de1"`, // gitleaks:allow
|
||||||
|
// https://github.com/evanyeung/terminal-slack/blob/b068f77808de72424d08b525d6cbf814849acd08/readme.md?plain=1#L66
|
||||||
|
`"user_token4": "xoxp-254112160503-252950188691-252375361712-6cbf56aada30951a9d310a5f23d032a0"`, // gitleaks:allow
|
||||||
|
`"user_token5": "xoxp-4614724432022-4621207627011-5182682871568-1ddad9823e8528ad0f4944dfa3c6fc6c"`, // gitleaks:allow
|
||||||
|
`"user_token6": ` + fmt.Sprintf(`"xoxp-%s-%s-%s-%s"`, secrets.NewSecret(numeric("12")), secrets.NewSecret(numeric("13")), secrets.NewSecret(numeric("13")), secrets.NewSecret(alphaNumeric("32"))),
|
||||||
|
// It's unclear what the `xoxe-` token means in this context, however, the format is similar to a user token.
|
||||||
|
`"url_private": "https:\/\/files.slack.com\/files-pri\/T04MCQMEXQ9-F04MAA1PKE3\/image.png?t=xoxe-4726837507825-4848681849303-4856614048758-e0b1f3d4cb371f92260edb0d9444d206"`,
|
||||||
|
}
|
||||||
|
fps := []string{
|
||||||
|
`https://docs.google.com/document/d/1W7KCxOxP-1Fy5EyF2lbJGE2WuKmu5v0suYqoHas1jRM`,
|
||||||
|
`"token1": "xoxp-1234567890"`, // gitleaks:allow
|
||||||
|
`"token2": "xoxp-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"`, // gitleaks:allow
|
||||||
|
`"token3": "xoxp-1234-1234-1234-4ddbc191d40ee098cbaae6f3523ada2d"`, // gitleaks:allow
|
||||||
|
`"token4": "xoxp-572370529330-573807301142-572331691188-####################"`, // gitleaks:allow
|
||||||
|
// This technically matches the pattern but is an obvious false positive.
|
||||||
|
// `"token5": "xoxp-000000000000-000000000000-000000000000-00000000000000000000000000000000"`, // gitleaks:allow
|
||||||
|
}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference: https://api.slack.com/authentication/token-types#app
|
||||||
|
func SlackAppLevelToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack App-level token",
|
||||||
|
RuleID: "slack-app-token",
|
||||||
|
// This regex is based on a limited number of examples and may not be 100% accurate.
|
||||||
|
Regex: regexp.MustCompile(`(?i)(xapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+)`),
|
||||||
|
Keywords: []string{"xapp"},
|
||||||
|
}
|
||||||
|
|
||||||
|
tps := []string{
|
||||||
|
// https://github.com/jonz-secops/TokenTester/blob/978e9f3eabc7e9978769cfbba10735afa3bf627e/slack#L17
|
||||||
|
`"token1": "xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e"`, // gitleaks:allow
|
||||||
|
`"token2": "xapp-1-IEMF8IMY1OQ-4037076220459-85c370b433e366de369c4ef5abdf41253519266982439a75af74a3d68d543fb6"`, // gitleaks:allow
|
||||||
|
`"token3": "xapp-1-BM3V7LC51DA-1441525068281-86641a2582cd0903402ab523e5bcc53b8253098c31591e529b55b41974d2e82f"`, // gitleaks:allow
|
||||||
|
`"token4": ` + fmt.Sprintf(`"xapp-1-A%s-%s-%s"`, secrets.NewSecret(numeric("10")), secrets.NewSecret(numeric("13")), secrets.NewSecret(alphaNumeric("64"))),
|
||||||
}
|
}
|
||||||
return validate(r, tps, nil)
|
return validate(r, tps, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SlackWebHook() *config.Rule {
|
// Reference: https://api.slack.com/authentication/config-tokens
|
||||||
|
func SlackConfigurationToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack Configuration access token",
|
||||||
|
RuleID: "slack-config-access-token",
|
||||||
|
Regex: regexp.MustCompile(`(?i)(xoxe.xox[bp]-\d-[A-Z0-9]{163,166})`),
|
||||||
|
Keywords: []string{"xoxe.xoxb-", "xoxe.xoxp-"},
|
||||||
|
}
|
||||||
|
|
||||||
|
tps := []string{
|
||||||
|
`"access_token1": "xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ"`, // gitleaks:allow
|
||||||
|
`"access_token2": "xoxe.xoxp-1-Mi0yLTMxNzcwMjQ0MTcxMy0zNjU5NDY0Njg4MTctNTE1ODE1MjY5MTcxNC01MTU4MDI0MTgyOTc5LWRmY2YwY2U4ODhhNzY5ZGU5MTAyNDU4MDJjMGQ0ZDliMTZhMjNkMmEyYzliNjkzMDRlN2VjZTI4MWNiMzRkNGQ"`, // gitleaks:allow
|
||||||
|
`"access_token3": "xoxe.xoxp-1-` + secrets.NewSecret(alphaNumeric("163")) + `"`,
|
||||||
|
`"access_token4": "xoxe.xoxb-1-Mi0yLTMxNzcwMjQ0MTcxMy0zNjU5NDY0Njg4MTctNTE1ODE1MjY5MTcxNC01MTU4MDI0MTgyOTc5LWRmY2YwY2U4ODhhNzY5ZGU5MTAyNDU4MDJjMGQ0ZDliMTZhMjNkMmEyYzliNjkzMDRlN2VjZTI4MWNiMzRkNGQ"`,
|
||||||
|
`"access_token5": "xoxe.xoxb-1-` + secrets.NewSecret(alphaNumeric("165")) + `"`,
|
||||||
|
}
|
||||||
|
fps := []string{
|
||||||
|
"xoxe.xoxp-1-SlackAppConfigurationAccessTokenHere",
|
||||||
|
"xoxe.xoxp-1-RANDOMSTRINGHERE",
|
||||||
|
"xoxe.xoxp-1-initial",
|
||||||
|
}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference: https://api.slack.com/authentication/config-tokens
|
||||||
|
func SlackConfigurationRefreshToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack Configuration refresh token",
|
||||||
|
RuleID: "slack-config-refresh-token",
|
||||||
|
Regex: regexp.MustCompile(`(?i)(xoxe-\d-[A-Z0-9]{146})`),
|
||||||
|
Keywords: []string{"xoxe-"},
|
||||||
|
}
|
||||||
|
|
||||||
|
tps := []string{
|
||||||
|
`"refresh_token1": "xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg"`, // gitleaks:allow
|
||||||
|
`"refresh_token2": "xoxe-1-My0xLTM0MTQwNDE0MDE3Ni01MTgyMDc1NDk2MDgwLTU0MjQ1NjIwNzgxODEtNGJkYTZhYTUxY2M1ODk3ZTNkN2YzMTgxMDI1ZDQzNzgwNWY4NWQ0ODdhZGIzM2ViOGI0MTM0MjdlNGVmYzQ4Ng"`, // gitleaks:allow
|
||||||
|
`"refresh_token3": "xoxe-1-` + secrets.NewSecret(alphaNumeric("146")) + `"`,
|
||||||
|
}
|
||||||
|
fps := []string{"xoxe-1-xxx", "XOxE-RROAmw, Home and Garden, 5:24, 20120323"}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference: https://api.slack.com/authentication/token-types#legacy_bot
|
||||||
|
func SlackLegacyBotToken() *config.Rule {
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack Legacy bot token",
|
||||||
|
RuleID: "slack-legacy-bot-token",
|
||||||
|
// This rule is based off the limited information I could find and may not be 100% accurate.
|
||||||
|
Regex: regexp.MustCompile(
|
||||||
|
`(xoxb-[0-9]{8,14}\-[a-zA-Z0-9]{18,26})`),
|
||||||
|
Keywords: []string{
|
||||||
|
"xoxb",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
tps := []string{
|
||||||
|
// https://github.com/jonz-secops/TokenTester/blob/978e9f3eabc7e9978769cfbba10735afa3bf627e/slack#LL42C38-L42C80
|
||||||
|
`"bot_token1": "xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1"`, // gitleaks:allow
|
||||||
|
// https://heejune.me/2018/08/01/crashdump-analysis-automation-using-slackbot-python-cdb-from-windows/
|
||||||
|
`"bot_token2": "xoxb-282029623751-BVtmnS3BQitmjZvjpQL7PSGP"`, // gitleaks:allow
|
||||||
|
// https://github.com/praetorian-inc/noseyparker/blob/16e0e5768fd14ea54f6c9a058566184d88343bb4/crates/noseyparker/data/default/rules/slack.yml#L15
|
||||||
|
`"bot_token3": "xoxb-47834520726-N3otsrwj8Cf99cs8GhiRZsX1"`, // gitleaks:allow
|
||||||
|
// https://github.com/pulumi/examples/blob/32d9047c19c2a9380c04e57a764321c25eef45b0/aws-js-sqs-slack/README.md?plain=1#L39
|
||||||
|
`"bot_token4": "xoxb-123456789012-Xw937qtWSXJss1lFaKe"`, // gitleaks:allow
|
||||||
|
// https://github.com/ilyasProgrammer/Odoo-eBay-Amazon/blob/a9c4a8a7548b19027bc0fd904f8ae9249248a293/custom_logging/models.py#LL9C24-L9C66
|
||||||
|
`"bot_token5": "xoxb-312554961652-uSmliU84rFhnUSBq9YdKh6lS"`, // gitleaks:allow
|
||||||
|
// https://github.com/jay-johnson/sci-pype/blob/6bff42ea4eb32d35b9f223db312e4cd0d3911100/src/pycore.py#L37
|
||||||
|
`"bot_token6": "xoxb-51351043345-Lzwmto5IMVb8UK36MghZYMEi"`, // gitleaks:allow
|
||||||
|
// https://github.com/logicmoo/logicmoo_workspace/blob/2e1794f596121c9949deb3bfbd30d5b027a51d3d/packs_sys/slack_prolog/prolog/slack_client_old.pl#L28
|
||||||
|
`"bot_token7": "xoxb-130154379991-ogFL0OFP3w6AwdJuK7wLojpK"`, // gitleaks:allow
|
||||||
|
// https://github.com/sbarski/serverless-chatbot/blob/7d556897486f3fd53795907b7e33252e5cc6b3a3/Lesson%203/serverless.yml#L38
|
||||||
|
`"bot_token8": "xoxb-159279836768-FOst5DLfEzmQgkz7cte5qiI"`, // gitleaks:allow
|
||||||
|
`"bot_token9": "xoxb-50014434-slacktokenx29U9X1bQ"`, // gitleaks:allow
|
||||||
|
`"bot_token10": ` + fmt.Sprintf(`"xoxb-%s-%s`, secrets.NewSecret(numeric("10")), secrets.NewSecret(alphaNumeric("24"))), // gitleaks:allow
|
||||||
|
`"bot_token11": ` + fmt.Sprintf(`"xoxb-%s-%s`, secrets.NewSecret(numeric("12")), secrets.NewSecret(alphaNumeric("23"))), // gitleaks:allow
|
||||||
|
}
|
||||||
|
fps := []string{
|
||||||
|
"xoxb-xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx", // gitleaks:allow
|
||||||
|
"xoxb-Slack_BOT_TOKEN",
|
||||||
|
"xoxb-abcdef-abcdef",
|
||||||
|
// "xoxb-0000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // gitleaks:allow
|
||||||
|
}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reference: https://api.slack.com/authentication/token-types#workspace
|
||||||
|
func SlackLegacyWorkspaceToken() *config.Rule {
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack Legacy Workspace token",
|
||||||
|
RuleID: "slack-legacy-workspace-token",
|
||||||
|
// This is by far the least confident pattern.
|
||||||
|
Regex: regexp.MustCompile(
|
||||||
|
`(xox[ar]-(?:\d-)?[0-9a-zA-Z]{8,48})`),
|
||||||
|
Keywords: []string{
|
||||||
|
"xoxa",
|
||||||
|
"xoxr",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
tps := []string{
|
||||||
|
`"access_token": "xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c"`, // gitleaks:allow
|
||||||
|
`"access_token1": ` + fmt.Sprintf(`"xoxa-%s-%s`, secrets.NewSecret(numeric("1")), secrets.NewSecret(alphaNumeric("12"))),
|
||||||
|
`"access_token2": ` + fmt.Sprintf(`"xoxa-%s`, secrets.NewSecret(alphaNumeric("12"))),
|
||||||
|
`"refresh_token1": ` + fmt.Sprintf(`"xoxr-%s-%s`, secrets.NewSecret(numeric("1")), secrets.NewSecret(alphaNumeric("12"))),
|
||||||
|
`"refresh_token2": ` + fmt.Sprintf(`"xoxr-%s`, secrets.NewSecret(alphaNumeric("12"))),
|
||||||
|
}
|
||||||
|
fps := []string{
|
||||||
|
// "xoxa-faketoken",
|
||||||
|
// "xoxa-access-token-string",
|
||||||
|
// "XOXa-nx991k",
|
||||||
|
"https://github.com/xoxa-nyc/xoxa-nyc.github.io/blob/master/README.md",
|
||||||
|
}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
// References:
|
||||||
|
// - https://api.slack.com/authentication/token-types#legacy
|
||||||
|
// - https://api.slack.com/changelog/2016-05-19-authorship-changing-for-older-tokens
|
||||||
|
// - https://github.com/jonz-secops/TokenTester/blob/978e9f3eabc7e9978769cfbba10735afa3bf627e/slack#L29
|
||||||
|
// - https://gist.github.com/thesubtlety/a1c460d53df0837c5817c478b9f10588#file-local-slack-jack-py-L32
|
||||||
|
func SlackLegacyToken() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Slack Legacy token",
|
||||||
|
RuleID: "slack-legacy-token",
|
||||||
|
Regex: regexp.MustCompile(`(xox[os]-\d+-\d+-\d+-[a-fA-F\d]+)`),
|
||||||
|
Keywords: []string{"xoxo", "xoxs"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
// https://github.com/GGStudy-DDUp/https-github.com-aldaor-HackerOneReports/blob/637e9261b63a7292a3a7ddf4bf13729c224d84df/PrivilegeEscalation/47940.txt#L23
|
||||||
|
`"access_token1": "xoxs-3206092076-3204538285-3743137121-836b042620"`, // gitleaks:allow
|
||||||
|
// https://github.com/jonz-secops/TokenTester/blob/978e9f3eabc7e9978769cfbba10735afa3bf627e/slack#L28
|
||||||
|
`"access_token2": "xoxs-416843729158-132049654-5609968301-e708ba56e1"`, // gitleaks:allow
|
||||||
|
// https://github.com/clr2of8/SlackExtract/blob/18d151152ff5a45b293d4b7193aa6d08f9ab1bfd/README.md?plain=1#L32
|
||||||
|
`"access_token3": "xoxs-420083410720-421837374423-440811613314-977844f625b707d5b0b268206dbc92cbc85feef3e71b08e44815a8e6e7657190"`, // gitleaks:allow
|
||||||
|
// https://github.com/zeroc00I/AllVideoPocsFromHackerOne/blob/95ae92f65ccef11c2c6acdaabfb7cc9b2b0eb4c6/jsonReports/61312.json#LL1C17-L1C17
|
||||||
|
`"access_token4": "xoxs-4829527689-4829527691-4814341714-d0346ec616"`, // gitleaks:allow
|
||||||
|
// https://github.com/ericvanderwal/general-playmaker/blob/34bd8e82e2d7b16ca9cc825d0c9d383b8378b550/Logic/setrandomseedtype.cs#LL783C15-L783C69
|
||||||
|
`"access_token5": "xoxs-155191149137-155868813314-338998331396-9f6d235915"`, // gitleaks:allow
|
||||||
|
`"access_token6": "xoxs-` + fmt.Sprintf("%s-%s-%s-%s", secrets.NewSecret(numeric("10")), secrets.NewSecret(numeric("10")), secrets.NewSecret(numeric("10")), secrets.NewSecret(hex("10"))) + `"`,
|
||||||
|
`"access_token7": "xoxo-523423-234243-234233-e039d02840a0b9379c"`, // gitleaks:allow
|
||||||
|
}
|
||||||
|
fps := []string{
|
||||||
|
"https://indieweb.org/images/3/35/2018-250-xoxo-indieweb-1.jpg",
|
||||||
|
"https://lh3.googleusercontent.com/-tWXjX3LUD6w/Ua4La_N5E2I/AAAAAAAAACg/qcm19xbEYa4/s640/EXO-XOXO-teaser-exo-k-34521098-720-516.jpg",
|
||||||
|
}
|
||||||
|
return validate(r, tps, fps)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SlackWebHookUrl() *config.Rule {
|
||||||
// define rule
|
// define rule
|
||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Slack Webhook",
|
Description: "Slack Webhook",
|
||||||
RuleID: "slack-web-hook",
|
RuleID: "slack-webhook-url",
|
||||||
|
// If this generates too many false-positives we should define an allowlist (e.g., "xxxx", "00000").
|
||||||
Regex: regexp.MustCompile(
|
Regex: regexp.MustCompile(
|
||||||
`https:\/\/hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+\/]{44,46}`),
|
`(https?:\/\/)?hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+\/]{43,46}`),
|
||||||
Keywords: []string{
|
Keywords: []string{
|
||||||
"hooks.slack.com",
|
"hooks.slack.com",
|
||||||
},
|
},
|
||||||
@@ -44,8 +266,16 @@ func SlackWebHook() *config.Rule {
|
|||||||
|
|
||||||
// validate
|
// validate
|
||||||
tps := []string{
|
tps := []string{
|
||||||
"https://hooks.slack.com/services/" + secrets.NewSecret(alphaNumeric("44")), // gitleaks:allow
|
"hooks.slack.com/services/" + secrets.NewSecret(alphaNumeric("44")),
|
||||||
"https://hooks.slack.com/workflows/" + secrets.NewSecret(alphaNumeric("44")), // gitleaks:allow
|
"http://hooks.slack.com/services/" + secrets.NewSecret(alphaNumeric("45")),
|
||||||
|
"https://hooks.slack.com/services/" + secrets.NewSecret(alphaNumeric("46")),
|
||||||
|
"http://hooks.slack.com/services/T024TTTTT/BBB72BBL/AZAAA9u0pA4ad666eMgbi555", // gitleaks:allow
|
||||||
|
"https://hooks.slack.com/services/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", // gitleaks:allow
|
||||||
|
"hooks.slack.com/workflows/" + secrets.NewSecret(alphaNumeric("44")),
|
||||||
|
"http://hooks.slack.com/workflows/" + secrets.NewSecret(alphaNumeric("45")),
|
||||||
|
"https://hooks.slack.com/workflows/" + secrets.NewSecret(alphaNumeric("46")),
|
||||||
|
"https://hooks.slack.com/workflows/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", // gitleaks:allow
|
||||||
|
"http://hooks.slack.com/workflows/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", // gitleaks:allow
|
||||||
}
|
}
|
||||||
return validate(r, tps, nil)
|
return validate(r, tps, nil)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package rules
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/zricethezav/gitleaks/v8/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Snyk() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Snyk API token",
|
||||||
|
RuleID: "snyk-api-token",
|
||||||
|
SecretGroup: 1,
|
||||||
|
Regex: generateSemiGenericRegex([]string{"snyk"}, hex8_4_4_4_12()),
|
||||||
|
Keywords: []string{"snyk"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
`const SNYK_TOKEN = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`const SNYK_KEY = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`const SNYK = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`SNYK = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`SNYK_TOKEN := "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`SNYK_TOKEN ::= "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`SNYK_TOKEN :::= "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
`SNYK_TOKEN ?= "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
func StripeAccessToken() *config.Rule {
|
func StripeAccessToken() *config.Rule {
|
||||||
// define rule
|
// define rule
|
||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Stripe",
|
Description: "Stripe Access Token",
|
||||||
RuleID: "stripe-access-token",
|
RuleID: "stripe-access-token",
|
||||||
Regex: regexp.MustCompile(`(?i)(sk|pk)_(test|live)_[0-9a-z]{10,32}`),
|
Regex: regexp.MustCompile(`(?i)(sk|pk)_(test|live)_[0-9a-z]{10,32}`),
|
||||||
Keywords: []string{
|
Keywords: []string{
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ func TelegramBotToken() *config.Rule {
|
|||||||
minToken := secrets.NewSecret(numeric("5") + ":A" + alphaNumericExtendedShort("34"))
|
minToken := secrets.NewSecret(numeric("5") + ":A" + alphaNumericExtendedShort("34"))
|
||||||
maxToken := secrets.NewSecret(numeric("16") + ":A" + alphaNumericExtendedShort("34"))
|
maxToken := secrets.NewSecret(numeric("16") + ":A" + alphaNumericExtendedShort("34"))
|
||||||
tps := []string{
|
tps := []string{
|
||||||
// variable assigment
|
// variable assignment
|
||||||
generateSampleSecret("telegram", validToken),
|
generateSampleSecret("telegram", validToken),
|
||||||
// URL contaning token
|
// URL containing token
|
||||||
generateSampleSecret("url", "https://api.telegram.org/bot"+validToken+"/sendMessage"),
|
generateSampleSecret("url", "https://api.telegram.org/bot"+validToken+"/sendMessage"),
|
||||||
// object constructor
|
// object constructor
|
||||||
`const bot = new Telegraf("` + validToken + `")`,
|
`const bot = new Telegraf("` + validToken + `")`,
|
||||||
|
|||||||
+28
-1
@@ -17,6 +17,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
protectCmd.Flags().Bool("staged", false, "detect secrets in a --staged state")
|
protectCmd.Flags().Bool("staged", false, "detect secrets in a --staged state")
|
||||||
protectCmd.Flags().String("log-opts", "", "git log options")
|
protectCmd.Flags().String("log-opts", "", "git log options")
|
||||||
|
protectCmd.Flags().StringP("gitleaks-ignore-path", "i", ".", "path to .gitleaksignore file or folder containing one")
|
||||||
rootCmd.AddCommand(protectCmd)
|
rootCmd.AddCommand(protectCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,10 +67,36 @@ func runProtect(cmd *cobra.Command, args []string) {
|
|||||||
if detector.Redact, err = cmd.Flags().GetBool("redact"); err != nil {
|
if detector.Redact, err = cmd.Flags().GetBool("redact"); err != nil {
|
||||||
log.Fatal().Err(err).Msg("")
|
log.Fatal().Err(err).Msg("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil {
|
if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil {
|
||||||
log.Fatal().Err(err).Msg("")
|
log.Fatal().Err(err).Msg("")
|
||||||
}
|
}
|
||||||
|
// set color flag
|
||||||
|
if detector.NoColor, err = cmd.Flags().GetBool("no-color"); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("")
|
||||||
|
}
|
||||||
|
|
||||||
|
gitleaksIgnorePath, err := cmd.Flags().GetString("gitleaks-ignore-path")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not get .gitleaksignore path")
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileExists(gitleaksIgnorePath) {
|
||||||
|
if err = detector.AddGitleaksIgnore(gitleaksIgnorePath); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileExists(filepath.Join(gitleaksIgnorePath, ".gitleaksignore")) {
|
||||||
|
if err = detector.AddGitleaksIgnore(filepath.Join(gitleaksIgnorePath, ".gitleaksignore")); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if fileExists(filepath.Join(source, ".gitleaksignore")) {
|
||||||
|
if err = detector.AddGitleaksIgnore(filepath.Join(source, ".gitleaksignore")); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get log options for git scan
|
// get log options for git scan
|
||||||
logOpts, err := cmd.Flags().GetString("log-opts")
|
logOpts, err := cmd.Flags().GetString("log-opts")
|
||||||
|
|||||||
+3
-2
@@ -39,12 +39,13 @@ func init() {
|
|||||||
cobra.OnInitialize(initLog)
|
cobra.OnInitialize(initLog)
|
||||||
rootCmd.PersistentFlags().StringP("config", "c", "", configDescription)
|
rootCmd.PersistentFlags().StringP("config", "c", "", configDescription)
|
||||||
rootCmd.PersistentFlags().Int("exit-code", 1, "exit code when leaks have been encountered")
|
rootCmd.PersistentFlags().Int("exit-code", 1, "exit code when leaks have been encountered")
|
||||||
rootCmd.PersistentFlags().StringP("source", "s", ".", "path to source (default: $PWD)")
|
rootCmd.PersistentFlags().StringP("source", "s", ".", "path to source")
|
||||||
rootCmd.PersistentFlags().StringP("report-path", "r", "", "report file")
|
rootCmd.PersistentFlags().StringP("report-path", "r", "", "report file")
|
||||||
rootCmd.PersistentFlags().StringP("report-format", "f", "json", "output format (json, csv, sarif)")
|
rootCmd.PersistentFlags().StringP("report-format", "f", "json", "output format (json, csv, junit, sarif)")
|
||||||
rootCmd.PersistentFlags().StringP("baseline-path", "b", "", "path to baseline with issues that can be ignored")
|
rootCmd.PersistentFlags().StringP("baseline-path", "b", "", "path to baseline with issues that can be ignored")
|
||||||
rootCmd.PersistentFlags().StringP("log-level", "l", "info", "log level (trace, debug, info, warn, error, fatal)")
|
rootCmd.PersistentFlags().StringP("log-level", "l", "info", "log level (trace, debug, info, warn, error, fatal)")
|
||||||
rootCmd.PersistentFlags().BoolP("verbose", "v", false, "show verbose output from scan")
|
rootCmd.PersistentFlags().BoolP("verbose", "v", false, "show verbose output from scan")
|
||||||
|
rootCmd.PersistentFlags().BoolP("no-color", "", false, "turn off color for verbose output")
|
||||||
rootCmd.PersistentFlags().Int("max-target-megabytes", 0, "files larger than this will be skipped")
|
rootCmd.PersistentFlags().Int("max-target-megabytes", 0, "files larger than this will be skipped")
|
||||||
rootCmd.PersistentFlags().Bool("redact", false, "redact secrets from logs and stdout")
|
rootCmd.PersistentFlags().Bool("redact", false, "redact secrets from logs and stdout")
|
||||||
rootCmd.PersistentFlags().Bool("no-banner", false, "suppress banner")
|
rootCmd.PersistentFlags().Bool("no-banner", false, "suppress banner")
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ type Allowlist struct {
|
|||||||
// Regexes is slice of content regular expressions that are allowed to be ignored.
|
// Regexes is slice of content regular expressions that are allowed to be ignored.
|
||||||
Regexes []*regexp.Regexp
|
Regexes []*regexp.Regexp
|
||||||
|
|
||||||
|
// RegexTarget
|
||||||
|
RegexTarget string
|
||||||
|
|
||||||
// Paths is a slice of path regular expressions that are allowed to be ignored.
|
// Paths is a slice of path regular expressions that are allowed to be ignored.
|
||||||
Paths []*regexp.Regexp
|
Paths []*regexp.Regexp
|
||||||
|
|
||||||
|
|||||||
+20
-16
@@ -36,17 +36,19 @@ type ViperConfig struct {
|
|||||||
Tags []string
|
Tags []string
|
||||||
|
|
||||||
Allowlist struct {
|
Allowlist struct {
|
||||||
Regexes []string
|
RegexTarget string
|
||||||
Paths []string
|
Regexes []string
|
||||||
Commits []string
|
Paths []string
|
||||||
StopWords []string
|
Commits []string
|
||||||
|
StopWords []string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Allowlist struct {
|
Allowlist struct {
|
||||||
Regexes []string
|
RegexTarget string
|
||||||
Paths []string
|
Regexes []string
|
||||||
Commits []string
|
Paths []string
|
||||||
StopWords []string
|
Commits []string
|
||||||
|
StopWords []string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,10 +124,11 @@ func (vc *ViperConfig) Translate() (Config, error) {
|
|||||||
Tags: r.Tags,
|
Tags: r.Tags,
|
||||||
Keywords: r.Keywords,
|
Keywords: r.Keywords,
|
||||||
Allowlist: Allowlist{
|
Allowlist: Allowlist{
|
||||||
Regexes: allowlistRegexes,
|
RegexTarget: r.Allowlist.RegexTarget,
|
||||||
Paths: allowlistPaths,
|
Regexes: allowlistRegexes,
|
||||||
Commits: r.Allowlist.Commits,
|
Paths: allowlistPaths,
|
||||||
StopWords: r.Allowlist.StopWords,
|
Commits: r.Allowlist.Commits,
|
||||||
|
StopWords: r.Allowlist.StopWords,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
orderedRules = append(orderedRules, r.RuleID)
|
orderedRules = append(orderedRules, r.RuleID)
|
||||||
@@ -148,10 +151,11 @@ func (vc *ViperConfig) Translate() (Config, error) {
|
|||||||
Extend: vc.Extend,
|
Extend: vc.Extend,
|
||||||
Rules: rulesMap,
|
Rules: rulesMap,
|
||||||
Allowlist: Allowlist{
|
Allowlist: Allowlist{
|
||||||
Regexes: allowlistRegexes,
|
RegexTarget: vc.Allowlist.RegexTarget,
|
||||||
Paths: allowlistPaths,
|
Regexes: allowlistRegexes,
|
||||||
Commits: vc.Allowlist.Commits,
|
Paths: allowlistPaths,
|
||||||
StopWords: vc.Allowlist.StopWords,
|
Commits: vc.Allowlist.Commits,
|
||||||
|
StopWords: vc.Allowlist.StopWords,
|
||||||
},
|
},
|
||||||
Keywords: keywords,
|
Keywords: keywords,
|
||||||
orderedRules: orderedRules,
|
orderedRules: orderedRules,
|
||||||
|
|||||||
+212
-102
@@ -14,16 +14,20 @@ title = "gitleaks config"
|
|||||||
description = "global allow lists"
|
description = "global allow lists"
|
||||||
paths = [
|
paths = [
|
||||||
'''gitleaks.toml''',
|
'''gitleaks.toml''',
|
||||||
'''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket)$''',
|
'''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket|vsidx|v2|suo|wsuo|.dll|pdb|exe)$''',
|
||||||
'''(go.mod|go.sum)$''',
|
'''(go.mod|go.sum)$''',
|
||||||
|
'''gradle.lockfile''',
|
||||||
'''node_modules''',
|
'''node_modules''',
|
||||||
|
'''package-lock.json''',
|
||||||
|
'''pnpm-lock.yaml''',
|
||||||
|
'''Database.refactorlog''',
|
||||||
'''vendor''',
|
'''vendor''',
|
||||||
]
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Adafruit API Key"
|
description = "Adafruit API Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:adafruit)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"adafruit",
|
"adafruit",
|
||||||
@@ -32,7 +36,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Adobe Client ID (OAuth Web)"
|
description = "Adobe Client ID (OAuth Web)"
|
||||||
id = "adobe-client-id"
|
id = "adobe-client-id"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:adobe)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"adobe",
|
"adobe",
|
||||||
@@ -57,7 +61,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Airtable API Key"
|
description = "Airtable API Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:airtable)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{17})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"airtable",
|
"airtable",
|
||||||
@@ -66,7 +70,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Algolia API Key"
|
description = "Algolia API Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:algolia)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"algolia",
|
"algolia",
|
||||||
]
|
]
|
||||||
@@ -82,7 +86,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Alibaba Secret Key"
|
description = "Alibaba Secret Key"
|
||||||
id = "alibaba-secret-key"
|
id = "alibaba-secret-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:alibaba)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"alibaba",
|
"alibaba",
|
||||||
@@ -91,7 +95,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Asana Client ID"
|
description = "Asana Client ID"
|
||||||
id = "asana-client-id"
|
id = "asana-client-id"
|
||||||
regex = '''(?i)(?:asana)(?:[0-9a-z\-_\t .]{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}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9]{16})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"asana",
|
"asana",
|
||||||
@@ -100,7 +104,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Asana Client Secret"
|
description = "Asana Client Secret"
|
||||||
id = "asana-client-secret"
|
id = "asana-client-secret"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:asana)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"asana",
|
"asana",
|
||||||
@@ -109,12 +113,21 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Atlassian API token"
|
description = "Atlassian API token"
|
||||||
id = "atlassian-api-token"
|
id = "atlassian-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:atlassian|confluence|jira)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"atlassian","confluence","jira",
|
"atlassian","confluence","jira",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Authress Service Client Access Key"
|
||||||
|
id = "authress-service-client-access-key"
|
||||||
|
regex = '''(?i)\b((?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc_[a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
|
secretGroup = 1
|
||||||
|
keywords = [
|
||||||
|
"sc_","ext_","scauth_","authress_",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "AWS"
|
description = "AWS"
|
||||||
id = "aws-access-token"
|
id = "aws-access-token"
|
||||||
@@ -126,7 +139,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Beamer API token"
|
description = "Beamer API token"
|
||||||
id = "beamer-api-token"
|
id = "beamer-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:beamer)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(b_[a-z0-9=_\-]{44})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"beamer",
|
"beamer",
|
||||||
@@ -135,7 +148,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Bitbucket Client ID"
|
description = "Bitbucket Client ID"
|
||||||
id = "bitbucket-client-id"
|
id = "bitbucket-client-id"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:bitbucket)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"bitbucket",
|
"bitbucket",
|
||||||
@@ -144,7 +157,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Bitbucket Client Secret"
|
description = "Bitbucket Client Secret"
|
||||||
id = "bitbucket-client-secret"
|
id = "bitbucket-client-secret"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:bitbucket)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"bitbucket",
|
"bitbucket",
|
||||||
@@ -153,7 +166,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Bittrex Access Key"
|
description = "Bittrex Access Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:bittrex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"bittrex",
|
"bittrex",
|
||||||
@@ -162,7 +175,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Bittrex Secret Key"
|
description = "Bittrex Secret Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:bittrex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"bittrex",
|
"bittrex",
|
||||||
@@ -179,7 +192,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Codecov Access Token"
|
description = "Codecov Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:codecov)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"codecov",
|
"codecov",
|
||||||
@@ -188,7 +201,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Coinbase Access Token"
|
description = "Coinbase Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:coinbase)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"coinbase",
|
"coinbase",
|
||||||
@@ -197,7 +210,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Confluent Access Token"
|
description = "Confluent Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:confluent)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{16})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"confluent",
|
"confluent",
|
||||||
@@ -206,7 +219,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Confluent Secret Key"
|
description = "Confluent Secret Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:confluent)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"confluent",
|
"confluent",
|
||||||
@@ -215,7 +228,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Contentful delivery API token"
|
description = "Contentful delivery API token"
|
||||||
id = "contentful-delivery-api-token"
|
id = "contentful-delivery-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:contentful)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{43})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"contentful",
|
"contentful",
|
||||||
@@ -232,12 +245,21 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Datadog Access Token"
|
description = "Datadog Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:datadog)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"datadog",
|
"datadog",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Defined Networking API token"
|
||||||
|
id = "defined-networking-api-token"
|
||||||
|
regex = '''(?i)(?:dnkey)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(dnkey-[a-z0-9=_\-]{26}-[a-z0-9=_\-]{52})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
|
secretGroup = 1
|
||||||
|
keywords = [
|
||||||
|
"dnkey",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "DigitalOcean OAuth Access Token"
|
description = "DigitalOcean OAuth Access Token"
|
||||||
id = "digitalocean-access-token"
|
id = "digitalocean-access-token"
|
||||||
@@ -268,7 +290,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Discord API key"
|
description = "Discord API key"
|
||||||
id = "discord-api-token"
|
id = "discord-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"discord",
|
"discord",
|
||||||
@@ -277,7 +299,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Discord client ID"
|
description = "Discord client ID"
|
||||||
id = "discord-client-id"
|
id = "discord-client-id"
|
||||||
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\t .]{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}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9]{18})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"discord",
|
"discord",
|
||||||
@@ -286,7 +308,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Discord client secret"
|
description = "Discord client secret"
|
||||||
id = "discord-client-secret"
|
id = "discord-client-secret"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:discord)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"discord",
|
"discord",
|
||||||
@@ -303,7 +325,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Droneci Access Token"
|
description = "Droneci Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:droneci)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"droneci",
|
"droneci",
|
||||||
@@ -312,7 +334,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Dropbox API secret"
|
description = "Dropbox API secret"
|
||||||
id = "dropbox-api-token"
|
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|;]|$)'''
|
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{15})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"dropbox",
|
"dropbox",
|
||||||
@@ -321,7 +343,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Dropbox long lived API token"
|
description = "Dropbox long lived API token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"dropbox",
|
"dropbox",
|
||||||
]
|
]
|
||||||
@@ -329,7 +351,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Dropbox short lived API token"
|
description = "Dropbox short lived API token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:dropbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(sl\.[a-z0-9\-=_]{135})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"dropbox",
|
"dropbox",
|
||||||
]
|
]
|
||||||
@@ -353,7 +375,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "EasyPost API token"
|
description = "EasyPost API token"
|
||||||
id = "easypost-api-token"
|
id = "easypost-api-token"
|
||||||
regex = '''EZAK(?i)[a-z0-9]{54}'''
|
regex = '''\bEZAK(?i)[a-z0-9]{54}'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"ezak",
|
"ezak",
|
||||||
]
|
]
|
||||||
@@ -361,7 +383,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "EasyPost test API token"
|
description = "EasyPost test API token"
|
||||||
id = "easypost-test-api-token"
|
id = "easypost-test-api-token"
|
||||||
regex = '''EZTK(?i)[a-z0-9]{54}'''
|
regex = '''\bEZTK(?i)[a-z0-9]{54}'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"eztk",
|
"eztk",
|
||||||
]
|
]
|
||||||
@@ -369,16 +391,16 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Etsy Access Token"
|
description = "Etsy Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:etsy)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"etsy",
|
"etsy",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Facebook"
|
description = "Facebook Access Token"
|
||||||
id = "facebook"
|
id = "facebook"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:facebook)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"facebook",
|
"facebook",
|
||||||
@@ -387,7 +409,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Fastly API key"
|
description = "Fastly API key"
|
||||||
id = "fastly-api-token"
|
id = "fastly-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:fastly)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"fastly",
|
"fastly",
|
||||||
@@ -396,7 +418,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Finicity API token"
|
description = "Finicity API token"
|
||||||
id = "finicity-api-token"
|
id = "finicity-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:finicity)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"finicity",
|
"finicity",
|
||||||
@@ -405,7 +427,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Finicity Client Secret"
|
description = "Finicity Client Secret"
|
||||||
id = "finicity-client-secret"
|
id = "finicity-client-secret"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:finicity)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{20})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"finicity",
|
"finicity",
|
||||||
@@ -414,7 +436,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Finnhub Access Token"
|
description = "Finnhub Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:finnhub)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{20})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"finnhub",
|
"finnhub",
|
||||||
@@ -423,7 +445,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Flickr Access Token"
|
description = "Flickr Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:flickr)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"flickr",
|
"flickr",
|
||||||
@@ -464,7 +486,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Freshbooks Access Token"
|
description = "Freshbooks Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:freshbooks)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"freshbooks",
|
"freshbooks",
|
||||||
@@ -482,16 +504,13 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Generic API Key"
|
description = "Generic API Key"
|
||||||
id = "generic-api-key"
|
id = "generic-api-key"
|
||||||
regex = '''(?i)(?:key|api|token|secret|client|passwd|password|auth|access)(?:[0-9a-z\-_\t .]{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|access)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
entropy = 3.5
|
entropy = 3.5
|
||||||
keywords = [
|
keywords = [
|
||||||
"key","api","token","secret","client","passwd","password","auth","access",
|
"key","api","token","secret","client","passwd","password","auth","access",
|
||||||
]
|
]
|
||||||
[rules.allowlist]
|
[rules.allowlist]
|
||||||
paths = [
|
|
||||||
'''Database.refactorlog'''
|
|
||||||
]
|
|
||||||
stopwords= [
|
stopwords= [
|
||||||
"client",
|
"client",
|
||||||
"endpoint",
|
"endpoint",
|
||||||
@@ -2016,10 +2035,26 @@ keywords = [
|
|||||||
"glpat-",
|
"glpat-",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "GitLab Pipeline Trigger Token"
|
||||||
|
id = "gitlab-ptt"
|
||||||
|
regex = '''glptt-[0-9a-f]{40}'''
|
||||||
|
keywords = [
|
||||||
|
"glptt-",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "GitLab Runner Registration Token"
|
||||||
|
id = "gitlab-rrt"
|
||||||
|
regex = '''GR1348941[0-9a-zA-Z\-\_]{20}'''
|
||||||
|
keywords = [
|
||||||
|
"gr1348941",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Gitter Access Token"
|
description = "Gitter Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:gitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"gitter",
|
"gitter",
|
||||||
@@ -2028,7 +2063,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "GoCardless API token"
|
description = "GoCardless API token"
|
||||||
id = "gocardless-api-token"
|
id = "gocardless-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:gocardless)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(live_(?i)[a-z0-9\-_=]{40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"live_","gocardless",
|
"live_","gocardless",
|
||||||
@@ -2072,7 +2107,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Heroku API Key"
|
description = "Heroku API Key"
|
||||||
id = "heroku-api-key"
|
id = "heroku-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:heroku)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"heroku",
|
"heroku",
|
||||||
@@ -2081,7 +2116,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "HubSpot API Token"
|
description = "HubSpot API Token"
|
||||||
id = "hubspot-api-key"
|
id = "hubspot-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:hubspot)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"hubspot",
|
"hubspot",
|
||||||
@@ -2090,7 +2125,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Intercom API Token"
|
description = "Intercom API Token"
|
||||||
id = "intercom-api-key"
|
id = "intercom-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:intercom)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{60})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"intercom",
|
"intercom",
|
||||||
@@ -2099,7 +2134,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "JSON Web Token"
|
description = "JSON Web Token"
|
||||||
id = "jwt"
|
id = "jwt"
|
||||||
regex = '''(?i)\b(ey[0-9a-z]{30,34}\.ey[0-9a-z-\/_]{30,500}\.[0-9a-zA-Z-\/_]{10,200})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
regex = '''(?i)\b(ey[0-9a-z]{30,34}\.ey[0-9a-z-\/_]{30,500}\.[0-9a-zA-Z-\/_]{10,200}={0,2})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"ey",
|
"ey",
|
||||||
]
|
]
|
||||||
@@ -2107,7 +2142,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Kraken Access Token"
|
description = "Kraken Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:kraken)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9\/=_\+\-]{80,90})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"kraken",
|
"kraken",
|
||||||
@@ -2116,7 +2151,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Kucoin Access Token"
|
description = "Kucoin Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:kucoin)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{24})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"kucoin",
|
"kucoin",
|
||||||
@@ -2125,7 +2160,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Kucoin Secret Key"
|
description = "Kucoin Secret Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:kucoin)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"kucoin",
|
"kucoin",
|
||||||
@@ -2134,7 +2169,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Launchdarkly Access Token"
|
description = "Launchdarkly Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:launchdarkly)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"launchdarkly",
|
"launchdarkly",
|
||||||
@@ -2151,7 +2186,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Linear Client Secret"
|
description = "Linear Client Secret"
|
||||||
id = "linear-client-secret"
|
id = "linear-client-secret"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:linear)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"linear",
|
"linear",
|
||||||
@@ -2160,7 +2195,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "LinkedIn Client ID"
|
description = "LinkedIn Client ID"
|
||||||
id = "linkedin-client-id"
|
id = "linkedin-client-id"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:linkedin|linked-in)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{14})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"linkedin","linked-in",
|
"linkedin","linked-in",
|
||||||
@@ -2169,7 +2204,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "LinkedIn Client secret"
|
description = "LinkedIn Client secret"
|
||||||
id = "linkedin-client-secret"
|
id = "linkedin-client-secret"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:linkedin|linked-in)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{16})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"linkedin","linked-in",
|
"linkedin","linked-in",
|
||||||
@@ -2178,7 +2213,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Lob API Key"
|
description = "Lob API Key"
|
||||||
id = "lob-api-key"
|
id = "lob-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:lob)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}((live|test)_[a-f0-9]{35})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"test_","live_",
|
"test_","live_",
|
||||||
@@ -2187,7 +2222,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Lob Publishable API Key"
|
description = "Lob Publishable API Key"
|
||||||
id = "lob-pub-api-key"
|
id = "lob-pub-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:lob)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}((test|live)_pub_[a-f0-9]{31})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"test_pub","live_pub","_pub",
|
"test_pub","live_pub","_pub",
|
||||||
@@ -2196,7 +2231,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Mailchimp API key"
|
description = "Mailchimp API key"
|
||||||
id = "mailchimp-api-key"
|
id = "mailchimp-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:mailchimp)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{32}-us20)(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"mailchimp",
|
"mailchimp",
|
||||||
@@ -2205,7 +2240,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Mailgun private API token"
|
description = "Mailgun private API token"
|
||||||
id = "mailgun-private-api-token"
|
id = "mailgun-private-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(key-[a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"mailgun",
|
"mailgun",
|
||||||
@@ -2214,7 +2249,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Mailgun public validation key"
|
description = "Mailgun public validation key"
|
||||||
id = "mailgun-pub-key"
|
id = "mailgun-pub-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(pubkey-[a-f0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"mailgun",
|
"mailgun",
|
||||||
@@ -2223,7 +2258,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Mailgun webhook signing key"
|
description = "Mailgun webhook signing key"
|
||||||
id = "mailgun-signing-key"
|
id = "mailgun-signing-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:mailgun)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"mailgun",
|
"mailgun",
|
||||||
@@ -2232,7 +2267,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "MapBox API token"
|
description = "MapBox API token"
|
||||||
id = "mapbox-api-token"
|
id = "mapbox-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:mapbox)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(pk\.[a-z0-9]{60}\.[a-z0-9]{22})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"mapbox",
|
"mapbox",
|
||||||
@@ -2241,7 +2276,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Mattermost Access Token"
|
description = "Mattermost Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:mattermost)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{26})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"mattermost",
|
"mattermost",
|
||||||
@@ -2250,7 +2285,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "MessageBird API token"
|
description = "MessageBird API token"
|
||||||
id = "messagebird-api-token"
|
id = "messagebird-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:messagebird|message-bird|message_bird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"messagebird","message-bird","message_bird",
|
"messagebird","message-bird","message_bird",
|
||||||
@@ -2259,7 +2294,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "MessageBird client ID"
|
description = "MessageBird client ID"
|
||||||
id = "messagebird-client-id"
|
id = "messagebird-client-id"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:messagebird|message-bird|message_bird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"messagebird","message-bird","message_bird",
|
"messagebird","message-bird","message_bird",
|
||||||
@@ -2276,7 +2311,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Netlify Access Token"
|
description = "Netlify Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:netlify)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{40,46})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"netlify",
|
"netlify",
|
||||||
@@ -2285,7 +2320,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "New Relic ingest browser API token"
|
description = "New Relic ingest browser API token"
|
||||||
id = "new-relic-browser-api-token"
|
id = "new-relic-browser-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(NRJS-[a-f0-9]{19})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"nrjs-",
|
"nrjs-",
|
||||||
@@ -2294,7 +2329,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "New Relic user API ID"
|
description = "New Relic user API ID"
|
||||||
id = "new-relic-user-api-id"
|
id = "new-relic-user-api-id"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"new-relic","newrelic","new_relic",
|
"new-relic","newrelic","new_relic",
|
||||||
@@ -2303,7 +2338,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "New Relic user API Key"
|
description = "New Relic user API Key"
|
||||||
id = "new-relic-user-api-key"
|
id = "new-relic-user-api-key"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(NRAK-[a-z0-9]{27})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"nrak",
|
"nrak",
|
||||||
@@ -2321,7 +2356,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Nytimes Access Token"
|
description = "Nytimes Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:nytimes|new-york-times,|newyorktimes)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"nytimes","new-york-times","newyorktimes",
|
"nytimes","new-york-times","newyorktimes",
|
||||||
@@ -2330,16 +2365,25 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Okta Access Token"
|
description = "Okta Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:okta)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9=_\-]{42})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"okta",
|
"okta",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "OpenAI API Key"
|
||||||
|
id = "openai-api-key"
|
||||||
|
regex = '''(?i)\b(sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
|
secretGroup = 1
|
||||||
|
keywords = [
|
||||||
|
"sk-","t3blbkfj",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Plaid API Token"
|
description = "Plaid API Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"plaid",
|
"plaid",
|
||||||
@@ -2348,7 +2392,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Plaid Client ID"
|
description = "Plaid Client ID"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"plaid",
|
"plaid",
|
||||||
@@ -2357,7 +2401,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Plaid Secret key"
|
description = "Plaid Secret key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"plaid",
|
"plaid",
|
||||||
@@ -2411,7 +2455,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Private Key"
|
description = "Private Key"
|
||||||
id = "private-key"
|
id = "private-key"
|
||||||
regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY----'''
|
regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"-----begin",
|
"-----begin",
|
||||||
]
|
]
|
||||||
@@ -2436,7 +2480,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "RapidAPI Access Token"
|
description = "RapidAPI Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:rapidapi)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{50})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"rapidapi",
|
"rapidapi",
|
||||||
@@ -2463,7 +2507,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Sendbird Access ID"
|
description = "Sendbird Access ID"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:sendbird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"sendbird",
|
"sendbird",
|
||||||
@@ -2472,7 +2516,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Sendbird Access Token"
|
description = "Sendbird Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:sendbird)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"sendbird",
|
"sendbird",
|
||||||
@@ -2499,7 +2543,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Sentry Access Token"
|
description = "Sentry Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:sentry)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"sentry",
|
"sentry",
|
||||||
@@ -2549,7 +2593,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Sidekiq Secret"
|
description = "Sidekiq Secret"
|
||||||
id = "sidekiq-secret"
|
id = "sidekiq-secret"
|
||||||
regex = '''(?i)(?:BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{8}:[a-f0-9]{8})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
regex = '''(?i)(?:BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{8}:[a-f0-9]{8})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"bundle_enterprise__contribsys__com","bundle_gems__contribsys__com",
|
"bundle_enterprise__contribsys__com","bundle_gems__contribsys__com",
|
||||||
@@ -2565,21 +2609,86 @@ keywords = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Slack token"
|
description = "Slack App-level token"
|
||||||
id = "slack-access-token"
|
id = "slack-app-token"
|
||||||
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})'''
|
regex = '''(?i)(xapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+)'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"xoxb","xoxa","xoxp","xoxr","xoxs",
|
"xapp",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Bot token"
|
||||||
|
id = "slack-bot-token"
|
||||||
|
regex = '''(xoxb-[0-9]{10,13}\-[0-9]{10,13}[a-zA-Z0-9-]*)'''
|
||||||
|
keywords = [
|
||||||
|
"xoxb",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Configuration access token"
|
||||||
|
id = "slack-config-access-token"
|
||||||
|
regex = '''(?i)(xoxe.xox[bp]-\d-[A-Z0-9]{163,166})'''
|
||||||
|
keywords = [
|
||||||
|
"xoxe.xoxb-","xoxe.xoxp-",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Configuration refresh token"
|
||||||
|
id = "slack-config-refresh-token"
|
||||||
|
regex = '''(?i)(xoxe-\d-[A-Z0-9]{146})'''
|
||||||
|
keywords = [
|
||||||
|
"xoxe-",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Legacy bot token"
|
||||||
|
id = "slack-legacy-bot-token"
|
||||||
|
regex = '''(xoxb-[0-9]{8,14}\-[a-zA-Z0-9]{18,26})'''
|
||||||
|
keywords = [
|
||||||
|
"xoxb",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Legacy token"
|
||||||
|
id = "slack-legacy-token"
|
||||||
|
regex = '''(xox[os]-\d+-\d+-\d+-[a-fA-F\d]+)'''
|
||||||
|
keywords = [
|
||||||
|
"xoxo","xoxs",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Legacy Workspace token"
|
||||||
|
id = "slack-legacy-workspace-token"
|
||||||
|
regex = '''(xox[ar]-(?:\d-)?[0-9a-zA-Z]{8,48})'''
|
||||||
|
keywords = [
|
||||||
|
"xoxa","xoxr",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack User"
|
||||||
|
id = "slack-user-token"
|
||||||
|
regex = '''(xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34})'''
|
||||||
|
keywords = [
|
||||||
|
"xoxp-","xoxe-",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Slack Webhook"
|
description = "Slack Webhook"
|
||||||
id = "slack-web-hook"
|
id = "slack-webhook-url"
|
||||||
regex = '''https:\/\/hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+\/]{44,46}'''
|
regex = '''(https?:\/\/)?hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+\/]{43,46}'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"hooks.slack.com",
|
"hooks.slack.com",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Snyk API token"
|
||||||
|
id = "snyk-api-token"
|
||||||
|
regex = '''(?i)(?:snyk)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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 = [
|
||||||
|
"snyk",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Square Access Token"
|
description = "Square Access Token"
|
||||||
id = "square-access-token"
|
id = "square-access-token"
|
||||||
@@ -2591,14 +2700,14 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Squarespace Access Token"
|
description = "Squarespace Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:squarespace)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"squarespace",
|
"squarespace",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Stripe"
|
description = "Stripe Access Token"
|
||||||
id = "stripe-access-token"
|
id = "stripe-access-token"
|
||||||
regex = '''(?i)(sk|pk)_(test|live)_[0-9a-z]{10,32}'''
|
regex = '''(?i)(sk|pk)_(test|live)_[0-9a-z]{10,32}'''
|
||||||
keywords = [
|
keywords = [
|
||||||
@@ -2608,7 +2717,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "SumoLogic Access ID"
|
description = "SumoLogic Access ID"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:sumo)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{14})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"sumo",
|
"sumo",
|
||||||
@@ -2617,7 +2726,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "SumoLogic Access Token"
|
description = "SumoLogic Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:sumo)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{64})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"sumo",
|
"sumo",
|
||||||
@@ -2635,7 +2744,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Travis CI Access Token"
|
description = "Travis CI Access Token"
|
||||||
id = "travisci-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|;]|$)'''
|
regex = '''(?i)(?:travis)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{22})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"travis",
|
"travis",
|
||||||
@@ -2652,7 +2761,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Twitch API token"
|
description = "Twitch API token"
|
||||||
id = "twitch-api-token"
|
id = "twitch-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:twitch)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"twitch",
|
"twitch",
|
||||||
@@ -2661,7 +2770,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Twitter Access Secret"
|
description = "Twitter Access Secret"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{45})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"twitter",
|
"twitter",
|
||||||
@@ -2670,7 +2779,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Twitter Access Token"
|
description = "Twitter Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9]{15,25}-[a-zA-Z0-9]{20,40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"twitter",
|
"twitter",
|
||||||
@@ -2679,7 +2788,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Twitter API Key"
|
description = "Twitter API Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"twitter",
|
"twitter",
|
||||||
@@ -2688,7 +2797,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Twitter API Secret"
|
description = "Twitter API Secret"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{50})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"twitter",
|
"twitter",
|
||||||
@@ -2697,7 +2806,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Twitter Bearer Token"
|
description = "Twitter Bearer Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:twitter)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(A{22}[a-zA-Z0-9%]{80,100})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"twitter",
|
"twitter",
|
||||||
@@ -2706,7 +2815,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Typeform API token"
|
description = "Typeform API token"
|
||||||
id = "typeform-api-token"
|
id = "typeform-api-token"
|
||||||
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|;]|$)'''
|
regex = '''(?i)(?:typeform)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(tfp_[a-z0-9\-_\.=]{59})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"tfp_",
|
"tfp_",
|
||||||
@@ -2731,7 +2840,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Yandex Access Token"
|
description = "Yandex Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:yandex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,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
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"yandex",
|
"yandex",
|
||||||
@@ -2740,7 +2849,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Yandex API Key"
|
description = "Yandex API Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:yandex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(AQVN[A-Za-z0-9_\-]{35,38})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"yandex",
|
"yandex",
|
||||||
@@ -2749,7 +2858,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Yandex AWS Access Token"
|
description = "Yandex AWS Access Token"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:yandex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(YC[a-zA-Z0-9_\-]{38})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"yandex",
|
"yandex",
|
||||||
@@ -2758,9 +2867,10 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Zendesk Secret Key"
|
description = "Zendesk Secret Key"
|
||||||
id = "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|;]|$)'''
|
regex = '''(?i)(?:zendesk)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{40})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
keywords = [
|
keywords = [
|
||||||
"zendesk",
|
"zendesk",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
+1
-1
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
func IsNew(finding report.Finding, baseline []report.Finding) bool {
|
func IsNew(finding report.Finding, baseline []report.Finding) bool {
|
||||||
// Explicitly testing each property as it gives significantly better performance in comparison to cmp.Equal(). Drawback is that
|
// Explicitly testing each property as it gives significantly better performance in comparison to cmp.Equal(). Drawback is that
|
||||||
// the code requires maintanance if/when the Finding struct changes
|
// the code requires maintenance if/when the Finding struct changes
|
||||||
for _, b := range baseline {
|
for _, b := range baseline {
|
||||||
|
|
||||||
if finding.Author == b.Author &&
|
if finding.Author == b.Author &&
|
||||||
|
|||||||
+67
-16
@@ -57,6 +57,9 @@ type Detector struct {
|
|||||||
// followSymlinks is a flag to enable scanning symlink files
|
// followSymlinks is a flag to enable scanning symlink files
|
||||||
FollowSymlinks bool
|
FollowSymlinks bool
|
||||||
|
|
||||||
|
// NoColor is a flag to disable color output
|
||||||
|
NoColor bool
|
||||||
|
|
||||||
// commitMap is used to keep track of commits that have been scanned.
|
// commitMap is used to keep track of commits that have been scanned.
|
||||||
// This is only used for logging purposes and git scans.
|
// This is only used for logging purposes and git scans.
|
||||||
commitMap map[string]bool
|
commitMap map[string]bool
|
||||||
@@ -144,14 +147,19 @@ func NewDetectorDefaultConfig() (*Detector, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Detector) AddGitleaksIgnore(gitleaksIgnorePath string) error {
|
func (d *Detector) AddGitleaksIgnore(gitleaksIgnorePath string) error {
|
||||||
log.Debug().Msg("found .gitleaksignore file")
|
log.Debug().Msgf("found .gitleaksignore file: %s", gitleaksIgnorePath)
|
||||||
file, err := os.Open(gitleaksIgnorePath)
|
file, err := os.Open(gitleaksIgnorePath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer file.Close()
|
// https://github.com/securego/gosec/issues/512
|
||||||
|
defer func() {
|
||||||
|
if err := file.Close(); err != nil {
|
||||||
|
log.Warn().Msgf("Error closing .gitleaksignore file: %s\n", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
scanner := bufio.NewScanner(file)
|
scanner := bufio.NewScanner(file)
|
||||||
|
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
@@ -160,14 +168,33 @@ func (d *Detector) AddGitleaksIgnore(gitleaksIgnorePath string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Detector) AddBaseline(baselinePath string) error {
|
func (d *Detector) AddBaseline(baselinePath string, source string) error {
|
||||||
if baselinePath != "" {
|
if baselinePath != "" {
|
||||||
|
absoluteSource, err := filepath.Abs(source)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
absoluteBaseline, err := filepath.Abs(baselinePath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
relativeBaseline, err := filepath.Rel(absoluteSource, absoluteBaseline)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
baseline, err := LoadBaseline(baselinePath)
|
baseline, err := LoadBaseline(baselinePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
d.baseline = baseline
|
d.baseline = baseline
|
||||||
|
baselinePath = relativeBaseline
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d.baselinePath = baselinePath
|
d.baselinePath = baselinePath
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -265,12 +292,6 @@ func (d *Detector) detectRule(fragment Fragment, rule config.Rule) []report.Find
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the secret is in the allowlist
|
|
||||||
if rule.Allowlist.RegexAllowed(finding.Secret) ||
|
|
||||||
d.Config.Allowlist.RegexAllowed(finding.Secret) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// extract secret from secret group if set
|
// extract secret from secret group if set
|
||||||
if rule.SecretGroup != 0 {
|
if rule.SecretGroup != 0 {
|
||||||
groups := rule.Regex.FindStringSubmatch(secret)
|
groups := rule.Regex.FindStringSubmatch(secret)
|
||||||
@@ -282,6 +303,27 @@ func (d *Detector) detectRule(fragment Fragment, rule config.Rule) []report.Find
|
|||||||
finding.Secret = secret
|
finding.Secret = secret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if the regexTarget is defined in the allowlist "regexes" entry
|
||||||
|
allowlistTarget := finding.Secret
|
||||||
|
switch rule.Allowlist.RegexTarget {
|
||||||
|
case "match":
|
||||||
|
allowlistTarget = finding.Match
|
||||||
|
case "line":
|
||||||
|
allowlistTarget = finding.Line
|
||||||
|
}
|
||||||
|
|
||||||
|
globalAllowlistTarget := finding.Secret
|
||||||
|
switch d.Config.Allowlist.RegexTarget {
|
||||||
|
case "match":
|
||||||
|
globalAllowlistTarget = finding.Match
|
||||||
|
case "line":
|
||||||
|
globalAllowlistTarget = finding.Line
|
||||||
|
}
|
||||||
|
if rule.Allowlist.RegexAllowed(allowlistTarget) ||
|
||||||
|
d.Config.Allowlist.RegexAllowed(globalAllowlistTarget) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// check if the secret is in the list of stopwords
|
// check if the secret is in the list of stopwords
|
||||||
if rule.Allowlist.ContainsStopWord(finding.Secret) ||
|
if rule.Allowlist.ContainsStopWord(finding.Secret) ||
|
||||||
d.Config.Allowlist.ContainsStopWord(finding.Secret) {
|
d.Config.Allowlist.ContainsStopWord(finding.Secret) {
|
||||||
@@ -502,7 +544,7 @@ func (d *Detector) DetectReader(r io.Reader, bufSize int) ([]report.Finding, err
|
|||||||
for _, finding := range d.Detect(fragment) {
|
for _, finding := range d.Detect(fragment) {
|
||||||
findings = append(findings, finding)
|
findings = append(findings, finding)
|
||||||
if d.Verbose {
|
if d.Verbose {
|
||||||
printFinding(finding)
|
printFinding(finding, d.NoColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -556,16 +598,25 @@ func (d *Detector) Detect(fragment Fragment) []report.Finding {
|
|||||||
|
|
||||||
// addFinding synchronously adds a finding to the findings slice
|
// addFinding synchronously adds a finding to the findings slice
|
||||||
func (d *Detector) addFinding(finding report.Finding) {
|
func (d *Detector) addFinding(finding report.Finding) {
|
||||||
if finding.Commit == "" {
|
globalFingerprint := fmt.Sprintf("%s:%s:%d", finding.File, finding.RuleID, finding.StartLine)
|
||||||
finding.Fingerprint = fmt.Sprintf("%s:%s:%d", finding.File, finding.RuleID, finding.StartLine)
|
if finding.Commit != "" {
|
||||||
} else {
|
|
||||||
finding.Fingerprint = fmt.Sprintf("%s:%s:%s:%d", finding.Commit, finding.File, finding.RuleID, finding.StartLine)
|
finding.Fingerprint = fmt.Sprintf("%s:%s:%s:%d", finding.Commit, finding.File, finding.RuleID, finding.StartLine)
|
||||||
|
} else {
|
||||||
|
finding.Fingerprint = globalFingerprint
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if we should ignore this finding
|
// check if we should ignore this finding
|
||||||
if _, ok := d.gitleaksIgnore[finding.Fingerprint]; ok {
|
if _, ok := d.gitleaksIgnore[globalFingerprint]; ok {
|
||||||
log.Debug().Msgf("ignoring finding with Fingerprint %s",
|
log.Debug().Msgf("ignoring finding with global Fingerprint %s",
|
||||||
finding.Fingerprint)
|
finding.Fingerprint)
|
||||||
return
|
return
|
||||||
|
} else if finding.Commit != "" {
|
||||||
|
// Awkward nested if because I'm not sure how to chain these two conditions.
|
||||||
|
if _, ok := d.gitleaksIgnore[finding.Fingerprint]; ok {
|
||||||
|
log.Debug().Msgf("ignoring finding with Fingerprint %s",
|
||||||
|
finding.Fingerprint)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.baseline != nil && !IsNew(finding, d.baseline) {
|
if d.baseline != nil && !IsNew(finding, d.baseline) {
|
||||||
@@ -576,7 +627,7 @@ func (d *Detector) addFinding(finding report.Finding) {
|
|||||||
d.findingMutex.Lock()
|
d.findingMutex.Lock()
|
||||||
d.findings = append(d.findings, finding)
|
d.findings = append(d.findings, finding)
|
||||||
if d.Verbose {
|
if d.Verbose {
|
||||||
printFinding(finding)
|
printFinding(finding, d.NoColor)
|
||||||
}
|
}
|
||||||
d.findingMutex.Unlock()
|
d.findingMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|||||||
+134
-3
@@ -6,6 +6,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
@@ -18,11 +19,12 @@ const repoBasePath = "../testdata/repos/"
|
|||||||
|
|
||||||
func TestDetect(t *testing.T) {
|
func TestDetect(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
cfgName string
|
cfgName string
|
||||||
fragment Fragment
|
baselinePath string
|
||||||
|
fragment Fragment
|
||||||
// NOTE: for expected findings, all line numbers will be 0
|
// NOTE: for expected findings, all line numbers will be 0
|
||||||
// because line deltas are added _after_ the finding is created.
|
// because line deltas are added _after_ the finding is created.
|
||||||
// I.e, if the finding is from a --no-git file, the line number will be
|
// I.e., if the finding is from a --no-git file, the line number will be
|
||||||
// increase by 1 in DetectFromFiles(). If the finding is from git,
|
// increase by 1 in DetectFromFiles(). If the finding is from git,
|
||||||
// the line number will be increased by the patch delta.
|
// the line number will be increased by the patch delta.
|
||||||
expectedFindings []report.Finding
|
expectedFindings []report.Finding
|
||||||
@@ -318,6 +320,15 @@ func TestDetect(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedFindings: []report.Finding{},
|
expectedFindings: []report.Finding{},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cfgName: "path_only",
|
||||||
|
baselinePath: ".baseline.json",
|
||||||
|
fragment: Fragment{
|
||||||
|
Raw: `const Discord_Public_Key = "e7322523fb86ed64c836a979cf8465fbd436378c653c1db38f9ae87bc62a6fd5"`,
|
||||||
|
FilePath: ".baseline.json",
|
||||||
|
},
|
||||||
|
expectedFindings: []report.Finding{},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
@@ -344,6 +355,7 @@ func TestDetect(t *testing.T) {
|
|||||||
assert.Equal(t, tt.wantError, err)
|
assert.Equal(t, tt.wantError, err)
|
||||||
}
|
}
|
||||||
d := NewDetector(cfg)
|
d := NewDetector(cfg)
|
||||||
|
d.baselinePath = tt.baselinePath
|
||||||
|
|
||||||
findings := d.Detect(tt.fragment)
|
findings := d.Detect(tt.fragment)
|
||||||
assert.ElementsMatch(t, tt.expectedFindings, findings)
|
assert.ElementsMatch(t, tt.expectedFindings, findings)
|
||||||
@@ -463,6 +475,22 @@ func TestFromGit(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
detector := NewDetector(cfg)
|
detector := NewDetector(cfg)
|
||||||
|
|
||||||
|
var ignorePath string
|
||||||
|
info, err := os.Stat(tt.source)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
|
||||||
|
if info.IsDir() {
|
||||||
|
ignorePath = filepath.Join(tt.source, ".gitleaksignore")
|
||||||
|
} else {
|
||||||
|
ignorePath = filepath.Join(filepath.Dir(tt.source), ".gitleaksignore")
|
||||||
|
}
|
||||||
|
if err = detector.AddGitleaksIgnore(ignorePath); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
|
||||||
findings, err := detector.DetectGit(tt.source, tt.logOpts, DetectType)
|
findings, err := detector.DetectGit(tt.source, tt.logOpts, DetectType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
@@ -474,6 +502,89 @@ func TestFromGit(t *testing.T) {
|
|||||||
assert.ElementsMatch(t, tt.expectedFindings, findings)
|
assert.ElementsMatch(t, tt.expectedFindings, findings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func TestFromGitStaged(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
cfgName string
|
||||||
|
source string
|
||||||
|
logOpts string
|
||||||
|
expectedFindings []report.Finding
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
source: filepath.Join(repoBasePath, "staged"),
|
||||||
|
cfgName: "simple",
|
||||||
|
expectedFindings: []report.Finding{
|
||||||
|
{
|
||||||
|
Description: "AWS Access Key",
|
||||||
|
StartLine: 7,
|
||||||
|
EndLine: 7,
|
||||||
|
StartColumn: 18,
|
||||||
|
EndColumn: 37,
|
||||||
|
Line: "\n\taws_token2 := \"AKIALALEMEL33243OLIA\" // this one is not",
|
||||||
|
Match: "AKIALALEMEL33243OLIA",
|
||||||
|
Secret: "AKIALALEMEL33243OLIA",
|
||||||
|
File: "api/api.go",
|
||||||
|
SymlinkFile: "",
|
||||||
|
Commit: "",
|
||||||
|
Entropy: 3.0841837,
|
||||||
|
Author: "",
|
||||||
|
Email: "",
|
||||||
|
Date: "0001-01-01T00:00:00Z",
|
||||||
|
Message: "",
|
||||||
|
Tags: []string{
|
||||||
|
"key",
|
||||||
|
"AWS",
|
||||||
|
},
|
||||||
|
RuleID: "aws-access-key",
|
||||||
|
Fingerprint: "api/api.go:aws-access-key:7",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if err := moveDotGit(".git", "dotGit"); err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
|
||||||
|
viper.AddConfigPath(configPath)
|
||||||
|
viper.SetConfigName("simple")
|
||||||
|
viper.SetConfigType("toml")
|
||||||
|
err = viper.ReadInConfig()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var vc config.ViperConfig
|
||||||
|
err = viper.Unmarshal(&vc)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
cfg, err := vc.Translate()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
detector := NewDetector(cfg)
|
||||||
|
if err = detector.AddGitleaksIgnore(filepath.Join(tt.source, ".gitleaksignore")); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
findings, err := detector.DetectGit(tt.source, tt.logOpts, ProtectStagedType)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, f := range findings {
|
||||||
|
f.Match = "" // remove lines cause copying and pasting them has some wack formatting
|
||||||
|
}
|
||||||
|
assert.ElementsMatch(t, tt.expectedFindings, findings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TestFromFiles tests the FromFiles function
|
// TestFromFiles tests the FromFiles function
|
||||||
func TestFromFiles(t *testing.T) {
|
func TestFromFiles(t *testing.T) {
|
||||||
@@ -525,6 +636,11 @@ func TestFromFiles(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
source: filepath.Join(repoBasePath, "nogit", "api.go"),
|
||||||
|
cfgName: "simple",
|
||||||
|
expectedFindings: []report.Finding{},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
@@ -543,6 +659,21 @@ func TestFromFiles(t *testing.T) {
|
|||||||
}
|
}
|
||||||
cfg, _ := vc.Translate()
|
cfg, _ := vc.Translate()
|
||||||
detector := NewDetector(cfg)
|
detector := NewDetector(cfg)
|
||||||
|
|
||||||
|
var ignorePath string
|
||||||
|
info, err := os.Stat(tt.source)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
|
|
||||||
|
if info.IsDir() {
|
||||||
|
ignorePath = filepath.Join(tt.source, ".gitleaksignore")
|
||||||
|
} else {
|
||||||
|
ignorePath = filepath.Join(filepath.Dir(tt.source), ".gitleaksignore")
|
||||||
|
}
|
||||||
|
if err = detector.AddGitleaksIgnore(ignorePath); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("could not call AddGitleaksIgnore")
|
||||||
|
}
|
||||||
detector.FollowSymlinks = true
|
detector.FollowSymlinks = true
|
||||||
findings, err := detector.DetectFiles(tt.source)
|
findings, err := detector.DetectFiles(tt.source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+17
-1
@@ -5,6 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -16,12 +17,27 @@ var ErrEncountered bool
|
|||||||
|
|
||||||
// GitLog returns a channel of gitdiff.File objects from the
|
// GitLog returns a channel of gitdiff.File objects from the
|
||||||
// git log -p command for the given source.
|
// git log -p command for the given source.
|
||||||
|
var quotedOptPattern = regexp.MustCompile(`^(?:"[^"]+"|'[^']+')$`)
|
||||||
func GitLog(source string, logOpts string) (<-chan *gitdiff.File, error) {
|
func GitLog(source string, logOpts string) (<-chan *gitdiff.File, error) {
|
||||||
sourceClean := filepath.Clean(source)
|
sourceClean := filepath.Clean(source)
|
||||||
var cmd *exec.Cmd
|
var cmd *exec.Cmd
|
||||||
if logOpts != "" {
|
if logOpts != "" {
|
||||||
args := []string{"-C", sourceClean, "log", "-p", "-U0"}
|
args := []string{"-C", sourceClean, "log", "-p", "-U0"}
|
||||||
args = append(args, strings.Split(logOpts, " ")...)
|
|
||||||
|
// Ensure that the user-provided |logOpts| aren't wrapped in quotes.
|
||||||
|
// https://github.com/gitleaks/gitleaks/issues/1153
|
||||||
|
userArgs := strings.Split(logOpts, " ")
|
||||||
|
var quotedOpts []string
|
||||||
|
for _, element := range userArgs {
|
||||||
|
if quotedOptPattern.MatchString(element) {
|
||||||
|
quotedOpts = append(quotedOpts, element)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(quotedOpts) > 0 {
|
||||||
|
log.Warn().Msgf("the following `--log-opts` values may not work as expected: %v\n\tsee https://github.com/gitleaks/gitleaks/issues/1153 for more information", quotedOpts)
|
||||||
|
}
|
||||||
|
|
||||||
|
args = append(args, userArgs...)
|
||||||
cmd = exec.Command("git", args...)
|
cmd = exec.Command("git", args...)
|
||||||
} else {
|
} else {
|
||||||
cmd = exec.Command("git", "-C", sourceClean, "log", "-p", "-U0",
|
cmd = exec.Command("git", "-C", sourceClean, "log", "-p", "-U0",
|
||||||
|
|||||||
+54
-27
@@ -74,7 +74,7 @@ func filter(findings []report.Finding, redact bool) []report.Finding {
|
|||||||
|
|
||||||
genericMatch := strings.Replace(f.Match, f.Secret, "REDACTED", -1)
|
genericMatch := strings.Replace(f.Match, f.Secret, "REDACTED", -1)
|
||||||
betterMatch := strings.Replace(fPrime.Match, fPrime.Secret, "REDACTED", -1)
|
betterMatch := strings.Replace(fPrime.Match, fPrime.Secret, "REDACTED", -1)
|
||||||
log.Trace().Msgf("skipping %s finding (%s), %s rule takes precendence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch)
|
log.Trace().Msgf("skipping %s finding (%s), %s rule takes precedence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch)
|
||||||
include = false
|
include = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -91,44 +91,71 @@ func filter(findings []report.Finding, redact bool) []report.Finding {
|
|||||||
return retFindings
|
return retFindings
|
||||||
}
|
}
|
||||||
|
|
||||||
func printFinding(f report.Finding) {
|
func printFinding(f report.Finding, noColor bool) {
|
||||||
// trim all whitespace and tabs from the line
|
// trim all whitespace and tabs
|
||||||
f.Line = strings.TrimSpace(f.Line)
|
f.Line = strings.TrimSpace(f.Line)
|
||||||
// trim all whitespace and tabs from the secret
|
|
||||||
f.Secret = strings.TrimSpace(f.Secret)
|
f.Secret = strings.TrimSpace(f.Secret)
|
||||||
// trim all whitespace and tabs from the match
|
|
||||||
f.Match = strings.TrimSpace(f.Match)
|
f.Match = strings.TrimSpace(f.Match)
|
||||||
|
|
||||||
matchInLineIDX := strings.Index(f.Line, f.Match)
|
isFileMatch := strings.HasPrefix(f.Match, "file detected:")
|
||||||
secretInMatchIdx := strings.Index(f.Match, f.Secret)
|
skipColor := noColor
|
||||||
|
finding := ""
|
||||||
|
var secret lipgloss.Style
|
||||||
|
|
||||||
start := f.Line[0:matchInLineIDX]
|
// Matches from filenames do not have a |line| or |secret|
|
||||||
startMatchIdx := 0
|
if !isFileMatch {
|
||||||
if matchInLineIDX > 20 {
|
matchInLineIDX := strings.Index(f.Line, f.Match)
|
||||||
startMatchIdx = matchInLineIDX - 20
|
secretInMatchIdx := strings.Index(f.Match, f.Secret)
|
||||||
start = "..." + f.Line[startMatchIdx:matchInLineIDX]
|
|
||||||
}
|
|
||||||
|
|
||||||
matchBeginning := lipgloss.NewStyle().SetString(f.Match[0:secretInMatchIdx]).Foreground(lipgloss.Color("#f5d445"))
|
skipColor = false
|
||||||
secret := lipgloss.NewStyle().SetString(f.Secret).
|
|
||||||
Bold(true).
|
if matchInLineIDX == -1 || noColor {
|
||||||
Italic(true).
|
skipColor = true
|
||||||
Foreground(lipgloss.Color("#f05c07"))
|
matchInLineIDX = 0
|
||||||
matchEnd := lipgloss.NewStyle().SetString(f.Match[secretInMatchIdx+len(f.Secret):]).Foreground(lipgloss.Color("#f5d445"))
|
}
|
||||||
lineEnd := f.Line[matchInLineIDX+len(f.Match):]
|
|
||||||
if len(f.Secret) > 100 {
|
start := f.Line[0:matchInLineIDX]
|
||||||
secret = lipgloss.NewStyle().SetString(f.Secret[0:100] + "...").
|
startMatchIdx := 0
|
||||||
|
if matchInLineIDX > 20 {
|
||||||
|
startMatchIdx = matchInLineIDX - 20
|
||||||
|
start = "..." + f.Line[startMatchIdx:matchInLineIDX]
|
||||||
|
}
|
||||||
|
|
||||||
|
matchBeginning := lipgloss.NewStyle().SetString(f.Match[0:secretInMatchIdx]).Foreground(lipgloss.Color("#f5d445"))
|
||||||
|
secret = lipgloss.NewStyle().SetString(f.Secret).
|
||||||
Bold(true).
|
Bold(true).
|
||||||
Italic(true).
|
Italic(true).
|
||||||
Foreground(lipgloss.Color("#f05c07"))
|
Foreground(lipgloss.Color("#f05c07"))
|
||||||
|
matchEnd := lipgloss.NewStyle().SetString(f.Match[secretInMatchIdx+len(f.Secret):]).Foreground(lipgloss.Color("#f5d445"))
|
||||||
|
|
||||||
|
lineEndIdx := matchInLineIDX + len(f.Match)
|
||||||
|
if len(f.Line)-1 <= lineEndIdx {
|
||||||
|
lineEndIdx = len(f.Line) - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
lineEnd := f.Line[lineEndIdx:]
|
||||||
|
|
||||||
|
if len(f.Secret) > 100 {
|
||||||
|
secret = lipgloss.NewStyle().SetString(f.Secret[0:100] + "...").
|
||||||
|
Bold(true).
|
||||||
|
Italic(true).
|
||||||
|
Foreground(lipgloss.Color("#f05c07"))
|
||||||
|
}
|
||||||
|
if len(lineEnd) > 20 {
|
||||||
|
lineEnd = lineEnd[0:20] + "..."
|
||||||
|
}
|
||||||
|
|
||||||
|
finding = fmt.Sprintf("%s%s%s%s%s\n", strings.TrimPrefix(strings.TrimLeft(start, " "), "\n"), matchBeginning, secret, matchEnd, lineEnd)
|
||||||
}
|
}
|
||||||
if len(lineEnd) > 20 {
|
|
||||||
lineEnd = lineEnd[0:20] + "..."
|
if skipColor || isFileMatch {
|
||||||
|
fmt.Printf("%-12s %s\n", "Finding:", f.Match)
|
||||||
|
fmt.Printf("%-12s %s\n", "Secret:", f.Secret)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("%-12s %s", "Finding:", finding)
|
||||||
|
fmt.Printf("%-12s %s\n", "Secret:", secret)
|
||||||
}
|
}
|
||||||
|
|
||||||
finding := fmt.Sprintf("%s%s%s%s%s\n", strings.TrimPrefix(strings.TrimLeft(start, " "), "\n"), matchBeginning, secret, matchEnd, lineEnd)
|
|
||||||
fmt.Printf("%-12s %s", "Finding:", finding)
|
|
||||||
fmt.Printf("%-12s %s\n", "Secret:", secret)
|
|
||||||
fmt.Printf("%-12s %s\n", "RuleID:", f.RuleID)
|
fmt.Printf("%-12s %s\n", "RuleID:", f.RuleID)
|
||||||
fmt.Printf("%-12s %f\n", "Entropy:", f.Entropy)
|
fmt.Printf("%-12s %f\n", "Entropy:", f.Entropy)
|
||||||
if f.File == "" {
|
if f.File == "" {
|
||||||
|
|||||||
@@ -14,11 +14,12 @@ require (
|
|||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||||
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 // indirect
|
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 // indirect
|
||||||
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0 // indirect
|
github.com/muesli/termenv v0.15.1 // indirect
|
||||||
github.com/rivo/uniseg v0.2.0 // indirect
|
github.com/rivo/uniseg v0.2.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ require (
|
|||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/subosito/gotenv v1.2.0 // indirect
|
github.com/subosito/gotenv v1.2.0 // indirect
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||||
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08 // indirect
|
golang.org/x/sys v0.6.0 // indirect
|
||||||
golang.org/x/text v0.3.6 // indirect
|
golang.org/x/text v0.3.6 // indirect
|
||||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
|
|||||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||||
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||||
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
@@ -195,9 +197,13 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO
|
|||||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
||||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||||
|
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
||||||
|
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||||
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
||||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
|
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||||
|
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
@@ -215,6 +221,8 @@ github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 h1:y1p/ycavWjGT9Fn
|
|||||||
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ=
|
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ=
|
||||||
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0 h1:STjmj0uFfRryL9fzRA/OupNppeAID6QJYPMavTL7jtY=
|
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0 h1:STjmj0uFfRryL9fzRA/OupNppeAID6QJYPMavTL7jtY=
|
||||||
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs=
|
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs=
|
||||||
|
github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs=
|
||||||
|
github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ=
|
||||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
||||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||||
@@ -434,6 +442,9 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08 h1:WecRHqgE09JBkh/584XIE6PMz5KKE/vER4izNUi30AQ=
|
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08 h1:WecRHqgE09JBkh/584XIE6PMz5KKE/vER4izNUi30AQ=
|
||||||
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||||
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/csv"
|
"encoding/csv"
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// writeCsv writes the list of findings to a writeCloser.
|
// writeCsv writes the list of findings to a writeCloser.
|
||||||
@@ -28,6 +29,7 @@ func writeCsv(f []Finding, w io.WriteCloser) error {
|
|||||||
"Date",
|
"Date",
|
||||||
"Email",
|
"Email",
|
||||||
"Fingerprint",
|
"Fingerprint",
|
||||||
|
"Tags",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -48,6 +50,7 @@ func writeCsv(f []Finding, w io.WriteCloser) error {
|
|||||||
f.Date,
|
f.Date,
|
||||||
f.Email,
|
f.Email,
|
||||||
f.Fingerprint,
|
f.Fingerprint,
|
||||||
|
strings.Join(f.Tags, " "),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
+4
-9
@@ -1,6 +1,7 @@
|
|||||||
package report
|
package report
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -34,6 +35,7 @@ func TestWriteCSV(t *testing.T) {
|
|||||||
Email: "johndoe@gmail.com",
|
Email: "johndoe@gmail.com",
|
||||||
Date: "10-19-2003",
|
Date: "10-19-2003",
|
||||||
Fingerprint: "fingerprint",
|
Fingerprint: "fingerprint",
|
||||||
|
Tags: []string{"tag1", "tag2", "tag3"},
|
||||||
},
|
},
|
||||||
}},
|
}},
|
||||||
{
|
{
|
||||||
@@ -45,42 +47,35 @@ func TestWriteCSV(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
tmpfile, err := os.Create(filepath.Join(tmpPath, test.testReportName+".csv"))
|
tmpfile, err := os.Create(filepath.Join(t.TempDir(), test.testReportName+".csv"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
err = writeCsv(test.findings, tmpfile)
|
err = writeCsv(test.findings, tmpfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
got, err := os.ReadFile(tmpfile.Name())
|
got, err := os.ReadFile(tmpfile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
if test.wantEmpty {
|
if test.wantEmpty {
|
||||||
if len(got) > 0 {
|
if len(got) > 0 {
|
||||||
t.Errorf("Expected empty file, got %s", got)
|
t.Errorf("Expected empty file, got %s", got)
|
||||||
}
|
}
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
want, err := os.ReadFile(test.expected)
|
want, err := os.ReadFile(test.expected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(got) != string(want) {
|
if !bytes.Equal(got, want) {
|
||||||
err = os.WriteFile(strings.Replace(test.expected, ".csv", ".got.csv", 1), got, 0644)
|
err = os.WriteFile(strings.Replace(test.expected, ".csv", ".got.csv", 1), got, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
t.Errorf("got %s, want %s", string(got), string(want))
|
t.Errorf("got %s, want %s", string(got), string(want))
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -38,7 +38,7 @@ type Finding struct {
|
|||||||
// Rule is the name of the rule that was matched
|
// Rule is the name of the rule that was matched
|
||||||
RuleID string
|
RuleID string
|
||||||
|
|
||||||
// unique identifer
|
// unique identifier
|
||||||
Fingerprint string
|
Fingerprint string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ func writeJson(findings []Finding, w io.WriteCloser) error {
|
|||||||
if len(findings) == 0 {
|
if len(findings) == 0 {
|
||||||
findings = []Finding{}
|
findings = []Finding{}
|
||||||
}
|
}
|
||||||
|
defer w.Close()
|
||||||
|
|
||||||
encoder := json.NewEncoder(w)
|
encoder := json.NewEncoder(w)
|
||||||
encoder.SetIndent("", " ")
|
encoder.SetIndent("", " ")
|
||||||
return encoder.Encode(findings)
|
return encoder.Encode(findings)
|
||||||
|
|||||||
+3
-11
@@ -1,6 +1,7 @@
|
|||||||
package report
|
package report
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -46,44 +47,35 @@ func TestWriteJSON(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
// create tmp file using os.TempDir()
|
tmpfile, err := os.Create(filepath.Join(t.TempDir(), test.testReportName+".json"))
|
||||||
tmpfile, err := os.Create(filepath.Join(tmpPath, test.testReportName+".json"))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
err = writeJson(test.findings, tmpfile)
|
err = writeJson(test.findings, tmpfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
got, err := os.ReadFile(tmpfile.Name())
|
got, err := os.ReadFile(tmpfile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
if test.wantEmpty {
|
if test.wantEmpty {
|
||||||
if len(got) > 0 {
|
if len(got) > 0 {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Errorf("Expected empty file, got %s", got)
|
t.Errorf("Expected empty file, got %s", got)
|
||||||
}
|
}
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
want, err := os.ReadFile(test.expected)
|
want, err := os.ReadFile(test.expected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(got) != string(want) {
|
if !bytes.Equal(got, want) {
|
||||||
err = os.WriteFile(strings.Replace(test.expected, ".json", ".got.json", 1), got, 0644)
|
err = os.WriteFile(strings.Replace(test.expected, ".json", ".got.json", 1), got, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
t.Errorf("got %s, want %s", string(got), string(want))
|
t.Errorf("got %s, want %s", string(got), string(want))
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+102
@@ -0,0 +1,102 @@
|
|||||||
|
package report
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"encoding/xml"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
func writeJunit(findings []Finding, w io.WriteCloser) error {
|
||||||
|
testSuites := TestSuites{
|
||||||
|
TestSuites: getTestSuites(findings),
|
||||||
|
}
|
||||||
|
|
||||||
|
io.WriteString(w, xml.Header)
|
||||||
|
encoder := xml.NewEncoder(w)
|
||||||
|
encoder.Indent("", "\t")
|
||||||
|
return encoder.Encode(testSuites)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTestSuites(findings []Finding) []TestSuite {
|
||||||
|
return []TestSuite{
|
||||||
|
{
|
||||||
|
Failures: strconv.Itoa(len(findings)),
|
||||||
|
Name: "gitleaks",
|
||||||
|
Tests: strconv.Itoa(len(findings)),
|
||||||
|
TestCases: getTestCases(findings),
|
||||||
|
Time: "",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTestCases(findings []Finding) []TestCase {
|
||||||
|
testCases := []TestCase{}
|
||||||
|
for _, f := range findings {
|
||||||
|
testCase := TestCase{
|
||||||
|
Classname: f.Description,
|
||||||
|
Failure: getFailure(f),
|
||||||
|
File: f.File,
|
||||||
|
Name: getMessage(f),
|
||||||
|
Time: "",
|
||||||
|
}
|
||||||
|
testCases = append(testCases, testCase)
|
||||||
|
}
|
||||||
|
return testCases
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFailure(f Finding) Failure {
|
||||||
|
return Failure{
|
||||||
|
Data: getData(f),
|
||||||
|
Message: getMessage(f),
|
||||||
|
Type: f.Description,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func getData(f Finding) string {
|
||||||
|
data, err := json.MarshalIndent(f, "", "\t")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return string(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getMessage(f Finding) string {
|
||||||
|
if f.Commit == "" {
|
||||||
|
return fmt.Sprintf("%s has detected a secret in file %s, line %s.", f.RuleID, f.File, strconv.Itoa(f.StartLine))
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("%s has detected a secret in file %s, line %s, at commit %s.", f.RuleID, f.File, strconv.Itoa(f.StartLine), f.Commit)
|
||||||
|
}
|
||||||
|
|
||||||
|
type TestSuites struct {
|
||||||
|
XMLName xml.Name `xml:"testsuites"`
|
||||||
|
TestSuites []TestSuite
|
||||||
|
}
|
||||||
|
|
||||||
|
type TestSuite struct {
|
||||||
|
XMLName xml.Name `xml:"testsuite"`
|
||||||
|
Failures string `xml:"failures,attr"`
|
||||||
|
Name string `xml:"name,attr"`
|
||||||
|
Tests string `xml:"tests,attr"`
|
||||||
|
TestCases []TestCase `xml:"testcase"`
|
||||||
|
Time string `xml:"time,attr"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type TestCase struct {
|
||||||
|
XMLName xml.Name `xml:"testcase"`
|
||||||
|
Classname string `xml:"classname,attr"`
|
||||||
|
Failure Failure `xml:"failure"`
|
||||||
|
File string `xml:"file,attr"`
|
||||||
|
Name string `xml:"name,attr"`
|
||||||
|
Time string `xml:"time,attr"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Failure struct {
|
||||||
|
XMLName xml.Name `xml:"failure"`
|
||||||
|
Data string `xml:",chardata"`
|
||||||
|
Message string `xml:"message,attr"`
|
||||||
|
Type string `xml:"type,attr"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package report
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestWriteJunit(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
findings []Finding
|
||||||
|
testReportName string
|
||||||
|
expected string
|
||||||
|
wantEmpty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
testReportName: "simple",
|
||||||
|
expected: filepath.Join(expectPath, "report", "junit_simple.xml"),
|
||||||
|
findings: []Finding{
|
||||||
|
{
|
||||||
|
|
||||||
|
Description: "Test Rule",
|
||||||
|
RuleID: "test-rule",
|
||||||
|
Match: "line containing secret",
|
||||||
|
Secret: "a secret",
|
||||||
|
StartLine: 1,
|
||||||
|
EndLine: 2,
|
||||||
|
StartColumn: 1,
|
||||||
|
EndColumn: 2,
|
||||||
|
Message: "opps",
|
||||||
|
File: "auth.py",
|
||||||
|
Commit: "0000000000000000",
|
||||||
|
Author: "John Doe",
|
||||||
|
Email: "johndoe@gmail.com",
|
||||||
|
Date: "10-19-2003",
|
||||||
|
Tags: []string{},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
|
||||||
|
Description: "Test Rule",
|
||||||
|
RuleID: "test-rule",
|
||||||
|
Match: "line containing secret",
|
||||||
|
Secret: "a secret",
|
||||||
|
StartLine: 2,
|
||||||
|
EndLine: 3,
|
||||||
|
StartColumn: 1,
|
||||||
|
EndColumn: 2,
|
||||||
|
Message: "",
|
||||||
|
File: "auth.py",
|
||||||
|
Commit: "",
|
||||||
|
Author: "",
|
||||||
|
Email: "",
|
||||||
|
Date: "",
|
||||||
|
Tags: []string{},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
testReportName: "empty",
|
||||||
|
expected: filepath.Join(expectPath, "report", "junit_empty.xml"),
|
||||||
|
findings: []Finding{},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
// create tmp file using os.TempDir()
|
||||||
|
tmpfile, err := os.Create(filepath.Join(t.TempDir(), test.testReportName+".xml"))
|
||||||
|
if err != nil {
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
err = writeJunit(test.findings, tmpfile)
|
||||||
|
if err != nil {
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
got, err := os.ReadFile(tmpfile.Name())
|
||||||
|
if err != nil {
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
if test.wantEmpty {
|
||||||
|
if len(got) > 0 {
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
t.Errorf("Expected empty file, got %s", got)
|
||||||
|
}
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
want, err := os.ReadFile(test.expected)
|
||||||
|
if err != nil {
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if string(got) != string(want) {
|
||||||
|
err = os.WriteFile(strings.Replace(test.expected, ".xml", ".got.xml", 1), got, 0644)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
t.Errorf("got %s, want %s", string(got), string(want))
|
||||||
|
}
|
||||||
|
|
||||||
|
os.Remove(tmpfile.Name())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,8 @@ func Write(findings []Finding, cfg config.Config, ext string, reportPath string)
|
|||||||
err = writeJson(findings, file)
|
err = writeJson(findings, file)
|
||||||
case ".csv", "csv":
|
case ".csv", "csv":
|
||||||
err = writeCsv(findings, file)
|
err = writeCsv(findings, file)
|
||||||
|
case ".xml", "junit":
|
||||||
|
err = writeJunit(findings, file)
|
||||||
case ".sarif", "sarif":
|
case ".sarif", "sarif":
|
||||||
err = writeSarif(cfg, findings, file)
|
err = writeSarif(cfg, findings, file)
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-6
@@ -11,7 +11,6 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
expectPath = "../testdata/expected/"
|
expectPath = "../testdata/expected/"
|
||||||
tmpPath = "../testdata/tmp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReport(t *testing.T) {
|
func TestReport(t *testing.T) {
|
||||||
@@ -69,6 +68,22 @@ func TestReport(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ext: ".xml",
|
||||||
|
findings: []Finding{
|
||||||
|
{
|
||||||
|
RuleID: "test-rule",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ext: "junit",
|
||||||
|
findings: []Finding{
|
||||||
|
{
|
||||||
|
RuleID: "test-rule",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// ext: "SARIF",
|
// ext: "SARIF",
|
||||||
// findings: []Finding{
|
// findings: []Finding{
|
||||||
@@ -80,22 +95,18 @@ func TestReport(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, test := range tests {
|
for i, test := range tests {
|
||||||
tmpfile, err := os.Create(filepath.Join(tmpPath, strconv.Itoa(i)+test.ext))
|
tmpfile, err := os.Create(filepath.Join(t.TempDir(), strconv.Itoa(i)+test.ext))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
err = Write(test.findings, config.Config{}, test.ext, tmpfile.Name())
|
err = Write(test.findings, config.Config{}, test.ext, tmpfile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
got, err := os.ReadFile(tmpfile.Name())
|
got, err := os.ReadFile(tmpfile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
|
|
||||||
if len(got) == 0 && !test.wantEmpty {
|
if len(got) == 0 && !test.wantEmpty {
|
||||||
t.Errorf("got empty file with extension " + test.ext)
|
t.Errorf("got empty file with extension " + test.ext)
|
||||||
|
|||||||
+12
-1
@@ -10,10 +10,11 @@ import (
|
|||||||
|
|
||||||
func writeSarif(cfg config.Config, findings []Finding, w io.WriteCloser) error {
|
func writeSarif(cfg config.Config, findings []Finding, w io.WriteCloser) error {
|
||||||
sarif := Sarif{
|
sarif := Sarif{
|
||||||
Schema: "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
|
Schema: "https://json.schemastore.org/sarif-2.1.0.json",
|
||||||
Version: "2.1.0",
|
Version: "2.1.0",
|
||||||
Runs: getRuns(cfg, findings),
|
Runs: getRuns(cfg, findings),
|
||||||
}
|
}
|
||||||
|
defer w.Close()
|
||||||
|
|
||||||
encoder := json.NewEncoder(w)
|
encoder := json.NewEncoder(w)
|
||||||
encoder.SetIndent("", " ")
|
encoder.SetIndent("", " ")
|
||||||
@@ -34,6 +35,7 @@ func getTool(cfg config.Config) Tool {
|
|||||||
Driver: Driver{
|
Driver: Driver{
|
||||||
Name: driver,
|
Name: driver,
|
||||||
SemanticVersion: version,
|
SemanticVersion: version,
|
||||||
|
InformationUri: "https://github.com/gitleaks/gitleaks",
|
||||||
Rules: getRules(cfg),
|
Rules: getRules(cfg),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -102,6 +104,9 @@ func getResults(findings []Finding) []Results {
|
|||||||
Date: f.Date,
|
Date: f.Date,
|
||||||
Author: f.Author,
|
Author: f.Author,
|
||||||
},
|
},
|
||||||
|
Properties: Properties{
|
||||||
|
Tags: f.Tags,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
results = append(results, r)
|
results = append(results, r)
|
||||||
}
|
}
|
||||||
@@ -164,6 +169,7 @@ type Rules struct {
|
|||||||
type Driver struct {
|
type Driver struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
SemanticVersion string `json:"semanticVersion"`
|
SemanticVersion string `json:"semanticVersion"`
|
||||||
|
InformationUri string `json:"informationUri"`
|
||||||
Rules []Rules `json:"rules"`
|
Rules []Rules `json:"rules"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,11 +206,16 @@ type Locations struct {
|
|||||||
PhysicalLocation PhysicalLocation `json:"physicalLocation"`
|
PhysicalLocation PhysicalLocation `json:"physicalLocation"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Properties struct {
|
||||||
|
Tags []string `json:"tags"`
|
||||||
|
}
|
||||||
|
|
||||||
type Results struct {
|
type Results struct {
|
||||||
Message Message `json:"message"`
|
Message Message `json:"message"`
|
||||||
RuleId string `json:"ruleId"`
|
RuleId string `json:"ruleId"`
|
||||||
Locations []Locations `json:"locations"`
|
Locations []Locations `json:"locations"`
|
||||||
PartialFingerPrints `json:"partialFingerprints"`
|
PartialFingerPrints `json:"partialFingerprints"`
|
||||||
|
Properties Properties `json:"properties"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Runs struct {
|
type Runs struct {
|
||||||
|
|||||||
+4
-11
@@ -1,6 +1,7 @@
|
|||||||
package report
|
package report
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -42,16 +43,14 @@ func TestWriteSarif(t *testing.T) {
|
|||||||
Author: "John Doe",
|
Author: "John Doe",
|
||||||
Email: "johndoe@gmail.com",
|
Email: "johndoe@gmail.com",
|
||||||
Date: "10-19-2003",
|
Date: "10-19-2003",
|
||||||
Tags: []string{},
|
Tags: []string{"tag1", "tag2", "tag3"},
|
||||||
},
|
},
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
// create tmp file using os.TempDir()
|
tmpfile, err := os.Create(filepath.Join(t.TempDir(), test.testReportName+".json"))
|
||||||
tmpfile, err := os.Create(filepath.Join(tmpPath, test.testReportName+".json"))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
viper.Reset()
|
viper.Reset()
|
||||||
@@ -76,29 +75,24 @@ func TestWriteSarif(t *testing.T) {
|
|||||||
err = writeSarif(cfg, test.findings, tmpfile)
|
err = writeSarif(cfg, test.findings, tmpfile)
|
||||||
fmt.Println(cfg)
|
fmt.Println(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
got, err := os.ReadFile(tmpfile.Name())
|
got, err := os.ReadFile(tmpfile.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
if test.wantEmpty {
|
if test.wantEmpty {
|
||||||
if len(got) > 0 {
|
if len(got) > 0 {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Errorf("Expected empty file, got %s", got)
|
t.Errorf("Expected empty file, got %s", got)
|
||||||
}
|
}
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
want, err := os.ReadFile(test.expected)
|
want, err := os.ReadFile(test.expected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(got) != string(want) {
|
if !bytes.Equal(got, want) {
|
||||||
err = os.WriteFile(strings.Replace(test.expected, ".sarif", ".got.sarif", 1), got, 0644)
|
err = os.WriteFile(strings.Replace(test.expected, ".sarif", ".got.sarif", 1), got, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
@@ -106,6 +100,5 @@ func TestWriteSarif(t *testing.T) {
|
|||||||
t.Errorf("got %s, want %s", string(got), string(want))
|
t.Errorf("got %s, want %s", string(got), string(want))
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Remove(tmpfile.Name())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
|
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"runs": [
|
"runs": [
|
||||||
]
|
]
|
||||||
|
|||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
RuleID,Commit,File,SymlinkFile,Secret,Match,StartLine,EndLine,StartColumn,EndColumn,Author,Message,Date,Email,Fingerprint
|
RuleID,Commit,File,SymlinkFile,Secret,Match,StartLine,EndLine,StartColumn,EndColumn,Author,Message,Date,Email,Fingerprint,Tags
|
||||||
test-rule,0000000000000000,auth.py,,a secret,line containing secret,1,2,1,2,John Doe,opps,10-19-2003,johndoe@gmail.com,fingerprint
|
test-rule,0000000000000000,auth.py,,a secret,line containing secret,1,2,1,2,John Doe,opps,10-19-2003,johndoe@gmail.com,fingerprint,tag1 tag2 tag3
|
||||||
|
+4
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite failures="0" name="gitleaks" tests="0" time=""></testsuite>
|
||||||
|
</testsuites>
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite failures="2" name="gitleaks" tests="2" time="">
|
||||||
|
<testcase classname="Test Rule" file="auth.py" name="test-rule has detected a secret in file auth.py, line 1, at commit 0000000000000000." time="">
|
||||||
|
<failure message="test-rule has detected a secret in file auth.py, line 1, at commit 0000000000000000." type="Test Rule">{
	"Description": "Test Rule",
	"StartLine": 1,
	"EndLine": 2,
	"StartColumn": 1,
	"EndColumn": 2,
	"Match": "line containing secret",
	"Secret": "a secret",
	"File": "auth.py",
	"SymlinkFile": "",
	"Commit": "0000000000000000",
	"Entropy": 0,
	"Author": "John Doe",
	"Email": "johndoe@gmail.com",
	"Date": "10-19-2003",
	"Message": "opps",
	"Tags": [],
	"RuleID": "test-rule",
	"Fingerprint": ""
}</failure>
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="Test Rule" file="auth.py" name="test-rule has detected a secret in file auth.py, line 2." time="">
|
||||||
|
<failure message="test-rule has detected a secret in file auth.py, line 2." type="Test Rule">{
	"Description": "Test Rule",
	"StartLine": 2,
	"EndLine": 3,
	"StartColumn": 1,
	"EndColumn": 2,
	"Match": "line containing secret",
	"Secret": "a secret",
	"File": "auth.py",
	"SymlinkFile": "",
	"Commit": "",
	"Entropy": 0,
	"Author": "",
	"Email": "",
	"Date": "",
	"Message": "",
	"Tags": [],
	"RuleID": "test-rule",
	"Fingerprint": ""
}</failure>
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
+9
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
|
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"runs": [
|
"runs": [
|
||||||
{
|
{
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
"driver": {
|
"driver": {
|
||||||
"name": "gitleaks",
|
"name": "gitleaks",
|
||||||
"semanticVersion": "v8.0.0",
|
"semanticVersion": "v8.0.0",
|
||||||
|
"informationUri": "https://github.com/gitleaks/gitleaks",
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"id": "aws-access-key",
|
"id": "aws-access-key",
|
||||||
@@ -293,6 +294,13 @@
|
|||||||
"author": "John Doe",
|
"author": "John Doe",
|
||||||
"date": "10-19-2003",
|
"date": "10-19-2003",
|
||||||
"commitMessage": "opps"
|
"commitMessage": "opps"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"tags": [
|
||||||
|
"tag1",
|
||||||
|
"tag2",
|
||||||
|
"tag3"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
../testdata/repos/nogit/api.go:aws-access-key:20
|
||||||
Vendored
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
var a = "initial"
|
||||||
|
fmt.Println(a)
|
||||||
|
|
||||||
|
var b, c int = 1, 2
|
||||||
|
fmt.Println(b, c)
|
||||||
|
|
||||||
|
var d = true
|
||||||
|
fmt.Println(d)
|
||||||
|
|
||||||
|
var e int
|
||||||
|
fmt.Println(e)
|
||||||
|
|
||||||
|
// opps I added a secret at line 20
|
||||||
|
awsToken := "AKIALALEMEL33243OLIA"
|
||||||
|
|
||||||
|
f := "apple"
|
||||||
|
fmt.Println(f)
|
||||||
|
}
|
||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
api/ignoreGlobal.go:aws-access-key:20
|
||||||
|
53cd7a3c6eb4937f413e3c25e4a9f39289afa69e:api/ignoreCommit.go:aws-access-key:20
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
var a = "initial"
|
||||||
|
fmt.Println(a)
|
||||||
|
|
||||||
|
var b, c int = 1, 2
|
||||||
|
fmt.Println(b, c)
|
||||||
|
|
||||||
|
var d = true
|
||||||
|
fmt.Println(d)
|
||||||
|
|
||||||
|
var e int
|
||||||
|
fmt.Println(e)
|
||||||
|
|
||||||
|
// opps I added a secret at line 20
|
||||||
|
awsToken := "AKIALALEMEL33243OLIA"
|
||||||
|
|
||||||
|
f := "apple"
|
||||||
|
fmt.Println(f)
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
var a = "initial"
|
||||||
|
fmt.Println(a)
|
||||||
|
|
||||||
|
var b, c int = 1, 2
|
||||||
|
fmt.Println(b, c)
|
||||||
|
|
||||||
|
var d = true
|
||||||
|
fmt.Println(d)
|
||||||
|
|
||||||
|
var e int
|
||||||
|
fmt.Println(e)
|
||||||
|
|
||||||
|
// opps I added a secret at line 20
|
||||||
|
awsToken := "AKIALALEMEL33243OLIA"
|
||||||
|
|
||||||
|
f := "apple"
|
||||||
|
fmt.Println(f)
|
||||||
|
}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
removing secret from foo package
|
add .gitleaksignore test files
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587
|
cada78a9bf157ec05573f19e682d211f811c2e2d
|
||||||
Vendored
BIN
Binary file not shown.
+4
@@ -11,3 +11,7 @@ a122b33c6bad3ee54724f52f2caad385ab1982ab 1b6da43b82b22e4eaa10bcf8ee591e91abbfc58
|
|||||||
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897009 -0500 checkout: moving from foo to main
|
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897009 -0500 checkout: moving from foo to main
|
||||||
2e1db472eeba53f06c4026ae4566ea022e36598e f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635897062 -0500 checkout: moving from main to foo
|
2e1db472eeba53f06c4026ae4566ea022e36598e f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635897062 -0500 checkout: moving from main to foo
|
||||||
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897508 -0500 checkout: moving from foo to main
|
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897508 -0500 checkout: moving from foo to main
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 4f77f1b3cc39d4b17e4cf4ba0a38f5daed9875b4 Richard Gomez <rmgomez368@gmail.com> 1681920523 -0400 commit: add .gitleaksignore test
|
||||||
|
4f77f1b3cc39d4b17e4cf4ba0a38f5daed9875b4 cada78a9bf157ec05573f19e682d211f811c2e2d Richard Gomez <rmgomez368@gmail.com> 1681920658 -0400 commit (amend): add .gitleaksignore test
|
||||||
|
cada78a9bf157ec05573f19e682d211f811c2e2d 2e1db472eeba53f06c4026ae4566ea022e36598e Richard Gomez <rmgomez368@gmail.com> 1681920730 -0400 reset: moving to HEAD~
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 53cd7a3c6eb4937f413e3c25e4a9f39289afa69e Richard Gomez <rmgomez368@gmail.com> 1681920759 -0400 commit: add .gitleaksignore test files
|
||||||
@@ -1,2 +1,6 @@
|
|||||||
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
|
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
|
||||||
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: Fast-forward
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: Fast-forward
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 4f77f1b3cc39d4b17e4cf4ba0a38f5daed9875b4 Richard Gomez <rmgomez368@gmail.com> 1681920523 -0400 commit: add .gitleaksignore test
|
||||||
|
4f77f1b3cc39d4b17e4cf4ba0a38f5daed9875b4 cada78a9bf157ec05573f19e682d211f811c2e2d Richard Gomez <rmgomez368@gmail.com> 1681920658 -0400 commit (amend): add .gitleaksignore test
|
||||||
|
cada78a9bf157ec05573f19e682d211f811c2e2d 2e1db472eeba53f06c4026ae4566ea022e36598e Richard Gomez <rmgomez368@gmail.com> 1681920730 -0400 reset: moving to HEAD~
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 53cd7a3c6eb4937f413e3c25e4a9f39289afa69e Richard Gomez <rmgomez368@gmail.com> 1681920759 -0400 commit: add .gitleaksignore test files
|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
x•ÎAjÃ0…á®uй@Ãh$�e!»ì{ƒ±5±E-+(ʦ§¯½@v�>xs-%w >zS…$:YF±ŽÅy"�,G¢k�bbó�¦ûզɤ:IpwäÙ#±¨Ì*xpÇaŒjäÕ×Úà+Ï«´·ZôÎ,Ãq¼.Eòvšk¹€åhGÂ@>Ñ#š£/»¾ç9Äo$%8-¹o*ßϼìµ)t}vó¸ÁLë
|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
|||||||
2e1db472eeba53f06c4026ae4566ea022e36598e
|
53cd7a3c6eb4937f413e3c25e4a9f39289afa69e
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
api/api.go:aws-access-key:6
|
||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
# test
|
||||||
|
This is a repo used for testing gitleaks
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func PrintHello() {
|
||||||
|
aws_token := "AKIALALEMEL33243OLIA" // fingerprint of that secret is added to .gitleaksignore
|
||||||
|
aws_token2 := "AKIALALEMEL33243OLIA" // this one is not
|
||||||
|
fmt.Println(aws_token)
|
||||||
|
fmt.Println(aws_token2)
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
add .gitleaksignore file
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e branch 'main' of github.com:gitleaks/test
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
ref: refs/heads/main
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587
|
||||||
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
[core]
|
||||||
|
repositoryformatversion = 0
|
||||||
|
filemode = true
|
||||||
|
bare = false
|
||||||
|
logallrefupdates = true
|
||||||
|
ignorecase = true
|
||||||
|
precomposeunicode = true
|
||||||
|
[remote "origin"]
|
||||||
|
url = git@github.com:gitleaks/test.git
|
||||||
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||||
|
[branch "main"]
|
||||||
|
remote = origin
|
||||||
|
merge = refs/heads/main
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Unnamed repository; edit this file 'description' to name the repository.
|
||||||
Vendored
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
|||||||
|
# git ls-files --others --exclude-from=.git/info/exclude
|
||||||
|
# Lines that start with '#' are comments.
|
||||||
|
# For a project mostly in C, the following would be a good set of
|
||||||
|
# exclude patterns (uncomment them if you want to use them):
|
||||||
|
# *.[oa]
|
||||||
|
# *~
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
|
||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896362 -0500 checkout: moving from main to remove-secrets
|
||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 906335481df9a4b48906c90318b4fac76b67fe73 Zach Rice <zricer@protonmail.com> 1635896426 -0500 commit: load token via env var
|
||||||
|
906335481df9a4b48906c90318b4fac76b67fe73 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896518 -0500 commit: add api package
|
||||||
|
a122b33c6bad3ee54724f52f2caad385ab1982ab a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896543 -0500 checkout: moving from remove-secrets to api-pkg
|
||||||
|
a122b33c6bad3ee54724f52f2caad385ab1982ab 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896644 -0500 checkout: moving from api-pkg to main
|
||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: Fast-forward
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896716 -0500 checkout: moving from main to foo
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 491504d5a31946ce75e22554cc34203d8e5ff3ca Zach Rice <zricer@protonmail.com> 1635896886 -0500 commit: adding foo package with secret
|
||||||
|
491504d5a31946ce75e22554cc34203d8e5ff3ca f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635896931 -0500 commit: removing secret from foo package
|
||||||
|
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897009 -0500 checkout: moving from foo to main
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635897062 -0500 checkout: moving from main to foo
|
||||||
|
f1b58b97808f8e744f6a23c693859df5b5968901 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635897508 -0500 checkout: moving from foo to main
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e bf3f24164d7256b4021575cbdb2f97b98e6f057e Rafael Figueiredo <rfigueiredo@garoa.cloud> 1679239434 -0300 commit: add .gitleaksignore file
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
0000000000000000000000000000000000000000 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896543 -0500 branch: Created from HEAD
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
0000000000000000000000000000000000000000 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896716 -0500 branch: Created from HEAD
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e 491504d5a31946ce75e22554cc34203d8e5ff3ca Zach Rice <zricer@protonmail.com> 1635896886 -0500 commit: adding foo package with secret
|
||||||
|
491504d5a31946ce75e22554cc34203d8e5ff3ca f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635896931 -0500 commit: removing secret from foo package
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
|
||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: Fast-forward
|
||||||
|
2e1db472eeba53f06c4026ae4566ea022e36598e bf3f24164d7256b4021575cbdb2f97b98e6f057e Rafael Figueiredo <rfigueiredo@garoa.cloud> 1679239434 -0300 commit: add .gitleaksignore file
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896362 -0500 branch: Created from HEAD
|
||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 906335481df9a4b48906c90318b4fac76b67fe73 Zach Rice <zricer@protonmail.com> 1635896426 -0500 commit: load token via env var
|
||||||
|
906335481df9a4b48906c90318b4fac76b67fe73 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896518 -0500 commit: add api package
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
0000000000000000000000000000000000000000 1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 Zach Rice <zricer@protonmail.com> 1635896329 -0500 clone: from github.com:gitleaks/test.git
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
0000000000000000000000000000000000000000 a122b33c6bad3ee54724f52f2caad385ab1982ab Zach Rice <zricer@protonmail.com> 1635896552 -0500 update by push
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
0000000000000000000000000000000000000000 f1b58b97808f8e744f6a23c693859df5b5968901 Zach Rice <zricer@protonmail.com> 1635896935 -0500 update by push
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
1b6da43b82b22e4eaa10bcf8ee591e91abbfc587 2e1db472eeba53f06c4026ae4566ea022e36598e Zach Rice <zricer@protonmail.com> 1635896648 -0500 pull origin main: fast-forward
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
xUÌ1Â0`×ܯ8nJ––.‚ƒƒ:*(8–´\¤´É•$ê þw3 Noxï{Ý$6Ëf1Û~´wF'0øYbF␍ŠœÏTB�p�ÐãND|ƒ*]uŽCÈSÐT •…ªkLÌ>a²Ž#(ûJm–‘®Ö(©ÚsæðÔ´¹]Úëé°=õ÷ô>ð°ú03
|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Loaded 100 of 126 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user