Compare commits

..
22 Commits
Author SHA1 Message Date
Zachary Rice 94f5950d68 Use allowlist (#411) 2020-07-24 11:58:43 -04:00
Zachary Rice fe69a17c9c Change remaining audits to scan (#410) 2020-07-24 11:30:33 -04:00
Zachary Rice 6ca7a11d88 Add line number to report plus some other things (#409)
* Init refactor

* think i got it working

* we got em

* Updating tests

* fixing tests

* Better comments, more test fixing

* Bumping to v5

* Fixing golint messages

* Replacing usage of audit with scan in comments

* bumping go-git

* Updating to v5 in some other spots
2020-07-24 10:49:03 -04:00
Zachary Rice cfbb600fcb Fixing patch direction and making additions the default (#408)
* Fixing patch direction and making additions the default

* adding test
2020-07-22 13:32:46 -04:00
Zachary Rice e36b550851 adding go mod/sum to ignore, adding quotes to aws secret rule (#397)
* adding go mod/sum to ignore, adding quotes to aws secret rule

* lil nicer formatting
2020-06-14 15:41:04 -04:00
zricethezav 2232dc191c removing bad options guard 2020-06-03 08:51:11 -04:00
Zachary Rice bdc688dd53 fix whitelist commits, added test (#390) 2020-05-31 10:25:58 -04:00
Steeve Barbeau e0f6399d5c Audit commits based on date/time parameters (#385)
* time based audit

* fixing SIGSEGV

* adding options for date and time format + tests

* Update repo.go

* Update github.go

* rebase + tests update
2020-05-24 18:03:47 -04:00
Zachary Rice 3e88ac6726 Update README.md 2020-05-20 15:48:53 -04:00
Zeyshi d0088f6c7c Update default.go (#382) 2020-05-14 17:27:35 -04:00
zricethezav 0d7c18cb39 fixing whitelist repo tests 2020-05-09 11:37:08 -04:00
zricethezav d0e98416b9 Merge branch 'master' of github.com:zricethezav/gitleaks 2020-05-09 11:24:06 -04:00
Zachary Rice b7438011b4 Rm generic from default (#379)
* fixing commit latest bug

* remove generic rule from default to reduce false positives
2020-05-09 11:21:17 -04:00
zricethezav 4e59d3bf19 Merge branch 'master' of github.com:zricethezav/gitleaks 2020-05-09 10:54:35 -04:00
Steeve Barbeau e4b26aea4a fixing issue #367 (#368) 2020-05-09 10:49:00 -04:00
Zachary Rice 473d0d55a7 Whitelist repo (#378)
* fixing commit latest bug

* bumping go-git and adding repo whitelist

* adding tests
2020-05-09 10:38:02 -04:00
Zachary Rice 8bd4649b01 Update leaky-repo.toml 2020-05-09 08:53:43 -04:00
zricethezav a69df84325 Merge branch 'master' of github.com:zricethezav/gitleaks 2020-05-09 08:51:58 -04:00
Marlon Pina Tojal 0faebdefea Whitelist files not being parsed (#375)
It seems that there is a typo on the default rules.
2020-05-04 10:56:27 -04:00
Zachary Rice a728e3abf3 Documentation upgrade (#374)
* fixing commit latest bug

* updating readme

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2020-04-28 17:43:01 -04:00
zricethezav e87c62fe72 Merge branch 'master' of github.com:zricethezav/gitleaks 2020-04-23 11:23:46 -04:00
zricethezav b4a0577786 fixing commit latest bug 2020-04-05 11:31:22 -04:00
64 changed files with 1975 additions and 2510 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
language: go
go:
- 1.13.x
- 1.14.x
services:
- docker
script:
+2 -2
View File
@@ -2,8 +2,8 @@
VERSION := `git fetch --tags && git tag | sort -V | tail -1`
PKG=github.com/zricethezav/gitleaks
LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks/v4/version.Version=$(VERSION)"
_LDFLAGS="github.com/zricethezav/gitleaks/v4/version.Version=$(VERSION)"
LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks/v5/version.Version=$(VERSION)"
_LDFLAGS="github.com/zricethezav/gitleaks/v5/version.Version=$(VERSION)"
COVER=--cover --coverprofile=cover.out
test-cover:
+19 -132
View File
@@ -5,148 +5,35 @@
</p>
</p>
### [Gitleaks Action](https://github.com/marketplace/actions/gitleaks) now available for your workflows!
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.
### Features:
- Scans for [commited](https://github.com/zricethezav/gitleaks/wiki/Scanning) secrets
- Scans for [uncommitted](https://github.com/zricethezav/gitleaks/wiki/Scanning#uncommitted-changes-scan) secrets as part of shifting security left
- Available [Github Action](https://github.com/marketplace/actions/gitleaks)
- Gitlab and Github API support which allows scans of whole organizations, users, and pull/merge requests
- [Custom rules](https://github.com/zricethezav/gitleaks/wiki/Configuration) via toml configuration
- High performance using [go-git](https://github.com/go-git/go-git)
- JSON and CSV reporting
- Private repo scans using key or password based authentication
Audit git repos for secrets. Gitleaks provides a way for you to find unencrypted secrets and other unwanted data types in git repositories. As part of its core functionality, it provides:
* Audits for uncommitted changes
* Github and Gitlab support including support for bulk organization and repository owner (user) repository scans, as well as pull/merge request scanning for use in common CI workflows.
* Support for private repository scans, and repositories that require key based authentication
* Output in JSON formats for consumption in other reporting tools and frameworks
* Externalised configuration for environment specific customisation including regex rules
* High performance through the use of src-d's [go-git](https://github.com/src-d/go-git) framework
## Installation, Documentation and Examples
This project is documented [here](https://github.com/zricethezav/gitleaks/wiki)
### Sponsors ❤️
#### Corporate 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)
| `repo scan` |
|---|
| <p align="left"><img src="https://raw.githubusercontent.com/zricethezav/gifs/master/repo-scan.gif"></p> | <p align="left"><img src="https://raw.githubusercontent.com/zricethezav/gifs/master/repo-scan.gif"></p> |
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)
| `pre commit scan` |
|---|
| <p align="left"><img src="https://raw.githubusercontent.com/zricethezav/gifs/master/pre-commit-1.gif"></p> |
## Getting Started
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, as per the below;
#### MacOS
```
brew install gitleaks
```
#### Docker
```bash
docker pull zricethezav/gitleaks
```
#### Go
Ensure `GO111MODULE=on` is set as an env var
```bash
go get github.com/zricethezav/gitleaks/v4@latest
```
## Usage
gitleaks has a wide range of configuration options that can be adjusted at runtime or via a configuration file based on your specific requirements.
```
Usage:
gitleaks [OPTIONS]
Application Options:
-v, --verbose Show verbose output from audit
-r, --repo= Target repository
--config= config path
--disk Clones repo(s) to disk
--version version number
--username= Username for git repo
--password= Password for git repo
--access-token= Access token for git repo
--commit= sha of commit to audit
--files-at-commit= sha of commit to audit all files at commit or "latest" to scan the last commit of the repository
--threads= Maximum number of threads gitleaks spawns
--ssh-key= path to ssh key used for auth
--uncommitted run gitleaks on uncommitted code
--repo-path= Path to repo
--owner-path= Path to owner directory (repos discovered)
--branch= Branch to audit
--report= path to write json leaks file
--report-format= json or csv (default: json)
--redact redact secrets from log messages and leaks
--debug log debug messages
--repo-config Load config from target repo. Config file must be ".gitleaks.toml" or "gitleaks.toml"
--pretty Pretty print json if leaks are present
--commit-from= Commit to start audit from
--commit-to= Commit to stop audit
--timeout= Time allowed per audit. Ex: 10us, 30s, 1m, 1h10m1s
--depth= Number of commits to audit
--host= git hosting service like gitlab or github. Supported hosts include: Github, Gitlab
--baseurl= Base URL for API requests. Defaults to the public GitLab or GitHub API, but can be set to a domain endpoint to use with a self hosted server.
--org= organization to audit
--user= user to audit
--pr= pull/merge request url
--exclude-forks audit excludes forks
Help Options:
-h, --help Show this help message
```
### Docker usage examples
Run gitleaks against:
###### Public repository
```bash
docker run --rm --name=gitleaks zricethezav/gitleaks -v -r https://github.com/zricethezav/gitleaks.git
```
###### Local repository already cloned into /tmp/
```bash
docker run --rm --name=gitleaks -v /tmp/:/code/ zricethezav/gitleaks -v --repo-path=/code/gitleaks
```
By default repos cloned to memory. Using `--disk` for clone to disk or you can quickly out of memory.
For speed up analyze operation using `--threads` parameter, which set to `ALL - 1` threads at your instance CPU.
## Exit Codes
Gitleaks provides consistent exist codes to assist in automation workflows such as CICD platforms and bulk scanning.
```
0: no leaks
1: leaks present
2: error encountered
```
----
## Give Thanks
👋 If using gitleaks has made your job easier consider sponsoring me through github's sponsorship program or donating a little something
❤️ [sponsor](https://github.com/sponsors/zricethezav)
💵 [paypal](https://www.paypal.me/zricethezav)
₿itcoin:3GndEzRZa6rJ8ZpkLureUcc5TDHMYfpDxn
### Sponsors
#### Individual Sponsors
These users are [sponsors](https://github.com/sponsors/zricethezav) of gitleaks:
[![Adam Shannon](https://github.com/adamdecaf.png?size=75)](https://github.com/adamdecaf) | [![Granville Schmidt](https://github.com/gramidt.png?size=75)](https://github.com/gramidt) |
[![Adam Shannon](https://github.com/adamdecaf.png?size=50)](https://github.com/adamdecaf) | [![Granville Schmidt](https://github.com/gramidt.png?size=50)](https://github.com/gramidt) |
---|---|
[Adam Shannon](https://ashannon.us/) | [Granville Schmidt](https://cloudcompliance.ninja)
----
#### Logo Attribution
The Gitleaks logo uses the Git Logo created <a href="https://twitter.com/jasonlong">Jason Long</a> is licensed under the <a href="https://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
-56
View File
@@ -1,56 +0,0 @@
package audit
import (
"fmt"
"io/ioutil"
"path"
"github.com/zricethezav/gitleaks/v4/manager"
log "github.com/sirupsen/logrus"
)
// Run accepts a manager and begins an audit based on the options/configs set in the manager.
func Run(m *manager.Manager) error {
if m.Opts.OwnerPath != "" {
files, err := ioutil.ReadDir(m.Opts.OwnerPath)
if err != nil {
return err
}
for _, f := range files {
if !f.IsDir() {
continue
}
m.Opts.RepoPath = fmt.Sprintf("%s/%s", m.Opts.OwnerPath, f.Name())
if err := runHelper(NewRepo(m)); err != nil {
log.Warnf("%s is not a git repo, skipping", f.Name())
}
}
return nil
}
return runHelper(NewRepo(m))
}
func runHelper(r *Repo) error {
if r.Manager.Opts.OpenLocal() {
r.Name = path.Base(r.Manager.Opts.RepoPath)
if err := r.Open(); err != nil {
return err
}
// Check if we are checking uncommitted files. This is the default behavior
// for a "$ gitleaks" command with no options set
if r.Manager.Opts.CheckUncommitted() {
if err := r.AuditUncommitted(); err != nil {
return err
}
return nil
}
} else {
if err := r.Clone(nil); err != nil {
return err
}
}
return r.Audit()
}
-425
View File
@@ -1,425 +0,0 @@
package audit
import (
"bytes"
"context"
"crypto/md5"
"fmt"
"io"
"os"
"path"
"path/filepath"
"sync"
"time"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/manager"
"github.com/BurntSushi/toml"
"github.com/sergi/go-diff/diffmatchpatch"
log "github.com/sirupsen/logrus"
"gopkg.in/src-d/go-billy.v4"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/go-git.v4/plumbing/storer"
"gopkg.in/src-d/go-git.v4/storage/memory"
)
// Repo wraps a *git.Repository object in addition to a manager object and the name of the repo.
// Commits are inspected from the *git.Repository object. If a commit is found then we send it
// via the manager LeakChan where the manager receives and keeps track of all leaks.
type Repo struct {
*git.Repository
// config is used when the --repo-config option is set.
// This allows users to load up configs specific to their repos.
// Imagine the scenario where you are doing an audit of a large organization
// and you want certain repos to look for specific rules. If those specific repos
// have a gitleaks.toml or .gitleaks.toml config then those configs will be used specifically
// for those repo audits.
config config.Config
// ctx is used to signal timeouts to running goroutines
ctx context.Context
cancel context.CancelFunc
Name string
Manager *manager.Manager
}
// NewRepo initializes and returns a Repo struct.
func NewRepo(m *manager.Manager) *Repo {
return &Repo{
Manager: m,
config: m.Config,
ctx: context.Background(),
}
}
// Clone will clone a repo and return a Repo struct which contains a go-git repo. The clone method
// is determined by the clone options set in Manager.metadata.cloneOptions
func (repo *Repo) Clone(cloneOption *git.CloneOptions) error {
var (
repository *git.Repository
err error
)
if cloneOption == nil {
cloneOption = repo.Manager.CloneOptions
}
log.Infof("cloning... %s", cloneOption.URL)
start := time.Now()
if repo.Manager.CloneDir != "" {
clonePath := fmt.Sprintf("%s/%x", repo.Manager.CloneDir, md5.Sum([]byte(time.Now().String())))
repository, err = git.PlainClone(clonePath, false, cloneOption)
} else {
repository, err = git.Clone(memory.NewStorage(), nil, cloneOption)
}
if err != nil {
return err
}
repo.Name = filepath.Base(repo.Manager.Opts.Repo)
repo.Repository = repository
repo.Manager.RecordTime(manager.CloneTime(howLong(start)))
return nil
}
func emptyCommit() *object.Commit {
return &object.Commit{
Hash: plumbing.Hash{},
Message: "***STAGED CHANGES***",
Author: object.Signature{
Name: "",
Email: "",
When: time.Unix(0, 0).UTC(),
},
}
}
// auditEmpty audits an empty repo without any commits. See https://github.com/zricethezav/gitleaks/issues/352
func (repo *Repo) auditEmpty() error {
auditTimeStart := time.Now()
wt, err := repo.Worktree()
if err != nil {
return err
}
status, err := wt.Status()
for fn := range status {
workTreeBuf := bytes.NewBuffer(nil)
workTreeFile, err := wt.Filesystem.Open(fn)
if err != nil {
continue
}
if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
return err
}
InspectFile(workTreeBuf.String(), workTreeFile.Name(), emptyCommit(), repo)
}
repo.Manager.RecordTime(manager.AuditTime(howLong(auditTimeStart)))
return nil
}
// AuditUncommitted will do a `git diff` and scan changed files that are being tracked. This is useful functionality
// for a pre-commit hook so you can make sure your code does not have any leaks before committing.
func (repo *Repo) AuditUncommitted() error {
// load up alternative config if possible, if not use manager's config
if repo.Manager.Opts.RepoConfig {
cfg, err := repo.loadRepoConfig()
if err != nil {
return err
}
repo.config = cfg
}
if err := repo.setupTimeout(); err != nil {
return err
}
r, err := repo.Head()
if err == plumbing.ErrReferenceNotFound {
// possibly an empty repo, or maybe its not, either way lets scan all the files in the directory
return repo.auditEmpty()
} else if err != nil {
return err
}
auditTimeStart := time.Now()
c, err := repo.CommitObject(r.Hash())
if err != nil {
return err
}
// Staged change so the commit details do not yet exist. Insert empty defaults.
c.Hash = plumbing.Hash{}
c.Message = "***STAGED CHANGES***"
c.Author.Name = ""
c.Author.Email = ""
c.Author.When = time.Unix(0, 0).UTC()
prevTree, err := c.Tree()
if err != nil {
return err
}
wt, err := repo.Worktree()
if err != nil {
return err
}
status, err := wt.Status()
for fn, state := range status {
var (
prevFileContents string
currFileContents string
filename string
)
if state.Staging != git.Untracked {
if state.Staging == git.Deleted {
// file in staging has been deleted, aka it is not on the filesystem
// so the contents of the file are ""
currFileContents = ""
} else {
workTreeBuf := bytes.NewBuffer(nil)
workTreeFile, err := wt.Filesystem.Open(fn)
if err != nil {
continue
}
if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
return err
}
currFileContents = workTreeBuf.String()
filename = workTreeFile.Name()
}
// get files at HEAD state
prevFile, err := prevTree.File(fn)
if err != nil {
prevFileContents = ""
} else {
prevFileContents, err = prevFile.Contents()
if err != nil {
return err
}
if filename == "" {
filename = prevFile.Name
}
}
diffs := diffmatchpatch.New().DiffMain(prevFileContents, currFileContents, false)
var diffContents string
for _, d := range diffs {
switch d.Type {
case diffmatchpatch.DiffInsert:
diffContents += fmt.Sprintf("%s\n", d.Text)
case diffmatchpatch.DiffDelete:
diffContents += fmt.Sprintf("%s\n", d.Text)
}
}
InspectFile(diffContents, filename, c, repo)
}
}
if err != nil {
return err
}
repo.Manager.RecordTime(manager.AuditTime(howLong(auditTimeStart)))
return nil
}
// Audit is responsible for scanning the entire history (default behavior) of a
// git repo. Options that can change the behavior of this function include: --commit, --depth, --branch.
// See options/options.go for an explanation on these options.
func (repo *Repo) Audit() error {
if err := repo.setupTimeout(); err != nil {
return err
}
if repo.cancel != nil {
defer repo.cancel()
}
if repo.Repository == nil {
return fmt.Errorf("%s repo is empty", repo.Name)
}
// load up alternative config if possible, if not use manager's config
if repo.Manager.Opts.RepoConfig {
cfg, err := repo.loadRepoConfig()
if err != nil {
return err
}
repo.config = cfg
}
auditTimeStart := time.Now()
// audit commit patches OR all files at commit. See https://github.com/zricethezav/gitleaks/issues/326
// TODO having --commit= and --fites-at-commit= set should probably be guarded against
if repo.Manager.Opts.Commit != "" {
return inspectCommit(repo.Manager.Opts.Commit, repo, inspectCommitPatches)
} else if repo.Manager.Opts.FilesAtCommit != "" {
return inspectCommit(repo.Manager.Opts.FilesAtCommit, repo, inspectFilesAtCommit)
}
logOpts, err := getLogOptions(repo)
if err != nil {
return err
}
cIter, err := repo.Log(logOpts)
if err != nil {
return err
}
cc := 0
semaphore := make(chan bool, howManyThreads(repo.Manager.Opts.Threads))
wg := sync.WaitGroup{}
err = cIter.ForEach(func(c *object.Commit) error {
if c == nil || repo.timeoutReached() || repo.depthReached(cc) {
return storer.ErrStop
}
if len(c.ParentHashes) == 0 {
cc++
err = inspectFilesAtCommit(c, repo)
if err != nil {
return err
}
return nil
}
if isCommitWhiteListed(c.Hash.String(), repo.config.Whitelist.Commits) {
return nil
}
cc++
err = c.Parents().ForEach(func(parent *object.Commit) error {
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.
// Once a fix has been merged I will remove this recover.
return
}
}()
if repo.timeoutReached() {
return nil
}
start := time.Now()
patch, err := c.Patch(parent)
if err != nil {
return fmt.Errorf("could not generate patch")
}
repo.Manager.RecordTime(manager.PatchTime(howLong(start)))
wg.Add(1)
semaphore <- true
go func(c *object.Commit, patch *object.Patch) {
defer func() {
<-semaphore
wg.Done()
}()
inspectPatch(patch, c, repo)
}(c, patch)
return nil
})
if c.Hash.String() == repo.Manager.Opts.CommitTo {
return storer.ErrStop
}
return nil
})
wg.Wait()
repo.Manager.RecordTime(manager.AuditTime(howLong(auditTimeStart)))
repo.Manager.IncrementCommits(cc)
return nil
}
// Open opens a local repo either from repo-path or $PWD
func (repo *Repo) Open() error {
if repo.Manager.Opts.RepoPath != "" {
// open git repo from repo path
repository, err := git.PlainOpen(repo.Manager.Opts.RepoPath)
if err != nil {
return err
}
repo.Repository = repository
} else {
// open git repo from PWD
dir, err := os.Getwd()
if err != nil {
return err
}
repository, err := git.PlainOpen(dir)
if err != nil {
return err
}
repo.Repository = repository
repo.Name = path.Base(dir)
}
return nil
}
func (repo *Repo) loadRepoConfig() (config.Config, error) {
wt, err := repo.Repository.Worktree()
if err != nil {
return config.Config{}, err
}
var f billy.File
f, _ = wt.Filesystem.Open(".gitleaks.toml")
if f == nil {
f, err = wt.Filesystem.Open("gitleaks.toml")
if err != nil {
return config.Config{}, fmt.Errorf("problem loading repo config: %v", err)
}
}
defer f.Close()
var tomlLoader config.TomlLoader
_, err = toml.DecodeReader(f, &tomlLoader)
return tomlLoader.Parse()
}
// timeoutReached returns true if the timeout deadline has been met. This function should be used
// at the top of loops and before potentially long running goroutines (like checking inefficient regexes)
func (repo *Repo) timeoutReached() bool {
if repo.ctx.Err() == context.DeadlineExceeded {
return true
}
return false
}
// setupTimeout parses the --timeout option and assigns a context with timeout to the manager
// which will exit early if the timeout has been met.
func (repo *Repo) setupTimeout() error {
if repo.Manager.Opts.Timeout == "" {
return nil
}
timeout, err := time.ParseDuration(repo.Manager.Opts.Timeout)
if err != nil {
return err
}
repo.ctx, repo.cancel = context.WithTimeout(context.Background(), timeout)
go func() {
select {
case <-repo.ctx.Done():
if repo.timeoutReached() {
log.Warnf("Timeout deadline (%s) exceeded for %s", timeout.String(), repo.Name)
}
}
}()
return nil
}
func (repo *Repo) depthReached(i int) bool {
if repo.Manager.Opts.Depth != 0 && repo.Manager.Opts.Depth == i {
log.Warnf("Exceeded depth limit (%d)", i)
return true
}
return false
}
-465
View File
@@ -1,465 +0,0 @@
package audit
import (
"fmt"
"math"
"path/filepath"
"regexp"
"runtime"
"strings"
"time"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/manager"
log "github.com/sirupsen/logrus"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
fdiff "gopkg.in/src-d/go-git.v4/plumbing/format/diff"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)
// Inspect patch accepts a patch, commit, and repo. If the patches contains files that are
// binary, then gitleaks will skip auditing that file OR if a file is matched on
// whitelisted files set in the configuration. If a global rule for files is defined and a filename
// matches said global rule, then a leak is sent to the manager.
// After that, file chunks are created which are then inspected by InspectString()
func inspectPatch(patch *object.Patch, c *object.Commit, repo *Repo) {
for _, f := range patch.FilePatches() {
if repo.timeoutReached() {
return
}
if f.IsBinary() {
continue
}
for _, chunk := range f.Chunks() {
if chunk.Type() == fdiff.Delete || chunk.Type() == fdiff.Add {
InspectFile(chunk.Content(), getFileFullPath(f), c, repo)
}
}
}
}
// getFileName accepts a file patch and returns the filename
func getFileFullPath(f fdiff.FilePatch) string {
fn := "???"
from, to := f.Files()
if from != nil {
return from.Path()
} else if to != nil {
return to.Path()
}
return fn
}
// getFileName accepts a string with full path and returns only path
func getFilePath(fullpath string) string {
return filepath.Dir(fullpath)
}
// getFileName accepts a string with full path and returns only filename
func getFileName(fullpath string) string {
return filepath.Base(fullpath)
}
// aws_access_key_id='AKIAIO5FODNN7EXAMPLE',
// trippedEntropy checks if a given capture group or offender falls in between entropy ranges
// supplied by a custom gitleaks configuration. Gitleaks do not check entropy by default.
func trippedEntropy(groups []string, rule config.Rule) bool {
for _, e := range rule.Entropies {
if len(groups) > e.Group {
entropy := shannonEntropy(groups[e.Group])
if entropy >= e.Min && entropy <= e.Max {
return true
}
}
}
return false
}
// getShannonEntropy https://en.wiktionary.org/wiki/Shannon_entropy
func shannonEntropy(data string) (entropy float64) {
if data == "" {
return 0
}
charCounts := make(map[rune]int)
for _, char := range data {
charCounts[char]++
}
invLength := 1.0 / float64(len(data))
for _, count := range charCounts {
freq := float64(count) * invLength
entropy -= freq * math.Log2(freq)
}
return entropy
}
// Checks if the given rule has a regex
func ruleContainRegex(rule config.Rule) bool {
if rule.Regex == nil {
return false
}
if rule.Regex.String() == "" {
return false
}
return true
}
// Checks if the given rule has a file name regex
func ruleContainFileNameRegex(rule config.Rule) bool {
if rule.FileNameRegex == nil {
return false
}
if rule.FileNameRegex.String() == "" {
return false
}
return true
}
// Checks if the given rule has a file path regex
func ruleContainFilePathRegex(rule config.Rule) bool {
if rule.FilePathRegex == nil {
return false
}
if rule.FilePathRegex.String() == "" {
return false
}
return true
}
func sendLeak(offender string, line string, filename string, rule config.Rule, c *object.Commit, repo *Repo) {
if repo.Manager.Opts.Redact {
line = strings.ReplaceAll(line, offender, "REDACTED")
offender = "REDACTED"
}
repo.Manager.SendLeaks(manager.Leak{
Line: line,
Offender: offender,
Commit: c.Hash.String(),
Repo: repo.Name,
Message: c.Message,
Rule: rule.Description,
Author: c.Author.Name,
Email: c.Author.Email,
Date: c.Author.When,
Tags: strings.Join(rule.Tags, ", "),
File: filename,
})
}
// InspectFile accepts a file content, fullpath of file, commit and repo. If the file is
// binary OR if a file is matched on whitelisted files set in the configuration, then gitleaks
// will skip auditing that file. It will check first if rules apply to this file comparing filename
// and path to their respective rule regexes and inspect file content with inspectFileContents after.
func InspectFile(content string, fullpath string, c *object.Commit, repo *Repo) {
filename := getFileName(fullpath)
path := getFilePath(fullpath)
// We want to check if there is a whitelist for this file
if len(repo.config.Whitelist.Files) != 0 {
for _, reFileName := range repo.config.Whitelist.Files {
if fileMatched(filename, reFileName) {
log.Debugf("whitelisted file found, skipping audit of file: %s", filename)
return
}
}
}
// We want to check if there is a whitelist for this path
if len(repo.config.Whitelist.Paths) != 0 {
for _, reFilePath := range repo.config.Whitelist.Paths {
if fileMatched(path, reFilePath) {
log.Debugf("file in whitelisted path found, skipping audit of file: %s", filename)
return
}
}
}
for _, rule := range repo.config.Rules {
start := time.Now()
// For each rule we want to check filename whitelists
if isFileNameWhiteListed(filename, rule.Whitelist) || isFilePathWhiteListed(path, rule.Whitelist) {
continue
}
// If it has fileNameRegex and it doesnt match we continue to next rule
if ruleContainFileNameRegex(rule) && !fileMatched(filename, rule.FileNameRegex) {
continue
}
// If it has filePathRegex and it doesnt match we continue to next rule
if ruleContainFilePathRegex(rule) && !fileMatched(path, rule.FilePathRegex) {
continue
}
// If it doesnt contain a content regex then it is a filename regex match
if !ruleContainRegex(rule) {
sendLeak("Filename/path offender: "+filename, "N/A", fullpath, rule, c, repo)
} else {
//otherwise we check if it matches content regex
inspectFileContents(content, fullpath, rule, c, repo)
}
// TODO should return filenameRegex if only file rule
repo.Manager.RecordTime(manager.RegexTime{
Time: howLong(start),
Regex: rule.Regex.String(),
})
}
}
// InspectString accepts a string, commit object, repo, and filename. This function iterates over
// all the rules set by the gitleaks config. If the rule contains entropy checks then entropy will be checked first.
// Next, if the rule contains a regular expression then that will be checked.
func inspectFileContents(content string, path string, rule config.Rule, c *object.Commit, repo *Repo) {
locs := rule.Regex.FindAllIndex([]byte(content), -1)
if len(locs) != 0 {
for _, loc := range locs {
start := loc[0]
end := loc[1]
for start != 0 && content[start] != '\n' {
start = start - 1
}
if start != 0 {
// skip newline
start = start + 1
}
for end < len(content)-1 && content[end] != '\n' {
end = end + 1
}
line := content[start:end]
offender := content[loc[0]:loc[1]]
groups := rule.Regex.FindStringSubmatch(offender)
if isOffenderWhiteListed(offender, rule.Whitelist) {
continue
}
if len(rule.Entropies) != 0 && !trippedEntropy(groups, rule) {
continue
}
sendLeak(offender, line, path, rule, c, repo)
}
}
}
type commitInspector func(c *object.Commit, repo *Repo) error
// inspectCommit accepts a commit hash, repo, and commit inspecting function. A new commit
// object will be created from the hash which will be passed into either inspectCommitPatches
// or inspectFilesAtCommit depending on the options set.
func inspectCommit(commit string, repo *Repo, f commitInspector) error {
if commit == "latest" {
ref, err := repo.Repository.Head()
if err != nil {
return err
}
commit = ref.Hash().String()
}
repo.Manager.IncrementCommits(1)
h := plumbing.NewHash(commit)
c, err := repo.CommitObject(h)
if err != nil {
return err
}
return f(c, repo)
}
// inspectCommitPatches accepts a commit object and a repo. This function is only called when the --commit=
// option has been set. That option tells gitleaks to look only at a single commit and check the contents
// of said commit. Similar to inspectPatch(), if the files contained in the commit are a binaries or if they are
// whitelisted then those files will be skipped.
func inspectCommitPatches(c *object.Commit, repo *Repo) error {
if len(c.ParentHashes) == 0 {
err := inspectFilesAtCommit(c, repo)
if err != nil {
return err
}
}
return c.Parents().ForEach(func(parent *object.Commit) error {
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.
// Once a fix has been merged I will remove this recover.
return
}
}()
if repo.timeoutReached() {
return nil
}
start := time.Now()
patch, err := c.Patch(parent)
if err != nil {
return fmt.Errorf("could not generate patch")
}
repo.Manager.RecordTime(manager.PatchTime(howLong(start)))
inspectPatch(patch, c, repo)
return nil
})
}
// inspectFilesAtCommit accepts a commit object and a repo. This function is only called when the --files-at-commit=
// option has been set. That option tells gitleaks to look only at ALL the files at a commit and check the contents
// of said commit. Similar to inspectPatch(), if the files contained in the commit are a binaries or if they are
// whitelisted then those files will be skipped.
func inspectFilesAtCommit(c *object.Commit, repo *Repo) error {
fIter, err := c.Files()
if err != nil {
return err
}
err = fIter.ForEach(func(f *object.File) error {
bin, err := f.IsBinary()
if bin || repo.timeoutReached() {
return nil
} else if err != nil {
return err
}
content, err := f.Contents()
if err != nil {
return err
}
InspectFile(content, f.Name, c, repo)
return nil
})
return err
}
// howManyThreads will return a number 1-GOMAXPROCS which is the number
// of goroutines that will spawn during gitleaks execution
func howManyThreads(threads int) int {
maxThreads := runtime.GOMAXPROCS(0)
if threads == 0 {
return 1
} else if threads > maxThreads {
log.Warnf("%d threads set too high, setting to system max, %d", threads, maxThreads)
return maxThreads
}
return threads
}
func isCommitWhiteListed(commitHash string, whitelistedCommits []string) bool {
for _, hash := range whitelistedCommits {
if commitHash == hash {
return true
}
}
return false
}
func isOffenderWhiteListed(offender string, whitelist []config.Whitelist) bool {
if len(whitelist) != 0 {
for _, wl := range whitelist {
if wl.Regex.FindString(offender) != "" {
return true
}
}
}
return false
}
func isFileNameWhiteListed(filename string, whitelist []config.Whitelist) bool {
if len(whitelist) != 0 {
for _, wl := range whitelist {
if fileMatched(filename, wl.File) {
return true
}
}
}
return false
}
func isFilePathWhiteListed(filepath string, whitelist []config.Whitelist) bool {
if len(whitelist) != 0 {
for _, wl := range whitelist {
if fileMatched(filepath, wl.Path) {
return true
}
}
}
return false
}
func fileMatched(f interface{}, re *regexp.Regexp) bool {
if re == nil {
return false
}
switch f.(type) {
case nil:
return false
case string:
if re.FindString(f.(string)) != "" {
return true
}
return false
case *object.File:
if re.FindString(f.(*object.File).Name) != "" {
return true
}
return false
}
return false
}
// getLogOptions determines what log options are used when iterating through commits.
// It is similar to `git log {branch}`. Default behavior is to log ALL branches so
// gitleaks gets the full git history.
func getLogOptions(repo *Repo) (*git.LogOptions, error) {
var logOpts git.LogOptions
if repo.Manager.Opts.CommitFrom != "" {
logOpts.From = plumbing.NewHash(repo.Manager.Opts.CommitFrom)
}
if repo.Manager.Opts.Branch != "" {
refs, err := repo.Storer.IterReferences()
if err != nil {
return nil, err
}
err = refs.ForEach(func(ref *plumbing.Reference) error {
if ref.Name().IsTag() {
return nil
}
// check heads first
if ref.Name().String() == "refs/heads/"+repo.Manager.Opts.Branch {
logOpts = git.LogOptions{
From: ref.Hash(),
}
return nil
} else if ref.Name().String() == "refs/remotes/origin/"+repo.Manager.Opts.Branch {
logOpts = git.LogOptions{
From: ref.Hash(),
}
return nil
}
return nil
})
if logOpts.From.IsZero() {
return nil, fmt.Errorf("could not find branch %s", repo.Manager.Opts.Branch)
}
return &logOpts, nil
}
if !logOpts.From.IsZero() {
return &logOpts, nil
}
return &git.LogOptions{All: true}, nil
}
// howLong accepts a time.Time object which is subtracted from time.Now() and
// converted to nanoseconds which is returned
func howLong(t time.Time) int64 {
return time.Now().Sub(t).Nanoseconds()
}
+41 -29
View File
@@ -6,14 +6,14 @@ import (
"regexp"
"strconv"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/options"
"github.com/BurntSushi/toml"
)
// Whitelist is struct containing items that if encountered will whitelist
// Allowlist is struct containing items that if encountered will allowlist
// a commit/line of code that would be considered a leak.
type Whitelist struct {
type Allowlist struct {
Description string
Regex *regexp.Regexp
File *regexp.Regexp
@@ -29,28 +29,29 @@ type Entropy struct {
// 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 audit. Each rule will be checked. If a regex match is found AND
// that match is not whitelisted (globally or locally), then a leak will be appended
// to the final audit report.
// over during an scan. Each rule will be checked. If a regex match is found AND
// that match is not allowlisted (globally or locally), then a leak will be appended
// to the final scan report.
type Rule struct {
Description string
Regex *regexp.Regexp
FileNameRegex *regexp.Regexp
FilePathRegex *regexp.Regexp
Tags []string
Whitelist []Whitelist
Allowlist []Allowlist
Entropies []Entropy
}
// Config is a composite struct of Rules and Whitelists
// Each Rule contains a description, regular expression, tags, and whitelists if available
// Config is a composite struct of Rules and Allowlists
// Each Rule contains a description, regular expression, tags, and allowlists if available
type Config struct {
Rules []Rule
Whitelist struct {
Allowlist struct {
Description string
Commits []string
Files []*regexp.Regexp
Paths []*regexp.Regexp
Repos []*regexp.Regexp
}
}
@@ -58,11 +59,12 @@ type Config struct {
// see the config in config/defaults.go for an example. TomlLoader is used
// to generate Config values (compiling regexes, etc).
type TomlLoader struct {
Whitelist struct {
Allowlist struct {
Description string
Commits []string
Files []string
Paths []string
Repos []string
}
Rules []struct {
Description string
@@ -75,7 +77,7 @@ type TomlLoader struct {
Max string
Group string
}
Whitelist []struct {
Allowlist []struct {
Description string
Regex string
File string
@@ -85,7 +87,7 @@ type TomlLoader struct {
}
// NewConfig will create a new config struct which contains
// rules on how gitleaks will proceed with its audit.
// rules on how gitleaks will proceed with its scan.
// If no options are passed via cli then NewConfig will return
// a default config which can be seen in config.go
func NewConfig(options options.Options) (Config, error) {
@@ -95,8 +97,8 @@ func NewConfig(options options.Options) (Config, error) {
var err error
if options.Config != "" {
_, err = toml.DecodeFile(options.Config, &tomlLoader)
// append a whitelist rule for whitelisting the config
tomlLoader.Whitelist.Files = append(tomlLoader.Whitelist.Files, path.Base(options.Config))
// append a allowlist rule for allowlisting the config
tomlLoader.Allowlist.Files = append(tomlLoader.Allowlist.Files, path.Base(options.Config))
} else {
_, err = toml.Decode(DefaultConfig, &tomlLoader)
}
@@ -113,7 +115,7 @@ func NewConfig(options options.Options) (Config, error) {
}
// Parse will parse the values set in a TomlLoader and use those values
// to create compiled regular expressions and rules used in audits
// to create compiled regular expressions and rules used in scans
func (tomlLoader TomlLoader) Parse() (Config, error) {
var cfg Config
for _, rule := range tomlLoader.Rules {
@@ -130,9 +132,9 @@ func (tomlLoader TomlLoader) Parse() (Config, error) {
return cfg, fmt.Errorf("problem loading config: %v", err)
}
// rule specific whitelists
var whitelists []Whitelist
for _, wl := range rule.Whitelist {
// rule specific allowlists
var allowlists []Allowlist
for _, wl := range rule.Allowlist {
wlRe, err := regexp.Compile(wl.Regex)
if err != nil {
return cfg, fmt.Errorf("problem loading config: %v", err)
@@ -145,7 +147,7 @@ func (tomlLoader TomlLoader) Parse() (Config, error) {
if err != nil {
return cfg, fmt.Errorf("problem loading config: %v", err)
}
whitelists = append(whitelists, Whitelist{
allowlists = append(allowlists, Allowlist{
Description: wl.Description,
File: wlFileNameRe,
Path: wlFilePathRe,
@@ -188,30 +190,40 @@ func (tomlLoader TomlLoader) Parse() (Config, error) {
FileNameRegex: fileNameRe,
FilePathRegex: filePathRe,
Tags: rule.Tags,
Whitelist: whitelists,
Allowlist: allowlists,
Entropies: entropies,
})
}
// global file name whitelists
for _, wlFileName := range tomlLoader.Whitelist.Files {
// global file name allowlists
for _, wlFileName := range tomlLoader.Allowlist.Files {
re, err := regexp.Compile(wlFileName)
if err != nil {
return cfg, fmt.Errorf("problem loading config: %v", err)
}
cfg.Whitelist.Files = append(cfg.Whitelist.Files, re)
cfg.Allowlist.Files = append(cfg.Allowlist.Files, re)
}
// global file path whitelists
for _, wlFilePath := range tomlLoader.Whitelist.Paths {
// global file path allowlists
for _, wlFilePath := range tomlLoader.Allowlist.Paths {
re, err := regexp.Compile(wlFilePath)
if err != nil {
return cfg, fmt.Errorf("problem loading config: %v", err)
}
cfg.Whitelist.Paths = append(cfg.Whitelist.Paths, re)
cfg.Allowlist.Paths = append(cfg.Allowlist.Paths, re)
}
cfg.Whitelist.Commits = tomlLoader.Whitelist.Commits
cfg.Whitelist.Description = tomlLoader.Whitelist.Description
// global repo allowlists
for _, wlRepo := range tomlLoader.Allowlist.Repos {
re, err := regexp.Compile(wlRepo)
if err != nil {
return cfg, fmt.Errorf("problem loading config: %v", err)
}
cfg.Allowlist.Repos = append(cfg.Allowlist.Repos, re)
}
cfg.Allowlist.Commits = tomlLoader.Allowlist.Commits
cfg.Allowlist.Description = tomlLoader.Allowlist.Description
return cfg, nil
}
+5 -4
View File
@@ -2,9 +2,10 @@ package config
import (
"fmt"
"github.com/zricethezav/gitleaks/v4/options"
"regexp"
"testing"
"github.com/zricethezav/gitleaks/v5/options"
)
func TestParse(t *testing.T) {
@@ -14,7 +15,7 @@ func TestParse(t *testing.T) {
wantErr error
wantFileRegex *regexp.Regexp
wantMessages *regexp.Regexp
wantWhitelist Whitelist
wantAllowlist Allowlist
}{
{
description: "default config",
@@ -41,9 +42,9 @@ func TestParse(t *testing.T) {
wantErr: fmt.Errorf("problem loading config: error parsing regexp: invalid nested repetition operator: `???`"),
},
{
description: "test bad global whitelist file regex",
description: "test bad global allowlist file regex",
opts: options.Options{
Config: "../test_data/test_configs/bad_aws_key_global_whitelist_file.toml",
Config: "../test_data/test_configs/bad_aws_key_global_allowlist_file.toml",
},
wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"),
},
+8 -11
View File
@@ -13,7 +13,7 @@ title = "gitleaks config"
[[rules]]
description = "AWS Secret Key"
regex = '''(?i)aws(.{0,20})?(?-i)[0-9a-zA-Z\/+]{40}'''
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
tags = ["key", "AWS"]
[[rules]]
@@ -23,12 +23,12 @@ title = "gitleaks config"
[[rules]]
description = "Facebook Secret Key"
regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)[0-9a-f]{32}'''
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}'''
regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
tags = ["key", "Facebook"]
[[rules]]
@@ -66,11 +66,6 @@ title = "gitleaks config"
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
tags = ["key", "AsymmetricPrivateKey"]
[[rules]]
description = "Generic Credential"
regex = '''(?i)(api_key|apikey|secret|password|pass|pw|key)(.{0,20})?[0-9a-zA-Z]{16,45}'''
tags = ["key", "API", "generic"]
[[rules]]
description = "Google API key"
regex = '''AIza[0-9A-Za-z\\-_]{35}'''
@@ -136,7 +131,9 @@ title = "gitleaks config"
regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}'''
tags = ["key", "twilio"]
[whitelist]
description = "Whitelisted files"
file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$)'''
[allowlist]
description = "Allowlisted files"
files = ['''^\.?gitleaks.toml$''',
'''(.*?)(jpg|gif|doc|pdf|bin)$''',
'''(go.mod|go.sum)$''']
`
+9 -9
View File
@@ -129,7 +129,7 @@ title = "gitleaks config"
[[rules]]
description = "Port"
regex = '''(?i)port(.{0,4})?[0-9]{1,10}'''
[[rules.whitelist]]
[[rules.allowlist]]
regex = '''(?i)port '''
description = "ignore export "
@@ -139,7 +139,7 @@ title = "gitleaks config"
description = "Email"
regex = '''[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}'''
tags = ["email"]
[[rules.whitelist]]
[[rules.allowlist]]
file = '''(?i)bashrc'''
description = "ignore bashrc emails"
@@ -149,13 +149,13 @@ title = "gitleaks config"
regex = '''(?i)(dbpasswd|dbuser|dbname|dbhost|api_key|apikey|secret|key|api|password|user|guid|hostname|pw|auth)(.{0,20})?['|"]([0-9a-zA-Z-_\/+!{}/=]{4,120})['|"]'''
tags = ["key", "API", "generic"]
# ignore leaks with specific identifiers like slack and aws
[[rules.whitelist]]
[[rules.allowlist]]
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})'''
description = "ignore slack"
[[rules.whitelist]]
[[rules.allowlist]]
description = "MailChimp API key"
regex = '''(?i)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]'''
[[rules.whitelist]]
[[rules.allowlist]]
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
@@ -172,7 +172,7 @@ title = "gitleaks config"
[[rules.Entropies]]
Min = "4.3"
Max = "7.0"
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore ssh key and pems"
file = '''(pem|ppk|env)$'''
path = '''(.*)?ssh'''
@@ -197,7 +197,7 @@ title = "gitleaks config"
description = "Files with keys and credentials"
fileNameRegex = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)'''
[whitelist]
description = "image whitelists"
file = '''(.*?)(jpg|gif|doc|pdf|bin)$'''
[allowlist]
description = "image allowlists"
files = ['''(.*?)(jpg|gif|doc|pdf|bin)$''']
+1 -1
View File
@@ -1,5 +1,5 @@
# This config contains a single rule which defines a regex and a range of entropy values. If a rule has
# both regex and entropy then that rule uses BOTH the regex and entropy in combination when performing an audit.
# both regex and entropy then that rule uses BOTH the regex and entropy in combination when performing an scan.
# In other words, if a line of code has an entropy value that is within the range of the entropies defined and
# a regex match is found then that line of code contains a leak.
@@ -1,13 +1,13 @@
# This config contains a single rule that checks for AWS keys. However, it also contains a whitelist table
# where you can define one or more whitelists. What this means is that if you have an example AWS key as part of your
# code (in a test for example), then you can whitelist that specific key so gitleaks will not label it as a leak.
# This config contains a single rule that checks for AWS keys. However, it also contains a allowlist table
# where you can define one or more allowlists. What this means is that if you have an example AWS key as part of your
# code (in a test for example), then you can allowlist that specific key so gitleaks will not label it as a leak.
# If this line was present in a git history: `aws_access_key_id='AKIAIO5FODNN7EXAMPLE``, gitleaks would match this line
# with the rule below, but since we have a whitelist against that specific key, it would be ignored.
# with the rule below, but since we have a allowlist against that specific key, it would be ignored.
[[rules]]
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[[rules.whitelist]]
[[rules.allowlist]]
regex = '''AKIAIO5FODNN7EXAMPLE.*'''
description = "ignore example aws key"
+5 -6
View File
@@ -1,19 +1,18 @@
module github.com/zricethezav/gitleaks/v4
module github.com/zricethezav/gitleaks/v5
go 1.14
require (
github.com/BurntSushi/toml v0.3.1
github.com/go-git/go-billy/v5 v5.0.0
github.com/go-git/go-git/v5 v5.1.0
github.com/google/go-cmp v0.4.0 // indirect
github.com/google/go-github/v29 v29.0.3
github.com/google/go-github/v31 v31.0.0
github.com/hako/durafmt v0.0.0-20191009132224-3f39dc1ed9f4
github.com/jessevdk/go-flags v1.4.0
github.com/mattn/go-colorable v0.1.2
github.com/sergi/go-diff v1.0.0
github.com/sergi/go-diff v1.1.0
github.com/sirupsen/logrus v1.4.2
github.com/xanzy/go-gitlab v0.21.0
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
gopkg.in/src-d/go-billy.v4 v4.3.2
gopkg.in/src-d/go-git.v4 v4.13.1
)
+32 -33
View File
@@ -7,7 +7,7 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -17,6 +17,16 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjr
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
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.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc=
github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.0.0 h1:k5RWPm4iJwYtfWoxIJy4wJX9ON7ihPeZZYC1fLYDnpg=
github.com/go-git/go-git/v5 v5.0.0/go.mod h1:oYD8y9kWsGINPFJoLdaScGCN6dlKg23blmClfZwtUVA=
github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk=
github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
@@ -25,12 +35,14 @@ 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=
github.com/google/go-github/v29 v29.0.3 h1:IktKCTwU//aFHnpA+2SLIi7Oo9uhAzgsdZNbcAqhgdc=
github.com/google/go-github/v29 v29.0.3/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E=
github.com/google/go-github/v31 v31.0.0 h1:JJUxlP9lFK+ziXKimTCprajMApV1ecWD4NB6CCb0plo=
github.com/google/go-github/v31 v31.0.0/go.mod h1:NQPZol8/1sMoWYGN2yaALIBytu17gAWfhbweiEed3pM=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/hako/durafmt v0.0.0-20191009132224-3f39dc1ed9f4 h1:60gBOooTSmNtrqNaRvrDbi8VAne0REaek2agjnITKSw=
github.com/hako/durafmt v0.0.0-20191009132224-3f39dc1ed9f4/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE=
github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
@@ -42,32 +54,29 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
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/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
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=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/xanzy/go-gitlab v0.21.0 h1:Ru55sR4TBoDNsAKwCOpzeaGtbiWj7xTksVmzBJbLu6c=
@@ -76,39 +85,32 @@ 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=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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-20190222072716-a9d3bda3a223/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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e h1:D5TXcfTk7xF7hvieo4QErS3qqCB4teTffacDWr7CI+0=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/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=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a h1:mEQZbbaBjWyLNy0tmZmgEuQAR8XOQ3hL8GYi3J/NG64=
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
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=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
@@ -116,15 +118,12 @@ google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg=
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
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=
+24 -20
View File
@@ -6,17 +6,17 @@ import (
"strings"
"sync"
"github.com/zricethezav/gitleaks/v4/audit"
"github.com/zricethezav/gitleaks/v4/manager"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/zricethezav/gitleaks/v5/options"
"github.com/zricethezav/gitleaks/v5/scan"
"github.com/google/go-github/v29/github"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/google/go-github/v31/github"
log "github.com/sirupsen/logrus"
"golang.org/x/oauth2"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
)
// Github wraps a github client and manager. This struct implements what the Host interface defines.
@@ -27,7 +27,7 @@ type Github struct {
}
// NewGithubClient accepts a manager struct and returns a Github host pointer which will be used to
// perform a github audit on an organization, user, or PR.
// perform a github scan on an organization, user, or PR.
func NewGithubClient(m *manager.Manager) (*Github, error) {
var err error
ctx := context.Background()
@@ -50,8 +50,8 @@ func NewGithubClient(m *manager.Manager) (*Github, error) {
}, err
}
// Audit will audit a github user or organization's repos.
func (g *Github) Audit() {
// Scan will scan a github user or organization's repos.
func (g *Github) Scan() {
ctx := context.Background()
listOptions := github.ListOptions{
PerPage: 100,
@@ -105,7 +105,7 @@ func (g *Github) Audit() {
}
for _, repo := range githubRepos {
r := audit.NewRepo(g.manager)
r := scan.NewRepo(g.manager)
if g.manager.CloneOptions != nil {
auth = g.manager.CloneOptions.Auth
@@ -119,7 +119,7 @@ func (g *Github) Audit() {
log.Warn("unable to clone via https and access token, attempting with ssh now")
auth, err := options.SSHAuth(g.manager.Opts)
if err != nil {
log.Warnf("unable to get ssh auth, skipping clone and audit for repo %s: %+v\n", *repo.CloneURL, err)
log.Warnf("unable to get ssh auth, skipping clone and scan for repo %s: %+v\n", *repo.CloneURL, err)
continue
}
err = r.Clone(&git.CloneOptions{
@@ -127,26 +127,26 @@ func (g *Github) Audit() {
Auth: auth,
})
if err != nil {
log.Warnf("err cloning %s, skipping clone and audit: %+v\n", *repo.SSHURL, err)
log.Warnf("err cloning %s, skipping clone and scan: %+v\n", *repo.SSHURL, err)
continue
}
}
if err = r.Audit(); err != nil {
if err = r.Scan(); err != nil {
log.Warn(err)
}
}
}
// AuditPR audits a single github PR
func (g *Github) AuditPR() {
// ScanPR scan a single github PR
func (g *Github) ScanPR() {
ctx := context.Background()
splits := strings.Split(g.manager.Opts.PullRequest, "/")
owner := splits[len(splits)-4]
repoName := splits[len(splits)-3]
prNum, err := strconv.Atoi(splits[len(splits)-1])
repo := audit.NewRepo(g.manager)
repo := scan.NewRepo(g.manager)
repo.Name = repoName
log.Infof("auditing pr %s\n", g.manager.Opts.PullRequest)
log.Infof("scanning pr %s\n", g.manager.Opts.PullRequest)
if err != nil {
return
@@ -175,7 +175,11 @@ func (g *Github) AuditPR() {
if f.Patch == nil {
continue
}
audit.InspectFile(*f.Patch, *f.Filename, &commitObj, repo)
repo.CheckRules(&scan.Bundle{
Content: *f.Patch,
FilePath: *f.Filename,
Commit: &commitObj,
})
}
}
page = resp.NextPage
+11 -11
View File
@@ -4,9 +4,9 @@ import (
"context"
"sync"
"github.com/zricethezav/gitleaks/v4/audit"
"github.com/zricethezav/gitleaks/v4/manager"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/zricethezav/gitleaks/v5/options"
"github.com/zricethezav/gitleaks/v5/scan"
log "github.com/sirupsen/logrus"
"github.com/xanzy/go-gitlab"
@@ -21,7 +21,7 @@ type Gitlab struct {
}
// NewGitlabClient accepts a manager struct and returns a Gitlab host pointer which will be used to
// perform a gitlab audit on an group or user.
// perform a gitlab scan on an group or user.
func NewGitlabClient(m *manager.Manager) (*Gitlab, error) {
var err error
@@ -38,8 +38,8 @@ func NewGitlabClient(m *manager.Manager) (*Gitlab, error) {
return gitlabClient, err
}
// Audit will audit a github user or organization's repos.
func (g *Gitlab) Audit() {
// Scan will scan a github user or organization's repos.
func (g *Gitlab) Scan() {
var (
projects []*gitlab.Project
resp *gitlab.Response
@@ -89,20 +89,20 @@ func (g *Gitlab) Audit() {
// iterate of gitlab projects
for _, p := range projects {
r := audit.NewRepo(g.manager)
r := scan.NewRepo(g.manager)
cloneOpts := g.manager.CloneOptions
cloneOpts.URL = p.HTTPURLToRepo
err := r.Clone(cloneOpts)
// TODO handle clone retry with ssh like github host
r.Name = p.Name
if err = r.Audit(); err != nil {
if err = r.Scan(); err != nil {
log.Error(err)
}
}
}
// AuditPR TODO not implemented
func (g *Gitlab) AuditPR() {
log.Error("AuditPR is not implemented in Gitlab host yet...")
// ScanPR TODO not implemented
func (g *Gitlab) ScanPR() {
log.Error("ScanPR is not implemented in Gitlab host yet...")
}
+11 -6
View File
@@ -1,8 +1,9 @@
package hosts
import (
"github.com/zricethezav/gitleaks/v4/manager"
"strings"
"github.com/zricethezav/gitleaks/v5/manager"
)
const (
@@ -13,11 +14,11 @@ const (
// Host is an interface used for defining external git hosting providers like github and gitlab.
// TODO add bitbucket
type Host interface {
Audit()
AuditPR()
Scan()
ScanPR()
}
// Run kicks off a host audit. This function accepts a manager and determines what host it should audit
// Run kicks off a host scan. This function accepts a manager and determines what host it should scan
func Run(m *manager.Manager) error {
var host Host
var err error
@@ -30,10 +31,14 @@ func Run(m *manager.Manager) error {
return nil
}
if err != nil {
return err
}
if m.Opts.PullRequest != "" {
host.AuditPR()
host.ScanPR()
} else {
host.Audit()
host.Scan()
}
return err
}
+4 -3
View File
@@ -3,11 +3,12 @@ package hosts
import (
"flag"
"fmt"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/manager"
"github.com/zricethezav/gitleaks/v4/options"
"os"
"testing"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/zricethezav/gitleaks/v5/options"
)
var (
+14 -14
View File
@@ -5,11 +5,11 @@ import (
"os"
"time"
"github.com/zricethezav/gitleaks/v4/audit"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/hosts"
"github.com/zricethezav/gitleaks/v4/manager"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/hosts"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/zricethezav/gitleaks/v5/options"
"github.com/zricethezav/gitleaks/v5/scan"
"github.com/hako/durafmt"
log "github.com/sirupsen/logrus"
@@ -53,25 +53,25 @@ func main() {
if m.Opts.CheckUncommitted() {
log.Warnf("%d leaks detected in staged changes", len(leaks))
} else {
log.Warnf("%d leaks detected. %d commits audited in %s", len(leaks),
metadata.Commits, durafmt.Parse(time.Duration(metadata.AuditTime)*time.Nanosecond))
log.Warnf("%d leaks detected. %d commits scanned in %s", len(leaks),
metadata.Commits, durafmt.Parse(time.Duration(metadata.ScanTime)*time.Nanosecond))
}
os.Exit(options.LeaksPresent)
} else {
if m.Opts.CheckUncommitted() {
log.Infof("No leaks detected in staged changes")
} else {
log.Infof("No leaks detected. %d commits audited in %s",
metadata.Commits, durafmt.Parse(time.Duration(metadata.AuditTime)*time.Nanosecond))
log.Infof("No leaks detected. %d commits scanned in %s",
metadata.Commits, durafmt.Parse(time.Duration(metadata.ScanTime)*time.Nanosecond))
}
os.Exit(options.Success)
}
}
// Run begins the program and contains some basic logic on how to continue with the audit. If any external git host
// options are set (like auditing a gitlab or github user) then a specific host client will be created and
// then Audit() and Report() will be called. Otherwise, gitleaks will create a new repo and an audit will proceed.
// If no options or the uncommitted option is set then a pre-commit audit will
// Run begins the program and contains some basic logic on how to continue with the scan. If any external git host
// options are set (like scanning a gitlab or github user) then a specific host client will be created and
// then Scan() and Report() will be called. Otherwise, gitleaks will create a new repo and an scan will proceed.
// If no options or the uncommitted option is set then a pre-commit scan will
// take place -- this is similar to running `git diff` on all the tracked files.
func Run(m *manager.Manager) error {
if m.Opts.Disk {
@@ -87,7 +87,7 @@ func Run(m *manager.Manager) error {
if m.Opts.Host != "" {
err = hosts.Run(m)
} else {
err = audit.Run(m)
err = scan.Run(m)
}
if err != nil {
return err
+23 -16
View File
@@ -9,17 +9,18 @@ import (
"os"
"os/signal"
"runtime"
"strings"
"sync"
"text/tabwriter"
"time"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/options"
"github.com/go-git/go-git/v5"
"github.com/hako/durafmt"
"github.com/mattn/go-colorable"
log "github.com/sirupsen/logrus"
"gopkg.in/src-d/go-git.v4"
)
const maxLineLen = 200
@@ -47,6 +48,7 @@ type Manager struct {
// 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"`
@@ -57,13 +59,14 @@ type Leak struct {
File string `json:"file"`
Date time.Time `json:"date"`
Tags string `json:"tags"`
Operation string `json:"operation"`
lookupHash string
}
// AuditTime is a type used to determine total audit time
type AuditTime int64
// ScanTime is a type used to determine total scan time
type ScanTime int64
// PatchTime is a type used to determine total patch time during an audit
// PatchTime is a type used to determine total patch time during an scan
type PatchTime int64
// CloneTime is a type used to determine total clone time
@@ -77,7 +80,7 @@ type RegexTime struct {
Regex string
}
// Metadata is a struct used to communicate metadata about an audit like timings and total commit counts.
// Metadata is a struct used to communicate metadata about an scan like timings and total commit counts.
type Metadata struct {
mux *sync.Mutex
data map[string]interface{}
@@ -86,7 +89,7 @@ type Metadata struct {
RegexTime map[string]int64
Commits int
AuditTime int64
ScanTime int64
patchTime int64
cloneTime int64
}
@@ -146,7 +149,7 @@ func (manager *Manager) GetLeaks() []Leak {
return manager.leaks
}
// SendLeaks accepts a leak and is used by the audit pkg. This is the public function
// SendLeaks accepts a leak and is used by the scan pkg. This is the public function
// that allows other packages to send leaks to the manager.
func (manager *Manager) SendLeaks(l Leak) {
if len(l.Line) > maxLineLen {
@@ -156,8 +159,12 @@ func (manager *Manager) SendLeaks(l Leak) {
l.Offender = l.Offender[0:maxLineLen-1] + "..."
}
h := sha1.New()
h.Write([]byte(l.Commit + l.Offender + l.File + l.Line))
h.Write([]byte(l.Commit + l.Offender + l.File + l.Line + string(l.LineNumber)))
l.lookupHash = hex.EncodeToString(h.Sum(nil))
if manager.Opts.Redact {
l.Line = strings.ReplaceAll(l.Line, l.Offender, "REDACTED")
l.Offender = "REDACTED"
}
manager.leakWG.Add(1)
manager.leakChan <- l
}
@@ -207,8 +214,8 @@ func (manager *Manager) receiveMetadata() {
switch ti := t.(type) {
case CloneTime:
manager.metadata.cloneTime += int64(ti)
case AuditTime:
manager.metadata.AuditTime += int64(ti)
case ScanTime:
manager.metadata.ScanTime += int64(ti)
case PatchTime:
manager.metadata.patchTime += int64(ti)
case RegexTime:
@@ -218,7 +225,7 @@ func (manager *Manager) receiveMetadata() {
}
}
// IncrementCommits increments total commits during an audit by i.
// IncrementCommits increments total commits during an scan by i.
func (manager *Manager) IncrementCommits(i int) {
manager.metadata.mux.Lock()
manager.metadata.Commits += i
@@ -231,12 +238,12 @@ func (manager *Manager) RecordTime(t interface{}) {
manager.metadata.timings <- t
}
// DebugOutput logs metadata and other messages that occurred during a gitleaks audit
// DebugOutput logs metadata and other messages that occurred during a gitleaks scan
func (manager *Manager) DebugOutput() {
log.Debugf("-------------------------\n")
log.Debugf("| Times and Commit Counts|\n")
log.Debugf("-------------------------\n")
fmt.Println("totalAuditTime: ", durafmt.Parse(time.Duration(manager.metadata.AuditTime)*time.Nanosecond))
fmt.Println("totalScanTime: ", durafmt.Parse(time.Duration(manager.metadata.ScanTime)*time.Nanosecond))
fmt.Println("totalPatchTime: ", durafmt.Parse(time.Duration(manager.metadata.patchTime)*time.Nanosecond))
fmt.Println("totalCloneTime: ", durafmt.Parse(time.Duration(manager.metadata.cloneTime)*time.Nanosecond))
fmt.Println("totalCommits: ", manager.metadata.Commits)
@@ -303,6 +310,6 @@ func (manager *Manager) receiveInterrupt() {
log.Error(err)
}
}
log.Info("gitleaks received interrupt, stopping audit")
log.Info("gitleaks received interrupt, stopping scan")
os.Exit(options.ErrorEncountered)
}
+8 -8
View File
@@ -3,8 +3,8 @@ package manager
import (
"crypto/rand"
"fmt"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/options"
"io"
"testing"
)
@@ -45,14 +45,14 @@ func TestSendReceiveLeaks(t *testing.T) {
func TestSendReceiveMeta(t *testing.T) {
tests := []struct {
auditTime int64
scanTime int64
patchTime int64
cloneTime int64
regexTime int64
iterations int
}{
{
auditTime: 1000,
scanTime: 1000,
patchTime: 1000,
cloneTime: 1000,
regexTime: 1000,
@@ -65,7 +65,7 @@ func TestSendReceiveMeta(t *testing.T) {
m, _ := NewManager(opts, cfg)
for i := 0; i < test.iterations; i++ {
m.RecordTime(AuditTime(test.auditTime))
m.RecordTime(ScanTime(test.scanTime))
m.RecordTime(PatchTime(test.patchTime))
m.RecordTime(CloneTime(test.cloneTime))
m.RecordTime(RegexTime{
@@ -82,9 +82,9 @@ func TestSendReceiveMeta(t *testing.T) {
t.Errorf("clone time mismatch, got %d, wanted %d",
md.cloneTime, test.cloneTime*int64(test.iterations))
}
if md.AuditTime != test.auditTime*int64(test.iterations) {
t.Errorf("audit time mismatch, got %d, wanted %d",
md.AuditTime, test.auditTime*int64(test.iterations))
if md.ScanTime != test.scanTime*int64(test.iterations) {
t.Errorf("scan time mismatch, got %d, wanted %d",
md.ScanTime, test.scanTime*int64(test.iterations))
}
if md.patchTime != test.patchTime*int64(test.iterations) {
t.Errorf("clone time mismatch, got %d, wanted %d",
+19 -16
View File
@@ -7,13 +7,13 @@ import (
"os/user"
"strings"
"github.com/zricethezav/gitleaks/v4/version"
"github.com/zricethezav/gitleaks/v5/version"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
"github.com/jessevdk/go-flags"
log "github.com/sirupsen/logrus"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/transport/http"
"gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
)
// No leaks or early exit due to invalid options
@@ -28,7 +28,7 @@ const (
// Options stores values of command line options
type Options struct {
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from audit"`
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from scan"`
Repo string `short:"r" long:"repo" description:"Target repository"`
Config string `long:"config" description:"config path"`
Disk bool `long:"disk" description:"Clones repo(s) to disk"`
@@ -36,32 +36,35 @@ type Options struct {
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"`
Commit string `long:"commit" description:"sha of commit to audit or \"latest\" to scan the last commit of the repository"`
FilesAtCommit string `long:"files-at-commit" description:"sha of commit to audit all files at commit"`
Commit string `long:"commit" description:"sha of commit to scan or \"latest\" to scan the last commit of the repository"`
FilesAtCommit string `long:"files-at-commit" description:"sha of commit to scan all files at commit"`
Threads int `long:"threads" description:"Maximum number of threads gitleaks spawns"`
SSH string `long:"ssh-key" description:"path to ssh key used for auth"`
Uncommited bool `long:"uncommitted" description:"run gitleaks on uncommitted code"`
RepoPath string `long:"repo-path" description:"Path to repo"`
OwnerPath string `long:"owner-path" description:"Path to owner directory (repos discovered)"`
Branch string `long:"branch" description:"Branch to audit"`
Branch string `long:"branch" description:"Branch to scan"`
Report string `long:"report" description:"path to write json leaks file"`
ReportFormat string `long:"report-format" default:"json" description:"json or csv"`
Redact bool `long:"redact" description:"redact secrets from log messages and leaks"`
Debug bool `long:"debug" description:"log debug messages"`
RepoConfig bool `long:"repo-config" description:"Load config from target repo. Config file must be \".gitleaks.toml\" or \"gitleaks.toml\""`
PrettyPrint bool `long:"pretty" description:"Pretty print json if leaks are present"`
CommitFrom string `long:"commit-from" description:"Commit to start audit from"`
CommitTo string `long:"commit-to" description:"Commit to stop audit"`
Timeout string `long:"timeout" description:"Time allowed per audit. Ex: 10us, 30s, 1m, 1h10m1s"`
Depth int `long:"depth" description:"Number of commits to audit"`
CommitFrom string `long:"commit-from" description:"Commit to start scan from"`
CommitTo string `long:"commit-to" description:"Commit to stop scan"`
CommitSince string `long:"commit-since" description:"Scan commits more recent than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format."`
CommitUntil string `long:"commit-until" description:"Scan commits older than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format."`
Timeout string `long:"timeout" description:"Time allowed per scan. Ex: 10us, 30s, 1m, 1h10m1s"`
Depth int `long:"depth" description:"Number of commits to scan"`
Deletion bool `long:"include-deletion" description:"Scan for patch deletions in addition to patch additions"`
// Hosts
Host string `long:"host" description:"git hosting service like gitlab or github. Supported hosts include: Github, Gitlab"`
BaseURL string `long:"baseurl" description:"Base URL for API requests. Defaults to the public GitLab or GitHub API, but can be set to a domain endpoint to use with a self hosted server."`
Organization string `long:"org" description:"organization to audit"`
User string `long:"user" description:"user to audit"`
Organization string `long:"org" description:"organization to scan"`
User string `long:"user" description:"user to scan"`
PullRequest string `long:"pr" description:"pull/merge request url"`
ExcludeForks bool `long:"exclude-forks" description:"audit excludes forks"`
ExcludeForks bool `long:"exclude-forks" description:"scan excludes forks"`
}
// ParseOptions is responsible for parsing options passed in by cli. An Options struct
@@ -239,7 +242,7 @@ func (opts Options) CheckUncommitted() bool {
}
// GetAccessToken accepts options and returns a string which is the access token to a git host.
// Setting this option or environment var is necessary if performing an audit with any of the git hosting providers
// Setting this option or environment var is necessary if performing an scan with any of the git hosting providers
// in the host pkg. The access token set by cli options takes precedence over env vars.
func GetAccessToken(opts Options) string {
if opts.AccessToken != "" {
+296
View File
@@ -0,0 +1,296 @@
package scan
import (
"context"
"crypto/md5"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"runtime"
"time"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/BurntSushi/toml"
"github.com/go-git/go-billy/v5"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/storage/memory"
log "github.com/sirupsen/logrus"
)
// Repo wraps a *git.Repository object in addition to a manager object and the name of the repo.
// Commits are inspected from the *git.Repository object. If a Commit is found then we send it
// via the manager LeakChan where the manager receives and keeps track of all leaks.
type Repo struct {
*git.Repository
// config is used when the --repo-config option is set.
// This allows users to load up configs specific to their repos.
// Imagine the scenario where you are doing an scan of a large organization
// and you want certain repos to look for specific rules. If those specific repos
// have a gitleaks.toml or .gitleaks.toml config then those configs will be used specifically
// for those repo scans.
config config.Config
// ctx is used to signal timeouts to running goroutines
ctx context.Context
cancel context.CancelFunc
Name string
Manager *manager.Manager
}
// NewRepo initializes and returns a Repo struct.
func NewRepo(m *manager.Manager) *Repo {
return &Repo{
Manager: m,
config: m.Config,
ctx: context.Background(),
}
}
// Run accepts a manager and begins an scan based on the options/configs set in the manager.
func Run(m *manager.Manager) error {
if m.Opts.OwnerPath != "" {
files, err := ioutil.ReadDir(m.Opts.OwnerPath)
if err != nil {
return err
}
for _, f := range files {
if !f.IsDir() {
continue
}
m.Opts.RepoPath = fmt.Sprintf("%s/%s", m.Opts.OwnerPath, f.Name())
if err := runHelper(NewRepo(m)); err != nil {
log.Warnf("%s is not a git repo, skipping", f.Name())
}
}
return nil
}
return runHelper(NewRepo(m))
}
func runHelper(r *Repo) error {
// Ignore allowlisted repos
for _, wlRepo := range r.Manager.Config.Allowlist.Repos {
if RegexMatched(r.Manager.Opts.RepoPath, wlRepo) {
return nil
}
if RegexMatched(r.Manager.Opts.Repo, wlRepo) {
return nil
}
}
if r.Manager.Opts.OpenLocal() {
r.Name = path.Base(r.Manager.Opts.RepoPath)
if err := r.Open(); err != nil {
return err
}
// Check if we are checking uncommitted files. This is the default behavior
// for a "$ gitleaks" command with no options set
if r.Manager.Opts.CheckUncommitted() {
if err := r.scanUncommitted(); err != nil {
return err
}
return nil
}
} else {
if err := r.Clone(nil); err != nil {
return err
}
}
return r.Scan()
}
// Clone will clone a repo and return a Repo struct which contains a go-git repo. The clone method
// is determined by the clone options set in Manager.metadata.cloneOptions
func (repo *Repo) Clone(cloneOption *git.CloneOptions) error {
var (
repository *git.Repository
err error
)
if cloneOption == nil {
cloneOption = repo.Manager.CloneOptions
}
log.Infof("cloning... %s", cloneOption.URL)
start := time.Now()
if repo.Manager.CloneDir != "" {
clonePath := fmt.Sprintf("%s/%x", repo.Manager.CloneDir, md5.Sum([]byte(time.Now().String())))
repository, err = git.PlainClone(clonePath, false, cloneOption)
} else {
repository, err = git.Clone(memory.NewStorage(), nil, cloneOption)
}
if err != nil {
return err
}
repo.Name = filepath.Base(repo.Manager.Opts.Repo)
repo.Repository = repository
repo.Manager.RecordTime(manager.CloneTime(howLong(start)))
return nil
}
// howManyThreads will return a number 1-GOMAXPROCS which is the number
// of goroutines that will spawn during gitleaks execution
func howManyThreads(threads int) int {
maxThreads := runtime.GOMAXPROCS(0)
if threads == 0 {
return 1
} else if threads > maxThreads {
log.Warnf("%d threads set too high, setting to system max, %d", threads, maxThreads)
return maxThreads
}
return threads
}
// getLogOptions determines what log options are used when iterating through commits.
// It is similar to `git log {branch}`. Default behavior is to log ALL branches so
// gitleaks gets the full git history.
func getLogOptions(repo *Repo) (*git.LogOptions, error) {
var logOpts git.LogOptions
const dateformat string = "2006-01-02"
const timeformat string = "2006-01-02T15:04:05-0700"
if repo.Manager.Opts.CommitFrom != "" {
logOpts.From = plumbing.NewHash(repo.Manager.Opts.CommitFrom)
}
if repo.Manager.Opts.CommitSince != "" {
if t, err := time.Parse(timeformat, repo.Manager.Opts.CommitSince); err == nil {
logOpts.Since = &t
} else if t, err := time.Parse(dateformat, repo.Manager.Opts.CommitSince); err == nil {
logOpts.Since = &t
} else {
return nil, err
}
}
if repo.Manager.Opts.CommitUntil != "" {
if t, err := time.Parse(timeformat, repo.Manager.Opts.CommitUntil); err == nil {
logOpts.Until = &t
} else if t, err := time.Parse(dateformat, repo.Manager.Opts.CommitUntil); err == nil {
logOpts.Until = &t
} else {
return nil, err
}
}
if repo.Manager.Opts.Branch != "" {
refs, err := repo.Storer.IterReferences()
if err != nil {
return nil, err
}
err = refs.ForEach(func(ref *plumbing.Reference) error {
if ref.Name().IsTag() {
return nil
}
// check heads first
if ref.Name().String() == "refs/heads/"+repo.Manager.Opts.Branch {
logOpts = git.LogOptions{
From: ref.Hash(),
}
return nil
} else if ref.Name().String() == "refs/remotes/origin/"+repo.Manager.Opts.Branch {
logOpts = git.LogOptions{
From: ref.Hash(),
}
return nil
}
return nil
})
if logOpts.From.IsZero() {
return nil, fmt.Errorf("could not find branch %s", repo.Manager.Opts.Branch)
}
return &logOpts, nil
}
if !logOpts.From.IsZero() || logOpts.Since != nil || logOpts.Until != nil {
return &logOpts, nil
}
return &git.LogOptions{All: true}, nil
}
// howLong accepts a time.Time object which is subtracted from time.Now() and
// converted to nanoseconds which is returned
func howLong(t time.Time) int64 {
return time.Now().Sub(t).Nanoseconds()
}
// Open opens a local repo either from repo-path or $PWD
func (repo *Repo) Open() error {
if repo.Manager.Opts.RepoPath != "" {
// open git repo from repo path
repository, err := git.PlainOpen(repo.Manager.Opts.RepoPath)
if err != nil {
return err
}
repo.Repository = repository
} else {
// open git repo from PWD
dir, err := os.Getwd()
if err != nil {
return err
}
repository, err := git.PlainOpen(dir)
if err != nil {
return err
}
repo.Repository = repository
repo.Name = path.Base(dir)
}
return nil
}
func (repo *Repo) loadRepoConfig() (config.Config, error) {
wt, err := repo.Repository.Worktree()
if err != nil {
return config.Config{}, err
}
var f billy.File
f, _ = wt.Filesystem.Open(".gitleaks.toml")
if f == nil {
f, err = wt.Filesystem.Open("gitleaks.toml")
if err != nil {
return config.Config{}, fmt.Errorf("problem loading repo config: %v", err)
}
}
defer f.Close()
var tomlLoader config.TomlLoader
_, err = toml.DecodeReader(f, &tomlLoader)
return tomlLoader.Parse()
}
// timeoutReached returns true if the timeout deadline has been met. This function should be used
// at the top of loops and before potentially long running goroutines (like checking inefficient regexes)
func (repo *Repo) timeoutReached() bool {
if repo.ctx.Err() == context.DeadlineExceeded {
return true
}
return false
}
// setupTimeout parses the --timeout option and assigns a context with timeout to the manager
// which will exit early if the timeout has been met.
func (repo *Repo) setupTimeout() error {
if repo.Manager.Opts.Timeout == "" {
return nil
}
timeout, err := time.ParseDuration(repo.Manager.Opts.Timeout)
if err != nil {
return err
}
repo.ctx, repo.cancel = context.WithTimeout(context.Background(), timeout)
go func() {
select {
case <-repo.ctx.Done():
if repo.timeoutReached() {
log.Warnf("Timeout deadline (%s) exceeded for %s", timeout.String(), repo.Name)
}
}
}()
return nil
}
+396
View File
@@ -0,0 +1,396 @@
package scan
import (
"bufio"
"fmt"
"io"
"math"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/manager"
fdiff "github.com/go-git/go-git/v5/plumbing/format/diff"
"github.com/go-git/go-git/v5/plumbing/object"
log "github.com/sirupsen/logrus"
)
const (
diffAddPrefix = "+"
diffAddFilePrefix = "+++ b"
diffAddFilePrefixSlash = "+++ b/"
diffLineSignature = " @@"
defaultLineNumber = -1
)
// CheckRules accepts bundle and checks each rule defined in the config against the bundle's content.
func (repo *Repo) CheckRules(bundle *Bundle) {
filename := filepath.Base(bundle.FilePath)
path := filepath.Dir(bundle.FilePath)
bundle.lineLookup = make(map[string]bool)
// We want to check if there is a allowlist for this file
if len(repo.config.Allowlist.Files) != 0 {
for _, reFileName := range repo.config.Allowlist.Files {
if RegexMatched(filename, reFileName) {
log.Debugf("allowlisted file found, skipping scan of file: %s", filename)
return
}
}
}
// We want to check if there is a allowlist for this path
if len(repo.config.Allowlist.Paths) != 0 {
for _, reFilePath := range repo.config.Allowlist.Paths {
if RegexMatched(path, reFilePath) {
log.Debugf("file in allowlisted path found, skipping scan of file: %s", filename)
return
}
}
}
for _, rule := range repo.config.Rules {
start := time.Now()
// For each rule we want to check filename allowlists
if isFileNameWhiteListed(filename, rule.Allowlist) || isFilePathWhiteListed(path, rule.Allowlist) {
continue
}
// If it has fileNameRegex and it doesnt match we continue to next rule
if ruleContainFileNameRegex(rule) && !RegexMatched(filename, rule.FileNameRegex) {
continue
}
// If it has filePathRegex and it doesnt match we continue to next rule
if ruleContainFilePathRegex(rule) && !RegexMatched(path, rule.FilePathRegex) {
continue
}
// If it doesnt contain a Content regex then it is a filename regex match
if !ruleContainRegex(rule) {
repo.Manager.SendLeaks(manager.Leak{
LineNumber: defaultLineNumber,
Line: "N/A",
Offender: "Filename/path offender: " + filename,
Commit: bundle.Commit.Hash.String(),
Repo: repo.Name,
Message: bundle.Commit.Message,
Rule: rule.Description,
Author: bundle.Commit.Author.Name,
Email: bundle.Commit.Author.Email,
Date: bundle.Commit.Author.When,
Tags: strings.Join(rule.Tags, ", "),
File: filename,
Operation: diffOpToString(bundle.Operation),
})
} else {
//otherwise we check if it matches Content regex
locs := rule.Regex.FindAllIndex([]byte(bundle.Content), -1)
if len(locs) != 0 {
for _, loc := range locs {
start := loc[0]
end := loc[1]
for start != 0 && bundle.Content[start] != '\n' {
start--
}
if bundle.Content[start] == '\n' {
start++
}
for end < len(bundle.Content)-1 && bundle.Content[end] != '\n' {
end++
}
line := bundle.Content[start:end]
offender := bundle.Content[loc[0]:loc[1]]
groups := rule.Regex.FindStringSubmatch(offender)
if isOffenderWhiteListed(offender, rule.Allowlist) {
continue
}
if len(rule.Entropies) != 0 && !trippedEntropy(groups, rule) {
continue
}
leak := manager.Leak{
LineNumber: defaultLineNumber,
Line: line,
Offender: offender,
Commit: bundle.Commit.Hash.String(),
Repo: repo.Name,
Message: bundle.Commit.Message,
Rule: rule.Description,
Author: bundle.Commit.Author.Name,
Email: bundle.Commit.Author.Email,
Date: bundle.Commit.Author.When,
Tags: strings.Join(rule.Tags, ", "),
File: bundle.FilePath,
Operation: diffOpToString(bundle.Operation),
}
// only search for line numbers on non-deletions
if bundle.Operation != fdiff.Delete {
extractAndInjectLineNumber(&leak, bundle, repo)
}
repo.Manager.SendLeaks(leak)
}
}
}
// TODO should return filenameRegex if only file rule
repo.Manager.RecordTime(manager.RegexTime{
Time: howLong(start),
Regex: rule.Regex.String(),
})
}
}
// RegexMatched matched an interface to a regular expression. The interface f can
// be a string type or go-git *object.File type.
func RegexMatched(f interface{}, re *regexp.Regexp) bool {
if re == nil {
return false
}
switch f.(type) {
case nil:
return false
case string:
if re.FindString(f.(string)) != "" {
return true
}
return false
case *object.File:
if re.FindString(f.(*object.File).Name) != "" {
return true
}
return false
}
return false
}
// diffOpToString converts a fdiff.Operation to a string
func diffOpToString(operation fdiff.Operation) string {
switch operation {
case fdiff.Add:
return "addition"
case fdiff.Equal:
return "equal"
default:
return "deletion"
}
}
// extractAndInjectLine accepts a leak, bundle, and repo which it uses to do a reverse search in order to extract
// the line number of a historic or present leak. The function is only called when the git operation is an addition
// or none, it does not get called when the git operation is deletion.
func extractAndInjectLineNumber(leak *manager.Leak, bundle *Bundle, repo *Repo) {
var err error
switch bundle.scanType {
case patchScan:
if bundle.Patch == "" {
return
}
scanner := bufio.NewScanner(strings.NewReader(bundle.Patch))
currFile := ""
currLine := 0
currStartDiffLine := 0
for scanner.Scan() {
txt := scanner.Text()
if strings.HasPrefix(txt, diffAddFilePrefix) {
currStartDiffLine = 1
currLine = 0
currFile = strings.Split(txt, diffAddFilePrefixSlash)[1]
// next line contains diff line information so lets scan it here
scanner.Scan()
txt := scanner.Text()
i := strings.Index(txt, diffAddPrefix)
pairs := strings.Split(strings.Split(txt[i+1:], diffLineSignature)[0], ",")
currStartDiffLine, err = strconv.Atoi(pairs[0])
if err != nil {
log.Debug(err)
return
}
continue
} else if strings.HasPrefix(txt, diffAddPrefix) && strings.Contains(txt, leak.Line) && leak.File == currFile {
potentialLine := currLine + currStartDiffLine
if _, ok := bundle.lineLookup[fmt.Sprintf("%s%d%s", leak.Line, potentialLine, currFile)]; !ok {
bundle.lineLookup[fmt.Sprintf("%s%d%s", leak.Line, potentialLine, currFile)] = true
leak.LineNumber = potentialLine
return
}
}
currLine++
}
case commitScan:
if bundle.Commit == nil {
return
}
f, err := bundle.Commit.File(bundle.FilePath)
if err != nil {
log.Error(err)
return
}
r, err := f.Reader()
if err != nil {
log.Error(err)
return
}
leak.LineNumber = extractLineHelper(r, bundle, leak)
case uncommittedScan:
wt, err := repo.Worktree()
if err != nil {
log.Error(err)
return
}
f, err := wt.Filesystem.Open(leak.File)
if err != nil {
log.Error(err)
return
}
leak.LineNumber = extractLineHelper(f, bundle, leak)
}
}
// extractLineHelper consolidates code for checking the leak line against the contents of a reader to find the
// line number of the leak.
func extractLineHelper(r io.Reader, bundle *Bundle, leak *manager.Leak) int {
scanner := bufio.NewScanner(r)
lineNumber := 1
for scanner.Scan() {
if leak.Line == scanner.Text() {
if _, ok := bundle.lineLookup[fmt.Sprintf("%s%d%s", leak.Line, lineNumber, bundle.FilePath)]; !ok {
bundle.lineLookup[fmt.Sprintf("%s%d%s", leak.Line, lineNumber, bundle.FilePath)] = true
return lineNumber
}
}
lineNumber++
}
return -1
}
// trippedEntropy checks if a given capture group or offender falls in between entropy ranges
// supplied by a custom gitleaks configuration. Gitleaks do not check entropy by default.
func trippedEntropy(groups []string, rule config.Rule) bool {
for _, e := range rule.Entropies {
if len(groups) > e.Group {
entropy := shannonEntropy(groups[e.Group])
if entropy >= e.Min && entropy <= e.Max {
return true
}
}
}
return false
}
// shannonEntropy calculates the entropy of data using the formula defined here:
// https://en.wiktionary.org/wiki/Shannon_entropy
// Another way to think about what this is doing is calculating the number of bits
// needed to on average encode the data. So, the higher the entropy, the more random the data, the
// more bits needed to encode that data.
func shannonEntropy(data string) (entropy float64) {
if data == "" {
return 0
}
charCounts := make(map[rune]int)
for _, char := range data {
charCounts[char]++
}
invLength := 1.0 / float64(len(data))
for _, count := range charCounts {
freq := float64(count) * invLength
entropy -= freq * math.Log2(freq)
}
return entropy
}
// Checks if the given rule has a regex
func ruleContainRegex(rule config.Rule) bool {
if rule.Regex == nil {
return false
}
if rule.Regex.String() == "" {
return false
}
return true
}
// Checks if the given rule has a file name regex
func ruleContainFileNameRegex(rule config.Rule) bool {
if rule.FileNameRegex == nil {
return false
}
if rule.FileNameRegex.String() == "" {
return false
}
return true
}
// Checks if the given rule has a file path regex
func ruleContainFilePathRegex(rule config.Rule) bool {
if rule.FilePathRegex == nil {
return false
}
if rule.FilePathRegex.String() == "" {
return false
}
return true
}
func isCommitWhiteListed(commitHash string, allowlistedCommits []string) bool {
for _, hash := range allowlistedCommits {
if commitHash == hash {
return true
}
}
return false
}
func isOffenderWhiteListed(offender string, allowlist []config.Allowlist) bool {
if len(allowlist) != 0 {
for _, wl := range allowlist {
if wl.Regex.FindString(offender) != "" {
return true
}
}
}
return false
}
func isFileNameWhiteListed(filename string, allowlist []config.Allowlist) bool {
if len(allowlist) != 0 {
for _, wl := range allowlist {
if RegexMatched(filename, wl.File) {
return true
}
}
}
return false
}
func isFilePathWhiteListed(filepath string, allowlist []config.Allowlist) bool {
if len(allowlist) != 0 {
for _, wl := range allowlist {
if RegexMatched(filepath, wl.Path) {
return true
}
}
}
return false
}
+455
View File
@@ -0,0 +1,455 @@
package scan
import (
"bytes"
"fmt"
"io"
"sync"
"time"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
fdiff "github.com/go-git/go-git/v5/plumbing/format/diff"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/storer"
"github.com/sergi/go-diff/diffmatchpatch"
log "github.com/sirupsen/logrus"
)
// Bundle contains various git information for scans.
type Bundle struct {
Commit *object.Commit
Patch string
Content string
FilePath string
Operation fdiff.Operation
reader io.Reader
lineLookup map[string]bool
scanType int
}
// commitScanner is a function signature for scanning commits. There is some
// redundant work needed by scanning all files at a commit (--files-at-commit=) and scanning
// the patches generated by a commit (--commit=). The function scanCommit wraps that redundant work
// and accepts a commitScanner for the different logic needed between the two cases described above.
type commitScanner func(c *object.Commit, repo *Repo) error
const (
// We need to differentiate between scans as the logic for line searching is different between
// scanning patches, commits, and uncommitted files.
patchScan int = iota + 1
uncommittedScan
commitScan
)
// Scan is responsible for scanning the entire history (default behavior) of a
// git repo. Options that can change the behavior of this function include: --Commit, --depth, --branch.
// See options/options.go for an explanation on these options.
func (repo *Repo) Scan() error {
if err := repo.setupTimeout(); err != nil {
return err
}
if repo.cancel != nil {
defer repo.cancel()
}
if repo.Repository == nil {
return fmt.Errorf("%s repo is empty", repo.Name)
}
// load up alternative config if possible, if not use manager's config
if repo.Manager.Opts.RepoConfig {
cfg, err := repo.loadRepoConfig()
if err != nil {
return err
}
repo.config = cfg
}
scanTimeStart := time.Now()
// scan Commit patches OR all files at Commit. See https://github.com/zricethezav/gitleaks/issues/326
if repo.Manager.Opts.Commit != "" {
return scanCommit(repo.Manager.Opts.Commit, repo, scanCommitPatches)
} else if repo.Manager.Opts.FilesAtCommit != "" {
return scanCommit(repo.Manager.Opts.FilesAtCommit, repo, scanFilesAtCommit)
}
logOpts, err := getLogOptions(repo)
if err != nil {
return err
}
cIter, err := repo.Log(logOpts)
if err != nil {
return err
}
cc := 0
semaphore := make(chan bool, howManyThreads(repo.Manager.Opts.Threads))
wg := sync.WaitGroup{}
err = cIter.ForEach(func(c *object.Commit) error {
if c == nil || repo.timeoutReached() || repo.depthReached(cc) {
return storer.ErrStop
}
// Check if Commit is allowlisted
if isCommitWhiteListed(c.Hash.String(), repo.config.Allowlist.Commits) {
return nil
}
// Check if at root
if len(c.ParentHashes) == 0 {
cc++
err = scanFilesAtCommit(c, repo)
if err != nil {
return err
}
return nil
}
// increase Commit counter
cc++
err = c.Parents().ForEach(func(parent *object.Commit) error {
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.
// Once a fix has been merged I will remove this recover.
return
}
}()
if repo.timeoutReached() {
return nil
}
if parent == nil {
// shouldn't reach this point but just in case
return nil
}
start := time.Now()
patch, err := parent.Patch(c)
if err != nil {
return fmt.Errorf("could not generate Patch")
}
repo.Manager.RecordTime(manager.PatchTime(howLong(start)))
wg.Add(1)
semaphore <- true
go func(c *object.Commit, patch *object.Patch) {
defer func() {
<-semaphore
wg.Done()
}()
scanPatch(patch, c, repo)
}(c, patch)
return nil
})
if c.Hash.String() == repo.Manager.Opts.CommitTo {
return storer.ErrStop
}
return nil
})
wg.Wait()
repo.Manager.RecordTime(manager.ScanTime(howLong(scanTimeStart)))
repo.Manager.IncrementCommits(cc)
return nil
}
// scanEmpty scans an empty repo without any commits. See https://github.com/zricethezav/gitleaks/issues/352
func (repo *Repo) scanEmpty() error {
scanTimeStart := time.Now()
wt, err := repo.Worktree()
if err != nil {
return err
}
status, err := wt.Status()
for fn := range status {
workTreeBuf := bytes.NewBuffer(nil)
workTreeFile, err := wt.Filesystem.Open(fn)
if err != nil {
continue
}
if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
return err
}
repo.CheckRules(&Bundle{
Content: workTreeBuf.String(),
FilePath: workTreeFile.Name(),
Commit: emptyCommit(),
scanType: uncommittedScan,
})
}
repo.Manager.RecordTime(manager.ScanTime(howLong(scanTimeStart)))
return nil
}
// scanUncommitted will do a `git diff` and scan changed files that are being tracked. This is useful functionality
// for a pre-Commit hook so you can make sure your code does not have any leaks before committing.
func (repo *Repo) scanUncommitted() error {
// load up alternative config if possible, if not use manager's config
if repo.Manager.Opts.RepoConfig {
cfg, err := repo.loadRepoConfig()
if err != nil {
return err
}
repo.config = cfg
}
if err := repo.setupTimeout(); err != nil {
return err
}
r, err := repo.Head()
if err == plumbing.ErrReferenceNotFound {
// possibly an empty repo, or maybe its not, either way lets scan all the files in the directory
return repo.scanEmpty()
} else if err != nil {
return err
}
scanTimeStart := time.Now()
c, err := repo.CommitObject(r.Hash())
if err != nil {
return err
}
// Staged change so the Commit details do not yet exist. Insert empty defaults.
c.Hash = plumbing.Hash{}
c.Message = "***STAGED CHANGES***"
c.Author.Name = ""
c.Author.Email = ""
c.Author.When = time.Unix(0, 0).UTC()
prevTree, err := c.Tree()
if err != nil {
return err
}
wt, err := repo.Worktree()
if err != nil {
return err
}
status, err := wt.Status()
for fn, state := range status {
var (
prevFileContents string
currFileContents string
filename string
)
if state.Staging != git.Untracked {
if state.Staging == git.Deleted {
// file in staging has been deleted, aka it is not on the filesystem
// so the contents of the file are ""
currFileContents = ""
} else {
workTreeBuf := bytes.NewBuffer(nil)
workTreeFile, err := wt.Filesystem.Open(fn)
if err != nil {
continue
}
if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
return err
}
currFileContents = workTreeBuf.String()
filename = workTreeFile.Name()
}
// get files at HEAD state
prevFile, err := prevTree.File(fn)
if err != nil {
prevFileContents = ""
} else {
prevFileContents, err = prevFile.Contents()
if err != nil {
return err
}
if filename == "" {
filename = prevFile.Name
}
}
diffs := diffmatchpatch.New().DiffMain(prevFileContents, currFileContents, false)
var diffContents string
for _, d := range diffs {
if d.Type == diffmatchpatch.DiffInsert {
diffContents += fmt.Sprintf("%s\n", d.Text)
}
}
repo.CheckRules(&Bundle{
Content: diffContents,
FilePath: filename,
Commit: c,
scanType: uncommittedScan,
})
}
}
if err != nil {
return err
}
repo.Manager.RecordTime(manager.ScanTime(howLong(scanTimeStart)))
return nil
}
// scan accepts a Patch, Commit, and repo. If the patches contains files that are
// binary, then gitleaks will skip scanning that file OR if a file is matched on
// allowlisted files set in the configuration. If a global rule for files is defined and a filename
// matches said global rule, then a leak is sent to the manager.
// After that, file chunks are created which are then inspected by InspectString()
func scanPatch(patch *object.Patch, c *object.Commit, repo *Repo) {
bundle := Bundle{
Commit: c,
Patch: patch.String(),
scanType: patchScan,
}
for _, f := range patch.FilePatches() {
if repo.timeoutReached() {
return
}
if f.IsBinary() {
continue
}
for _, chunk := range f.Chunks() {
if chunk.Type() == fdiff.Add || (repo.Manager.Opts.Deletion && chunk.Type() == fdiff.Delete) {
bundle.Content = chunk.Content()
bundle.Operation = chunk.Type()
// get filepath
from, to := f.Files()
if from != nil {
bundle.FilePath = from.Path()
} else if to != nil {
bundle.FilePath = to.Path()
} else {
bundle.FilePath = "???"
}
repo.CheckRules(&bundle)
}
}
}
}
// scanCommit accepts a Commit hash, repo, and commit scanning function. A new Commit
// object will be created from the hash which will be passed into either scanCommitPatches
// or scanFilesAtCommit depending on the options set.
func scanCommit(commit string, repo *Repo, f commitScanner) error {
if commit == "latest" {
ref, err := repo.Repository.Head()
if err != nil {
return err
}
commit = ref.Hash().String()
}
repo.Manager.IncrementCommits(1)
h := plumbing.NewHash(commit)
c, err := repo.CommitObject(h)
if err != nil {
return err
}
return f(c, repo)
}
// scanCommitPatches accepts a Commit object and a repo. This function is only called when the --Commit=
// option has been set. That option tells gitleaks to look only at a single Commit and check the contents
// of said Commit. Similar to scan(), if the files contained in the Commit are a binaries or if they are
// allowlisted then those files will be skipped.
func scanCommitPatches(c *object.Commit, repo *Repo) error {
if len(c.ParentHashes) == 0 {
err := scanFilesAtCommit(c, repo)
if err != nil {
return err
}
}
return c.Parents().ForEach(func(parent *object.Commit) error {
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.
// Once a fix has been merged I will remove this recover.
return
}
}()
if repo.timeoutReached() {
return nil
}
if parent == nil {
return nil
}
start := time.Now()
patch, err := parent.Patch(c)
if err != nil {
return fmt.Errorf("could not generate Patch")
}
repo.Manager.RecordTime(manager.PatchTime(howLong(start)))
scanPatch(patch, c, repo)
return nil
})
}
// scanFilesAtCommit accepts a Commit object and a repo. This function is only called when the --files-at-Commit=
// option has been set. That option tells gitleaks to look only at ALL the files at a Commit and check the contents
// of said Commit. Similar to scan(), if the files contained in the Commit are a binaries or if they are
// allowlisted then those files will be skipped.
func scanFilesAtCommit(c *object.Commit, repo *Repo) error {
fIter, err := c.Files()
if err != nil {
return err
}
err = fIter.ForEach(func(f *object.File) error {
bin, err := f.IsBinary()
if bin || repo.timeoutReached() {
return nil
} else if err != nil {
return err
}
content, err := f.Contents()
if err != nil {
return err
}
repo.CheckRules(&Bundle{
Content: content,
FilePath: f.Name,
Commit: c,
scanType: commitScan,
Operation: fdiff.Add,
})
return nil
})
return err
}
// depthReached checks if i meets the depth (--depth=) if set
func (repo *Repo) depthReached(i int) bool {
if repo.Manager.Opts.Depth != 0 && repo.Manager.Opts.Depth == i {
log.Warnf("Exceeded depth limit (%d)", i)
return true
}
return false
}
// emptyCommit generates an empty commit used for scanning uncommitted changes
func emptyCommit() *object.Commit {
return &object.Commit{
Hash: plumbing.Hash{},
Message: "***STAGED CHANGES***",
Author: object.Signature{
Name: "",
Email: "",
When: time.Unix(0, 0).UTC(),
},
}
}
+92 -29
View File
@@ -1,4 +1,4 @@
package audit
package scan
import (
"encoding/json"
@@ -10,16 +10,16 @@ import (
"sort"
"testing"
"github.com/zricethezav/gitleaks/v4/config"
"github.com/zricethezav/gitleaks/v4/manager"
"github.com/zricethezav/gitleaks/v4/options"
"github.com/zricethezav/gitleaks/v5/config"
"github.com/zricethezav/gitleaks/v5/manager"
"github.com/zricethezav/gitleaks/v5/options"
"github.com/sergi/go-diff/diffmatchpatch"
)
const testRepoBase = "../test_data/test_repos/"
func TestAudit(t *testing.T) {
func TestScan(t *testing.T) {
moveDotGit("dotGit", ".git")
defer moveDotGit(".git", "dotGit")
tests := []struct {
@@ -58,11 +58,11 @@ func TestAudit(t *testing.T) {
emptyRepo: true,
},
{
description: "test local repo one aws leak whitelisted",
description: "test local repo one aws leak allowlisted",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_1",
ReportFormat: "json",
Config: "../test_data/test_configs/aws_key_whitelist_python_files.toml",
Config: "../test_data/test_configs/aws_key_allowlist_python_files.toml",
},
wantEmpty: true,
},
@@ -76,7 +76,7 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_two_leaks.json",
},
{
description: "test local repo two leaks from commit",
description: "test local repo two leaks from Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_leaks_commit_from.json.got",
@@ -86,7 +86,7 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_two_leaks_commit_from.json",
},
{
description: "test local repo two leaks to commit",
description: "test local repo two leaks to Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_leaks_commit_to.json.got",
@@ -96,7 +96,7 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_two_leaks_commit_to.json",
},
{
description: "test local repo two leaks range commit",
description: "test local repo two leaks range Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_leaks_commit_range.json.got",
@@ -107,19 +107,19 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_two_leaks_commit_range.json",
},
{
description: "test local repo two leaks globally whitelisted",
description: "test local repo two leaks globally allowlisted",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Config: "../test_data/test_configs/aws_key_global_whitelist_file.toml",
Config: "../test_data/test_configs/aws_key_global_allowlist_file.toml",
ReportFormat: "json",
},
wantEmpty: true,
},
{
description: "test local repo two leaks whitelisted",
description: "test local repo two leaks allowlisted",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Config: "../test_data/test_configs/aws_key_whitelist_files.toml",
Config: "../test_data/test_configs/aws_key_allowlist_files.toml",
ReportFormat: "json",
},
wantEmpty: true,
@@ -145,7 +145,7 @@ func TestAudit(t *testing.T) {
wantEmpty: true,
},
{
description: "test local repo one aws leak single commit",
description: "test local repo one aws leak single Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_1",
Report: "../test_data/test_local_repo_one_aws_leak_commit.json.got",
@@ -173,6 +173,16 @@ func TestAudit(t *testing.T) {
},
wantPath: "../test_data/test_local_owner_aws_leak.json",
},
{
description: "test owner path allowlist repo",
opts: options.Options{
OwnerPath: "../test_data/test_repos/",
Report: "../test_data/test_local_owner_aws_leak_allowlist_repo.json.got",
ReportFormat: "json",
Config: "../test_data/test_configs/aws_key_local_owner_allowlist_repo.toml",
},
wantPath: "../test_data/test_local_owner_aws_leak_allowlist_repo.json",
},
{
description: "test entropy and regex",
opts: options.Options{
@@ -197,8 +207,8 @@ func TestAudit(t *testing.T) {
description: "test local repo four entropy alternative config",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_1",
Report: "../test_data/test_regex_whitelist.json.got",
Config: "../test_data/test_configs/aws_key_aws_whitelisted.toml",
Report: "../test_data/test_regex_allowlist.json.got",
Config: "../test_data/test_configs/aws_key_aws_allowlisted.toml",
ReportFormat: "json",
},
wantEmpty: true,
@@ -234,7 +244,7 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_owner_aws_leak_depth_2.json",
},
{
description: "test local repo five files at commit",
description: "test local repo five files at Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_5",
Report: "../test_data/test_local_repo_five_files_at_commit.json.got",
@@ -244,7 +254,7 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_five_files_at_commit.json",
},
{
description: "test local repo five files at latest commit",
description: "test local repo five files at latest Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_5",
Report: "../test_data/test_local_repo_five_files_at_latest_commit.json.got",
@@ -254,22 +264,24 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_five_files_at_commit.json",
},
{
description: "test local repo five at commit",
description: "test local repo five at Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_5",
Report: "../test_data/test_local_repo_five_commit.json.got",
Commit: "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
ReportFormat: "json",
Config: "../test_data/test_configs/generic.toml",
},
wantPath: "../test_data/test_local_repo_five_commit.json",
},
{
description: "test local repo five at latest commit",
description: "test local repo five at latest Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_5",
Report: "../test_data/test_local_repo_five_at_latest_commit.json.got",
Commit: "latest",
ReportFormat: "json",
Config: "../test_data/test_configs/generic.toml",
},
wantPath: "../test_data/test_local_repo_five_at_latest_commit.json",
},
@@ -304,14 +316,65 @@ func TestAudit(t *testing.T) {
wantPath: "../test_data/test_local_repo_six_filepath_filename.json",
},
{
description: "test local repo six path globally whitelisted",
description: "test local repo six path globally allowlisted",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_6",
Report: "../test_data/test_local_repo_six_path_globally_whitelisted.json.got",
Config: "../test_data/test_configs/aws_key_global_whitelist_path.toml",
Report: "../test_data/test_local_repo_six_path_globally_allowlisted.json.got",
Config: "../test_data/test_configs/aws_key_global_allowlist_path.toml",
ReportFormat: "json",
},
wantPath: "../test_data/test_local_repo_six_path_globally_whitelisted.json",
wantPath: "../test_data/test_local_repo_six_path_globally_allowlisted.json",
},
{
description: "test local repo six leaks since date",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_6",
Report: "../test_data/test_local_repo_six_leaks_since_date.json.got",
ReportFormat: "json",
CommitSince: "2019-10-25",
},
wantPath: "../test_data/test_local_repo_six_leaks_since_date.json",
},
{
description: "test local repo two leaks until date",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_6",
Report: "../test_data/test_local_repo_six_leaks_until_date.json.got",
ReportFormat: "json",
CommitUntil: "2019-10-25",
},
wantPath: "../test_data/test_local_repo_six_leaks_until_date.json",
},
{
description: "test local repo four leaks timerange Commit",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_4",
Report: "../test_data/test_local_repo_four_leaks_commit_timerange.json.got",
ReportFormat: "json",
CommitSince: "2019-10-25T13:01:27-0400",
CommitUntil: "2019-10-25T13:12:32-0400",
},
wantPath: "../test_data/test_local_repo_four_leaks_commit_timerange.json",
},
{
description: "test local repo two allowlist Commit config",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_allowlist_commits.json.got",
Config: "../test_data/test_configs/allowlist_commit.toml",
ReportFormat: "json",
},
wantPath: "../test_data/test_local_repo_two_allowlist_commits.json",
},
{
description: "test local repo two deletion",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_2",
Report: "../test_data/test_local_repo_two_leaks_deletion.json.got",
ReportFormat: "json",
Deletion: true,
},
wantPath: "../test_data/test_local_repo_two_leaks_deletion.json",
},
}
@@ -357,7 +420,7 @@ func TestAudit(t *testing.T) {
}
}
func TestAuditUncommited(t *testing.T) {
func TestScanUncommited(t *testing.T) {
moveDotGit("dotGit", ".git")
defer moveDotGit(".git", "dotGit")
tests := []struct {
@@ -371,7 +434,7 @@ func TestAuditUncommited(t *testing.T) {
addition string
}{
{
description: "test audit local one leak",
description: "test scan local one leak",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_1",
Report: "../test_data/test_local_repo_one_aws_leak_uncommitted.json.got",
@@ -383,7 +446,7 @@ func TestAuditUncommited(t *testing.T) {
addition: " aws_access_key_id='AKIAIO5FODNN7DXAMPLE'\n\n",
},
{
description: "test audit local no leak",
description: "test scan local no leak",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_1",
Uncommited: true,
@@ -394,7 +457,7 @@ func TestAuditUncommited(t *testing.T) {
addition: "nothing bad",
},
{
description: "test audit repo with no commits",
description: "test scan repo with no commits",
opts: options.Options{
RepoPath: "../test_data/test_repos/test_repo_7",
Report: "../test_data/test_local_repo_seven_aws_leak_uncommitted.json.got",
@@ -0,0 +1,13 @@
[[rules]]
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[allowlist]
commits = [
"b10b3e2cb320a8c211fda94c4567299d37de7776",
"17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"996865bb912f3bc45898a370a13aadb315014b55"
]
@@ -2,13 +2,13 @@
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore md files"
file = '''(.*)?md$'''
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore this regex"
regex = '''ignore$'''
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore regex and md files"
regex = '''ignore$'''
file = '''(.*)?md$'''
@@ -2,6 +2,6 @@
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore python files"
file = '''(.*)?py$'''
@@ -2,6 +2,6 @@
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[[rules.whitelist]]
[[rules.allowlist]]
regex = '''AKIAIO5FODNN7EXAMPLE.*'''
description = "ignore aws key"
@@ -3,7 +3,7 @@
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[whitelist]
[allowlist]
description = "ignore md files"
files = [
'''(.*)?md$'''
@@ -3,7 +3,7 @@
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[whitelist]
[allowlist]
description = "ignore config folders"
paths = [
'''config(uration)?'''
@@ -0,0 +1,9 @@
[[rules]]
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[allowlist]
description = "allowlist repo"
repos = [
'''test_repo_1'''
]
@@ -3,6 +3,6 @@
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[whitelist]
[allowlist]
description = "ignore md files"
files = ['''???????''']
+4
View File
@@ -0,0 +1,4 @@
[[rules]]
description = "Generic Credential"
regex = '''(?i)(api_key|apikey|secret|password|pass|pw|key)(.{0,20})?[0-9a-zA-Z]{16,45}'''
tags = ["key", "API", "generic"]
+6 -6
View File
@@ -125,13 +125,13 @@ title = "gitleaks config"
description = "AWS Manager ID"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore common jenkins functions"
regex = '''whitelistme'''
regex = '''allowlistme'''
file = '''(.*)?Jenkinsfile$'''
[[rules.whitelist]]
[[rules.allowlist]]
description = "ignore common jenkins functions2"
regex = '''whitelistme'''
regex = '''allowlistme'''
file = '''(.*)?Jenkinsfile$'''
# Global rules. This instructs gitleaks to ignore all .pem files or if a message with
@@ -139,8 +139,8 @@ title = "gitleaks config"
description = "Files with keys and credentials"
fileRegex = '''(.*?)(pem)'''
[whitelist]
description = "File whitelists"
[allowlist]
description = "File allowlists"
files = [
'''(.*?)(jpg|gif)$''',
'''(.*?)(doc|pdf|bin)$'''
+28 -348
View File
@@ -1,6 +1,7 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -10,75 +11,12 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
},
{
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
@@ -88,62 +26,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
@@ -153,49 +41,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
@@ -205,62 +56,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding aws key\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, API, generic"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, AWS"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIAE",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, API, generic"
},
{
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIA",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
@@ -270,62 +71,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, AWS"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIAE",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "more secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, API, generic"
},
{
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "more secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, API, generic"
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "64cfcee9aad1c84581631636bfc54f2050718d1a",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:36:22-04:00",
"tags": "key, AWS"
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "64cfcee9aad1c84581631636bfc54f2050718d1a",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:36:22-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 6,
"offender": "AKIALALEMEL33243OLIA",
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
@@ -335,36 +86,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:35:03-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "dev branch\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:35:03-04:00",
"tags": "key, API, generic"
},
{
"line": "\nmore_secrets = '99432bfewaf823ec3294e231'",
"offender": "secrets = '99432bfewaf823ec3294e231",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
},
{
"line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
@@ -374,23 +101,12 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:08:04-05:00",
"tags": "key, AWS"
},
{
"line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"offender": "key_id='AKIAIO5FODNN7EXAMPL2",
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "introduce more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:08:04-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
"repo": "test_repo_5",
@@ -400,36 +116,12 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:07:34-05:00",
"tags": "key, AWS"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "introduce secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:07:34-05:00",
"tags": "key, API, generic"
},
{
"line": "db_password: verySecretProductionPassword",
"offender": "password: verySecretProductionPassword",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic Credential",
"commitMessage": "Adding some secrets in config folder\n\n",
"author": "Noel Algora",
"email": "noealgigu@gmail.com",
"file": "application.yaml",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
@@ -439,19 +131,7 @@
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, AWS"
},
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"offender": "key_id=AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic Credential",
"commitMessage": "Adding some secrets in config folder\n\n",
"author": "Noel Algora",
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -0,0 +1,137 @@
[
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "adding aws key\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIA",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "more secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 6,
"offender": "AKIALALEMEL33243OLIA",
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "dev branch\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:35:03-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
"rule": "AWS Manager ID",
"commitMessage": "introduce more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:08:04-05:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
"repo": "test_repo_5",
"rule": "AWS Manager ID",
"commitMessage": "introduce secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:07:34-05:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "AWS Manager ID",
"commitMessage": "Adding some secrets in config folder\n\n",
"author": "Noel Algora",
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_6",
"rule": "AWS Manager ID",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS",
"operation": "addition"
}
]
+16 -214
View File
@@ -1,6 +1,7 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -10,75 +11,12 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
},
{
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
@@ -88,75 +26,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, AWS"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIAE",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, API, generic"
},
{
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 4,
"offender": "AKIALALEMEL33243OLIA",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
@@ -166,49 +41,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIAE",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "more secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, API, generic"
},
{
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_3",
"rule": "Generic Credential",
"commitMessage": "more secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "key, API, generic"
},
{
"line": "\nmore_secrets = '99432bfewaf823ec3294e231'",
"offender": "secrets = '99432bfewaf823ec3294e231",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
},
{
"line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
@@ -218,36 +56,12 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:08:04-05:00",
"tags": "key, AWS"
},
{
"line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"offender": "key_id='AKIAIO5FODNN7EXAMPL2",
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "introduce more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:08:04-05:00",
"tags": "key, API, generic"
},
{
"line": "db_password: verySecretProductionPassword",
"offender": "password: verySecretProductionPassword",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic Credential",
"commitMessage": "Adding some secrets in config folder\n\n",
"author": "Noel Algora",
"email": "noealgigu@gmail.com",
"file": "application.yaml",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
@@ -257,19 +71,7 @@
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, AWS"
},
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"offender": "key_id=AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "Generic Credential",
"commitMessage": "Adding some secrets in config folder\n\n",
"author": "Noel Algora",
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": "\nmore_secrets = '99432bfewaf823ec3294e231'",
"line": "more_secrets = '99432bfewaf823ec3294e231'",
"lineNumber": 7,
"offender": "secrets = '99432bfewaf823ec3294e231",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
@@ -10,6 +11,7 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
"tags": "key, API, generic",
"operation": "addition"
}
]
+4 -2
View File
@@ -1,6 +1,7 @@
[
{
"line": "\nmore_secrets = '99432bfewaf823ec3294e231'",
"line": "more_secrets = '99432bfewaf823ec3294e231'",
"lineNumber": 7,
"offender": "secrets = '99432bfewaf823ec3294e231",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
@@ -10,6 +11,7 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
"tags": "key, API, generic",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
@@ -10,10 +11,12 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
@@ -23,45 +26,7 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, AWS"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"offender": "key_id='AKIAIO5FODNN7EXAMPL2",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
},
{
"line": "more_secrets = '99432bfewaf823ec3294e231'",
"offender": "secrets = '99432bfewaf823ec3294e231",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"lineNumber": 1,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
@@ -10,10 +11,12 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"lineNumber": 4,
"offender": "AKIAIO5FODNN7EXAMPL2",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
@@ -23,45 +26,7 @@
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, AWS"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
},
{
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
"offender": "key_id='AKIAIO5FODNN7EXAMPL2",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
},
{
"line": "more_secrets = '99432bfewaf823ec3294e231'",
"offender": "secrets = '99432bfewaf823ec3294e231",
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
"repo": "test_repo_5",
"rule": "Generic Credential",
"commitMessage": "even more secrets\n",
"author": "Zach Rice",
"email": "zrice@gitlab.com",
"file": "secrets.py",
"date": "2020-02-01T10:30:22-05:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,19 +1,7 @@
[
{
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "\"99432bfewaf823ec3294e231\"",
"commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9",
"repo": "test_repo_4",
"rule": "entropy",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:26-04:00",
"tags": "entropy"
},
{
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"lineNumber": 5,
"offender": "\"99432bfewaf823ec3294e231\"",
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
"repo": "test_repo_4",
@@ -23,23 +11,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:54:08-04:00",
"tags": "entropy"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "\"99432bfewaf823ec3294e231\"",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_4",
"rule": "entropy",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "entropy"
"tags": "entropy",
"operation": "addition"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"lineNumber": 6,
"offender": "\"99432bfewaf823ec3294e231\"",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
@@ -49,6 +26,7 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "entropy"
"tags": "entropy",
"operation": "addition"
}
]
@@ -0,0 +1,32 @@
[
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_4",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS",
"operation": "addition"
}
]
+3 -27
View File
@@ -1,6 +1,7 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -10,32 +11,7 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
},
{
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": "N/A",
"lineNumber": -1,
"offender": "Filename/path offender: server.test.py",
"commit": "d274003914c707212cbe84e3e466a00013ccb639",
"repo": "test_repo_1",
@@ -10,10 +11,12 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T10:03:38-04:00",
"tags": ""
"tags": "",
"operation": "addition"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -23,10 +26,12 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "N/A",
"lineNumber": -1,
"offender": "Filename/path offender: server.test.py",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -36,6 +41,7 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": ""
"tags": "",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -10,32 +11,7 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"offender": "key_id='AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
},
{
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7DXAMPLE'",
"lineNumber": 10,
"offender": "AKIAIO5FODNN7DXAMPLE",
"commit": "0000000000000000000000000000000000000000",
"repo": "test_repo_1",
@@ -10,19 +11,7 @@
"email": "",
"file": "server.test.py",
"date": "1970-01-01T00:00:00Z",
"tags": "key, AWS"
},
{
"line": " aws_access_key_id='AKIAIO5FODNN7DXAMPLE'",
"offender": "key_id='AKIAIO5FODNN7DXAMPLE",
"commit": "0000000000000000000000000000000000000000",
"repo": "test_repo_1",
"rule": "Generic Credential",
"commitMessage": "***STAGED CHANGES***",
"author": "",
"email": "",
"file": "server.test.py",
"date": "1970-01-01T00:00:00Z",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "equal"
}
]
@@ -1,6 +1,7 @@
[
{
"line": "AKIAIO5FODNN7EXAMPLE",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "0000000000000000000000000000000000000000",
"repo": "test_repo_7",
@@ -10,6 +11,7 @@
"email": "",
"file": "file",
"date": "1970-01-01T00:00:00Z",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "equal"
}
]
+6 -2
View File
@@ -1,6 +1,7 @@
[
{
"line": "api_token: exampleSecretPassword",
"lineNumber": 2,
"offender": "token: exampleSecretPassword",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
@@ -10,10 +11,12 @@
"email": "noealgigu@gmail.com",
"file": "application.yaml",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, Yml, Yaml"
"tags": "key, Yml, Yaml",
"operation": "addition"
},
{
"line": "db_password: verySecretProductionPassword",
"lineNumber": 3,
"offender": "password: verySecretProductionPassword",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
@@ -23,6 +26,7 @@
"email": "noealgigu@gmail.com",
"file": "application.yaml",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, Yml, Yaml"
"tags": "key, Yml, Yaml",
"operation": "addition"
}
]
+3 -1
View File
@@ -1,6 +1,7 @@
[
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
@@ -10,6 +11,7 @@
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": "apiToken=d41d8cd98f00b204e9800998ecf8427e",
"lineNumber": 2,
"offender": "Token=d41d8cd98f00b204e9800998ecf8427e",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
@@ -10,6 +11,7 @@
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, Yml, Yaml"
"tags": "key, Yml, Yaml",
"operation": "addition"
}
]
@@ -0,0 +1,17 @@
[
{
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
"lineNumber": 3,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
"repo": "test_repo_6",
"rule": "AWS Manager ID",
"commitMessage": "Adding some secrets in config folder\n\n",
"author": "Noel Algora",
"email": "noealgigu@gmail.com",
"file": "config/application.properties",
"date": "2020-02-24T14:13:15-05:00",
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,6 +1,7 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_6",
@@ -10,6 +11,7 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -0,0 +1,17 @@
[
{
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
"lineNumber": 5,
"offender": "AKIAIO5FODNN7EXAMPLE",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_6",
"rule": "AWS Manager ID",
"commitMessage": "commit 1 with secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "key, AWS",
"operation": "addition"
}
]
+12 -56
View File
@@ -1,19 +1,7 @@
[
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "64cfcee9aad1c84581631636bfc54f2050718d1a",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:36:22-04:00",
"tags": "key, AWS"
},
{
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 6,
"offender": "AKIALALEMEL33243OLIA",
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
"repo": "test_repo_3",
@@ -23,23 +11,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:35:03-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_3",
@@ -49,23 +26,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_3",
@@ -75,23 +41,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_3",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_3",
@@ -101,6 +56,7 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -0,0 +1,17 @@
[
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS",
"operation": "addition"
}
]
+9 -146
View File
@@ -1,45 +1,7 @@
[
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
@@ -49,62 +11,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
@@ -114,49 +26,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
@@ -166,19 +41,7 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding aws key\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,32 +1,7 @@
[
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, API, generic"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
@@ -36,49 +11,12 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
@@ -88,19 +26,7 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS"
},
{
"line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding aws key\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,32 +1,7 @@
[
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, API, generic"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
@@ -36,45 +11,7 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"offender": "secret: AKIALALEMEL33243OLIAE",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -1,45 +1,7 @@
[
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
@@ -49,58 +11,7 @@
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"offender": "KEY = \"AKIALALEMEL33243OLIBE",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
"offender": "SECRET = \"99432bfewaf823ec3294e231",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, API, generic"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"offender": "secret: \"AKIALALEMEL33243OLIAE",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "Generic Credential",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, API, generic"
"tags": "key, AWS",
"operation": "addition"
}
]
@@ -0,0 +1,92 @@
[
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": -1,
"offender": "AKIALALEMEL33243OLIB",
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "rm secrets again\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:32-04:00",
"tags": "key, AWS",
"operation": "deletion"
},
{
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIB",
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "adding another one\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:12:08-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": -1,
"offender": "AKIALALEMEL33243OLIA",
"commit": "996865bb912f3bc45898a370a13aadb315014b55",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "committing pem\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:07:41-04:00",
"tags": "key, AWS",
"operation": "deletion"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": -1,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS",
"operation": "deletion"
},
{
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
"lineNumber": 5,
"offender": "AKIALALEMEL33243OLIA",
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "wait this is actually adding an aws secret\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T13:01:27-04:00",
"tags": "key, AWS",
"operation": "addition"
},
{
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
"lineNumber": 3,
"offender": "AKIALALEMEL33243OLIA",
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
"repo": "test_repo_2",
"rule": "AWS Manager ID",
"commitMessage": "adding aws key\n",
"author": "zach rice",
"email": "zricer@protonmail.com",
"file": "secrets.md",
"date": "2019-10-25T12:58:39-04:00",
"tags": "key, AWS",
"operation": "addition"
}
]
+3 -1
View File
@@ -1,6 +1,7 @@
[
{
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"lineNumber": 6,
"offender": "'ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
"repo": "test_repo_1",
@@ -10,6 +11,7 @@
"email": "zricer@protonmail.com",
"file": "server.test.py",
"date": "2019-10-24T09:29:27-04:00",
"tags": "entropy"
"tags": "entropy",
"operation": "addition"
}
]