Compare commits

...
29 Commits
Author SHA1 Message Date
zricethezav 28fd47e170 Bump version for pre-commit 2021-05-05 09:10:47 -04:00
bplaxco 8250e40a75 Include offenderEntropy in the JSON output (#549)
* Pass the entropy data back to the Leak struct

Do this to make it easier to tune entropy checks and make decisions in
systems consuming the output.

~ B'ezrat Hashem ~

* Return negative number when entropy not checked

That way you can tell the difference between not checking or an
actual entropy level of 0

~ B'ezrat Hashem ~

* Make sure to handle range checks properly

Make sure to show when something had an entropy returned but was outside
range, or didn't have a hit at all, etc...

~ B'zrat Hashem ~

* Add a few doc strings

Follow the project's conventiona add a comment above the methods

~ B'ezrat Hashem ~

* Update tests and get them to pass

~ B'ezrat Hashem ~

* Remove checked in `.got` files

~ B'ezrat Hashem ~

* Add `*.got` to the `.gitignore`

Make sure the test output files aren't checked-in

~ B'ezrat Hashem ~
2021-05-03 20:22:20 -04:00
Pavel Shklovsky e7553b0168 Add pre-commit support (#552)
* Add pre-commit support

* Update README.md
2021-04-22 18:37:28 -04:00
Zachary Rice 12d276acd7 Bug 553 global allowlist (#554)
* add global file check

* rm whitespace
2021-04-22 18:07:07 -04:00
Pavel Shklovsky e6934bf0a5 Docker-based pre-commit configuration example (#551)
* Docker-based pre-commit configuration example

* Docker-based pre-commit configuration example
2021-04-21 12:58:03 -04:00
Zachary Rice 6f5ad9dc0b Update README.md 2021-04-12 11:07:28 -04:00
Zachary Rice a2019a4782 Update README.md 2021-04-09 14:21:15 -04:00
zricethezav 5d7b7718ec splitting out github rules and retabbing 2021-04-09 14:07:23 -04:00
Zachary Rice 190877a24b Pypi GitHub rules (#546)
* adding pypi and basic azure rules

* Adding new github format
2021-04-08 16:34:08 -04:00
mercurieteandmercuriete 144362b972 docs(Dockerfile): Fix example of usage on Dockerfile (#545)
* Closes #544

Co-authored-by: mercuriete <mercuriete@gmail.com>
2021-04-08 10:23:03 -04:00
Zachary Rice d353ac5108 Update README.md 2021-04-06 14:42:44 -04:00
Zachary Rice a27a08904a Update README.md 2021-03-05 16:40:07 -05:00
Zachary Rice 5ef4e336ce Update README.md 2021-03-05 16:39:23 -05:00
zricethezav 78f2c46517 Consistency in options 2021-03-05 16:19:24 -05:00
Kai bdcb9e33a8 Update SARIF output to return empty array if no results were found (#530) 2021-03-05 16:10:53 -05:00
Zachary Rice 6e4e9df55f stricter regex for github token (#535) 2021-03-05 16:10:04 -05:00
Zachary Rice b3bed5658d adding recover for patch generation (#534) 2021-03-05 16:00:41 -05:00
eddie-northcutt-wfp0 a10ae91ba7 v7.x Update - Add ability to append repo configurations, and user supplied configurations to the specified or default configuration (#487)
* Update merge configuration changes for  Gitleaks 7.x

* Change merge to append, and did some clean up
2021-03-05 15:09:10 -05:00
Zachary Rice a8dbc7f107 Update README.md 2021-02-25 16:33:24 -05:00
erikaweir 4544156b44 Copy edits to Readme.md (#529)
* Update README.md

* Update README.md

* Update README.md
2021-02-19 18:01:31 -05:00
Rahul sharma b52e8c9c7c Slack Webhook Match (#527) 2021-02-19 13:05:25 -05:00
rui 0ce1249b95 chore(deps): bump go to v1.16 (#525)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-02-18 09:14:10 -05:00
Zachary Rice 3932ed6baf --no-git should report relative path to --path (#519) 2021-02-03 13:48:59 -05:00
Zachary Rice 981b636920 gitter chat 2021-02-02 17:27:24 -05:00
Kai c8e15c731a Always generate a report if --report is enabled (#508) 2021-01-26 07:59:51 -05:00
Zachary Rice 901f932a89 Add file type checking for unstaged commits (#512) 2021-01-22 11:49:21 -05:00
seb-elttamandSeb Elttam c0a9580a65 Fix dotgit regex again (#507)
* fix dotgit regex again

* Revert accidentally modified files

Co-authored-by: Seb Elttam <seb@elttam.com>
2021-01-21 15:31:21 -05:00
Paweł Kowalczyk 8be91eea5d Add exit code 1 on invalid usage, fixes #500 (#501) 2021-01-10 09:34:31 -05:00
Zachary Rice 1c6f2252b8 Update README.md 2020-12-11 20:55:32 -05:00
73 changed files with 809 additions and 266 deletions

No files matched your search

+1
View File
@@ -6,6 +6,7 @@
*.dylib
*.DS_STORE
*.idea
*.got
gitleaks
build
+5
View File
@@ -0,0 +1,5 @@
- id: gitleaks
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
entry: gitleaks
language: golang
+4 -4
View File
@@ -1,8 +1,8 @@
language: go
go:
- 1.14.x
- 1.16.x
services:
- docker
- docker
script:
- make test
- make security-scan
- make test
- make security-scan
+1 -1
View File
@@ -12,6 +12,6 @@ ENTRYPOINT ["gitleaks"]
# How to use me :
# docker build -t gitleaks .
# docker run --rm --name=gitleaks gitleaks --repo=https://github.com/zricethezav/gitleaks
# docker run --rm --name=gitleaks gitleaks --repo-url=https://github.com/zricethezav/gitleaks
# This will check for secrets in https://github.com/zricethezav/gitleaks
+8 -7
View File
@@ -10,15 +10,16 @@ test-cover:
go test ./... --race $(COVER) $(PKG) -v
go tool cover -html=cover.out
test:
go get golang.org/x/lint/golint
format:
go fmt ./...
test: format
go get golang.org/x/lint/golint
go vet ./...
golint ./...
go test ./... --race $(PKG) -v
build:
go fmt ./...
build: format
golint ./...
go vet ./...
go mod tidy
@@ -41,9 +42,9 @@ release-builds:
deploy:
@echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
echo "Pushing zricethezav/gitleaks:$(VERSION) and zricethezav/gitleaks:latest"
docker push zricethezav/gitleaks
dockerbuild:
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
dockerbuild:
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
+67 -50
View File
@@ -5,21 +5,26 @@
</p>
</p>
Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys, and tokens in git repos. Gitleaks aims to be the **easy-to-use, all-in-one solution** for finding secrets, past or present, in your code.
Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys, and tokens in git repos. Gitleaks is an **easy-to-use, all-in-one solution** for finding secrets, past or present, in your code.
### Introduction Video
<p align="left">
<a href="https://www.youtube.com/watch?v=VUq2eII20S4"><img alt="intro" src="https://img.youtube.com/vi/VUq2eII20S4/maxresdefault.jpg" height="200"></a>
</p>
### Features:
- Scan for [commited](https://github.com/zricethezav/gitleaks#Scanning) secrets
- Scan for [unstaged](https://github.com/zricethezav/gitleaks#scan-unstaged-changes) secrets as part of shifting security left
- Scan for [unstaged](https://github.com/zricethezav/gitleaks#scan-unstaged-changes) secrets to shift security left
- Scan [directories and files](https://github.com/zricethezav/gitleaks#scan-local-directory)
- Available [Github Action](https://github.com/marketplace/actions/gitleaks)
- Run [Gitleaks Action](https://github.com/marketplace/actions/gitleaks) in your CI/CD pipeline
- [Custom rules](https://github.com/zricethezav/gitleaks#configuration) via toml configuration
- High performance using [go-git](https://github.com/go-git/go-git)
- Increased performance using [go-git](https://github.com/go-git/go-git)
- JSON, SARIF, and CSV reporting
- Private repo scans using key or password based authentication
### Installation
Written in Go, gitleaks is available in binary form for many popular platforms and OS types from the [releases page](https://github.com/zricethezav/gitleaks/releases). Alternatively, executed via Docker or it can be installed using Go directly.
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases). In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo.
##### MacOS
@@ -37,6 +42,18 @@ docker pull zricethezav/gitleaks
```bash
GO111MODULE=on go get github.com/zricethezav/gitleaks/v7
```
##### As a pre-commit hook
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions.
Sample `.pre-commit-config.yaml`
```yaml
- repo: https://github.com/zricethezav/gitleaks
rev: v7.5.0
hooks:
- id: gitleaks
```
### Usage and Options
```
@@ -44,41 +61,41 @@ Usage:
gitleaks [OPTIONS]
Application Options:
-v, --verbose Show verbose output from scan
-r, --repo-url= Repository URL
-p, --path= Path to directory (repo if contains .git) or file
-c, --config-path= Path to config
--repo-config-path= Path to gitleaks config relative to repo root
--version Version number
--username= Username for git repo
--password= Password for git repo
--access-token= Access token for git repo
--threads= Maximum number of threads gitleaks spawns
--ssh-key= Path to ssh key used for auth
--unstaged Run gitleaks on unstaged code
--branch= Branch to scan
--redact Redact secrets from log messages and leaks
--debug Log debug messages
--leaks-exit-code= Exit code when leaks have been encountered (default: 1)
--no-git Treat git repos as plain directories and scan those
files
-o, --report= Report output path
-f, --format= JSON, CSV, SARIF (default: json)
--files-at-commit= Sha of commit to scan all files at commit
--commit= Sha of commit to scan or "latest" to scan the last
commit of the repository
--commits= Comma separated list of a commits to scan
--commits-file= Path to file of line separated list of commits to scan
--commit-from= Commit to start scan from
--commit-to= Commit to stop scan
--commit-since= Scan commits more recent than a specific date. Ex:
'2006-01-02' or '2006-01-02T15:04:05-0700' format.
--commit-until= Scan commits older than a specific date. Ex:
'2006-01-02' or '2006-01-02T15:04:05-0700' format.
--depth= Number of commits to scan
-v, --verbose Show verbose output from scan
-q, --quiet Sets log level to error and only output leaks, one json object per line
-r, --repo-url= Repository URL
-p, --path= Path to directory (repo if contains .git) or file
-c, --config-path= Path to config
--repo-config-path= Path to gitleaks config relative to repo root
--clone-path= Path to clone repo to disk
--version Version number
--username= Username for git repo
--password= Password for git repo
--access-token= Access token for git repo
--threads= Maximum number of threads gitleaks spawns
--ssh-key= Path to ssh key used for auth
--unstaged Run gitleaks on unstaged code
--branch= Branch to scan
--redact Redact secrets from log messages and leaks
--debug Log debug messages
--no-git Treat git repos as plain directories and scan those files
--leaks-exit-code= Exit code when leaks have been encountered (default: 1)
--append-repo-config Append the provided or default config with the repo config.
--additional-config= Path to an additional gitleaks config to append with an existing config. Can be used with --append-repo-config to append up to three configurations
-o, --report= Report output path
-f, --format= JSON, CSV, SARIF (default: json)
--files-at-commit= Sha of commit to scan all files at commit
--commit= Sha of commit to scan or "latest" to scan the last commit of the repository
--commits= Comma separated list of a commits to scan
--commits-file= Path to file of line separated list of commits to scan
--commit-from= Commit to start scan from
--commit-to= Commit to stop scan
--commit-since= Scan commits more recent than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format.
--commit-until= Scan commits older than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format.
--depth= Number of commits to scan
Help Options:
-h, --help Show this help message
-h, --help Show this help message
```
@@ -92,7 +109,7 @@ gitleaks --repo-url=https://github.com/my-insecure/repo -v
#### Basic repo-url scan output to a report:
If we want the report in sarif or csv we can set the `-f/--format` option
If you want the report in sarif or csv you can set the `-f/--format` option
```
gitleaks --repo-url=https://github.com/my-insecure/repo -v --report=my-report.json
```
@@ -107,20 +124,20 @@ gitleaks --repo-url=https://github.com/my-insecure/repo --commit=commit-sha -v
gitleaks --path=path/to/local/repo -v
```
#### Scan repos contain in a parent directory:
If we had `repo1`, `repo2`, `repo3` all under `path/to/local`, gitleaks will discover and scan those repos.
#### Scan repos contained in a parent directory:
If you have `repo1`, `repo2`, `repo3` all under `path/to/local`, gitleaks will discover and scan those repos.
```
gitleaks --path=path/to/local/ -v
```
#### Scan local directory:
You might want to scan the current contents of a repo, ignoring git alltogether. You can use the `--no-git` option to do this.
If you want to scan the current contents of a repo, ignoring git alltogether. You can use the `--no-git` option to do this.
```
gitleaks --path=path/to/local/repo -v --no-git
```
#### Scan a file:
Or you might want to scan a single file using gitleaks rules. You can do this by specifying the file in `--path` and including the `--no-git` option.
Or if you want to scan a single file using gitleaks rules. You can do this by specifying the file in `--path` and including the `--no-git` option.
```
gitleaks --path=path/to/local/repo/main.go -v --no-git
```
@@ -134,8 +151,9 @@ gitleaks --path=path/to/local/repo -v --unstaged
### Configuration
Provide your own gitleaks configurations with `--config-path` or `--repo-config-path`. The difference between the two is `--config-path` loads a local gitleaks config whereas `--repo-config-path` will load a configuration present in the repo you want to scan. For example, `gitleaks --repo-config-path=".github/gitleaks.config"`.
The default configuration Gitleaks uses is located [here](https://github.com/zricethezav/gitleaks/blob/master/config/default.go). More configuration examples can be seen [here](https://github.com/zricethezav/gitleaks/tree/master/examples). Configuration files contain a few different toml tables which will be explained below.
Provide your own gitleaks configurations with `--config-path` or `--repo-config-path`. `--config-path` loads a local gitleaks configuration whereas `--repo-config-path` will load a configuration present just in the repo you want to scan. For example, `gitleaks --repo-config-path=".github/gitleaks.config"`.
The default configuration Gitleaks uses is located [here](https://github.com/zricethezav/gitleaks/blob/master/config/default.go). More configuration examples can be seen [here](https://github.com/zricethezav/gitleaks/tree/master/examples). Configuration files will contain a few different toml tables. Further explanation is provided below.
### Rules summary
The rules are written in [TOML](https://github.com/toml-lang/toml) as defined in [TomlLoader struct](https://github.com/zricethezav/gitleaks/blob/master/config/config.go#L57-L87), and can be summarized as:
@@ -247,7 +265,7 @@ You can always set the exit code when leaves are encountered with the `--leaks-e
```
### Sponsors ❤️
#### Corporate Sponsors
#### Organization Sponsors
[![gammanet](https://gammanet.com/assets/images/new-design/gamma-logo.png)](https://gammanet.com/?utm_source=gitleaks&utm_medium=homepage&utm_campaign=gitleaks_promotion)
Gamma proactively detects and remediates data leaks across cloud apps. Scan your public repos for secret leaks with [Gamma](https://gammanet.com/github-demo?utm_source=gitleaks&utm_medium=homepage&utm_campaign=gitleaks_promotion)
@@ -255,9 +273,8 @@ Gamma proactively detects and remediates data leaks across cloud apps. Scan your
#### Individual Sponsors
These users are [sponsors](https://github.com/sponsors/zricethezav) of gitleaks:
[![Adam Shannon](https://github.com/adamdecaf.png?size=50)](https://github.com/adamdecaf) |
---|
----
- [Adam Shannon](https://github.com/adamdecaf)
- [ProjectDiscovery](https://projectdiscovery.io/#/)
#### Logo Attribution
+1 -1
View File
@@ -6,7 +6,7 @@ import (
// used for ignoring .git directories when the --no-git flag is set
// related issue: https://github.com/zricethezav/gitleaks/issues/486
const dotGit = `\.git/`
const dotGit = `/\.git/`
// AllowList is struct containing items that if encountered will allowlist
// a commit/line of code that would be considered a leak.
+43 -12
View File
@@ -2,7 +2,10 @@ package config
import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"regexp"
"strconv"
@@ -249,13 +252,7 @@ func LoadRepoConfig(repo *git.Repository, repoConfig string) (Config, error) {
if err != nil {
return Config{}, err
}
var tomlLoader TomlLoader
_, err = toml.DecodeReader(r, &tomlLoader)
if err != nil {
return Config{}, err
}
return tomlLoader.Parse()
return parseTomlFile(r)
}
log.Debug("attempting to load repo config from bare worktree, this may use an old config")
@@ -274,15 +271,49 @@ func LoadRepoConfig(repo *git.Repository, repoConfig string) (Config, error) {
return Config{}, err
}
var tomlLoader TomlLoader
r, err := f.Reader()
if err != nil {
return Config{}, err
}
_, err = toml.DecodeReader(r, &tomlLoader)
if err != nil {
return Config{}, err
}
return parseTomlFile(r)
}
// LoadAdditionalConfig Accepts a path to a gitleaks config and returns a Config struct
func LoadAdditionalConfig(repoConfig string) (Config, error) {
file, err := os.Open(filepath.Clean(repoConfig))
if err != nil {
return Config{}, err
}
return parseTomlFile(file)
}
// AppendConfig Accepts a Config struct and will append those fields to this Config Struct's fields
func (config *Config) AppendConfig(configToBeAppended Config) Config {
newAllowList := AllowList{
Description: "Appended Configuration",
Commits: append(config.Allowlist.Commits, configToBeAppended.Allowlist.Commits...),
Files: append(config.Allowlist.Files, configToBeAppended.Allowlist.Files...),
Paths: append(config.Allowlist.Paths, configToBeAppended.Allowlist.Paths...),
Regexes: append(config.Allowlist.Regexes, configToBeAppended.Allowlist.Regexes...),
Repos: append(config.Allowlist.Repos, configToBeAppended.Allowlist.Repos...),
}
return Config{
Rules: append(config.Rules, configToBeAppended.Rules...),
Allowlist: newAllowList,
}
}
// takes a File, makes sure it is a valid config, and parses it
func parseTomlFile(f io.Reader) (Config, error) {
var tomlLoader TomlLoader
_, err := toml.DecodeReader(f, &tomlLoader)
if err != nil {
log.Errorf("Unable to read gitleaks config. Using defaults. Error: %s", err)
return Config{}, err
}
return tomlLoader.Parse()
}
+70
View File
@@ -211,3 +211,73 @@ func writeTestConfig(toml string) (string, error) {
return tmpfile.Name(), nil
}
func TestAppendingConfiguration(t *testing.T) {
testRegexA, _ := regexp.Compile("a")
testRegexB, _ := regexp.Compile("b")
allowListA := AllowList{
Description: "Test Description",
Commits: []string{"a"},
Files: []*regexp.Regexp{testRegexA},
Paths: []*regexp.Regexp{testRegexA},
Regexes: []*regexp.Regexp{testRegexA},
Repos: []*regexp.Regexp{testRegexA},
}
allowListB := AllowList{
Description: "Test Description",
Commits: []string{"b"},
Files: []*regexp.Regexp{testRegexB},
Paths: []*regexp.Regexp{testRegexB},
Regexes: []*regexp.Regexp{testRegexB},
Repos: []*regexp.Regexp{testRegexB},
}
ruleA := Rule{Description: "a"}
ruleB := Rule{Description: "b"}
rulesA := []Rule{ruleA}
rulesB := []Rule{ruleB}
cfgA := Config{
Rules: rulesA,
Allowlist: allowListA,
}
cfgB := Config{
Rules: rulesB,
Allowlist: allowListB,
}
cfgAppended := cfgA.AppendConfig(cfgB)
if !(len(cfgAppended.Rules) == 2) {
t.Errorf("Length of Appended Rules = %d; want 2", len(cfgAppended.Rules))
}
if !(len(cfgAppended.Allowlist.Commits) == 2) {
t.Errorf("Length of Appended Allowed Commits = %d; want 2", len(cfgAppended.Allowlist.Commits))
}
if !(len(cfgAppended.Allowlist.Files) == 2) {
t.Errorf("Length of Appended Allowed Files = %d; want 2", len(cfgAppended.Allowlist.Files))
}
if !(len(cfgAppended.Allowlist.Paths) == 2) {
t.Errorf("Length of Appended Allowed Paths = %d; want 2", len(cfgAppended.Allowlist.Paths))
}
if !(len(cfgAppended.Allowlist.Regexes) == 2) {
t.Errorf("Length of Appended Allowed Regexes = %d; want 2", len(cfgAppended.Allowlist.Regexes))
}
if !(len(cfgAppended.Allowlist.Repos) == 2) {
t.Errorf("Length of Appended Allowed Repos = %d; want 2", len(cfgAppended.Allowlist.Repos))
}
if cfgAppended.Allowlist.Description != "Appended Configuration" {
t.Errorf("Allow List Description is = \"%s\"; want \"Appended Configuration\"", cfgAppended.Allowlist.Description)
}
}
+111 -94
View File
@@ -7,158 +7,175 @@ const DefaultConfig = `
title = "gitleaks config"
[[rules]]
description = "AWS Access Key"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
description = "AWS Access Key"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[[rules]]
description = "AWS Secret Key"
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
tags = ["key", "AWS"]
description = "AWS Secret Key"
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
tags = ["key", "AWS"]
[[rules]]
description = "AWS MWS key"
regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
tags = ["key", "AWS", "MWS"]
description = "AWS MWS key"
regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
tags = ["key", "AWS", "MWS"]
[[rules]]
description = "Facebook Secret Key"
regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
tags = ["key", "Facebook"]
description = "Facebook Secret Key"
regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
tags = ["key", "Facebook"]
[[rules]]
description = "Facebook Client ID"
regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
tags = ["key", "Facebook"]
description = "Facebook Client ID"
regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
tags = ["key", "Facebook"]
[[rules]]
description = "Twitter Secret Key"
regex = '''(?i)twitter(.{0,20})?[0-9a-z]{35,44}'''
tags = ["key", "Twitter"]
description = "Twitter Secret Key"
regex = '''(?i)twitter(.{0,20})?[0-9a-z]{35,44}'''
tags = ["key", "Twitter"]
[[rules]]
description = "Twitter Client ID"
regex = '''(?i)twitter(.{0,20})?[0-9a-z]{18,25}'''
tags = ["client", "Twitter"]
description = "Twitter Client ID"
regex = '''(?i)twitter(.{0,20})?[0-9a-z]{18,25}'''
tags = ["client", "Twitter"]
[[rules]]
description = "Github"
regex = '''(?i)github(.{0,20})?(?-i)[0-9a-zA-Z]{35,40}'''
tags = ["key", "Github"]
description = "Github Personal Access Token"
regex = '''ghp_[0-9a-zA-Z]{36}'''
tags = ["key", "Github"]
[[rules]]
description = "Github OAuth Access Token"
regex = '''gho_[0-9a-zA-Z]{36}'''
tags = ["key", "Github"]
[[rules]]
description = "Github App Token"
regex = '''(ghu|ghs)_[0-9a-zA-Z]{36}'''
tags = ["key", "Github"]
[[rules]]
description = "Github Refresh Token"
regex = '''ghr_[0-9a-zA-Z]{76}'''
tags = ["key", "Github"]
[[rules]]
description = "LinkedIn Client ID"
regex = '''(?i)linkedin(.{0,20})?(?-i)[0-9a-z]{12}'''
tags = ["client", "LinkedIn"]
description = "LinkedIn Client ID"
regex = '''(?i)linkedin(.{0,20})?(?-i)[0-9a-z]{12}'''
tags = ["client", "LinkedIn"]
[[rules]]
description = "LinkedIn Secret Key"
regex = '''(?i)linkedin(.{0,20})?[0-9a-z]{16}'''
tags = ["secret", "LinkedIn"]
description = "LinkedIn Secret Key"
regex = '''(?i)linkedin(.{0,20})?[0-9a-z]{16}'''
tags = ["secret", "LinkedIn"]
[[rules]]
description = "Slack"
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
tags = ["key", "Slack"]
description = "Slack"
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
tags = ["key", "Slack"]
[[rules]]
description = "Asymmetric Private Key"
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
tags = ["key", "AsymmetricPrivateKey"]
description = "Asymmetric Private Key"
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
tags = ["key", "AsymmetricPrivateKey"]
[[rules]]
description = "Google API key"
regex = '''AIza[0-9A-Za-z\\-_]{35}'''
tags = ["key", "Google"]
description = "Google API key"
regex = '''AIza[0-9A-Za-z\\-_]{35}'''
tags = ["key", "Google"]
[[rules]]
description = "Google (GCP) Service Account"
regex = '''"type": "service_account"'''
tags = ["key", "Google"]
description = "Google (GCP) Service Account"
regex = '''"type": "service_account"'''
tags = ["key", "Google"]
[[rules]]
description = "Heroku API key"
regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
tags = ["key", "Heroku"]
description = "Heroku API key"
regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
tags = ["key", "Heroku"]
[[rules]]
description = "MailChimp API key"
regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}'''
tags = ["key", "Mailchimp"]
description = "MailChimp API key"
regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}'''
tags = ["key", "Mailchimp"]
[[rules]]
description = "Mailgun API key"
regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}'''
tags = ["key", "Mailgun"]
description = "Mailgun API key"
regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}'''
tags = ["key", "Mailgun"]
[[rules]]
description = "PayPal Braintree access token"
regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
tags = ["key", "Paypal"]
description = "PayPal Braintree access token"
regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
tags = ["key", "Paypal"]
[[rules]]
description = "Picatic API key"
regex = '''sk_live_[0-9a-z]{32}'''
tags = ["key", "Picatic"]
description = "Picatic API key"
regex = '''sk_live_[0-9a-z]{32}'''
tags = ["key", "Picatic"]
[[rules]]
description = "SendGrid API Key"
regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}'''
tags = ["key", "SendGrid"]
description = "SendGrid API Key"
regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}'''
tags = ["key", "SendGrid"]
[[rules]]
description = "Slack Webhook"
regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
tags = ["key", "slack"]
description = "Slack Webhook"
regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8,12}/[a-zA-Z0-9_]{24}'''
tags = ["key", "slack"]
[[rules]]
description = "Stripe API key"
regex = '''(?i)stripe(.{0,20})?[sr]k_live_[0-9a-zA-Z]{24}'''
tags = ["key", "Stripe"]
description = "Stripe API key"
regex = '''(?i)stripe(.{0,20})?[sr]k_live_[0-9a-zA-Z]{24}'''
tags = ["key", "Stripe"]
[[rules]]
description = "Square access token"
regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
tags = ["key", "square"]
description = "Square access token"
regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
tags = ["key", "square"]
[[rules]]
description = "Square OAuth secret"
regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
tags = ["key", "square"]
description = "Square OAuth secret"
regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
tags = ["key", "square"]
[[rules]]
description = "Twilio API key"
regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}'''
tags = ["key", "twilio"]
description = "Twilio API key"
regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}'''
tags = ["key", "twilio"]
[[rules]]
description = "Dynatrace ttoken"
regex = '''dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}'''
tags = ["key", "Dynatrace"]
description = "Dynatrace ttoken"
regex = '''dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}'''
tags = ["key", "Dynatrace"]
[[rules]]
description = "Shopify shared secret"
regex = '''shpss_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
description = "Shopify shared secret"
regex = '''shpss_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
[[rules]]
description = "Shopify access token"
regex = '''shpat_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
description = "Shopify access token"
regex = '''shpat_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
[[rules]]
description = "Shopify custom app access token"
regex = '''shpca_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
description = "Shopify custom app access token"
regex = '''shpca_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
[[rules]]
description = "Shopify private app access token"
regex = '''shppa_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
description = "Shopify private app access token"
regex = '''shppa_[a-fA-F0-9]{32}'''
tags = ["key", "Shopify"]
[[rules]]
description = "PyPI upload token"
regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}'''
tags = ["key", "pypi"]
[allowlist]
description = "Allowlisted files"
files = ['''^\.?gitleaks.toml$''',
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''',
'''(go.mod|go.sum)$''']
description = "Allowlisted files"
files = ['''^\.?gitleaks.toml$''',
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''',
'''(go.mod|go.sum)$''']
`
+60 -14
View File
@@ -6,6 +6,23 @@ import (
"regexp"
)
// Offender is a struct that contains the information matched when searching
// content and information on why it matched (i.e. the EntropyLevel)
type Offender struct {
Match string
EntropyLevel float64
}
// IsEmpty checks to see if nothing was found in the match
func (o *Offender) IsEmpty() bool {
return o.Match == ""
}
// ToString the contents of the match
func (o *Offender) ToString() string {
return o.Match
}
// Rule is a struct that contains information that is loaded from a gitleaks config.
// This struct is used in the Config struct as an array of Rules and is iterated
// over during an scan. Each rule will be checked. If a regex match is found AND
@@ -23,28 +40,46 @@ type Rule struct {
}
// Inspect checks the content of a line for a leak
func (r *Rule) Inspect(line string) string {
offender := r.Regex.FindString(line)
if offender == "" {
return ""
func (r *Rule) Inspect(line string) *Offender {
match := r.Regex.FindString(line)
// EntropyLevel -1 means not checked
if match == "" {
return &Offender{
Match: "",
EntropyLevel: -1,
}
}
// check if offender is allowed
// EntropyLevel -1 means not checked
if r.RegexAllowed(line) {
return ""
return &Offender{
Match: "",
EntropyLevel: -1,
}
}
// check entropy
groups := r.Regex.FindStringSubmatch(offender)
if len(r.Entropies) != 0 && !r.ContainsEntropyLeak(groups) {
return ""
groups := r.Regex.FindStringSubmatch(match)
entropyWithinRange, entropyLevel := r.CheckEntropy(groups)
if len(r.Entropies) != 0 && !entropyWithinRange {
return &Offender{
Match: "",
EntropyLevel: entropyLevel,
}
}
// 0 is a match for the full regex pattern
if 0 < r.ReportGroup && r.ReportGroup < len(groups) {
offender = groups[r.ReportGroup]
match = groups[r.ReportGroup]
}
return &Offender{
Match: match,
EntropyLevel: entropyLevel,
}
return offender
}
// RegexAllowed checks if the content is allowlisted
@@ -57,17 +92,28 @@ func (r *Rule) CommitAllowed(commit string) bool {
return r.AllowList.CommitAllowed(commit)
}
// ContainsEntropyLeak checks if there is an entropy leak
func (r *Rule) ContainsEntropyLeak(groups []string) bool {
// CheckEntropy checks if there is an entropy leak
func (r *Rule) CheckEntropy(groups []string) (bool, float64) {
var highestFound float64 = 0
for _, e := range r.Entropies {
if len(groups) > e.Group {
entropy := shannonEntropy(groups[e.Group])
if entropy >= e.Min && entropy <= e.Max {
return true
return true, entropy
} else if entropy > highestFound {
highestFound = entropy
}
}
}
return false
if len(r.Entropies) == 0 {
// entropies not checked
return false, -1
}
// entropies checked but not within the range
return false, highestFound
}
// HasFileOrPathLeakOnly first checks if there are no entropy/regex rules, then checks if
+14
View File
@@ -0,0 +1,14 @@
# pre-commit configuration example to add docker-based hook that executes gitleaks
# This should be added to .pre-commit-config.yaml coniguration file: https://pre-commit.com/#2-add-a-pre-commit-configuration
repos:
- repo: local
hooks:
- id: gitleaks
name: Gitleaks
language: docker_image
entry: zricethezav/gitleaks:v7.4.0
args:
- --config-path
- .gitleaks.toml
- --verbose
+1 -1
View File
@@ -1,6 +1,6 @@
module github.com/zricethezav/gitleaks/v7
go 1.15
go 1.16
replace github.com/go-git/go-git/v5 => github.com/zricethezav/go-git/v5 v5.2.2
-11
View File
@@ -22,9 +22,6 @@ github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agR
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.2.0 h1:YPBLG/3UK1we1ohRkncLjaXWLW+HKp5QNM/jTli2JgI=
github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@@ -40,10 +37,8 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
@@ -66,8 +61,6 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
github.com/zricethezav/go-git/v5 v5.2.1 h1:snaoKv8ksDSz7NfBRXsBr9Yr8IKEKWRWf1zdhFmcFvI=
github.com/zricethezav/go-git/v5 v5.2.1/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
github.com/zricethezav/go-git/v5 v5.2.2 h1:VOVijF5OpIiHvFZXX94AJezdJ0b0kTyRyVNZ4yaqCRU=
github.com/zricethezav/go-git/v5 v5.2.2/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -82,7 +75,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -93,15 +85,12 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+22 -20
View File
@@ -20,25 +20,27 @@ import (
// Options stores values of command line options
type Options struct {
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from scan"`
Quiet bool `short:"q" long:"quiet" description:"Sets log level to error and only output leaks, one json object per line"`
RepoURL string `short:"r" long:"repo-url" description:"Repository URL"`
Path string `short:"p" long:"path" description:"Path to directory (repo if contains .git) or file"`
ConfigPath string `short:"c" long:"config-path" description:"Path to config"`
RepoConfigPath string `long:"repo-config-path" description:"Path to gitleaks config relative to repo root"`
ClonePath string `long:"clone-path" description:"Path to clone repo to disk"`
Version bool `long:"version" description:"Version number"`
Username string `long:"username" description:"Username for git repo"`
Password string `long:"password" description:"Password for git repo"`
AccessToken string `long:"access-token" description:"Access token for git repo"`
Threads int `long:"threads" description:"Maximum number of threads gitleaks spawns"`
SSH string `long:"ssh-key" description:"Path to ssh key used for auth"`
Unstaged bool `long:"unstaged" description:"Run gitleaks on unstaged code"`
Branch string `long:"branch" description:"Branch to scan"`
Redact bool `long:"redact" description:"Redact secrets from log messages and leaks"`
Debug bool `long:"debug" description:"Log debug messages"`
NoGit bool `long:"no-git" description:"Treat git repos as plain directories and scan those files"`
CodeOnLeak int `long:"leaks-exit-code" default:"1" description:"Exit code when leaks have been encountered"`
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from scan"`
Quiet bool `short:"q" long:"quiet" description:"Sets log level to error and only output leaks, one json object per line"`
RepoURL string `short:"r" long:"repo-url" description:"Repository URL"`
Path string `short:"p" long:"path" description:"Path to directory (repo if contains .git) or file"`
ConfigPath string `short:"c" long:"config-path" description:"Path to config"`
RepoConfigPath string `long:"repo-config-path" description:"Path to gitleaks config relative to repo root"`
ClonePath string `long:"clone-path" description:"Path to clone repo to disk"`
Version bool `long:"version" description:"Version number"`
Username string `long:"username" description:"Username for git repo"`
Password string `long:"password" description:"Password for git repo"`
AccessToken string `long:"access-token" description:"Access token for git repo"`
Threads int `long:"threads" description:"Maximum number of threads gitleaks spawns"`
SSH string `long:"ssh-key" description:"Path to ssh key used for auth"`
Unstaged bool `long:"unstaged" description:"Run gitleaks on unstaged code"`
Branch string `long:"branch" description:"Branch to scan"`
Redact bool `long:"redact" description:"Redact secrets from log messages and leaks"`
Debug bool `long:"debug" description:"Log debug messages"`
NoGit bool `long:"no-git" description:"Treat git repos as plain directories and scan those files"`
CodeOnLeak int `long:"leaks-exit-code" default:"1" description:"Exit code when leaks have been encountered"`
AppendRepoConfig bool `long:"append-repo-config" description:"Append the provided or default config with the repo config."`
AdditionalConfig string `long:"additional-config" description:"Path to an additional gitleaks config to append with an existing config. Can be used with --append-repo-config to append up to three configurations"`
// Report Options
Report string `short:"o" long:"report" description:"Report output path"`
@@ -69,7 +71,7 @@ func ParseOptions() (Options, error) {
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type != flags.ErrHelp {
parser.WriteHelp(os.Stdout)
}
os.Exit(0)
os.Exit(1)
}
if opts.Version {
+11 -3
View File
@@ -43,6 +43,14 @@ func (cs *CommitScanner) SetRepoName(repoName string) {
func (cs *CommitScanner) Scan() (Report, error) {
var scannerReport Report
defer func() {
if err := recover(); err != nil {
// sometimes the Patch generation will fail due to a known bug in
// sergi's go-diff: https://github.com/sergi/go-diff/issues/89.
return
}
}()
if cs.cfg.Allowlist.CommitAllowed(cs.commit.Hash.String()) {
return scannerReport, nil
}
@@ -62,7 +70,7 @@ func (cs *CommitScanner) Scan() (Report, error) {
}
patch, err := parent.Patch(cs.commit)
if err != nil {
if err != nil || patch == nil {
return scannerReport, fmt.Errorf("could not generate Patch")
}
@@ -113,7 +121,7 @@ func (cs *CommitScanner) Scan() (Report, error) {
continue
}
offender := rule.Inspect(line)
if offender == "" {
if offender.IsEmpty() {
continue
}
@@ -128,7 +136,7 @@ func (cs *CommitScanner) Scan() (Report, error) {
continue
}
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(cs.commit)
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(cs.commit).WithEntropy(offender.EntropyLevel)
leak.File = to.Path()
leak.LineNumber = extractLine(patchContent, leak, lineLookup)
leak.RepoURL = cs.opts.RepoURL
+2 -3
View File
@@ -97,8 +97,7 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) {
}
offender := rule.Inspect(line)
if offender == "" {
if offender.IsEmpty() {
continue
}
@@ -113,7 +112,7 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) {
continue
}
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(fs.commit)
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(fs.commit).WithEntropy(offender.EntropyLevel)
leak.File = f.Name
leak.LineNumber = i + 1
leak.RepoURL = fs.opts.RepoURL
+26 -17
View File
@@ -3,6 +3,7 @@ package scan
import (
"encoding/json"
"fmt"
"math"
"strings"
"time"
@@ -14,20 +15,21 @@ import (
// Leak is a struct that contains information about some line of code that contains
// sensitive information as determined by the rules set in a gitleaks config
type Leak struct {
Line string `json:"line"`
LineNumber int `json:"lineNumber"`
Offender string `json:"offender"`
Commit string `json:"commit"`
Repo string `json:"repo"`
RepoURL string `json:"repoURL"`
LeakURL string `json:"leakURL"`
Rule string `json:"rule"`
Message string `json:"commitMessage"`
Author string `json:"author"`
Email string `json:"email"`
File string `json:"file"`
Date time.Time `json:"date"`
Tags string `json:"tags"`
Line string `json:"line"`
LineNumber int `json:"lineNumber"`
Offender string `json:"offender"`
OffenderEntropy float64 `json:"offenderEntropy"`
Commit string `json:"commit"`
Repo string `json:"repo"`
RepoURL string `json:"repoURL"`
LeakURL string `json:"leakURL"`
Rule string `json:"rule"`
Message string `json:"commitMessage"`
Author string `json:"author"`
Email string `json:"email"`
File string `json:"file"`
Date time.Time `json:"date"`
Tags string `json:"tags"`
}
// RedactLeak will replace the offending string with "REDACTED" in both
@@ -41,9 +43,10 @@ func RedactLeak(leak Leak) Leak {
// NewLeak creates a new leak from common data all leaks must have, line, offender, linenumber
func NewLeak(line string, offender string, lineNumber int) Leak {
return Leak{
Line: line,
Offender: offender,
LineNumber: lineNumber,
Line: line,
Offender: offender,
LineNumber: lineNumber,
OffenderEntropy: -1, // -1 means not checked
}
}
@@ -57,6 +60,12 @@ func (leak Leak) WithCommit(commit *object.Commit) Leak {
return leak
}
// WithEntropy adds OffenderEntropy data to the leak
func (leak Leak) WithEntropy(entropyLevel float64) Leak {
leak.OffenderEntropy = math.Round(entropyLevel*1000) / 1000
return leak
}
// Log logs a leak and redacts if necessary
func (leak Leak) Log(opts options.Options) {
if !opts.Quiet && !opts.Verbose {
+14 -4
View File
@@ -73,7 +73,12 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
for _, rule := range ngs.cfg.Rules {
if rule.HasFileOrPathLeakOnly(p) {
leak := NewLeak("", "Filename or path offender: "+p, defaultLineNumber)
leak.File = p
relPath, err := filepath.Rel(ngs.opts.Path, p)
if err != nil {
leak.File = p
} else {
leak.File = relPath
}
leak.Rule = rule.Description
leak.Tags = strings.Join(rule.Tags, ", ")
@@ -100,7 +105,7 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
}
offender := rule.Inspect(line)
if offender == "" {
if offender.IsEmpty() {
continue
}
if ngs.cfg.Allowlist.RegexAllowed(line) {
@@ -114,8 +119,13 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
continue
}
leak := NewLeak(line, offender, defaultLineNumber)
leak.File = p
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithEntropy(offender.EntropyLevel)
relPath, err := filepath.Rel(ngs.opts.Path, p)
if err != nil {
leak.File = p
} else {
leak.File = relPath
}
leak.LineNumber = lineNumber
leak.Rule = rule.Description
leak.Tags = strings.Join(rule.Tags, ", ")
-1
View File
@@ -27,7 +27,6 @@ func WriteReport(report Report, opts options.Options, cfg config.Config) error {
logrus.Warn("leaks found: ", len(report.Leaks))
} else {
logrus.Info("No leaks found")
return nil
}
if opts.Report == "" {
+2 -1
View File
@@ -110,7 +110,8 @@ func configToRules(cfg config.Config) []Rules {
}
func leaksToResults(leaks []Leak) []Results {
var results []Results
results := make([]Results, 0)
for _, leak := range leaks {
results = append(results, Results{
Message: Message{
+23 -2
View File
@@ -45,6 +45,13 @@ func NewScanner(opts options.Options, cfg config.Config) (Scanner, error) {
return nil, err
}
if st == typeDirScanner {
if opts.AdditionalConfig != "" {
additionalCfg, err := config.LoadAdditionalConfig(opts.AdditionalConfig)
if err != nil {
return nil, err
}
cfg = cfg.AppendConfig(additionalCfg)
}
return NewParentScanner(opts, cfg), nil
}
@@ -56,12 +63,26 @@ func NewScanner(opts options.Options, cfg config.Config) (Scanner, error) {
}
}
// load up alternative config if possible, if not use manager's config
// load up alternative config if possible, if not use default/specified config. Will append if AppendRepoConfig is true
if opts.RepoConfigPath != "" && !opts.NoGit {
cfg, err = config.LoadRepoConfig(repo, opts.RepoConfigPath)
repoCfg, err := config.LoadRepoConfig(repo, opts.RepoConfigPath)
if err != nil {
return nil, err
}
if opts.AppendRepoConfig {
cfg = cfg.AppendConfig(repoCfg)
} else {
cfg = repoCfg
}
}
// append additional config with the rest of the config
if opts.AdditionalConfig != "" {
additionalCfg, err := config.LoadAdditionalConfig(opts.AdditionalConfig)
if err != nil {
return nil, err
}
cfg = cfg.AppendConfig(additionalCfg)
}
switch st {
+65 -15
View File
@@ -441,6 +441,16 @@ func TestScan(t *testing.T) {
},
wantPath: "../test_data/test_allow_list_file.json",
},
{
description: "test allowlist files",
opts: options.Options{
Path: "../test_data/test_repos/test_repo_10",
Report: "../test_data/test_allow_list_file.json.got",
ReportFormat: "json",
ConfigPath: "../test_data/test_configs/allowlist_files.toml",
},
wantPath: "../test_data/test_allow_list_file.json",
},
{
description: "test allowlist files no-git",
opts: options.Options{
@@ -464,27 +474,63 @@ func TestScan(t *testing.T) {
wantPath: "../test_data/test_allow_list_docx_no_git.json",
},
{
description: "test local repo two allowlist Commit config",
description: "test append repo config",
opts: options.Options{
Path: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_allowlist_commits_files_at_commit.json.got",
ConfigPath: "../test_data/test_configs/allowlist_commit.toml",
ReportFormat: "json",
FilesAtCommit: "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
Path: "../test_data/test_repos/test_repo_10",
Report: "../test_data/test_append_repo.json.got",
ReportFormat: "json",
ConfigPath: "../test_data/test_configs/nozips.toml",
RepoConfigPath: ".gitleaks.toml",
AppendRepoConfig: true,
},
wantPath: "../test_data/test_append_repo.json",
},
{
description: "test additional config",
opts: options.Options{
Path: "../test_data/test_repos/test_repo_10",
Report: "../test_data/test_additional_config.json.got",
ReportFormat: "json",
ConfigPath: "../test_data/test_configs/nozips.toml",
AdditionalConfig: "../test_data/test_repos/test_repo_10/.gitleaks.toml",
},
wantPath: "../test_data/test_additional_config.json",
},
{
description: "test append repo config with additional config",
opts: options.Options{
Path: "../test_data/test_repos/test_repo_10",
Report: "../test_data/test_append_repo_additional_config.json.got",
ReportFormat: "json",
ConfigPath: "../test_data/test_configs/nozips.toml",
RepoConfigPath: ".gitleaks.toml",
AppendRepoConfig: true,
AdditionalConfig: "../test_data/test_configs/allowlist_bad_docx_10.toml",
},
wantPath: "../test_data/test_local_repo_two_allowlist_commits_files_at_commit.json",
wantEmpty: true,
},
{
description: "test local repo two global allowlist commit config",
description: "test append repo config with additional config",
opts: options.Options{
Path: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_global_allowlist_files_at_commit.json.got",
ConfigPath: "../test_data/test_configs/allowlist_global_files.toml",
ReportFormat: "json",
FilesAtCommit: "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
Path: "../test_data/test_repos/test_repo_10",
Report: "../test_data/test_append_repo_additional_config.json.got",
ReportFormat: "json",
ConfigPath: "../test_data/test_configs/nozips.toml",
RepoConfigPath: ".gitleaks.toml",
AppendRepoConfig: true,
AdditionalConfig: "../test_data/test_configs/allowlist_bad_docx_10.toml",
},
wantEmpty: true,
},
{
description: "test file with no leak due to additional config no git",
opts: options.Options{
Path: "../test_data/test_repos/test_dir_1",
Report: "../test_data/fail.json.got",
ReportFormat: "json",
NoGit: false,
AdditionalConfig: "../test_data/test_configs/allowlist_allow_all_repo_1.toml",
},
wantPath: "../test_data/test_local_repo_two_global_allowlist_files_at_commit.json",
wantEmpty: true,
},
}
@@ -714,7 +760,7 @@ func fileCheck(wantPath, gotPath string) error {
}
}
if !found {
return fmt.Errorf("unable to find %+v in got leaks", wantLeak)
return fmt.Errorf("unable to find %+v in %s", wantLeak, gotPath)
}
}
@@ -733,6 +779,10 @@ func same(l1, l2 Leak) bool {
return false
}
if l1.OffenderEntropy != l2.OffenderEntropy {
return false
}
if l1.Line != l2.Line {
return false
}
+32 -4
View File
@@ -57,6 +57,28 @@ func (us *UnstagedScanner) Scan() (Report, error) {
if err != nil {
continue
}
// Check if file is allow listed
if us.cfg.Allowlist.FileAllowed(filepath.Base(fn)) ||
us.cfg.Allowlist.PathAllowed(fn) {
continue
}
// Check individual file path ONLY rules
for _, rule := range us.cfg.Rules {
if rule.HasFileOrPathLeakOnly(fn) {
leak := NewLeak("", "Filename or path offender: "+fn, defaultLineNumber)
leak.Repo = us.repoName
leak.File = fn
leak.RepoURL = us.opts.RepoURL
leak.LeakURL = leak.URL()
leak.Rule = rule.Description
leak.Tags = strings.Join(rule.Tags, ", ")
leak.Log(us.opts)
scannerReport.Leaks = append(scannerReport.Leaks, leak)
continue
}
}
if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
return scannerReport, err
}
@@ -65,7 +87,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
lineNumber++
for _, rule := range us.cfg.Rules {
offender := rule.Inspect(line)
if offender == "" {
if offender.IsEmpty() {
continue
}
if us.cfg.Allowlist.RegexAllowed(line) ||
@@ -79,7 +101,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
if rule.Path.String() != "" && !rule.HasFilePathLeak(filepath.Base(workTreeFile.Name())) {
continue
}
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(emptyCommit())
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(emptyCommit()).WithEntropy(offender.EntropyLevel)
leak.File = workTreeFile.Name()
leak.LineNumber = lineNumber
leak.Repo = us.repoName
@@ -162,6 +184,12 @@ func (us *UnstagedScanner) Scan() (Report, error) {
}
}
// Check if file is allow listed
if us.cfg.Allowlist.FileAllowed(filepath.Base(filename)) ||
us.cfg.Allowlist.PathAllowed(filename) {
continue
}
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
prettyDiff := diffPrettyText(diffs)
@@ -178,7 +206,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
for _, line := range strings.Split(diffContents, "\n") {
for _, rule := range us.cfg.Rules {
offender := rule.Inspect(line)
if offender == "" {
if offender.IsEmpty() {
continue
}
if us.cfg.Allowlist.RegexAllowed(line) ||
@@ -192,7 +220,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
if rule.Path.String() != "" && !rule.HasFilePathLeak(filepath.Base(filename)) {
continue
}
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(emptyCommit())
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(emptyCommit()).WithEntropy(offender.EntropyLevel)
leak.File = filename
leak.LineNumber = extractLine(prettyDiff, leak, lineLookup) + 1
leak.Repo = us.repoName
+19
View File
@@ -0,0 +1,19 @@
[
{
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: tmp/bad.docx",
"offenderEntropy": -1,
"commit": "b0f9b62dfe12e4e10de180359c6b9276472494f8",
"repo": "test_repo_10",
"repoURL": "",
"leakURL": "",
"rule": "Block dangerous filetypes",
"commitMessage": "Create bad.docx",
"author": "Zachary Rice",
"email": "zricer@protonmail.com",
"file": "tmp/bad.docx",
"date": "2020-12-09T11:02:10-05:00",
"tags": "key, extensions"
}
]
@@ -3,6 +3,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/.gitignore",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/bad.zip",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/gitfile.txt",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -46,5 +49,39 @@
"file": "../test_data/test_repos/test_repo_10/gitfile.txt",
"date": "0001-01-01T00:00:00Z",
"tags": "key, extensions"
},
{
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/creds.git",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
"leakURL": "",
"rule": "Block dangerous filetypes",
"commitMessage": "",
"author": "",
"email": "",
"file": "../test_data/test_repos/test_repo_10/creds.git",
"date": "0001-01-01T00:00:00Z",
"tags": "key, extensions"
},
{
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/somedir.git/secret.key",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
"leakURL": "",
"rule": "Block dangerous filetypes",
"commitMessage": "",
"author": "",
"email": "",
"file": "../test_data/test_repos/test_repo_10/somedir.git/secret.key",
"date": "0001-01-01T00:00:00Z",
"tags": "key, extensions"
}
]
+1
View File
@@ -3,6 +3,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: tmp/bad.docx",
"offenderEntropy": -1,
"commit": "b0f9b62dfe12e4e10de180359c6b9276472494f8",
"repo": "test_repo_10",
"repoURL": "",
@@ -1,8 +1,26 @@
[
{
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/somedir.git/secret.key",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
"leakURL": "",
"rule": "Block dangerous filetypes",
"commitMessage": "",
"author": "",
"email": "",
"file": "../test_data/test_repos/test_repo_10/somedir.git/secret.key",
"date": "0001-01-01T00:00:00Z",
"tags": "key, extensions"
},
{
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/tmp/bad.docx",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
+19
View File
@@ -0,0 +1,19 @@
[
{
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: tmp/bad.docx",
"offenderEntropy": -1,
"commit": "b0f9b62dfe12e4e10de180359c6b9276472494f8",
"repo": "test_repo_10",
"repoURL": "",
"leakURL": "",
"rule": "Block dangerous filetypes",
"commitMessage": "Create bad.docx",
"author": "Zachary Rice",
"email": "zricer@protonmail.com",
"file": "tmp/bad.docx",
"date": "2020-12-09T11:02:10-05:00",
"tags": "key, extensions"
}
]
@@ -0,0 +1,3 @@
[allowlist]
description = "Allowlisted files"
files = [ '''server.test.py''','''server.test2.py''']
@@ -0,0 +1,3 @@
[allowlist]
description = "Allowlisted files"
files = [ '''bad.docx''']
+1 -1
View File
@@ -1,6 +1,6 @@
[[rules]]
description = "Block dangerous filetypes"
file = '''(.*?)(gitfile.txt|gitignore|pdf|doc|docx|zip|xls|tfplan|tfstate|tfvars|vault_pass|vagrant|pyc|key|cache)$'''
file = '''(.*?)(creds.git|gitfile.txt|gitignore|pdf|doc|docx|zip|xls|tfplan|tfstate|tfvars|vault_pass|vagrant|pyc|key|cache)$'''
tags = ["key", "extensions"]
[rules.allowlist]
paths = ['''.docx''']
+4
View File
@@ -0,0 +1,4 @@
[[rules]]
description = "No Zips"
file = '''.*\.zip'''
+2
View File
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
+1
View File
@@ -2,6 +2,7 @@
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"offender": "Entropy range [{P1:4.5 P2:4.7} {P1:5.5 P2:6.3}]",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "entropy",
+1
View File
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
+23
View File
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repos",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"repoURL": "",
@@ -51,6 +54,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"repoURL": "",
@@ -67,6 +71,7 @@
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
"repoURL": "",
@@ -83,6 +88,7 @@
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"repoURL": "",
@@ -99,6 +105,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_3",
"repoURL": "",
@@ -115,6 +122,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_3",
"repoURL": "",
@@ -131,6 +139,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_3",
"repoURL": "",
@@ -147,6 +156,7 @@
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_4",
"repoURL": "",
@@ -163,6 +173,7 @@
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_4",
"repoURL": "",
@@ -179,6 +190,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_4",
"repoURL": "",
@@ -195,6 +207,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
"repoURL": "",
@@ -211,6 +224,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_4",
"repoURL": "",
@@ -227,6 +241,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
"repo": "test_repo_5",
"repoURL": "",
@@ -243,6 +258,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"offenderEntropy": -1,
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
"repoURL": "",
@@ -259,6 +275,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repos",
"repoURL": "",
@@ -275,6 +292,7 @@
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"repoURL": "",
@@ -291,6 +309,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 2,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "ce7e8177bbf8a172c06b6a1e370a374d5c19f660",
"repo": "test_repo_8",
"repoURL": "",
@@ -307,6 +326,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "9267bc86ec1497471cbc6f3308f3527f7ef34b9d",
"repo": "test_repo_8",
"repoURL": "",
@@ -323,6 +343,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
"repo": "test_repo_8",
"repoURL": "",
@@ -339,6 +360,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a",
"repo": "test_repo_9",
"repoURL": "",
@@ -355,6 +377,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repos",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"repoURL": "",
@@ -51,6 +54,7 @@
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"repoURL": "",
@@ -67,6 +71,7 @@
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
"repoURL": "",
@@ -83,6 +88,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_3",
"repoURL": "",
@@ -99,6 +105,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_3",
"repoURL": "",
@@ -115,6 +122,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_3",
"repoURL": "",
@@ -131,6 +139,7 @@
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_4",
"repoURL": "",
@@ -147,6 +156,7 @@
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_4",
"repoURL": "",
@@ -163,6 +173,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
"repoURL": "",
@@ -179,6 +190,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_4",
"repoURL": "",
@@ -195,6 +207,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_4",
"repoURL": "",
@@ -211,6 +224,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"offenderEntropy": -1,
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
"repoURL": "",
@@ -227,6 +241,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
"repo": "test_repo_5",
"repoURL": "",
@@ -243,6 +258,7 @@
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"repoURL": "",
@@ -259,6 +275,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repos",
"repoURL": "",
@@ -275,6 +292,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
"repo": "test_repo_8",
"repoURL": "",
@@ -291,6 +309,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 2,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "ce7e8177bbf8a172c06b6a1e370a374d5c19f660",
"repo": "test_repo_8",
"repoURL": "",
@@ -307,6 +326,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "9267bc86ec1497471cbc6f3308f3527f7ef34b9d",
"repo": "test_repo_8",
"repoURL": "",
@@ -323,6 +343,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a",
"repo": "test_repo_9",
"repoURL": "",
@@ -339,6 +360,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repos",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repos",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"repoURL": "",
@@ -51,6 +54,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"offenderEntropy": -1,
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
"repoURL": "",
@@ -67,6 +71,7 @@
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"repoURL": "",
@@ -83,6 +88,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
"repo": "test_repo_8",
"repoURL": "",
@@ -99,6 +105,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a",
"repo": "test_repo_9",
"repoURL": "",
+3
View File
@@ -3,6 +3,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
"repo": "test_repo_8",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 2,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "ce7e8177bbf8a172c06b6a1e370a374d5c19f660",
"repo": "test_repo_8",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 6,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "9267bc86ec1497471cbc6f3308f3527f7ef34b9d",
"repo": "test_repo_8",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": "more_secrets = '99432bfewaf823ec3294e231'",
"lineNumber": 7,
"offender": "secrets = '99432bfewaf823ec3294e231",
"offenderEntropy": -1,
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
@@ -3,6 +3,7 @@
"line": "more_secrets = '99432bfewaf823ec3294e231'",
"lineNumber": 7,
"offender": "secrets = '99432bfewaf823ec3294e231",
"offenderEntropy": -1,
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
@@ -3,6 +3,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "AWS Access Key",
@@ -18,6 +19,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"offenderEntropy": -1,
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "AWS Access Key",
@@ -18,6 +19,7 @@
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"offenderEntropy": -1,
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"lineNumber": 4,
"offender": "\"99432bfewaf823ec3294e231\"",
"offenderEntropy": 3.355,
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_4",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"lineNumber": 5,
"offender": "\"99432bfewaf823ec3294e231\"",
"offenderEntropy": 3.355,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_4",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_9",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7DXAMPLE'",
"lineNumber": 10,
"offender": "AKIAIO5FODNN7DXAMPLE",
"offenderEntropy": -1,
"commit": "0000000000000000000000000000000000000000",
"repo": "test_repo_1",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": "AKIAIO5FODNN7EXAMPLE",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "0000000000000000000000000000000000000000",
"repo": "test_repo_7",
"rule": "AWS Access Key",
+3
View File
@@ -3,6 +3,7 @@
"line": "api_token: exampleSecretPassword",
"lineNumber": 3,
"offender": "token: exampleSecretPassword",
"offenderEntropy": -1,
"commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d",
"repo": "test_repo_6",
"rule": "Generic password",
@@ -17,6 +18,7 @@
"line": "db_password_token: exampleSecretPassword",
"lineNumber": 3,
"offender": "password_token: exampleSecretPassword",
"offenderEntropy": -1,
"commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d",
"repo": "test_repo_6",
"rule": "Generic password",
@@ -31,6 +33,7 @@
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "95cf0237f8cdfc0686a29df08260d8635f46c9b0",
"repo": "test_repo_6",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": "api_token: exampleSecretPassword",
"lineNumber": 2,
"offender": "token: exampleSecretPassword",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic password",
@@ -18,6 +19,7 @@
"line": "db_password: verySecretProductionPassword",
"lineNumber": 3,
"offender": "password: verySecretProductionPassword",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic password",
@@ -3,6 +3,7 @@
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": "apiToken=d41d8cd98f00b204e9800998ecf8427e",
"lineNumber": 2,
"offender": "Token=d41d8cd98f00b204e9800998ecf8427e",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic password",
@@ -3,6 +3,7 @@
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_6",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"offenderEntropy": -1,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_6",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_3",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_3",
"repoURL": "",
@@ -51,6 +54,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_3",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_3",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_3",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"repoURL": "",
+3
View File
@@ -3,6 +3,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -3,6 +3,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": -1,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "AWS Access Key",
@@ -18,6 +19,7 @@
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"offenderEntropy": -1,
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "AWS Access Key",
@@ -33,6 +35,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": -1,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Access Key",
@@ -48,6 +51,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": -1,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Access Key",
@@ -63,6 +67,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Access Key",
@@ -78,6 +83,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"rule": "AWS Access Key",
@@ -3,6 +3,7 @@
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"offenderEntropy": -1,
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"repoURL": "",
+9
View File
@@ -3,6 +3,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/README.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -19,6 +20,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -35,6 +37,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/no_secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -51,6 +54,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_3/no_secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -67,6 +71,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_3/secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -83,6 +88,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -99,6 +105,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/no_secrets.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -115,6 +122,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_5/notes.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
@@ -131,6 +139,7 @@
"line": "",
"lineNumber": 1,
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_8/README.md",
"offenderEntropy": -1,
"commit": "",
"repo": "",
"repoURL": "",
+1
View File
@@ -3,6 +3,7 @@
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"lineNumber": 6,
"offender": "'ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"offenderEntropy": 4.631,
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "entropy and regex",
Whitespace-only changes.
@@ -0,0 +1 @@
hah