mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6adc045580 | ||
|
|
95f8bd0daa | ||
|
|
2cc2519302 | ||
|
|
7111a698c0 | ||
|
|
8b9092a248 | ||
|
|
0aa05133a9 | ||
|
|
2952df5432 | ||
|
|
541e26b067 | ||
|
|
6018a6bb70 | ||
|
|
ca987b3842 | ||
|
|
67f8d28d7f | ||
|
|
f88abe99d7 | ||
|
|
6ddf27c5c3 | ||
|
|
aadd9387b2 | ||
|
|
0fd68c901d | ||
|
|
17a3943afe | ||
|
|
abc73e2443 | ||
|
|
3c1751e5c4 | ||
|
|
a32ef6afc4 | ||
|
|
127df8a6f0 | ||
|
|
aa91fd3e5e | ||
|
|
c8e97d97f9 | ||
|
|
67e3603ba4 | ||
|
|
f62617d7a6 | ||
|
|
9324184c24 | ||
|
|
a80ce0d251 | ||
|
|
c1c4a93f98 | ||
|
|
e74e6292ee | ||
|
|
25c3e92c2a | ||
|
|
9ab424172d | ||
|
|
28fd47e170 | ||
|
|
8250e40a75 | ||
|
|
e7553b0168 | ||
|
|
12d276acd7 | ||
|
|
e6934bf0a5 | ||
|
|
6f5ad9dc0b | ||
|
|
a2019a4782 | ||
|
|
5d7b7718ec | ||
|
|
190877a24b | ||
|
|
144362b972 | ||
|
|
d353ac5108 | ||
|
|
a27a08904a | ||
|
|
5ef4e336ce | ||
|
|
78f2c46517 | ||
|
|
bdcb9e33a8 | ||
|
|
6e4e9df55f | ||
|
|
b3bed5658d | ||
|
|
a10ae91ba7 | ||
|
|
a8dbc7f107 | ||
|
|
4544156b44 | ||
|
|
b52e8c9c7c | ||
|
|
0ce1249b95 |
No files matched your search
@@ -1,4 +1,3 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [zricethezav]
|
github: [zricethezav]
|
||||||
custom: ["https://www.paypal.me/zricethezav"]
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: Maintenance request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: enhancement
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
|
|
||||||
|
cc @zricethezav
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GO111MODULE: on
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v ./...
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GO111MODULE: on
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: make test
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
*.dylib
|
*.dylib
|
||||||
*.DS_STORE
|
*.DS_STORE
|
||||||
*.idea
|
*.idea
|
||||||
|
*.got
|
||||||
gitleaks
|
gitleaks
|
||||||
build
|
build
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- id: gitleaks
|
||||||
|
name: Detect hardcoded secrets
|
||||||
|
description: Detect hardcoded secrets using Gitleaks
|
||||||
|
entry: gitleaks
|
||||||
|
language: golang
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
language: go
|
|
||||||
go:
|
|
||||||
- 1.14.x
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
script:
|
|
||||||
- make test
|
|
||||||
- make security-scan
|
|
||||||
+5
-10
@@ -1,17 +1,12 @@
|
|||||||
FROM golang:1.15.5 AS build
|
FROM golang:1.17 AS build
|
||||||
WORKDIR /go/src/github.com/zricethezav/gitleaks
|
WORKDIR /go/src/github.com/zricethezav/gitleaks
|
||||||
ARG ldflags
|
ARG ldflags
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN GO111MODULE=on CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="${ldflags} *.go
|
RUN GO111MODULE=on CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="${ldflags} *.go
|
||||||
|
|
||||||
FROM alpine:3.11
|
FROM alpine:3.14.1
|
||||||
RUN apk add --no-cache bash git openssh
|
RUN adduser -D gitleaks && \
|
||||||
|
apk add --no-cache bash git openssh-client
|
||||||
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
|
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
|
||||||
|
USER gitleaks
|
||||||
ENTRYPOINT ["gitleaks"]
|
ENTRYPOINT ["gitleaks"]
|
||||||
|
|
||||||
# How to use me :
|
|
||||||
|
|
||||||
# docker build -t gitleaks .
|
|
||||||
# docker run --rm --name=gitleaks gitleaks --repo=https://github.com/zricethezav/gitleaks
|
|
||||||
|
|
||||||
# This will check for secrets in https://github.com/zricethezav/gitleaks
|
|
||||||
@@ -10,24 +10,21 @@ test-cover:
|
|||||||
go test ./... --race $(COVER) $(PKG) -v
|
go test ./... --race $(COVER) $(PKG) -v
|
||||||
go tool cover -html=cover.out
|
go tool cover -html=cover.out
|
||||||
|
|
||||||
test:
|
format:
|
||||||
go get golang.org/x/lint/golint
|
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
|
|
||||||
|
test: format
|
||||||
|
go get golang.org/x/lint/golint
|
||||||
go vet ./...
|
go vet ./...
|
||||||
golint ./...
|
golint ./...
|
||||||
go test ./... --race $(PKG) -v
|
go test ./... --race $(PKG) -v
|
||||||
|
|
||||||
build:
|
build: format
|
||||||
go fmt ./...
|
|
||||||
golint ./...
|
golint ./...
|
||||||
go vet ./...
|
go vet ./...
|
||||||
go mod tidy
|
go mod tidy
|
||||||
go build $(LDFLAGS)
|
go build $(LDFLAGS)
|
||||||
|
|
||||||
security-scan:
|
|
||||||
go get github.com/securego/gosec/cmd/gosec
|
|
||||||
gosec -no-fail ./...
|
|
||||||
|
|
||||||
release-builds:
|
release-builds:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
mkdir build
|
mkdir build
|
||||||
@@ -41,9 +38,9 @@ release-builds:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
@echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
|
@echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
|
||||||
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
|
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
|
||||||
echo "Pushing zricethezav/gitleaks:$(VERSION) and zricethezav/gitleaks:latest"
|
echo "Pushing zricethezav/gitleaks:$(VERSION) and zricethezav/gitleaks:latest"
|
||||||
docker push zricethezav/gitleaks
|
docker push zricethezav/gitleaks
|
||||||
|
|
||||||
dockerbuild:
|
dockerbuild:
|
||||||
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
|
docker build --build-arg ldflags=$(_LDFLAGS) -f Dockerfile -t zricethezav/gitleaks:latest -t zricethezav/gitleaks:$(VERSION) .
|
||||||
@@ -1,43 +1,81 @@
|
|||||||
<p align="center">
|
|
||||||
<img alt="gitleaks" src="https://raw.githubusercontent.com/zricethezav/gifs/master/gitleakslogo.png" height="70" />
|
```
|
||||||
<p align="center">
|
○
|
||||||
<a href="https://travis-ci.org/zricethezav/gitleaks"><img alt="Travis" src="https://img.shields.io/travis/zricethezav/gitleaks/master.svg?style=flat-square"></a>
|
│╲
|
||||||
<a href="https://gitter.im/gitleaks/gitleaks"><img alt="Travis" src="https://badges.gitter.im/gitleaks/gitleaks.svg?style=flat-square"></a>
|
│ ○
|
||||||
|
○ ░
|
||||||
|
░ gitleaks
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
<p align="left">
|
||||||
|
<p align="left">
|
||||||
|
<a href="https://github.com/zricethezav/gitleaks/actions/workflows/test.yml">
|
||||||
|
<img alt="Github Test" src="https://github.com/zricethezav/gitleaks/actions/workflows/test.yml/badge.svg">
|
||||||
|
</a>
|
||||||
|
<a href="https://hub.docker.com/r/zricethezav/gitleaks">
|
||||||
|
<img src="https://img.shields.io/docker/pulls/zricethezav/gitleaks.svg" />
|
||||||
|
</a>
|
||||||
|
<a href="https://twitter.com/intent/follow?screen_name=zricethezav">
|
||||||
|
<img src="https://img.shields.io/twitter/follow/zricethezav?label=Follow%20zricethezav&style=social&color=blue" alt="Follow @zricethezav" />
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys, and tokens in git repos. Gitleaks aims to be the **easy-to-use, all-in-one solution** for finding secrets, past or present, in your code.
|
Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys, and tokens in git repos. Gitleaks is an **easy-to-use, all-in-one solution** for finding secrets, past or present, in your code.
|
||||||
|
|
||||||
|
### [Introduction Video](https://www.youtube.com/watch?v=VUq2eII20S4)
|
||||||
|
|
||||||
|
|
||||||
### Features:
|
### Features:
|
||||||
- Scan for [commited](https://github.com/zricethezav/gitleaks#Scanning) secrets
|
- Scan for [commited](https://github.com/zricethezav/gitleaks#Scanning) secrets
|
||||||
- Scan for [unstaged](https://github.com/zricethezav/gitleaks#scan-unstaged-changes) secrets as part of shifting security left
|
- Scan for [unstaged](https://github.com/zricethezav/gitleaks#scan-unstaged-changes) secrets to shift security left
|
||||||
- Scan [directories and files](https://github.com/zricethezav/gitleaks#scan-local-directory)
|
- Scan [directories and files](https://github.com/zricethezav/gitleaks#scan-local-directory)
|
||||||
- Available [Github Action](https://github.com/marketplace/actions/gitleaks)
|
- Run [Gitleaks Action](https://github.com/marketplace/actions/gitleaks) in your CI/CD pipeline
|
||||||
- [Custom rules](https://github.com/zricethezav/gitleaks#configuration) via toml configuration
|
- [Custom rules](https://github.com/zricethezav/gitleaks#configuration) via toml configuration
|
||||||
- High performance using [go-git](https://github.com/go-git/go-git)
|
- Increased performance using [go-git](https://github.com/go-git/go-git)
|
||||||
- JSON, SARIF, and CSV reporting
|
- json, sarif, and csv reporting
|
||||||
- Private repo scans using key or password based authentication
|
- Private repo scans using key or password based authentication
|
||||||
|
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
Gitleaks can be installed with Homebrew, Docker, and Go. Gitleaks is also available in binary form for many popular platforms and OS types from the [releases page](https://github.com/zricethezav/gitleaks/releases).
|
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases). In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo.
|
||||||
|
|
||||||
##### MacOS
|
##### MacOS
|
||||||
|
|
||||||
```
|
```bash
|
||||||
brew install gitleaks
|
brew install gitleaks
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Docker
|
##### Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker pull zricethezav/gitleaks
|
# To just pull the image
|
||||||
|
docker pull zricethezav/gitleaks:latest
|
||||||
|
# To run it from your cloned repo
|
||||||
|
cd to/your/repo/
|
||||||
|
docker run -v ${PWD}:/my-repo zricethezav/gitleaks:latest --path="/my-repo" [OPTIONS]
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Go
|
##### Go
|
||||||
```bash
|
```bash
|
||||||
GO111MODULE=on go get github.com/zricethezav/gitleaks/v7
|
GO111MODULE=on go get github.com/zricethezav/gitleaks/v7
|
||||||
```
|
```
|
||||||
|
##### As a pre-commit hook
|
||||||
|
|
||||||
|
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions.
|
||||||
|
|
||||||
|
Sample `.pre-commit-config.yaml`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# The revision doesn't get updated manually
|
||||||
|
# check this https://github.com/zricethezav/gitleaks/releases
|
||||||
|
# to see if there are newer versions
|
||||||
|
- repo: https://github.com/zricethezav/gitleaks
|
||||||
|
rev: v7.6.0
|
||||||
|
hooks:
|
||||||
|
- id: gitleaks
|
||||||
|
```
|
||||||
|
|
||||||
### Usage and Options
|
### Usage and Options
|
||||||
```
|
```
|
||||||
@@ -45,42 +83,39 @@ Usage:
|
|||||||
gitleaks [OPTIONS]
|
gitleaks [OPTIONS]
|
||||||
|
|
||||||
Application Options:
|
Application Options:
|
||||||
-v, --verbose Show verbose output from scan
|
-v, --verbose Show verbose output from scan
|
||||||
-q, --quiet Sets log level to error and only output leaks, one json object per line
|
-q, --quiet Sets log level to error and only output leaks, one json object per line
|
||||||
-r, --repo-url= Repository URL
|
-r, --repo-url= Repository URL
|
||||||
-p, --path= Path to directory (repo if contains .git) or file
|
-p, --path= Path to directory (repo if contains .git) or file
|
||||||
-c, --config-path= Path to config
|
-c, --config-path= Path to config
|
||||||
--repo-config-path= Path to gitleaks config relative to repo root
|
--repo-config-path= Path to gitleaks config relative to repo root
|
||||||
--version Version number
|
--clone-path= Path to clone repo to disk
|
||||||
--username= Username for git repo
|
--version Version number
|
||||||
--password= Password for git repo
|
--username= Username for git repo
|
||||||
--access-token= Access token for git repo
|
--password= Password for git repo
|
||||||
--threads= Maximum number of threads gitleaks spawns
|
--access-token= Access token for git repo
|
||||||
--ssh-key= Path to ssh key used for auth
|
--threads= Maximum number of threads gitleaks spawns
|
||||||
--unstaged Run gitleaks on unstaged code
|
--ssh-key= Path to ssh key used for auth
|
||||||
--branch= Branch to scan
|
--unstaged Run gitleaks on unstaged code
|
||||||
--redact Redact secrets from log messages and leaks
|
--branch= Branch to scan
|
||||||
--debug Log debug messages
|
--redact Redact secrets from log messages and leaks
|
||||||
--leaks-exit-code= Exit code when leaks have been encountered (default: 1)
|
--debug Log debug messages
|
||||||
--no-git Treat git repos as plain directories and scan those
|
--no-git Treat git repos as plain directories and scan those files
|
||||||
files
|
--leaks-exit-code= Exit code when leaks have been encountered (default: 1)
|
||||||
-o, --report= Report output path
|
--append-repo-config Append the provided or default config with the repo config.
|
||||||
-f, --format= JSON, CSV, SARIF (default: json)
|
--additional-config= Path to an additional gitleaks config to append with an existing config. Can be used with --append-repo-config to append up to three configurations
|
||||||
--files-at-commit= Sha of commit to scan all files at commit
|
-o, --report= Report output path
|
||||||
--commit= Sha of commit to scan or "latest" to scan the last
|
-f, --format= json, csv, sarif (default: json)
|
||||||
commit of the repository
|
--files-at-commit= Sha of commit to scan all files at commit
|
||||||
--commits= Comma separated list of a commits to scan
|
--commit= Sha of commit to scan or "latest" to scan the last commit of the repository
|
||||||
--commits-file= Path to file of line separated list of commits to scan
|
--commits= Comma separated list of a commits to scan
|
||||||
--commit-from= Commit to start scan from
|
--commits-file= Path to file of line separated list of commits to scan
|
||||||
--commit-to= Commit to stop scan
|
--commit-since= Scan commits more recent than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format.
|
||||||
--commit-since= Scan commits more recent than a specific date. Ex:
|
--commit-until= Scan commits older than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format.
|
||||||
'2006-01-02' or '2006-01-02T15:04:05-0700' format.
|
--depth= Number of commits to scan
|
||||||
--commit-until= Scan commits older than a specific date. Ex:
|
|
||||||
'2006-01-02' or '2006-01-02T15:04:05-0700' format.
|
|
||||||
--depth= Number of commits to scan
|
|
||||||
|
|
||||||
Help Options:
|
Help Options:
|
||||||
-h, --help Show this help message
|
-h, --help Show this help message
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -88,66 +123,65 @@ Help Options:
|
|||||||
|
|
||||||
#### Basic repo-url scan:
|
#### Basic repo-url scan:
|
||||||
This scans the entire history of tests/secrets and logs leaks as they are encountered `-v`/`--verbose` being set.
|
This scans the entire history of tests/secrets and logs leaks as they are encountered `-v`/`--verbose` being set.
|
||||||
```
|
```bash
|
||||||
gitleaks --repo-url=https://github.com/my-insecure/repo -v
|
gitleaks --repo-url=https://github.com/my-insecure/repo -v
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Basic repo-url scan output to a report:
|
#### Basic repo-url scan output to a report:
|
||||||
If we want the report in sarif or csv we can set the `-f/--format` option
|
If you want the report in sarif or csv you can set the `-f/--format` option
|
||||||
```
|
```bash
|
||||||
gitleaks --repo-url=https://github.com/my-insecure/repo -v --report=my-report.json
|
gitleaks --repo-url=https://github.com/my-insecure/repo -v --report=my-report.json
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Scan specific commit:
|
#### Scan specific commit:
|
||||||
```
|
```bash
|
||||||
gitleaks --repo-url=https://github.com/my-insecure/repo --commit=commit-sha -v
|
gitleaks --repo-url=https://github.com/my-insecure/repo --commit=commit-sha -v
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Scan local repo:
|
#### Scan local repo:
|
||||||
```
|
```bash
|
||||||
gitleaks --path=path/to/local/repo -v
|
gitleaks --path=path/to/local/repo -v
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Scan repos contain in a parent directory:
|
#### Scan repos contained in a parent directory:
|
||||||
If we had `repo1`, `repo2`, `repo3` all under `path/to/local`, gitleaks will discover and scan those repos.
|
If you have `repo1`, `repo2`, `repo3` all under `path/to/local`, gitleaks will discover and scan those repos.
|
||||||
```
|
```bash
|
||||||
gitleaks --path=path/to/local/ -v
|
gitleaks --path=path/to/local/ -v
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Scan local directory:
|
#### Scan local directory:
|
||||||
You might want to scan the current contents of a repo, ignoring git alltogether. You can use the `--no-git` option to do this.
|
If you want to scan the current contents of a repo, ignoring git alltogether. You can use the `--no-git` option to do this.
|
||||||
```
|
```bash
|
||||||
gitleaks --path=path/to/local/repo -v --no-git
|
gitleaks --path=path/to/local/repo -v --no-git
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Scan a file:
|
#### Scan a file:
|
||||||
Or you might want to scan a single file using gitleaks rules. You can do this by specifying the file in `--path` and including the `--no-git` option.
|
Or if you want to scan a single file using gitleaks rules. You can do this by specifying the file in `--path` and including the `--no-git` option.
|
||||||
```
|
```bash
|
||||||
gitleaks --path=path/to/local/repo/main.go -v --no-git
|
gitleaks --path=path/to/local/repo/main.go -v --no-git
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Scan unstaged changes:
|
#### Scan unstaged changes:
|
||||||
If you have unstaged changes are are currently at the root of the repo, you can run `gitleaks` with no `--path` or `--repo-url` specified which will run a scan on your uncommitted changes. Or if you want to specify a
|
If you have unstaged changes are are currently at the root of the repo, you can run `gitleaks` with no `--path` or `--repo-url` specified which will run a scan on your uncommitted changes. Or if you want to specify a
|
||||||
path, you can run:
|
path, you can run:
|
||||||
```
|
```bash
|
||||||
gitleaks --path=path/to/local/repo -v --unstaged
|
gitleaks --path=path/to/local/repo -v --unstaged
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
Provide your own gitleaks configurations with `--config-path` or `--repo-config-path`. The difference between the two is `--config-path` loads a local gitleaks config whereas `--repo-config-path` will load a configuration present in the repo you want to scan. For example, `gitleaks --repo-config-path=".github/gitleaks.config"`.
|
Provide your own gitleaks configurations with `--config-path` or `--repo-config-path`. `--config-path` loads a local gitleaks configuration whereas `--repo-config-path` will load a configuration present just in the repo you want to scan. For example, `gitleaks --repo-config-path=".github/gitleaks.config"`.
|
||||||
The default configuration Gitleaks uses is located [here](https://github.com/zricethezav/gitleaks/blob/master/config/default.go). More configuration examples can be seen [here](https://github.com/zricethezav/gitleaks/tree/master/examples). Configuration files contain a few different toml tables which will be explained below.
|
The default configuration Gitleaks uses is located [here](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml). More configuration examples can be seen [here](https://github.com/zricethezav/gitleaks/tree/master/examples). Configuration files will contain a few different toml tables. Further explanation is provided below.
|
||||||
|
|
||||||
### Rules summary
|
### Rules summary
|
||||||
|
|
||||||
The rules are written in [TOML](https://github.com/toml-lang/toml) as defined in [TomlLoader struct](https://github.com/zricethezav/gitleaks/blob/master/config/config.go#L57-L87), and can be summarized as:
|
The rules are written in [TOML](https://github.com/toml-lang/toml) as defined in [TomlLoader struct](https://github.com/zricethezav/gitleaks/blob/master/config/config.go#L57-L87), and can be summarized as:
|
||||||
|
|
||||||
```
|
```toml
|
||||||
|
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "a string describing one of many rule in this config"
|
description = "a string describing one of many rule in this config"
|
||||||
regex = '''one-go-style-regex-for-this-rule'''
|
regex = '''one-go-style-regex-for-this-rule'''
|
||||||
file = '''a-file-name-regex'''
|
file = '''a-file-name-regex'''
|
||||||
path = '''a-file-path-regex'''
|
path = '''a-file-path-regex'''
|
||||||
tags = ["tag","another tag"]
|
tags = ["tag","another tag"]
|
||||||
@@ -177,7 +211,7 @@ Regular expressions are _NOT_ the full Perl set, so there are no look-aheads or
|
|||||||
### Examples
|
### Examples
|
||||||
#### Example 1
|
#### Example 1
|
||||||
The first and most commonly edited array of tables is `[[rules]]`. This is where you can define your own custom rules for Gitleaks to use while scanning repos. Example keys/values within the `[[rules]]` table:
|
The first and most commonly edited array of tables is `[[rules]]`. This is where you can define your own custom rules for Gitleaks to use while scanning repos. Example keys/values within the `[[rules]]` table:
|
||||||
```
|
```toml
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "generic secret regex"
|
description = "generic secret regex"
|
||||||
regex = '''secret(.{0,20})([0-9a-zA-Z-._{}$\/\+=]{20,120})'''
|
regex = '''secret(.{0,20})([0-9a-zA-Z-._{}$\/\+=]{20,120})'''
|
||||||
@@ -185,35 +219,34 @@ The first and most commonly edited array of tables is `[[rules]]`. This is where
|
|||||||
```
|
```
|
||||||
#### Example 2
|
#### Example 2
|
||||||
We can also **combine** regular expressions AND entropy:
|
We can also **combine** regular expressions AND entropy:
|
||||||
```
|
```toml
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "entropy and regex example"
|
description = "entropy and regex example"
|
||||||
regex = '''secret(.{0,20})['|"]([0-9a-zA-Z-._{}$\/\+=]{20,120})['|"]'''
|
regex = '''secret(.{0,20})['|"]([0-9a-zA-Z-._{}$\/\+=]{20,120})['|"]'''
|
||||||
[[rules.Entropies]]
|
[[rules.Entropies]]
|
||||||
Min = "4.5"
|
Min = "4.5"
|
||||||
Max = "4.7"
|
Max = "4.7"
|
||||||
```
|
```
|
||||||
Translating this rule to English, this rule states: "if we encounter a line of code that matches *regex* AND the line falls within the bounds of a [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) of 4.5 to 4.7, then the line must be a leak"
|
Translating this rule to English, this rule states: "if we encounter a line of code that matches *regex* AND the line falls within the bounds of a [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) of 4.5 to 4.7, then the line must be a leak"
|
||||||
|
|
||||||
#### Example 3
|
#### Example 3
|
||||||
Let's compare two lines of code:
|
Let's compare two lines of code:
|
||||||
```
|
```
|
||||||
aws_secret='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'
|
aws_secret='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'
|
||||||
```
|
```
|
||||||
and
|
and
|
||||||
```
|
```
|
||||||
aws_secret=os.getenv('AWS_SECRET_ACCESS_KEY')
|
aws_secret=os.getenv('AWS_SECRET_ACCESS_KEY')
|
||||||
|
|
||||||
```
|
```
|
||||||
The first line of code is an example of a hardcoded secret being assigned to the variable `aws_secret`. The second line of code is an example of a secret being assigned via env variables to `aws_secret`. Both would be caught by the rule defined in *example 2* but only the first line is actually a leak. Let's define a new rule that will capture only the first line of code. We can do this by combining regular expression **groups** and entropy.
|
The first line of code is an example of a hardcoded secret being assigned to the variable `aws_secret`. The second line of code is an example of a secret being assigned via env variables to `aws_secret`. Both would be caught by the rule defined in *example 2* but only the first line is actually a leak. Let's define a new rule that will capture only the first line of code. We can do this by combining regular expression **groups** and entropy.
|
||||||
```
|
```toml
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "entropy and regex example"
|
description = "entropy and regex example"
|
||||||
regex = '''secret(.{0,20})['|"]([0-9a-zA-Z-._{}$\/\+=]{20,120})['|"]'''
|
regex = '''secret(.{0,20})['|"]([0-9a-zA-Z-._{}$\/\+=]{20,120})['|"]'''
|
||||||
[[rules.Entropies]]
|
[[rules.Entropies]]
|
||||||
Min = "4.5"
|
Min = "4.5"
|
||||||
Max = "4.7"
|
Max = "4.7"
|
||||||
Group = "2"
|
Group = "2"
|
||||||
```
|
```
|
||||||
Notice how we added `Group = "2"` to this rule. We can translate this rule to English: "if we encounter a line of code that matches regex AND the entropy of the *second regex group* falls within the bounds of a [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) of 4.5 to 4.7, then the line must be a leak"
|
Notice how we added `Group = "2"` to this rule. We can translate this rule to English: "if we encounter a line of code that matches regex AND the entropy of the *second regex group* falls within the bounds of a [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) of 4.5 to 4.7, then the line must be a leak"
|
||||||
|
|
||||||
@@ -223,24 +256,22 @@ The proper Perl regex for AWS secret keys is
|
|||||||
`(?<![A-Za-z0-9\\+])[A-Za-z0-9\\+=]{40}(?![A-Za-z0-9\\+=])`
|
`(?<![A-Za-z0-9\\+])[A-Za-z0-9\\+=]{40}(?![A-Za-z0-9\\+=])`
|
||||||
but the Go library doesn't do lookahead/lookbehind, so
|
but the Go library doesn't do lookahead/lookbehind, so
|
||||||
we'll look for 40 base64 characters, then allowlist
|
we'll look for 40 base64 characters, then allowlist
|
||||||
if they're embedded in a string of 41 base64 characters, that is,
|
if they're embedded in a string of 41 base64 characters, that is,
|
||||||
without any delimiters. This will make a false negative for, say:
|
without any delimiters. This will make a false negative for, say:
|
||||||
```
|
```
|
||||||
foo=+awsSecretAccessKeyisBase64=40characters
|
foo=+awsSecretAccessKeyisBase64=40characters
|
||||||
```
|
```
|
||||||
So you can use the following to effectively create the proper Perl regex:
|
So you can use the following to effectively create the proper Perl regex:
|
||||||
```
|
```toml
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "AWS secret key regardless of labeling"
|
description = "AWS secret key regardless of labeling"
|
||||||
regex = '''.?[A-Za-z0-9\\+=]{40}.?'''
|
regex = '''.?[A-Za-z0-9\\+=]{40}.?'''
|
||||||
[rules.allowlist]
|
[rules.allowlist]
|
||||||
description = "41 base64 characters is not an AWS secret key"
|
description = "41 base64 characters is not an AWS secret key"
|
||||||
regexes = ['''[A-Za-z0-9\\+=]{41}''']
|
regexes = ['''[A-Za-z0-9\\+=]{41}''']
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Exit Codes
|
### Exit Codes
|
||||||
You can always set the exit code when leaves are encountered with the `--leaks-exit-code` flag. Default exit codes below:
|
You can always set the exit code when leaves are encountered with the `--leaks-exit-code` flag. Default exit codes below:
|
||||||
```
|
```
|
||||||
@@ -249,19 +280,16 @@ You can always set the exit code when leaves are encountered with the `--leaks-e
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Sponsors ❤️
|
### Sponsors ❤️
|
||||||
#### Corporate Sponsors
|
#### Organization Sponsors
|
||||||
[](https://gammanet.com/?utm_source=gitleaks&utm_medium=homepage&utm_campaign=gitleaks_promotion)
|
Sir, ehm, this is uhh... this is empty [😭](https://www.youtube.com/watch?v=w1o4O2SfQ5g)
|
||||||
|
|
||||||
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)
|
#### Individual Sponsors
|
||||||
|
|
||||||
#### Individual Sponsors
|
|
||||||
These users are [sponsors](https://github.com/sponsors/zricethezav) of gitleaks:
|
These users are [sponsors](https://github.com/sponsors/zricethezav) of gitleaks:
|
||||||
|
|
||||||
[](https://github.com/adamdecaf) |
|
- [Adam Shannon](https://github.com/adamdecaf)
|
||||||
---|
|
- [ProjectDiscovery](https://projectdiscovery.io/#/)
|
||||||
----
|
- [Ben "Ihavespoons"](https://github.com/ihavespoons)
|
||||||
|
- [Henry Sachs](https://github.com/henrysachs)
|
||||||
|
|
||||||
#### Logo Attribution
|
#### 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>.
|
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>.
|
||||||
|
|
||||||
+48
-13
@@ -1,8 +1,12 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -13,6 +17,9 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//go:embed gitleaks.toml
|
||||||
|
var DefaultConfig string
|
||||||
|
|
||||||
// Config is a composite struct of Rules and Allowlists
|
// Config is a composite struct of Rules and Allowlists
|
||||||
// Each Rule contains a description, regular expression, tags, and allowlists if available
|
// Each Rule contains a description, regular expression, tags, and allowlists if available
|
||||||
type Config struct {
|
type Config struct {
|
||||||
@@ -39,7 +46,7 @@ type TomlAllowList struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TomlLoader gets loaded with the values from a gitleaks toml config
|
// TomlLoader gets loaded with the values from a gitleaks toml config
|
||||||
// see the config in config/defaults.go for an example. TomlLoader is used
|
// see the config in config/gitleaks.toml for an example. TomlLoader is used
|
||||||
// to generate Config values (compiling regexes, etc).
|
// to generate Config values (compiling regexes, etc).
|
||||||
type TomlLoader struct {
|
type TomlLoader struct {
|
||||||
AllowList TomlAllowList
|
AllowList TomlAllowList
|
||||||
@@ -249,13 +256,7 @@ func LoadRepoConfig(repo *git.Repository, repoConfig string) (Config, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return Config{}, err
|
return Config{}, err
|
||||||
}
|
}
|
||||||
var tomlLoader TomlLoader
|
return parseTomlFile(r)
|
||||||
_, err = toml.DecodeReader(r, &tomlLoader)
|
|
||||||
if err != nil {
|
|
||||||
return Config{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return tomlLoader.Parse()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug("attempting to load repo config from bare worktree, this may use an old config")
|
log.Debug("attempting to load repo config from bare worktree, this may use an old config")
|
||||||
@@ -274,15 +275,49 @@ func LoadRepoConfig(repo *git.Repository, repoConfig string) (Config, error) {
|
|||||||
return Config{}, err
|
return Config{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var tomlLoader TomlLoader
|
|
||||||
r, err := f.Reader()
|
r, err := f.Reader()
|
||||||
if err != nil {
|
|
||||||
return Config{}, err
|
|
||||||
}
|
|
||||||
_, err = toml.DecodeReader(r, &tomlLoader)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Config{}, err
|
return Config{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return parseTomlFile(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
// LoadAdditionalConfig Accepts a path to a gitleaks config and returns a Config struct
|
||||||
|
func LoadAdditionalConfig(repoConfig string) (Config, error) {
|
||||||
|
file, err := os.Open(filepath.Clean(repoConfig))
|
||||||
|
if err != nil {
|
||||||
|
return Config{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return parseTomlFile(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AppendConfig Accepts a Config struct and will append those fields to this Config Struct's fields
|
||||||
|
func (config *Config) AppendConfig(configToBeAppended Config) Config {
|
||||||
|
newAllowList := AllowList{
|
||||||
|
Description: "Appended Configuration",
|
||||||
|
Commits: append(config.Allowlist.Commits, configToBeAppended.Allowlist.Commits...),
|
||||||
|
Files: append(config.Allowlist.Files, configToBeAppended.Allowlist.Files...),
|
||||||
|
Paths: append(config.Allowlist.Paths, configToBeAppended.Allowlist.Paths...),
|
||||||
|
Regexes: append(config.Allowlist.Regexes, configToBeAppended.Allowlist.Regexes...),
|
||||||
|
Repos: append(config.Allowlist.Repos, configToBeAppended.Allowlist.Repos...),
|
||||||
|
}
|
||||||
|
|
||||||
|
return Config{
|
||||||
|
Rules: append(config.Rules, configToBeAppended.Rules...),
|
||||||
|
Allowlist: newAllowList,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// takes a File, makes sure it is a valid config, and parses it
|
||||||
|
func parseTomlFile(f io.Reader) (Config, error) {
|
||||||
|
var tomlLoader TomlLoader
|
||||||
|
_, err := toml.DecodeReader(f, &tomlLoader)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("Unable to read gitleaks config. Using defaults. Error: %s", err)
|
||||||
|
return Config{}, err
|
||||||
|
}
|
||||||
return tomlLoader.Parse()
|
return tomlLoader.Parse()
|
||||||
}
|
}
|
||||||
+93
-19
@@ -1,15 +1,19 @@
|
|||||||
package config
|
package config_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
"github.com/zricethezav/gitleaks/v7/options"
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const configPath = "../testdata/configs/"
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
description string
|
description string
|
||||||
@@ -17,7 +21,7 @@ func TestParse(t *testing.T) {
|
|||||||
wantErr error
|
wantErr error
|
||||||
wantFileRegex *regexp.Regexp
|
wantFileRegex *regexp.Regexp
|
||||||
wantMessages *regexp.Regexp
|
wantMessages *regexp.Regexp
|
||||||
wantAllowlist AllowList
|
wantAllowlist config.AllowList
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
description: "default config",
|
description: "default config",
|
||||||
@@ -26,102 +30,102 @@ func TestParse(t *testing.T) {
|
|||||||
{
|
{
|
||||||
description: "test successful load",
|
description: "test successful load",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/aws_key.toml",
|
ConfigPath: filepath.Join(configPath, "aws_key.toml"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test bad toml",
|
description: "test bad toml",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_aws_key.toml",
|
ConfigPath: filepath.Join(configPath, "bad_aws_key.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("Near line 7 (last key parsed 'rules.description'): expected value but found \"AWS\" instead"),
|
wantErr: fmt.Errorf("Near line 7 (last key parsed 'rules.description'): expected value but found \"AWS\" instead"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test bad regex",
|
description: "test bad regex",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_regex_aws_key.toml",
|
ConfigPath: filepath.Join(configPath, "bad_regex_aws_key.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: error parsing regexp: invalid nested repetition operator: `???`"),
|
wantErr: fmt.Errorf("problem loading config: error parsing regexp: invalid nested repetition operator: `???`"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test bad global allowlist file regex",
|
description: "test bad global allowlist file regex",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_aws_key_global_allowlist_file.toml",
|
ConfigPath: filepath.Join(configPath, "bad_aws_key_global_allowlist_file.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"),
|
wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test bad global file regex",
|
description: "test bad global file regex",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_aws_key_file_regex.toml",
|
ConfigPath: filepath.Join(configPath, "bad_aws_key_file_regex.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"),
|
wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test successful load big ol thing",
|
description: "test successful load big ol thing",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/large.toml",
|
ConfigPath: filepath.Join(configPath, "large.toml"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test load entropy",
|
description: "test load entropy",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/entropy.toml",
|
ConfigPath: filepath.Join(configPath, "entropy.toml"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy bad range",
|
description: "test entropy bad range",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_1.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_1.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: entropy Min value cannot be higher than Max value"),
|
wantErr: fmt.Errorf("problem loading config: entropy Min value cannot be higher than Max value"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy value max",
|
description: "test entropy value max",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_2.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_2.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("strconv.ParseFloat: parsing \"x\": invalid syntax"),
|
wantErr: fmt.Errorf("strconv.ParseFloat: parsing \"x\": invalid syntax"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy value min",
|
description: "test entropy value min",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_3.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_3.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("strconv.ParseFloat: parsing \"x\": invalid syntax"),
|
wantErr: fmt.Errorf("strconv.ParseFloat: parsing \"x\": invalid syntax"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy value group",
|
description: "test entropy value group",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_4.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_4.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("strconv.ParseInt: parsing \"x\": invalid syntax"),
|
wantErr: fmt.Errorf("strconv.ParseInt: parsing \"x\": invalid syntax"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy value group",
|
description: "test entropy value group",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_5.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_5.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: group cannot be lower than 0"),
|
wantErr: fmt.Errorf("problem loading config: group cannot be lower than 0"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy value group",
|
description: "test entropy value group",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_6.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_6.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: group cannot be higher than number of groups in regexp"),
|
wantErr: fmt.Errorf("problem loading config: group cannot be higher than number of groups in regexp"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "test entropy range limits",
|
description: "test entropy range limits",
|
||||||
opts: options.Options{
|
opts: options.Options{
|
||||||
ConfigPath: "../test_data/test_configs/bad_entropy_7.toml",
|
ConfigPath: filepath.Join(configPath, "bad_entropy_7.toml"),
|
||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("problem loading config: invalid entropy ranges, must be within 0.0-8.0"),
|
wantErr: fmt.Errorf("problem loading config: invalid entropy ranges, must be within 0.0-8.0"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
_, err := NewConfig(test.opts)
|
_, err := config.NewConfig(test.opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if test.wantErr == nil {
|
if test.wantErr == nil {
|
||||||
t.Error(test.description, err)
|
t.Error(test.description, err)
|
||||||
@@ -151,7 +155,7 @@ func TestParseFields(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
config, err := NewConfig(options.Options{ConfigPath: configPath})
|
config, err := config.NewConfig(options.Options{ConfigPath: configPath})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Couldn't parse config: %v", err)
|
t.Fatalf("Couldn't parse config: %v", err)
|
||||||
}
|
}
|
||||||
@@ -185,7 +189,7 @@ func TestParseFields(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func findRuleByDescription(rules []Rule, description string) (*Rule, error) {
|
func findRuleByDescription(rules []config.Rule, description string) (*config.Rule, error) {
|
||||||
for _, rule := range rules {
|
for _, rule := range rules {
|
||||||
if rule.Description == description {
|
if rule.Description == description {
|
||||||
return &rule, nil
|
return &rule, nil
|
||||||
@@ -211,3 +215,73 @@ func writeTestConfig(toml string) (string, error) {
|
|||||||
|
|
||||||
return tmpfile.Name(), nil
|
return tmpfile.Name(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAppendingConfiguration(t *testing.T) {
|
||||||
|
testRegexA, _ := regexp.Compile("a")
|
||||||
|
testRegexB, _ := regexp.Compile("b")
|
||||||
|
|
||||||
|
allowListA := config.AllowList{
|
||||||
|
Description: "Test Description",
|
||||||
|
Commits: []string{"a"},
|
||||||
|
Files: []*regexp.Regexp{testRegexA},
|
||||||
|
Paths: []*regexp.Regexp{testRegexA},
|
||||||
|
Regexes: []*regexp.Regexp{testRegexA},
|
||||||
|
Repos: []*regexp.Regexp{testRegexA},
|
||||||
|
}
|
||||||
|
|
||||||
|
allowListB := config.AllowList{
|
||||||
|
Description: "Test Description",
|
||||||
|
Commits: []string{"b"},
|
||||||
|
Files: []*regexp.Regexp{testRegexB},
|
||||||
|
Paths: []*regexp.Regexp{testRegexB},
|
||||||
|
Regexes: []*regexp.Regexp{testRegexB},
|
||||||
|
Repos: []*regexp.Regexp{testRegexB},
|
||||||
|
}
|
||||||
|
|
||||||
|
ruleA := config.Rule{Description: "a"}
|
||||||
|
ruleB := config.Rule{Description: "b"}
|
||||||
|
|
||||||
|
rulesA := []config.Rule{ruleA}
|
||||||
|
rulesB := []config.Rule{ruleB}
|
||||||
|
|
||||||
|
cfgA := config.Config{
|
||||||
|
Rules: rulesA,
|
||||||
|
Allowlist: allowListA,
|
||||||
|
}
|
||||||
|
|
||||||
|
cfgB := config.Config{
|
||||||
|
Rules: rulesB,
|
||||||
|
Allowlist: allowListB,
|
||||||
|
}
|
||||||
|
|
||||||
|
cfgAppended := cfgA.AppendConfig(cfgB)
|
||||||
|
|
||||||
|
if !(len(cfgAppended.Rules) == 2) {
|
||||||
|
t.Errorf("Length of Appended Rules = %d; want 2", len(cfgAppended.Rules))
|
||||||
|
}
|
||||||
|
|
||||||
|
if !(len(cfgAppended.Allowlist.Commits) == 2) {
|
||||||
|
t.Errorf("Length of Appended Allowed Commits = %d; want 2", len(cfgAppended.Allowlist.Commits))
|
||||||
|
}
|
||||||
|
|
||||||
|
if !(len(cfgAppended.Allowlist.Files) == 2) {
|
||||||
|
t.Errorf("Length of Appended Allowed Files = %d; want 2", len(cfgAppended.Allowlist.Files))
|
||||||
|
}
|
||||||
|
|
||||||
|
if !(len(cfgAppended.Allowlist.Paths) == 2) {
|
||||||
|
t.Errorf("Length of Appended Allowed Paths = %d; want 2", len(cfgAppended.Allowlist.Paths))
|
||||||
|
}
|
||||||
|
|
||||||
|
if !(len(cfgAppended.Allowlist.Regexes) == 2) {
|
||||||
|
t.Errorf("Length of Appended Allowed Regexes = %d; want 2", len(cfgAppended.Allowlist.Regexes))
|
||||||
|
}
|
||||||
|
|
||||||
|
if !(len(cfgAppended.Allowlist.Repos) == 2) {
|
||||||
|
t.Errorf("Length of Appended Allowed Repos = %d; want 2", len(cfgAppended.Allowlist.Repos))
|
||||||
|
}
|
||||||
|
|
||||||
|
if cfgAppended.Allowlist.Description != "Appended Configuration" {
|
||||||
|
t.Errorf("Allow List Description is = \"%s\"; want \"Appended Configuration\"", cfgAppended.Allowlist.Description)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
package config
|
|
||||||
|
|
||||||
// DefaultConfig is the default gitleaks configuration. If --config={path-to-config} is set than the config located
|
|
||||||
// at {path-to-config} will be used. Alternatively, if --repo-config is set then gitleaks will attempt to
|
|
||||||
// use the config set in a gitleaks.toml or .gitleaks.toml file in the repo that is run with --repo-config set.
|
|
||||||
const DefaultConfig = `
|
|
||||||
title = "gitleaks config"
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "AWS Access Key"
|
|
||||||
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
|
|
||||||
tags = ["key", "AWS"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "AWS Secret Key"
|
|
||||||
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
|
|
||||||
tags = ["key", "AWS"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "AWS MWS key"
|
|
||||||
regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
|
|
||||||
tags = ["key", "AWS", "MWS"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Facebook Secret Key"
|
|
||||||
regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
|
|
||||||
tags = ["key", "Facebook"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Facebook Client ID"
|
|
||||||
regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
|
|
||||||
tags = ["key", "Facebook"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Twitter Secret Key"
|
|
||||||
regex = '''(?i)twitter(.{0,20})?[0-9a-z]{35,44}'''
|
|
||||||
tags = ["key", "Twitter"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Twitter Client ID"
|
|
||||||
regex = '''(?i)twitter(.{0,20})?[0-9a-z]{18,25}'''
|
|
||||||
tags = ["client", "Twitter"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Github"
|
|
||||||
regex = '''(?i)github(.{0,20})?(?-i)[0-9a-zA-Z]{35,40}'''
|
|
||||||
tags = ["key", "Github"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "LinkedIn Client ID"
|
|
||||||
regex = '''(?i)linkedin(.{0,20})?(?-i)[0-9a-z]{12}'''
|
|
||||||
tags = ["client", "LinkedIn"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "LinkedIn Secret Key"
|
|
||||||
regex = '''(?i)linkedin(.{0,20})?[0-9a-z]{16}'''
|
|
||||||
tags = ["secret", "LinkedIn"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Slack"
|
|
||||||
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
|
|
||||||
tags = ["key", "Slack"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Asymmetric Private Key"
|
|
||||||
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
|
|
||||||
tags = ["key", "AsymmetricPrivateKey"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Google API key"
|
|
||||||
regex = '''AIza[0-9A-Za-z\\-_]{35}'''
|
|
||||||
tags = ["key", "Google"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Google (GCP) Service Account"
|
|
||||||
regex = '''"type": "service_account"'''
|
|
||||||
tags = ["key", "Google"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Heroku API key"
|
|
||||||
regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
|
|
||||||
tags = ["key", "Heroku"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "MailChimp API key"
|
|
||||||
regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}'''
|
|
||||||
tags = ["key", "Mailchimp"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Mailgun API key"
|
|
||||||
regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}'''
|
|
||||||
tags = ["key", "Mailgun"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "PayPal Braintree access token"
|
|
||||||
regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
|
|
||||||
tags = ["key", "Paypal"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Picatic API key"
|
|
||||||
regex = '''sk_live_[0-9a-z]{32}'''
|
|
||||||
tags = ["key", "Picatic"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "SendGrid API Key"
|
|
||||||
regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}'''
|
|
||||||
tags = ["key", "SendGrid"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Slack Webhook"
|
|
||||||
regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
|
|
||||||
tags = ["key", "slack"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Stripe API key"
|
|
||||||
regex = '''(?i)stripe(.{0,20})?[sr]k_live_[0-9a-zA-Z]{24}'''
|
|
||||||
tags = ["key", "Stripe"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Square access token"
|
|
||||||
regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
|
|
||||||
tags = ["key", "square"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Square OAuth secret"
|
|
||||||
regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
|
|
||||||
tags = ["key", "square"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Twilio API key"
|
|
||||||
regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}'''
|
|
||||||
tags = ["key", "twilio"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Dynatrace ttoken"
|
|
||||||
regex = '''dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}'''
|
|
||||||
tags = ["key", "Dynatrace"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Shopify shared secret"
|
|
||||||
regex = '''shpss_[a-fA-F0-9]{32}'''
|
|
||||||
tags = ["key", "Shopify"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Shopify access token"
|
|
||||||
regex = '''shpat_[a-fA-F0-9]{32}'''
|
|
||||||
tags = ["key", "Shopify"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Shopify custom app access token"
|
|
||||||
regex = '''shpca_[a-fA-F0-9]{32}'''
|
|
||||||
tags = ["key", "Shopify"]
|
|
||||||
|
|
||||||
[[rules]]
|
|
||||||
description = "Shopify private app access token"
|
|
||||||
regex = '''shppa_[a-fA-F0-9]{32}'''
|
|
||||||
tags = ["key", "Shopify"]
|
|
||||||
|
|
||||||
[allowlist]
|
|
||||||
description = "Allowlisted files"
|
|
||||||
files = ['''^\.?gitleaks.toml$''',
|
|
||||||
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''',
|
|
||||||
'''(go.mod|go.sum)$''']
|
|
||||||
`
|
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
title = "gitleaks config"
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "AWS Access Key"
|
||||||
|
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
|
||||||
|
tags = ["key", "AWS"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "AWS Secret Key"
|
||||||
|
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
|
||||||
|
tags = ["key", "AWS"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "AWS MWS key"
|
||||||
|
regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
|
||||||
|
tags = ["key", "AWS", "MWS"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Facebook Secret Key"
|
||||||
|
regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
|
||||||
|
tags = ["key", "Facebook"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Facebook Client ID"
|
||||||
|
regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
|
||||||
|
tags = ["key", "Facebook"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Twitter Secret Key"
|
||||||
|
regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]'''
|
||||||
|
tags = ["key", "Twitter"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Twitter Client ID"
|
||||||
|
regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]'''
|
||||||
|
tags = ["client", "Twitter"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Github Personal Access Token"
|
||||||
|
regex = '''ghp_[0-9a-zA-Z]{36}'''
|
||||||
|
tags = ["key", "Github"]
|
||||||
|
[[rules]]
|
||||||
|
description = "Github OAuth Access Token"
|
||||||
|
regex = '''gho_[0-9a-zA-Z]{36}'''
|
||||||
|
tags = ["key", "Github"]
|
||||||
|
[[rules]]
|
||||||
|
description = "Github App Token"
|
||||||
|
regex = '''(ghu|ghs)_[0-9a-zA-Z]{36}'''
|
||||||
|
tags = ["key", "Github"]
|
||||||
|
[[rules]]
|
||||||
|
description = "Github Refresh Token"
|
||||||
|
regex = '''ghr_[0-9a-zA-Z]{76}'''
|
||||||
|
tags = ["key", "Github"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "LinkedIn Client ID"
|
||||||
|
regex = '''(?i)linkedin(.{0,20})?(?-i)[0-9a-z]{12}'''
|
||||||
|
tags = ["client", "LinkedIn"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "LinkedIn Secret Key"
|
||||||
|
regex = '''(?i)linkedin(.{0,20})?[0-9a-z]{16}'''
|
||||||
|
tags = ["secret", "LinkedIn"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack"
|
||||||
|
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
|
||||||
|
tags = ["key", "Slack"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Asymmetric Private Key"
|
||||||
|
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
|
||||||
|
tags = ["key", "AsymmetricPrivateKey"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Google API key"
|
||||||
|
regex = '''AIza[0-9A-Za-z\\-_]{35}'''
|
||||||
|
tags = ["key", "Google"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Google (GCP) Service Account"
|
||||||
|
regex = '''"type": "service_account"'''
|
||||||
|
tags = ["key", "Google"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Heroku API key"
|
||||||
|
regex = '''(?i)heroku(.{0,20})?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
|
||||||
|
tags = ["key", "Heroku"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "MailChimp API key"
|
||||||
|
regex = '''(?i)(mailchimp|mc)(.{0,20})?[0-9a-f]{32}-us[0-9]{1,2}'''
|
||||||
|
tags = ["key", "Mailchimp"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Mailgun API key"
|
||||||
|
regex = '''((?i)(mailgun|mg)(.{0,20})?)?key-[0-9a-z]{32}'''
|
||||||
|
tags = ["key", "Mailgun"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "PayPal Braintree access token"
|
||||||
|
regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
|
||||||
|
tags = ["key", "Paypal"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Picatic API key"
|
||||||
|
regex = '''sk_live_[0-9a-z]{32}'''
|
||||||
|
tags = ["key", "Picatic"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "SendGrid API Key"
|
||||||
|
regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}'''
|
||||||
|
tags = ["key", "SendGrid"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Slack Webhook"
|
||||||
|
regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8,12}/[a-zA-Z0-9_]{24}'''
|
||||||
|
tags = ["key", "slack"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Stripe API key"
|
||||||
|
regex = '''(?i)stripe(.{0,20})?[sr]k_live_[0-9a-zA-Z]{24}'''
|
||||||
|
tags = ["key", "Stripe"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Square access token"
|
||||||
|
regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
|
||||||
|
tags = ["key", "square"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Square OAuth secret"
|
||||||
|
regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
|
||||||
|
tags = ["key", "square"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Twilio API key"
|
||||||
|
regex = '''(?i)twilio(.{0,20})?SK[0-9a-f]{32}'''
|
||||||
|
tags = ["key", "twilio"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Dynatrace ttoken"
|
||||||
|
regex = '''dt0[a-zA-Z]{1}[0-9]{2}\.[A-Z0-9]{24}\.[A-Z0-9]{64}'''
|
||||||
|
tags = ["key", "Dynatrace"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Shopify shared secret"
|
||||||
|
regex = '''shpss_[a-fA-F0-9]{32}'''
|
||||||
|
tags = ["key", "Shopify"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Shopify access token"
|
||||||
|
regex = '''shpat_[a-fA-F0-9]{32}'''
|
||||||
|
tags = ["key", "Shopify"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Shopify custom app access token"
|
||||||
|
regex = '''shpca_[a-fA-F0-9]{32}'''
|
||||||
|
tags = ["key", "Shopify"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Shopify private app access token"
|
||||||
|
regex = '''shppa_[a-fA-F0-9]{32}'''
|
||||||
|
tags = ["key", "Shopify"]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "PyPI upload token"
|
||||||
|
regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}'''
|
||||||
|
tags = ["key", "pypi"]
|
||||||
|
|
||||||
|
[allowlist]
|
||||||
|
description = "Allowlisted files"
|
||||||
|
files = ['''^\.?gitleaks.toml$''',
|
||||||
|
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''',
|
||||||
|
'''(go.mod|go.sum)$''']
|
||||||
+60
-14
@@ -6,6 +6,23 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Offender is a struct that contains the information matched when searching
|
||||||
|
// content and information on why it matched (i.e. the EntropyLevel)
|
||||||
|
type Offender struct {
|
||||||
|
Match string
|
||||||
|
EntropyLevel float64
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsEmpty checks to see if nothing was found in the match
|
||||||
|
func (o *Offender) IsEmpty() bool {
|
||||||
|
return o.Match == ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// ToString the contents of the match
|
||||||
|
func (o *Offender) ToString() string {
|
||||||
|
return o.Match
|
||||||
|
}
|
||||||
|
|
||||||
// Rule is a struct that contains information that is loaded from a gitleaks config.
|
// 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
|
// This struct is used in the Config struct as an array of Rules and is iterated
|
||||||
// over during an scan. Each rule will be checked. If a regex match is found AND
|
// over during an scan. Each rule will be checked. If a regex match is found AND
|
||||||
@@ -23,28 +40,46 @@ type Rule struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Inspect checks the content of a line for a leak
|
// Inspect checks the content of a line for a leak
|
||||||
func (r *Rule) Inspect(line string) string {
|
func (r *Rule) Inspect(line string) *Offender {
|
||||||
offender := r.Regex.FindString(line)
|
match := r.Regex.FindString(line)
|
||||||
if offender == "" {
|
|
||||||
return ""
|
// EntropyLevel -1 means not checked
|
||||||
|
if match == "" {
|
||||||
|
return &Offender{
|
||||||
|
Match: "",
|
||||||
|
EntropyLevel: -1,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if offender is allowed
|
// check if offender is allowed
|
||||||
|
// EntropyLevel -1 means not checked
|
||||||
if r.RegexAllowed(line) {
|
if r.RegexAllowed(line) {
|
||||||
return ""
|
return &Offender{
|
||||||
|
Match: "",
|
||||||
|
EntropyLevel: -1,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check entropy
|
// check entropy
|
||||||
groups := r.Regex.FindStringSubmatch(offender)
|
groups := r.Regex.FindStringSubmatch(match)
|
||||||
if len(r.Entropies) != 0 && !r.ContainsEntropyLeak(groups) {
|
entropyWithinRange, entropyLevel := r.CheckEntropy(groups)
|
||||||
return ""
|
|
||||||
|
if len(r.Entropies) != 0 && !entropyWithinRange {
|
||||||
|
return &Offender{
|
||||||
|
Match: "",
|
||||||
|
EntropyLevel: entropyLevel,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0 is a match for the full regex pattern
|
// 0 is a match for the full regex pattern
|
||||||
if 0 < r.ReportGroup && r.ReportGroup < len(groups) {
|
if 0 < r.ReportGroup && r.ReportGroup < len(groups) {
|
||||||
offender = groups[r.ReportGroup]
|
match = groups[r.ReportGroup]
|
||||||
|
}
|
||||||
|
|
||||||
|
return &Offender{
|
||||||
|
Match: match,
|
||||||
|
EntropyLevel: entropyLevel,
|
||||||
}
|
}
|
||||||
return offender
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegexAllowed checks if the content is allowlisted
|
// RegexAllowed checks if the content is allowlisted
|
||||||
@@ -57,17 +92,28 @@ func (r *Rule) CommitAllowed(commit string) bool {
|
|||||||
return r.AllowList.CommitAllowed(commit)
|
return r.AllowList.CommitAllowed(commit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainsEntropyLeak checks if there is an entropy leak
|
// CheckEntropy checks if there is an entropy leak
|
||||||
func (r *Rule) ContainsEntropyLeak(groups []string) bool {
|
func (r *Rule) CheckEntropy(groups []string) (bool, float64) {
|
||||||
|
var highestFound float64 = 0
|
||||||
|
|
||||||
for _, e := range r.Entropies {
|
for _, e := range r.Entropies {
|
||||||
if len(groups) > e.Group {
|
if len(groups) > e.Group {
|
||||||
entropy := shannonEntropy(groups[e.Group])
|
entropy := shannonEntropy(groups[e.Group])
|
||||||
if entropy >= e.Min && entropy <= e.Max {
|
if entropy >= e.Min && entropy <= e.Max {
|
||||||
return true
|
return true, entropy
|
||||||
|
} else if entropy > highestFound {
|
||||||
|
highestFound = entropy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
|
if len(r.Entropies) == 0 {
|
||||||
|
// entropies not checked
|
||||||
|
return false, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
// entropies checked but not within the range
|
||||||
|
return false, highestFound
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasFileOrPathLeakOnly first checks if there are no entropy/regex rules, then checks if
|
// HasFileOrPathLeakOnly first checks if there are no entropy/regex rules, then checks if
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ title = "gitleaks config"
|
|||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Files with keys and credentials"
|
description = "Files with keys and credentials"
|
||||||
file = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)'''
|
file = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)'''
|
||||||
|
|
||||||
# Global allowlist
|
# Global allowlist
|
||||||
[allowlist]
|
[allowlist]
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# pre-commit configuration example to add docker-based hook that executes gitleaks
|
||||||
|
# This should be added to .pre-commit-config.yaml coniguration file: https://pre-commit.com/#2-add-a-pre-commit-configuration
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: gitleaks
|
||||||
|
name: Gitleaks
|
||||||
|
language: docker_image
|
||||||
|
entry: zricethezav/gitleaks:v7.4.0
|
||||||
|
args:
|
||||||
|
- --config-path
|
||||||
|
- .gitleaks.toml
|
||||||
|
- --verbose
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
module github.com/zricethezav/gitleaks/v7
|
module github.com/zricethezav/gitleaks/v7
|
||||||
|
|
||||||
go 1.15
|
go 1.16
|
||||||
|
|
||||||
replace github.com/go-git/go-git/v5 => github.com/zricethezav/go-git/v5 v5.2.2
|
replace github.com/go-git/go-git/v5 => github.com/zricethezav/go-git/v5 v5.3.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v0.3.1
|
github.com/BurntSushi/toml v0.3.1
|
||||||
github.com/go-git/go-git/v5 v5.2.0
|
github.com/go-git/go-git/v5 v5.3.0
|
||||||
github.com/google/go-cmp v0.4.0 // indirect
|
|
||||||
github.com/hako/durafmt v0.0.0-20191009132224-3f39dc1ed9f4
|
github.com/hako/durafmt v0.0.0-20191009132224-3f39dc1ed9f4
|
||||||
github.com/jessevdk/go-flags v1.4.0
|
github.com/jessevdk/go-flags v1.5.0
|
||||||
github.com/sergi/go-diff v1.1.0
|
github.com/sergi/go-diff v1.1.0
|
||||||
github.com/sirupsen/logrus v1.4.2
|
github.com/sirupsen/logrus v1.4.2
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
|
||||||
gopkg.in/yaml.v2 v2.2.8 // indirect
|
|
||||||
)
|
)
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
|
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
|
||||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
|
||||||
|
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||||
|
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ=
|
||||||
|
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
|
||||||
|
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
|
||||||
|
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
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 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||||
@@ -12,96 +17,96 @@ 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=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
|
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
|
||||||
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
|
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
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 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
|
||||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
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 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
|
||||||
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
|
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.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||||
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
|
||||||
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M=
|
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||||
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
|
github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8=
|
||||||
github.com/go-git/go-git/v5 v5.2.0 h1:YPBLG/3UK1we1ohRkncLjaXWLW+HKp5QNM/jTli2JgI=
|
github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
|
||||||
github.com/go-git/go-git/v5 v5.2.0/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
|
|
||||||
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
|
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
|
||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
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/hako/durafmt v0.0.0-20191009132224-3f39dc1ed9f4 h1:60gBOooTSmNtrqNaRvrDbi8VAne0REaek2agjnITKSw=
|
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/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.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||||
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
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/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||||
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
|
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
|
||||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
|
||||||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY=
|
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck=
|
||||||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||||
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.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 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
|
||||||
|
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
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/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
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/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/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
|
github.com/pkg/errors v0.9.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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
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/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
|
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||||
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
||||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
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.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
|
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||||
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/zricethezav/go-git/v5 v5.2.1 h1:snaoKv8ksDSz7NfBRXsBr9Yr8IKEKWRWf1zdhFmcFvI=
|
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
|
||||||
github.com/zricethezav/go-git/v5 v5.2.1/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
|
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
|
||||||
github.com/zricethezav/go-git/v5 v5.2.2 h1:VOVijF5OpIiHvFZXX94AJezdJ0b0kTyRyVNZ4yaqCRU=
|
github.com/zricethezav/go-git/v5 v5.3.0 h1:sx02mqKAT6Doe4rLcquIJr1XjrV5QcX8KXk3wSCVic4=
|
||||||
github.com/zricethezav/go-git/v5 v5.2.2/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs=
|
github.com/zricethezav/go-git/v5 v5.3.0/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
|
||||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
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-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg=
|
||||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
|
golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs=
|
||||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
|
|
||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
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/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E=
|
||||||
|
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||||
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
|
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
|
||||||
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-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/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
||||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
|
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.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
|
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
+39
-25
@@ -20,29 +20,31 @@ import (
|
|||||||
|
|
||||||
// Options stores values of command line options
|
// Options stores values of command line options
|
||||||
type Options struct {
|
type Options struct {
|
||||||
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from scan"`
|
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from scan"`
|
||||||
Quiet bool `short:"q" long:"quiet" description:"Sets log level to error and only output leaks, one json object per line"`
|
Quiet bool `short:"q" long:"quiet" description:"Sets log level to error and only output leaks, one json object per line"`
|
||||||
RepoURL string `short:"r" long:"repo-url" description:"Repository URL"`
|
RepoURL string `short:"r" long:"repo-url" description:"Repository URL"`
|
||||||
Path string `short:"p" long:"path" description:"Path to directory (repo if contains .git) or file"`
|
Path string `short:"p" long:"path" description:"Path to directory (repo if contains .git) or file"`
|
||||||
ConfigPath string `short:"c" long:"config-path" description:"Path to config"`
|
ConfigPath string `short:"c" long:"config-path" description:"Path to config"`
|
||||||
RepoConfigPath string `long:"repo-config-path" description:"Path to gitleaks config relative to repo root"`
|
RepoConfigPath string `long:"repo-config-path" description:"Path to gitleaks config relative to repo root"`
|
||||||
ClonePath string `long:"clone-path" description:"Path to clone repo to disk"`
|
ClonePath string `long:"clone-path" description:"Path to clone repo to disk"`
|
||||||
Version bool `long:"version" description:"Version number"`
|
Version bool `long:"version" description:"Version number"`
|
||||||
Username string `long:"username" description:"Username for git repo"`
|
Username string `long:"username" description:"Username for git repo"`
|
||||||
Password string `long:"password" description:"Password for git repo"`
|
Password string `long:"password" description:"Password for git repo"`
|
||||||
AccessToken string `long:"access-token" description:"Access token for git repo"`
|
AccessToken string `long:"access-token" description:"Access token for git repo"`
|
||||||
Threads int `long:"threads" description:"Maximum number of threads gitleaks spawns"`
|
Threads int `long:"threads" description:"Maximum number of threads gitleaks spawns"`
|
||||||
SSH string `long:"ssh-key" description:"Path to ssh key used for auth"`
|
SSH string `long:"ssh-key" description:"Path to ssh key used for auth"`
|
||||||
Unstaged bool `long:"unstaged" description:"Run gitleaks on unstaged code"`
|
Unstaged bool `long:"unstaged" description:"Run gitleaks on unstaged code"`
|
||||||
Branch string `long:"branch" description:"Branch to scan"`
|
Branch string `long:"branch" description:"Branch to scan"`
|
||||||
Redact bool `long:"redact" description:"Redact secrets from log messages and leaks"`
|
Redact bool `long:"redact" description:"Redact secrets from log messages and leaks"`
|
||||||
Debug bool `long:"debug" description:"Log debug messages"`
|
Debug bool `long:"debug" description:"Log debug messages"`
|
||||||
NoGit bool `long:"no-git" description:"Treat git repos as plain directories and scan those files"`
|
NoGit bool `long:"no-git" description:"Treat git repos as plain directories and scan those files"`
|
||||||
CodeOnLeak int `long:"leaks-exit-code" default:"1" description:"Exit code when leaks have been encountered"`
|
CodeOnLeak int `long:"leaks-exit-code" default:"1" description:"Exit code when leaks have been encountered"`
|
||||||
|
AppendRepoConfig bool `long:"append-repo-config" description:"Append the provided or default config with the repo config."`
|
||||||
|
AdditionalConfig string `long:"additional-config" description:"Path to an additional gitleaks config to append with an existing config. Can be used with --append-repo-config to append up to three configurations"`
|
||||||
|
|
||||||
// Report Options
|
// Report Options
|
||||||
Report string `short:"o" long:"report" description:"Report output path"`
|
Report string `short:"o" long:"report" description:"Report output path"`
|
||||||
ReportFormat string `short:"f" long:"format" default:"json" description:"JSON, CSV, SARIF"`
|
ReportFormat string `short:"f" long:"format" default:"json" description:"json, csv, sarif"`
|
||||||
|
|
||||||
// Commit Options
|
// Commit Options
|
||||||
FilesAtCommit string `long:"files-at-commit" description:"Sha of commit to scan all files at commit"`
|
FilesAtCommit string `long:"files-at-commit" description:"Sha of commit to scan all files at commit"`
|
||||||
@@ -142,8 +144,8 @@ func (opts Options) CloneOptions() (*git.CloneOptions, error) {
|
|||||||
|
|
||||||
var auth transport.AuthMethod
|
var auth transport.AuthMethod
|
||||||
|
|
||||||
if strings.HasPrefix(opts.RepoURL, "git") {
|
if strings.HasPrefix(opts.RepoURL, "ssh://") || (!strings.Contains(opts.RepoURL, "://") && strings.Contains(opts.RepoURL, ":")) {
|
||||||
// using git protocol so needs ssh auth
|
// using ssh:// url or scp-like syntax
|
||||||
auth, err = SSHAuth(opts)
|
auth, err = SSHAuth(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -174,17 +176,29 @@ func (opts Options) CloneOptions() (*git.CloneOptions, error) {
|
|||||||
// SSHAuth tried to generate ssh public keys based on what was passed via cli. If no
|
// SSHAuth tried to generate ssh public keys based on what was passed via cli. If no
|
||||||
// path was passed via cli then this will attempt to retrieve keys from the default
|
// path was passed via cli then this will attempt to retrieve keys from the default
|
||||||
// location for ssh keys, $HOME/.ssh/id_rsa. This function is only called if the
|
// location for ssh keys, $HOME/.ssh/id_rsa. This function is only called if the
|
||||||
// repo url using the git:// protocol.
|
// repo url using the ssh:// protocol or scp-like syntax.
|
||||||
func SSHAuth(opts Options) (*ssh.PublicKeys, error) {
|
func SSHAuth(opts Options) (*ssh.PublicKeys, error) {
|
||||||
|
params := strings.Split(opts.RepoURL, "@")
|
||||||
|
|
||||||
|
if len(params) != 2 {
|
||||||
|
return nil, fmt.Errorf("user must be specified in the URL")
|
||||||
|
}
|
||||||
|
|
||||||
|
// the part of the RepoURL before the "@" (params[0]) can be something like:
|
||||||
|
// - "ssh://user" if RepoURL is an ssh:// URL
|
||||||
|
// - "user" if RepoURL uses scp-like syntax
|
||||||
|
// we must strip the protocol if it is present so that we only have "user"
|
||||||
|
username := strings.Replace(params[0], "ssh://", "", 1)
|
||||||
|
|
||||||
if opts.SSH != "" {
|
if opts.SSH != "" {
|
||||||
return ssh.NewPublicKeysFromFile("git", opts.SSH, "")
|
return ssh.NewPublicKeysFromFile(username, opts.SSH, "")
|
||||||
}
|
}
|
||||||
c, err := user.Current()
|
c, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defaultPath := fmt.Sprintf("%s/.ssh/id_rsa", c.HomeDir)
|
defaultPath := fmt.Sprintf("%s/.ssh/id_rsa", c.HomeDir)
|
||||||
return ssh.NewPublicKeysFromFile("git", defaultPath, "")
|
return ssh.NewPublicKeysFromFile(username, defaultPath, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenLocal checks what options are set, if no remote targets are set
|
// OpenLocal checks what options are set, if no remote targets are set
|
||||||
|
|||||||
+11
-3
@@ -43,6 +43,14 @@ func (cs *CommitScanner) SetRepoName(repoName string) {
|
|||||||
func (cs *CommitScanner) Scan() (Report, error) {
|
func (cs *CommitScanner) Scan() (Report, error) {
|
||||||
var scannerReport Report
|
var scannerReport Report
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if err := recover(); err != nil {
|
||||||
|
// sometimes the Patch generation will fail due to a known bug in
|
||||||
|
// sergi's go-diff: https://github.com/sergi/go-diff/issues/89.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if cs.cfg.Allowlist.CommitAllowed(cs.commit.Hash.String()) {
|
if cs.cfg.Allowlist.CommitAllowed(cs.commit.Hash.String()) {
|
||||||
return scannerReport, nil
|
return scannerReport, nil
|
||||||
}
|
}
|
||||||
@@ -62,7 +70,7 @@ func (cs *CommitScanner) Scan() (Report, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
patch, err := parent.Patch(cs.commit)
|
patch, err := parent.Patch(cs.commit)
|
||||||
if err != nil {
|
if err != nil || patch == nil {
|
||||||
return scannerReport, fmt.Errorf("could not generate Patch")
|
return scannerReport, fmt.Errorf("could not generate Patch")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +121,7 @@ func (cs *CommitScanner) Scan() (Report, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
offender := rule.Inspect(line)
|
offender := rule.Inspect(line)
|
||||||
if offender == "" {
|
if offender.IsEmpty() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +136,7 @@ func (cs *CommitScanner) Scan() (Report, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(cs.commit)
|
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(cs.commit).WithEntropy(offender.EntropyLevel)
|
||||||
leak.File = to.Path()
|
leak.File = to.Path()
|
||||||
leak.LineNumber = extractLine(patchContent, leak, lineLookup)
|
leak.LineNumber = extractLine(patchContent, leak, lineLookup)
|
||||||
leak.RepoURL = cs.opts.RepoURL
|
leak.RepoURL = cs.opts.RepoURL
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package scan_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCommitScan(t *testing.T) {
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer moveDotGit(".git", "dotGit")
|
||||||
|
tests := []struct {
|
||||||
|
description string
|
||||||
|
opts options.Options
|
||||||
|
wantPath string
|
||||||
|
empty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
description: "empty repo",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "empty"),
|
||||||
|
Report: filepath.Join(expectPath, "empty", "empty_report.json.got"),
|
||||||
|
},
|
||||||
|
empty: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with default config at specific commit",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_208ae46.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
Commit: "208ae4669ade2563fcaf9f12922fa2c0a5b37c63",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_208ae46.json"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with custom config at specific commit",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "with_config"),
|
||||||
|
Report: filepath.Join(expectPath, "with_config", "results_e7c0aff3.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
RepoConfigPath: "gitleaks.toml",
|
||||||
|
Commit: "e7c0aff3e8a60b50a85432fdf933f8beff013743",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "with_config", "results_e7c0aff3.json"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
cfg, err := config.NewConfig(test.opts)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scanner, err := scan.NewScanner(test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerReport, err := scanner.Scan()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = scan.WriteReport(scannerReport, test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.empty {
|
||||||
|
if len(scannerReport.Leaks) != 0 {
|
||||||
|
t.Errorf("%s wanted no leaks but got some instead: %+v", test.description, scannerReport.Leaks)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.wantPath != "" {
|
||||||
|
err := fileCheck(test.wantPath, test.opts.Report)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-3
@@ -2,6 +2,8 @@ package scan
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/zricethezav/gitleaks/v7/config"
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
"github.com/zricethezav/gitleaks/v7/options"
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
)
|
)
|
||||||
@@ -30,10 +32,11 @@ func NewCommitsScanner(opts options.Options, cfg config.Config, repo *git.Reposi
|
|||||||
// Scan kicks off a CommitsScanner Scan
|
// Scan kicks off a CommitsScanner Scan
|
||||||
func (css *CommitsScanner) Scan() (Report, error) {
|
func (css *CommitsScanner) Scan() (Report, error) {
|
||||||
var scannerReport Report
|
var scannerReport Report
|
||||||
for _, c := range css.commits {
|
for _, commitHash := range css.commits {
|
||||||
c, err := obtainCommit(css.repo, c)
|
c, err := obtainCommit(css.repo, commitHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return scannerReport, nil
|
log.Errorf("skipping %s, err: %v", commitHash, err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
cs := NewCommitScanner(css.opts, css.cfg, css.repo, c)
|
cs := NewCommitScanner(css.opts, css.cfg, css.repo, c)
|
||||||
commitReport, err := cs.Scan()
|
commitReport, err := cs.Scan()
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package scan_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCommitsScan(t *testing.T) {
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer moveDotGit(".git", "dotGit")
|
||||||
|
tests := []struct {
|
||||||
|
description string
|
||||||
|
opts options.Options
|
||||||
|
wantPath string
|
||||||
|
empty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
description: "basic repo with default config ranging first and third commit",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_ae8db4a2_208ae46.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
Commits: "ae8db4a2306798fcb3a5b9cbe8c486027fc1931f,208ae4669ade2563fcaf9f12922fa2c0a5b37c63",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_ae8db4a2_208ae46.json"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "repo with config first two commits",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "with_config"),
|
||||||
|
Report: filepath.Join(expectPath, "with_config", "results_ae8db4a_e7c0aff.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
RepoConfigPath: "gitleaks.toml",
|
||||||
|
Commits: "ae8db4a2306798fcb3a5b9cbe8c486027fc1931f,e7c0aff3e8a60b50a85432fdf933f8beff013743",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "with_config", "results_ae8db4a_e7c0aff.json"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with depth=1",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_depth_1.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
Depth: 1,
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_depth_1.json"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with default config ranging first and third commit with a non-existent commit in middle",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_ae8db4a2_208ae46.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
Commits: "ae8db4a2306798fcb3a5b9cbe8c486027fc1931f,nocommithere,208ae4669ade2563fcaf9f12922fa2c0a5b37c63",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_ae8db4a2_208ae46.json"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
cfg, err := config.NewConfig(test.opts)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scanner, err := scan.NewScanner(test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerReport, err := scanner.Scan()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = scan.WriteReport(scannerReport, test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.empty {
|
||||||
|
if len(scannerReport.Leaks) != 0 {
|
||||||
|
t.Errorf("%s wanted no leaks but got some instead: %+v", test.description, scannerReport.Leaks)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.wantPath != "" {
|
||||||
|
err := fileCheck(test.wantPath, test.opts.Report)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -97,8 +97,7 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
offender := rule.Inspect(line)
|
offender := rule.Inspect(line)
|
||||||
|
if offender.IsEmpty() {
|
||||||
if offender == "" {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +112,7 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(fs.commit)
|
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(fs.commit).WithEntropy(offender.EntropyLevel)
|
||||||
leak.File = f.Name
|
leak.File = f.Name
|
||||||
leak.LineNumber = i + 1
|
leak.LineNumber = i + 1
|
||||||
leak.RepoURL = fs.opts.RepoURL
|
leak.RepoURL = fs.opts.RepoURL
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package scan_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFilesAtCommitScan(t *testing.T) {
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer moveDotGit(".git", "dotGit")
|
||||||
|
tests := []struct {
|
||||||
|
description string
|
||||||
|
opts options.Options
|
||||||
|
wantPath string
|
||||||
|
empty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
description: "basic repo with no secrets present in files at first commit",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_files_at_ae8db4a2.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
FilesAtCommit: "ae8db4a2306798fcb3a5b9cbe8c486027fc1931f",
|
||||||
|
},
|
||||||
|
empty: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with secrets present in files at third commit",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_files_at_208ae46.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
FilesAtCommit: "208ae4669ade2563fcaf9f12922fa2c0a5b37c63",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_files_at_208ae46.json"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
cfg, err := config.NewConfig(test.opts)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scanner, err := scan.NewScanner(test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerReport, err := scanner.Scan()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = scan.WriteReport(scannerReport, test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.empty {
|
||||||
|
if len(scannerReport.Leaks) != 0 {
|
||||||
|
t.Errorf("%s wanted no leaks but got some instead: %+v", test.description, scannerReport.Leaks)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.wantPath != "" {
|
||||||
|
err := fileCheck(test.wantPath, test.opts.Report)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+26
-17
@@ -3,6 +3,7 @@ package scan
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -14,20 +15,21 @@ import (
|
|||||||
// Leak is a struct that contains information about some line of code that contains
|
// Leak is a struct that contains information about some line of code that contains
|
||||||
// sensitive information as determined by the rules set in a gitleaks config
|
// sensitive information as determined by the rules set in a gitleaks config
|
||||||
type Leak struct {
|
type Leak struct {
|
||||||
Line string `json:"line"`
|
Line string `json:"line"`
|
||||||
LineNumber int `json:"lineNumber"`
|
LineNumber int `json:"lineNumber"`
|
||||||
Offender string `json:"offender"`
|
Offender string `json:"offender"`
|
||||||
Commit string `json:"commit"`
|
OffenderEntropy float64 `json:"offenderEntropy"`
|
||||||
Repo string `json:"repo"`
|
Commit string `json:"commit"`
|
||||||
RepoURL string `json:"repoURL"`
|
Repo string `json:"repo"`
|
||||||
LeakURL string `json:"leakURL"`
|
RepoURL string `json:"repoURL"`
|
||||||
Rule string `json:"rule"`
|
LeakURL string `json:"leakURL"`
|
||||||
Message string `json:"commitMessage"`
|
Rule string `json:"rule"`
|
||||||
Author string `json:"author"`
|
Message string `json:"commitMessage"`
|
||||||
Email string `json:"email"`
|
Author string `json:"author"`
|
||||||
File string `json:"file"`
|
Email string `json:"email"`
|
||||||
Date time.Time `json:"date"`
|
File string `json:"file"`
|
||||||
Tags string `json:"tags"`
|
Date time.Time `json:"date"`
|
||||||
|
Tags string `json:"tags"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RedactLeak will replace the offending string with "REDACTED" in both
|
// RedactLeak will replace the offending string with "REDACTED" in both
|
||||||
@@ -41,9 +43,10 @@ func RedactLeak(leak Leak) Leak {
|
|||||||
// NewLeak creates a new leak from common data all leaks must have, line, offender, linenumber
|
// NewLeak creates a new leak from common data all leaks must have, line, offender, linenumber
|
||||||
func NewLeak(line string, offender string, lineNumber int) Leak {
|
func NewLeak(line string, offender string, lineNumber int) Leak {
|
||||||
return Leak{
|
return Leak{
|
||||||
Line: line,
|
Line: line,
|
||||||
Offender: offender,
|
Offender: offender,
|
||||||
LineNumber: lineNumber,
|
LineNumber: lineNumber,
|
||||||
|
OffenderEntropy: -1, // -1 means not checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +60,12 @@ func (leak Leak) WithCommit(commit *object.Commit) Leak {
|
|||||||
return leak
|
return leak
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithEntropy adds OffenderEntropy data to the leak
|
||||||
|
func (leak Leak) WithEntropy(entropyLevel float64) Leak {
|
||||||
|
leak.OffenderEntropy = math.Round(entropyLevel*1000) / 1000
|
||||||
|
return leak
|
||||||
|
}
|
||||||
|
|
||||||
// Log logs a leak and redacts if necessary
|
// Log logs a leak and redacts if necessary
|
||||||
func (leak Leak) Log(opts options.Options) {
|
func (leak Leak) Log(opts options.Options) {
|
||||||
if !opts.Quiet && !opts.Verbose {
|
if !opts.Quiet && !opts.Verbose {
|
||||||
|
|||||||
+24
-26
@@ -6,26 +6,30 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
"github.com/zricethezav/gitleaks/v7/config"
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
"github.com/zricethezav/gitleaks/v7/options"
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
|
||||||
"golang.org/x/sync/errgroup"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NoGitScanner is a scanner that absolutely despises git
|
// NoGitScanner is a scanner that absolutely despises git
|
||||||
type NoGitScanner struct {
|
type NoGitScanner struct {
|
||||||
opts options.Options
|
opts options.Options
|
||||||
cfg config.Config
|
cfg config.Config
|
||||||
|
throttle *Throttle
|
||||||
|
mtx *sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNoGitScanner creates and returns a nogit scanner. This is used for scanning files and directories
|
// NewNoGitScanner creates and returns a nogit scanner. This is used for scanning files and directories
|
||||||
func NewNoGitScanner(opts options.Options, cfg config.Config) *NoGitScanner {
|
func NewNoGitScanner(opts options.Options, cfg config.Config) *NoGitScanner {
|
||||||
ngs := &NoGitScanner{
|
ngs := &NoGitScanner{
|
||||||
opts: opts,
|
opts: opts,
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
|
throttle: NewThrottle(opts),
|
||||||
|
mtx: &sync.Mutex{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// no-git scans should ignore .git folders by default
|
// no-git scans should ignore .git folders by default
|
||||||
@@ -42,10 +46,8 @@ func NewNoGitScanner(opts options.Options, cfg config.Config) *NoGitScanner {
|
|||||||
// Scan kicks off a NoGitScanner Scan
|
// Scan kicks off a NoGitScanner Scan
|
||||||
func (ngs *NoGitScanner) Scan() (Report, error) {
|
func (ngs *NoGitScanner) Scan() (Report, error) {
|
||||||
var scannerReport Report
|
var scannerReport Report
|
||||||
|
|
||||||
g, _ := errgroup.WithContext(context.Background())
|
g, _ := errgroup.WithContext(context.Background())
|
||||||
paths := make(chan string, 100)
|
paths := make(chan string)
|
||||||
|
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
defer close(paths)
|
defer close(paths)
|
||||||
return filepath.Walk(ngs.opts.Path,
|
return filepath.Walk(ngs.opts.Path,
|
||||||
@@ -60,11 +62,11 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
leaks := make(chan Leak, 100)
|
|
||||||
|
|
||||||
for path := range paths {
|
for path := range paths {
|
||||||
p := path
|
p := path
|
||||||
|
ngs.throttle.Limit()
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
|
defer ngs.throttle.Release()
|
||||||
if ngs.cfg.Allowlist.FileAllowed(filepath.Base(p)) ||
|
if ngs.cfg.Allowlist.FileAllowed(filepath.Base(p)) ||
|
||||||
ngs.cfg.Allowlist.PathAllowed(p) {
|
ngs.cfg.Allowlist.PathAllowed(p) {
|
||||||
return nil
|
return nil
|
||||||
@@ -84,7 +86,9 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
|
|||||||
|
|
||||||
leak.Log(ngs.opts)
|
leak.Log(ngs.opts)
|
||||||
|
|
||||||
leaks <- leak
|
ngs.mtx.Lock()
|
||||||
|
scannerReport.Leaks = append(scannerReport.Leaks, leak)
|
||||||
|
ngs.mtx.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +109,7 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
offender := rule.Inspect(line)
|
offender := rule.Inspect(line)
|
||||||
if offender == "" {
|
if offender.IsEmpty() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if ngs.cfg.Allowlist.RegexAllowed(line) {
|
if ngs.cfg.Allowlist.RegexAllowed(line) {
|
||||||
@@ -119,7 +123,7 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
leak := NewLeak(line, offender, defaultLineNumber)
|
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithEntropy(offender.EntropyLevel)
|
||||||
relPath, err := filepath.Rel(ngs.opts.Path, p)
|
relPath, err := filepath.Rel(ngs.opts.Path, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
leak.File = p
|
leak.File = p
|
||||||
@@ -129,26 +133,20 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
|
|||||||
leak.LineNumber = lineNumber
|
leak.LineNumber = lineNumber
|
||||||
leak.Rule = rule.Description
|
leak.Rule = rule.Description
|
||||||
leak.Tags = strings.Join(rule.Tags, ", ")
|
leak.Tags = strings.Join(rule.Tags, ", ")
|
||||||
|
|
||||||
leak.Log(ngs.opts)
|
leak.Log(ngs.opts)
|
||||||
|
|
||||||
leaks <- leak
|
ngs.mtx.Lock()
|
||||||
|
scannerReport.Leaks = append(scannerReport.Leaks, leak)
|
||||||
|
ngs.mtx.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return f.Close()
|
return f.Close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
if err := g.Wait(); err != nil {
|
||||||
if err := g.Wait(); err != nil {
|
log.Error(err)
|
||||||
log.Error(err)
|
|
||||||
}
|
|
||||||
close(leaks)
|
|
||||||
}()
|
|
||||||
|
|
||||||
for leak := range leaks {
|
|
||||||
scannerReport.Leaks = append(scannerReport.Leaks, leak)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return scannerReport, g.Wait()
|
return scannerReport, nil
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package scan_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestNoGit(t *testing.T) {
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer moveDotGit(".git", "dotGit")
|
||||||
|
tests := []struct {
|
||||||
|
description string
|
||||||
|
opts options.Options
|
||||||
|
wantPath string
|
||||||
|
empty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
description: "[nogit] basic repo",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_no_git.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
NoGit: true,
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_no_git.json"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "[nogit] empty",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "empty"),
|
||||||
|
Report: filepath.Join(expectPath, "empty", "results_no_git_empty.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
NoGit: true,
|
||||||
|
},
|
||||||
|
empty: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
cfg, err := config.NewConfig(test.opts)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scanner, err := scan.NewScanner(test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerReport, err := scanner.Scan()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = scan.WriteReport(scannerReport, test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.empty {
|
||||||
|
if len(scannerReport.Leaks) != 0 {
|
||||||
|
t.Errorf("%s wanted no leaks but got some instead: %+v", test.description, scannerReport.Leaks)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.wantPath != "" {
|
||||||
|
err := fileCheck(test.wantPath, test.opts.Report)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-12
@@ -2,6 +2,7 @@ package scan
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
@@ -21,6 +22,7 @@ type RepoScanner struct {
|
|||||||
repo *git.Repository
|
repo *git.Repository
|
||||||
throttle *Throttle
|
throttle *Throttle
|
||||||
repoName string
|
repoName string
|
||||||
|
mtx *sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRepoScanner returns a new repo scanner (go figure). This function also
|
// NewRepoScanner returns a new repo scanner (go figure). This function also
|
||||||
@@ -32,6 +34,7 @@ func NewRepoScanner(opts options.Options, cfg config.Config, repo *git.Repositor
|
|||||||
repo: repo,
|
repo: repo,
|
||||||
throttle: NewThrottle(opts),
|
throttle: NewThrottle(opts),
|
||||||
repoName: getRepoName(opts),
|
repoName: getRepoName(opts),
|
||||||
|
mtx: &sync.Mutex{},
|
||||||
}
|
}
|
||||||
|
|
||||||
return rs
|
return rs
|
||||||
@@ -54,7 +57,6 @@ func (rs *RepoScanner) Scan() (Report, error) {
|
|||||||
|
|
||||||
g, _ := errgroup.WithContext(context.Background())
|
g, _ := errgroup.WithContext(context.Background())
|
||||||
commits = make(chan *object.Commit)
|
commits = make(chan *object.Commit)
|
||||||
leaks := make(chan Leak)
|
|
||||||
|
|
||||||
commitNum := 0
|
commitNum := 0
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
@@ -91,25 +93,20 @@ func (rs *RepoScanner) Scan() (Report, error) {
|
|||||||
log.Error(err)
|
log.Error(err)
|
||||||
}
|
}
|
||||||
for _, leak := range report.Leaks {
|
for _, leak := range report.Leaks {
|
||||||
leaks <- leak
|
rs.mtx.Lock()
|
||||||
|
scannerReport.Leaks = append(scannerReport.Leaks, leak)
|
||||||
|
rs.mtx.Unlock()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
if err := g.Wait(); err != nil {
|
||||||
if err := g.Wait(); err != nil {
|
log.Error(err)
|
||||||
log.Error(err)
|
|
||||||
}
|
|
||||||
close(leaks)
|
|
||||||
}()
|
|
||||||
|
|
||||||
for leak := range leaks {
|
|
||||||
scannerReport.Leaks = append(scannerReport.Leaks, leak)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scannerReport.Commits = commitNum
|
scannerReport.Commits = commitNum
|
||||||
return scannerReport, g.Wait()
|
return scannerReport, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetRepoName sets the repo name
|
// SetRepoName sets the repo name
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package scan_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestRepoScan(t *testing.T) {
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer moveDotGit(".git", "dotGit")
|
||||||
|
tests := []struct {
|
||||||
|
description string
|
||||||
|
opts options.Options
|
||||||
|
wantPath string
|
||||||
|
empty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
description: "empty repo",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "empty"),
|
||||||
|
Report: filepath.Join(expectPath, "empty", "empty_report.json.got"),
|
||||||
|
},
|
||||||
|
empty: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with default config",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results.json"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "with_config repo",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "with_config"),
|
||||||
|
Report: filepath.Join(expectPath, "with_config", "results.json.got"),
|
||||||
|
RepoConfigPath: "gitleaks.toml",
|
||||||
|
ReportFormat: "json",
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "with_config", "results.json"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
cfg, err := config.NewConfig(test.opts)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scanner, err := scan.NewScanner(test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerReport, err := scanner.Scan()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = scan.WriteReport(scannerReport, test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.empty {
|
||||||
|
if len(scannerReport.Leaks) != 0 {
|
||||||
|
t.Errorf("%s wanted no leaks but got some instead: %+v", test.description, scannerReport.Leaks)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.wantPath != "" {
|
||||||
|
err := fileCheck(test.wantPath, test.opts.Report)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
-15
@@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/csv"
|
"encoding/csv"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@@ -27,28 +28,27 @@ func WriteReport(report Report, opts options.Options, cfg config.Config) error {
|
|||||||
logrus.Warn("leaks found: ", len(report.Leaks))
|
logrus.Warn("leaks found: ", len(report.Leaks))
|
||||||
} else {
|
} else {
|
||||||
logrus.Info("No leaks found")
|
logrus.Info("No leaks found")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.Report == "" {
|
if opts.Report == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
} else {
|
||||||
|
if opts.Redact {
|
||||||
if opts.Redact {
|
var redactedLeaks []Leak
|
||||||
var redactedLeaks []Leak
|
for _, leak := range report.Leaks {
|
||||||
for _, leak := range report.Leaks {
|
redactedLeaks = append(redactedLeaks, RedactLeak(leak))
|
||||||
redactedLeaks = append(redactedLeaks, RedactLeak(leak))
|
}
|
||||||
|
report.Leaks = redactedLeaks
|
||||||
}
|
}
|
||||||
report.Leaks = redactedLeaks
|
|
||||||
}
|
|
||||||
|
|
||||||
file, err := os.Create(opts.Report)
|
file, err := os.Create(opts.Report)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer rable(file.Close)
|
defer rable(file.Close)
|
||||||
|
|
||||||
if opts.Report != "" {
|
switch strings.ToLower(opts.ReportFormat) {
|
||||||
switch opts.ReportFormat {
|
|
||||||
case "json":
|
case "json":
|
||||||
encoder := json.NewEncoder(file)
|
encoder := json.NewEncoder(file)
|
||||||
encoder.SetIndent("", " ")
|
encoder.SetIndent("", " ")
|
||||||
|
|||||||
+4
-1
@@ -77,6 +77,7 @@ type Locations struct {
|
|||||||
//Results ...
|
//Results ...
|
||||||
type Results struct {
|
type Results struct {
|
||||||
Message Message `json:"message"`
|
Message Message `json:"message"`
|
||||||
|
RuleId string `json:"ruleId"`
|
||||||
Properties ResultProperties `json:"properties"`
|
Properties ResultProperties `json:"properties"`
|
||||||
Locations []Locations `json:"locations"`
|
Locations []Locations `json:"locations"`
|
||||||
}
|
}
|
||||||
@@ -110,12 +111,14 @@ func configToRules(cfg config.Config) []Rules {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func leaksToResults(leaks []Leak) []Results {
|
func leaksToResults(leaks []Leak) []Results {
|
||||||
var results []Results
|
results := make([]Results, 0)
|
||||||
|
|
||||||
for _, leak := range leaks {
|
for _, leak := range leaks {
|
||||||
results = append(results, Results{
|
results = append(results, Results{
|
||||||
Message: Message{
|
Message: Message{
|
||||||
Text: fmt.Sprintf("%s secret detected", leak.Rule),
|
Text: fmt.Sprintf("%s secret detected", leak.Rule),
|
||||||
},
|
},
|
||||||
|
RuleId: leak.Rule,
|
||||||
Properties: ResultProperties{
|
Properties: ResultProperties{
|
||||||
Commit: leak.Commit,
|
Commit: leak.Commit,
|
||||||
Offender: leak.Offender,
|
Offender: leak.Offender,
|
||||||
|
|||||||
+23
-2
@@ -45,6 +45,13 @@ func NewScanner(opts options.Options, cfg config.Config) (Scanner, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if st == typeDirScanner {
|
if st == typeDirScanner {
|
||||||
|
if opts.AdditionalConfig != "" {
|
||||||
|
additionalCfg, err := config.LoadAdditionalConfig(opts.AdditionalConfig)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
cfg = cfg.AppendConfig(additionalCfg)
|
||||||
|
}
|
||||||
return NewParentScanner(opts, cfg), nil
|
return NewParentScanner(opts, cfg), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,12 +63,26 @@ func NewScanner(opts options.Options, cfg config.Config) (Scanner, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load up alternative config if possible, if not use manager's config
|
// load up alternative config if possible, if not use default/specified config. Will append if AppendRepoConfig is true
|
||||||
if opts.RepoConfigPath != "" && !opts.NoGit {
|
if opts.RepoConfigPath != "" && !opts.NoGit {
|
||||||
cfg, err = config.LoadRepoConfig(repo, opts.RepoConfigPath)
|
repoCfg, err := config.LoadRepoConfig(repo, opts.RepoConfigPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if opts.AppendRepoConfig {
|
||||||
|
cfg = cfg.AppendConfig(repoCfg)
|
||||||
|
} else {
|
||||||
|
cfg = repoCfg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// append additional config with the rest of the config
|
||||||
|
if opts.AdditionalConfig != "" {
|
||||||
|
additionalCfg, err := config.LoadAdditionalConfig(opts.AdditionalConfig)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
cfg = cfg.AppendConfig(additionalCfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch st {
|
switch st {
|
||||||
|
|||||||
+30
-692
@@ -1,686 +1,52 @@
|
|||||||
package scan
|
package scan_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/zricethezav/gitleaks/v7/config"
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
"github.com/zricethezav/gitleaks/v7/options"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const testRepoBase = "../test_data/test_repos/"
|
const repoBasePath = "../testdata/repos/"
|
||||||
|
const expectPath = "../testdata/expect/"
|
||||||
|
|
||||||
func TestScan(t *testing.T) {
|
func moveDotGit(from, to string) error {
|
||||||
err := moveDotGit("dotGit", ".git")
|
repoDirs, err := ioutil.ReadDir("../testdata/repos")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
return err
|
||||||
}
|
}
|
||||||
defer moveDotGit(".git", "dotGit")
|
for _, dir := range repoDirs {
|
||||||
tests := []struct {
|
if to == ".git" {
|
||||||
description string
|
_, err := os.Stat(fmt.Sprintf("%s/%s/%s", repoBasePath, dir.Name(), "dotGit"))
|
||||||
opts options.Options
|
if os.IsNotExist(err) {
|
||||||
wantPath string
|
// dont want to delete the only copy of .git accidentally
|
||||||
wantErr error
|
continue
|
||||||
wantScanErr error
|
}
|
||||||
emptyRepo bool
|
os.RemoveAll(fmt.Sprintf("%s/%s/%s", repoBasePath, dir.Name(), ".git"))
|
||||||
wantEmpty bool
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
description: "test local repo one aws leak",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_local_repo_one_aws_leak.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
Threads: runtime.GOMAXPROCS(0),
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_one_aws_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo one aws leak threaded",
|
|
||||||
opts: options.Options{
|
|
||||||
Threads: runtime.GOMAXPROCS(0),
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_local_repo_one_aws_leak.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_one_aws_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test non existent repo",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/no_repo_here",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantErr: fmt.Errorf("stat ../test_data/test_repos/no_repo_here: no such file or directory"),
|
|
||||||
emptyRepo: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo one aws leak allowlisted",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_allowlist_python_files.toml",
|
|
||||||
},
|
|
||||||
wantEmpty: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_leaks.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_leaks.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks from Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_leaks_commit_from.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
CommitFrom: "996865bb912f3bc45898a370a13aadb315014b55",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_leaks_commit_from.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks to Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_leaks_commit_to.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
CommitTo: "996865bb912f3bc45898a370a13aadb315014b55",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_leaks_commit_to.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks to from Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_leaks_commit_to_from.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
CommitFrom: "d8ac0b73aeeb45843319cdc5ce506516eb49bf7a",
|
|
||||||
CommitTo: "51f6dcf6b89b93f4075ba92c400b075631a6cc93",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_leaks_commit_to_from.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks list Commits",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_leaks_commit_range.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
Commits: "d8ac0b73aeeb45843319cdc5ce506516eb49bf7a,996865bb912f3bc45898a370a13aadb315014b55,17471a5fda722a9e423f1a0d3f0d267ea009d41c,51f6dcf6b89b93f4075ba92c400b075631a6cc93,b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_leaks_commit_range.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks file list commits",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_leaks_file_commit_range.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
CommitsFile: "../test_data/test_options/test_local_repo_commits.txt",
|
|
||||||
Threads: runtime.GOMAXPROCS(0),
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_leaks_file_commit_range.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks globally allowlisted",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_global_allowlist_file.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantEmpty: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two leaks allowlisted",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_allowlist_files.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantEmpty: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo three leaks dev branch with reportGroup set",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_3",
|
|
||||||
Report: "../test_data/test_local_repo_three_leaks_with_report_groups.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_with_report_groups.toml",
|
|
||||||
Branch: "dev",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_three_leaks_with_report_groups.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo three leaks dev branch",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_3",
|
|
||||||
Report: "../test_data/test_local_repo_three_leaks.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key.toml",
|
|
||||||
Branch: "dev",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_three_leaks.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo branch does not exist",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_3",
|
|
||||||
Branch: "nobranch",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantScanErr: fmt.Errorf("could not find branch nobranch"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo one aws leak single Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_local_repo_one_aws_leak_commit.json.got",
|
|
||||||
Commit: "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_one_aws_leak_commit.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo one aws leak AND leak on python files",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_local_repo_one_aws_leak_and_file_leak.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_file_regex.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_one_aws_leak_and_file_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test owner path",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/",
|
|
||||||
Report: "../test_data/test_local_owner_aws_leak.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
Threads: runtime.GOMAXPROCS(0),
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_owner_aws_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test owner path allowlist repo",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/",
|
|
||||||
Report: "../test_data/test_local_owner_aws_leak_allowlist_repo.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../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{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_regex_entropy.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/regex_entropy.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
Threads: runtime.GOMAXPROCS(0),
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_regex_entropy.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo four entropy alternative config",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_4",
|
|
||||||
Report: "../test_data/test_local_repo_four_alt_config_entropy.json.got",
|
|
||||||
RepoConfigPath: "gitleaks.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_four_alt_config_entropy.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo four entropy alternative config",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_regex_allowlist.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_aws_allowlisted.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantEmpty: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test owner path depth=2",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/",
|
|
||||||
Report: "../test_data/test_local_owner_aws_leak_depth_2.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
Depth: 2,
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_owner_aws_leak_depth_2.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo five files at Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_5",
|
|
||||||
Report: "../test_data/test_local_repo_five_files_at_commit.json.got",
|
|
||||||
FilesAtCommit: "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_five_files_at_commit.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo five files at latest Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_5",
|
|
||||||
Report: "../test_data/test_local_repo_five_files_at_latest_commit.json.got",
|
|
||||||
FilesAtCommit: "latest",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_five_files_at_commit.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo five at Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_5",
|
|
||||||
Report: "../test_data/test_local_repo_five_commit.json.got",
|
|
||||||
Commit: "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/generic.toml",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_five_commit.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo five at latest Commit",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_5",
|
|
||||||
Report: "../test_data/test_local_repo_five_at_latest_commit.json.got",
|
|
||||||
Commit: "latest",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/generic.toml",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_five_at_latest_commit.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo six filename",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_6",
|
|
||||||
Report: "../test_data/test_local_repo_six_filename.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/regex_filename.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_six_filename.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo six filepath",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_6",
|
|
||||||
Report: "../test_data/test_local_repo_six_filepath.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/regex_filepath.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_six_filepath.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo six filename and filepath",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_6",
|
|
||||||
Report: "../test_data/test_local_repo_six_filepath_filename.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/regex_filepath_filename.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_six_filepath_filename.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo six path globally allowlisted",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_6",
|
|
||||||
Report: "../test_data/test_local_repo_six_path_globally_allowlisted.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/aws_key_global_allowlist_path.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_six_path_globally_allowlisted.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo six leaks since date",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../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{
|
|
||||||
Path: "../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{
|
|
||||||
Path: "../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{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_allowlist_commits.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/allowlist_commit.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_allowlist_commits.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo eight (merges)",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_8",
|
|
||||||
Report: "../test_data/test_local_repo_eight.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_eight.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo nine",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_9",
|
|
||||||
Report: "../test_data/test_local_repo_nine_aws_leak.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/large_with_global_allowlist_regex.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_nine_aws_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test dir one no git",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_dir_1",
|
|
||||||
Report: "../test_data/test_dir1_aws_leak.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
NoGit: true,
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_dir1_aws_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test file with leak no git",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_dir_1/server.test.py",
|
|
||||||
Report: "../test_data/test_file1_aws_leak.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
NoGit: true,
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_file1_aws_leak.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test only md files no git",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/",
|
|
||||||
Report: "../test_data/test_only_files_no_git.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/onlyFiles.toml",
|
|
||||||
NoGit: true,
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_only_files_no_git.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test allowlist files",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_10",
|
|
||||||
Report: "../test_data/test_allow_list_file.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/allowlist_files.toml",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_allow_list_file.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test allowlist files no-git",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_10",
|
|
||||||
Report: "../test_data/test_allow_list_file_no_git.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/allowlist_files.toml",
|
|
||||||
NoGit: true,
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_allow_list_file_no_git.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test allowlist docx no-git",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_10",
|
|
||||||
Report: "../test_data/test_allow_list_docx_no_git.json.got",
|
|
||||||
ReportFormat: "json",
|
|
||||||
ConfigPath: "../test_data/test_configs/allowlist_docx.toml",
|
|
||||||
NoGit: true,
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_allow_list_docx_no_git.json",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two allowlist Commit config",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_allowlist_commits_files_at_commit.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/allowlist_commit.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
FilesAtCommit: "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_allowlist_commits_files_at_commit.json",
|
|
||||||
wantEmpty: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test local repo two global allowlist commit config",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_2",
|
|
||||||
Report: "../test_data/test_local_repo_two_global_allowlist_files_at_commit.json.got",
|
|
||||||
ConfigPath: "../test_data/test_configs/allowlist_global_files.toml",
|
|
||||||
ReportFormat: "json",
|
|
||||||
FilesAtCommit: "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_two_global_allowlist_files_at_commit.json",
|
|
||||||
wantEmpty: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, test := range tests {
|
|
||||||
fmt.Println(test.description)
|
|
||||||
cfg, err := config.NewConfig(test.opts)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
}
|
||||||
|
if !dir.IsDir() {
|
||||||
scanner, err := NewScanner(test.opts, cfg)
|
|
||||||
if test.wantErr != nil {
|
|
||||||
if err == nil {
|
|
||||||
t.Fatalf("did not receive wantErr: %v", test.wantErr)
|
|
||||||
}
|
|
||||||
if err.Error() != test.wantErr.Error() {
|
|
||||||
t.Fatalf("wantErr does not equal err received: %v", err.Error())
|
|
||||||
}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err != nil {
|
_, err := os.Stat(fmt.Sprintf("%s/%s/%s", repoBasePath, dir.Name(), from))
|
||||||
t.Fatal(err)
|
if os.IsNotExist(err) {
|
||||||
}
|
|
||||||
|
|
||||||
scannerReport, err := scanner.Scan()
|
|
||||||
|
|
||||||
if test.wantScanErr != nil {
|
|
||||||
if err == nil {
|
|
||||||
t.Fatalf("did not receive wantErr: %v", test.wantScanErr)
|
|
||||||
}
|
|
||||||
if err.Error() != test.wantScanErr.Error() {
|
|
||||||
t.Fatalf("wantErr does not equal err received: %v", err.Error())
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = WriteReport(scannerReport, test.opts, cfg)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if test.wantEmpty {
|
|
||||||
if len(scannerReport.Leaks) != 0 {
|
|
||||||
t.Errorf("wanted no leaks but got some instead: %+v", scannerReport.Leaks)
|
|
||||||
}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if test.wantPath != "" {
|
err = os.Rename(fmt.Sprintf("%s/%s/%s", repoBasePath, dir.Name(), from),
|
||||||
err := fileCheck(test.wantPath, test.opts.Report)
|
fmt.Sprintf("%s/%s/%s", repoBasePath, dir.Name(), to))
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
func TestScanUncommited(t *testing.T) {
|
|
||||||
moveDotGit("dotGit", ".git")
|
|
||||||
defer moveDotGit(".git", "dotGit")
|
|
||||||
tests := []struct {
|
|
||||||
description string
|
|
||||||
opts options.Options
|
|
||||||
wantPath string
|
|
||||||
wantErr error
|
|
||||||
wantScanErr error
|
|
||||||
emptyRepo bool
|
|
||||||
wantEmpty bool
|
|
||||||
fileToChange string
|
|
||||||
addition string
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
description: "test scan local one leak",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Report: "../test_data/test_local_repo_one_aws_leak_uncommitted.json.got",
|
|
||||||
Unstaged: true,
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_one_aws_leak_uncommitted.json",
|
|
||||||
fileToChange: "server.test.py",
|
|
||||||
addition: " aws_access_key_id='AKIAIO5FODNN7DXAMPLE'\n\n",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test scan local no leak",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_1",
|
|
||||||
Unstaged: true,
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantEmpty: true,
|
|
||||||
fileToChange: "server.test.py",
|
|
||||||
addition: "nothing bad",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
description: "test scan repo with no commits",
|
|
||||||
opts: options.Options{
|
|
||||||
Path: "../test_data/test_repos/test_repo_7",
|
|
||||||
Report: "../test_data/test_local_repo_seven_aws_leak_uncommitted.json.got",
|
|
||||||
Unstaged: true,
|
|
||||||
ReportFormat: "json",
|
|
||||||
},
|
|
||||||
wantPath: "../test_data/test_local_repo_seven_aws_leak_uncommitted.json",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
for _, test := range tests {
|
|
||||||
var (
|
|
||||||
old []byte
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
fmt.Println(test.description)
|
|
||||||
if test.fileToChange != "" {
|
|
||||||
old, err = ioutil.ReadFile(fmt.Sprintf("%s/%s", test.opts.Path, test.fileToChange))
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
altered, err := os.OpenFile(fmt.Sprintf("%s/%s", test.opts.Path, test.fileToChange),
|
|
||||||
os.O_WRONLY|os.O_APPEND, 0644)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = altered.WriteString(test.addition)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg, err := config.NewConfig(test.opts)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
return err
|
||||||
}
|
|
||||||
scanner, err := NewScanner(test.opts, cfg)
|
|
||||||
if test.wantErr != nil {
|
|
||||||
if err == nil {
|
|
||||||
t.Fatalf("did not receive wantErr: %v", test.wantErr)
|
|
||||||
}
|
|
||||||
if err.Error() != test.wantErr.Error() {
|
|
||||||
t.Fatalf("wantErr does not equal err received: %v", err.Error())
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
scannerReport, err := scanner.Scan()
|
|
||||||
|
|
||||||
if test.wantScanErr != nil {
|
|
||||||
if err == nil {
|
|
||||||
t.Fatalf("did not receive wantErr: %v", test.wantScanErr)
|
|
||||||
}
|
|
||||||
if err.Error() != test.wantScanErr.Error() {
|
|
||||||
t.Fatalf("wantErr does not equal err received: %v", err.Error())
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = WriteReport(scannerReport, test.opts, cfg)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if test.fileToChange != "" {
|
|
||||||
err = ioutil.WriteFile(fmt.Sprintf("%s/%s", test.opts.Path, test.fileToChange), old, 0)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if test.wantEmpty {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if test.wantPath != "" {
|
|
||||||
err := fileCheck(test.wantPath, test.opts.Report)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func fileCheck(wantPath, gotPath string) error {
|
func fileCheck(wantPath, gotPath string) error {
|
||||||
var (
|
var (
|
||||||
gotLeaks []Leak
|
gotLeaks []scan.Leak
|
||||||
wantLeaks []Leak
|
wantLeaks []scan.Leak
|
||||||
)
|
)
|
||||||
want, err := ioutil.ReadFile(wantPath)
|
want, err := ioutil.ReadFile(wantPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -714,7 +80,7 @@ func fileCheck(wantPath, gotPath string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
return fmt.Errorf("unable to find %+v in got leaks", wantLeak)
|
return fmt.Errorf("unable to find %+v in %s", wantLeak, gotPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -724,7 +90,7 @@ func fileCheck(wantPath, gotPath string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func same(l1, l2 Leak) bool {
|
func same(l1, l2 scan.Leak) bool {
|
||||||
if l1.Commit != l2.Commit {
|
if l1.Commit != l2.Commit {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -733,6 +99,10 @@ func same(l1, l2 Leak) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if l1.OffenderEntropy != l2.OffenderEntropy {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if l1.Line != l2.Line {
|
if l1.Line != l2.Line {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -763,35 +133,3 @@ func same(l1, l2 Leak) bool {
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func moveDotGit(from, to string) error {
|
|
||||||
repoDirs, err := ioutil.ReadDir("../test_data/test_repos")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
for _, dir := range repoDirs {
|
|
||||||
if to == ".git" {
|
|
||||||
_, err := os.Stat(fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), "dotGit"))
|
|
||||||
if os.IsNotExist(err) {
|
|
||||||
// dont want to delete the only copy of .git accidentally
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
os.RemoveAll(fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), ".git"))
|
|
||||||
}
|
|
||||||
if !dir.IsDir() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
_, err := os.Stat(fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), from))
|
|
||||||
if os.IsNotExist(err) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
err = os.Rename(fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), from),
|
|
||||||
fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), to))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// fmt.Println("RENAMED")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
+18
-6
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -66,7 +67,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
// Check individual file path ONLY rules
|
// Check individual file path ONLY rules
|
||||||
for _, rule := range us.cfg.Rules {
|
for _, rule := range us.cfg.Rules {
|
||||||
if rule.HasFileOrPathLeakOnly(fn) {
|
if rule.HasFileOrPathLeakOnly(fn) {
|
||||||
leak := NewLeak("", "Filename or path offender: "+ fn, defaultLineNumber)
|
leak := NewLeak("", "Filename or path offender: "+fn, defaultLineNumber)
|
||||||
leak.Repo = us.repoName
|
leak.Repo = us.repoName
|
||||||
leak.File = fn
|
leak.File = fn
|
||||||
leak.RepoURL = us.opts.RepoURL
|
leak.RepoURL = us.opts.RepoURL
|
||||||
@@ -79,7 +80,9 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
|
if fc, err := os.Readlink(fn); err == nil {
|
||||||
|
workTreeBuf = bytes.NewBufferString(fc)
|
||||||
|
} else if _, err := io.Copy(workTreeBuf, workTreeFile); err != nil {
|
||||||
return scannerReport, err
|
return scannerReport, err
|
||||||
}
|
}
|
||||||
lineNumber := 0
|
lineNumber := 0
|
||||||
@@ -87,7 +90,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
lineNumber++
|
lineNumber++
|
||||||
for _, rule := range us.cfg.Rules {
|
for _, rule := range us.cfg.Rules {
|
||||||
offender := rule.Inspect(line)
|
offender := rule.Inspect(line)
|
||||||
if offender == "" {
|
if offender.IsEmpty() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if us.cfg.Allowlist.RegexAllowed(line) ||
|
if us.cfg.Allowlist.RegexAllowed(line) ||
|
||||||
@@ -101,7 +104,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
if rule.Path.String() != "" && !rule.HasFilePathLeak(filepath.Base(workTreeFile.Name())) {
|
if rule.Path.String() != "" && !rule.HasFilePathLeak(filepath.Base(workTreeFile.Name())) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(emptyCommit())
|
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(emptyCommit()).WithEntropy(offender.EntropyLevel)
|
||||||
leak.File = workTreeFile.Name()
|
leak.File = workTreeFile.Name()
|
||||||
leak.LineNumber = lineNumber
|
leak.LineNumber = lineNumber
|
||||||
leak.Repo = us.repoName
|
leak.Repo = us.repoName
|
||||||
@@ -156,6 +159,9 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
// file in staging has been deleted, aka it is not on the filesystem
|
// file in staging has been deleted, aka it is not on the filesystem
|
||||||
// so the contents of the file are ""
|
// so the contents of the file are ""
|
||||||
currFileContents = ""
|
currFileContents = ""
|
||||||
|
//check if file is symlink
|
||||||
|
} else if fc, err := os.Readlink(fn); err == nil {
|
||||||
|
currFileContents = fc
|
||||||
} else {
|
} else {
|
||||||
workTreeBuf := bytes.NewBuffer(nil)
|
workTreeBuf := bytes.NewBuffer(nil)
|
||||||
workTreeFile, err := wt.Filesystem.Open(fn)
|
workTreeFile, err := wt.Filesystem.Open(fn)
|
||||||
@@ -184,6 +190,12 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if file is allow listed
|
||||||
|
if us.cfg.Allowlist.FileAllowed(filepath.Base(filename)) ||
|
||||||
|
us.cfg.Allowlist.PathAllowed(filename) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
dmp := diffmatchpatch.New()
|
dmp := diffmatchpatch.New()
|
||||||
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
|
diffs := dmp.DiffMain(prevFileContents, currFileContents, false)
|
||||||
prettyDiff := diffPrettyText(diffs)
|
prettyDiff := diffPrettyText(diffs)
|
||||||
@@ -200,7 +212,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
for _, line := range strings.Split(diffContents, "\n") {
|
for _, line := range strings.Split(diffContents, "\n") {
|
||||||
for _, rule := range us.cfg.Rules {
|
for _, rule := range us.cfg.Rules {
|
||||||
offender := rule.Inspect(line)
|
offender := rule.Inspect(line)
|
||||||
if offender == "" {
|
if offender.IsEmpty() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if us.cfg.Allowlist.RegexAllowed(line) ||
|
if us.cfg.Allowlist.RegexAllowed(line) ||
|
||||||
@@ -214,7 +226,7 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|||||||
if rule.Path.String() != "" && !rule.HasFilePathLeak(filepath.Base(filename)) {
|
if rule.Path.String() != "" && !rule.HasFilePathLeak(filepath.Base(filename)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
leak := NewLeak(line, offender, defaultLineNumber).WithCommit(emptyCommit())
|
leak := NewLeak(line, offender.ToString(), defaultLineNumber).WithCommit(emptyCommit()).WithEntropy(offender.EntropyLevel)
|
||||||
leak.File = filename
|
leak.File = filename
|
||||||
leak.LineNumber = extractLine(prettyDiff, leak, lineLookup) + 1
|
leak.LineNumber = extractLine(prettyDiff, leak, lineLookup) + 1
|
||||||
leak.Repo = us.repoName
|
leak.Repo = us.repoName
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package scan_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/zricethezav/gitleaks/v7/config"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/options"
|
||||||
|
"github.com/zricethezav/gitleaks/v7/scan"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestUnstaged(t *testing.T) {
|
||||||
|
err := moveDotGit("dotGit", ".git")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer moveDotGit(".git", "dotGit")
|
||||||
|
tests := []struct {
|
||||||
|
description string
|
||||||
|
opts options.Options
|
||||||
|
wantPath string
|
||||||
|
fileToChange string
|
||||||
|
change string
|
||||||
|
empty bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
description: "basic repo with unstagged change containing a secret",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_unstaged.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
Unstaged: true,
|
||||||
|
},
|
||||||
|
wantPath: filepath.Join(expectPath, "basic", "results_unstaged.json"),
|
||||||
|
fileToChange: filepath.Join(repoBasePath, "basic", "secrets.py"),
|
||||||
|
change: "\nadded_aws_access_key_id='AKIAIO5FODNN7DXAMPLE'\n",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: "basic repo with unstagged change not containing a secret",
|
||||||
|
opts: options.Options{
|
||||||
|
Path: filepath.Join(repoBasePath, "basic"),
|
||||||
|
Report: filepath.Join(expectPath, "basic", "results_unstaged.json.got"),
|
||||||
|
ReportFormat: "json",
|
||||||
|
Unstaged: true,
|
||||||
|
},
|
||||||
|
empty: true,
|
||||||
|
fileToChange: filepath.Join(repoBasePath, "basic", "secrets.py"),
|
||||||
|
change: "\nnice_variable='is_nice''\n",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
var old []byte
|
||||||
|
if test.fileToChange != "" {
|
||||||
|
old, err = ioutil.ReadFile(test.fileToChange)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
altered, err := os.OpenFile(test.fileToChange,
|
||||||
|
os.O_WRONLY|os.O_APPEND, 0644)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = altered.WriteString(test.change)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg, err := config.NewConfig(test.opts)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scanner, err := scan.NewScanner(test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerReport, err := scanner.Scan()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = scan.WriteReport(scannerReport, test.opts, cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.empty {
|
||||||
|
if len(scannerReport.Leaks) != 0 {
|
||||||
|
t.Errorf("%s wanted no leaks but got some instead: %+v", test.description, scannerReport.Leaks)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if test.wantPath != "" {
|
||||||
|
err := fileCheck(test.wantPath, test.opts.Report)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(test.description, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = ioutil.WriteFile(test.fileToChange, old, 0)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/.gitignore",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/.gitignore",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/bad.zip",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/bad.zip",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/gitfile.txt",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/gitfile.txt",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/creds.git",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/creds.git",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/somedir.git/secret.key",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/somedir.git/secret.key",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: tmp/bad.docx",
|
|
||||||
"commit": "b0f9b62dfe12e4e10de180359c6b9276472494f8",
|
|
||||||
"repo": "test_repo_10",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "Create bad.docx",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "tmp/bad.docx",
|
|
||||||
"date": "2020-12-09T11:02:10-05:00",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/somedir.git/secret.key",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/somedir.git/secret.key",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/tmp/bad.docx",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "Block dangerous filetypes",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/tmp/bad.docx",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"offender": "Entropy range [{P1:4.5 P2:4.7} {P1:5.5 P2:6.3}]",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_1",
|
|
||||||
"rule": "entropy",
|
|
||||||
"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": "entropy"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_dir_1/server.test.py",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,370 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repos",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: AKIALALEMEL33243OLIAE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPL2",
|
|
||||||
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repos",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 2,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "ce7e8177bbf8a172c06b6a1e370a374d5c19f660",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "dummy.txt w/ text",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:39:11-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "9267bc86ec1497471cbc6f3308f3527f7ef34b9d",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Update dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:41:11-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Merge pull request #1 from zricethezav/additional-secret-branch\n\nUpdate dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:44:48-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a",
|
|
||||||
"repo": "test_repo_9",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "gitleaks allow secret\n",
|
|
||||||
"author": "Zach Rice",
|
|
||||||
"email": "zrice@gitlab.com",
|
|
||||||
"file": "server.test.py",
|
|
||||||
"date": "2020-08-12T13:36:20-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repos",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,354 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPL2",
|
|
||||||
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repos",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Merge pull request #1 from zricethezav/additional-secret-branch\n\nUpdate dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:44:48-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 2,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "ce7e8177bbf8a172c06b6a1e370a374d5c19f660",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "dummy.txt w/ text",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:39:11-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "9267bc86ec1497471cbc6f3308f3527f7ef34b9d",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Update dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:41:11-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a",
|
|
||||||
"repo": "test_repo_9",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "gitleaks allow secret\n",
|
|
||||||
"author": "Zach Rice",
|
|
||||||
"email": "zrice@gitlab.com",
|
|
||||||
"file": "server.test.py",
|
|
||||||
"date": "2020-08-12T13:36:20-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repos",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repos",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPL2",
|
|
||||||
"commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Merge pull request #1 from zricethezav/additional-secret-branch\n\nUpdate dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:44:48-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a",
|
|
||||||
"repo": "test_repo_9",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "gitleaks allow secret\n",
|
|
||||||
"author": "Zach Rice",
|
|
||||||
"email": "zrice@gitlab.com",
|
|
||||||
"file": "server.test.py",
|
|
||||||
"date": "2020-08-12T13:36:20-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "748f11eaf2c38c3cf0ac6a22e44208777e79fa6f",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Merge pull request #1 from zricethezav/additional-secret-branch\n\nUpdate dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:44:48-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 2,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "ce7e8177bbf8a172c06b6a1e370a374d5c19f660",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "dummy.txt w/ text",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:39:11-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "9267bc86ec1497471cbc6f3308f3527f7ef34b9d",
|
|
||||||
"repo": "test_repo_8",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "Update dummy.txt",
|
|
||||||
"author": "Zachary Rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "dummy.txt",
|
|
||||||
"date": "2020-07-25T14:41:11-04:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "more_secrets = '99432bfewaf823ec3294e231'",
|
|
||||||
"lineNumber": 7,
|
|
||||||
"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",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "more_secrets = '99432bfewaf823ec3294e231'",
|
|
||||||
"lineNumber": 7,
|
|
||||||
"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",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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, AWS",
|
|
||||||
"operation": "addition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPL2",
|
|
||||||
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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, AWS",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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, AWS",
|
|
||||||
"operation": "addition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPL2",
|
|
||||||
"commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0",
|
|
||||||
"repo": "test_repo_5",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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, AWS",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "\"99432bfewaf823ec3294e231\"",
|
|
||||||
"commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "entropy",
|
|
||||||
"commitMessage": "more secrets\n",
|
|
||||||
"author": "zach rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "secrets.md",
|
|
||||||
"date": "2019-10-25T13:54:08-04:00",
|
|
||||||
"tags": "entropy"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "\"99432bfewaf823ec3294e231\"",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "entropy",
|
|
||||||
"commitMessage": "adding another one\n",
|
|
||||||
"author": "zach rice",
|
|
||||||
"email": "zricer@protonmail.com",
|
|
||||||
"file": "secrets.md",
|
|
||||||
"date": "2019-10-25T13:12:08-04:00",
|
|
||||||
"tags": "entropy"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_4",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_9",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_1",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_1",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_1",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "0000000000000000000000000000000000000000",
|
|
||||||
"repo": "test_repo_7",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "file",
|
|
||||||
"date": "1970-01-01T00:00:00Z",
|
|
||||||
"tags": "key, AWS",
|
|
||||||
"operation": "equal"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "api_token: exampleSecretPassword",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "token: exampleSecretPassword",
|
|
||||||
"commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "Generic password",
|
|
||||||
"commitMessage": "More secrets\n\n",
|
|
||||||
"author": "Noel Algora",
|
|
||||||
"email": "noealgigu@gmail.com",
|
|
||||||
"file": "config/config.yaml",
|
|
||||||
"date": "2020-02-19T04:08:26-05:00",
|
|
||||||
"tags": "key, Yml, Yaml"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "db_password_token: exampleSecretPassword",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "password_token: exampleSecretPassword",
|
|
||||||
"commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "Generic password",
|
|
||||||
"commitMessage": "More secrets\n\n",
|
|
||||||
"author": "Noel Algora",
|
|
||||||
"email": "noealgigu@gmail.com",
|
|
||||||
"file": "config/config.yaml",
|
|
||||||
"date": "2020-02-19T04:08:26-05:00",
|
|
||||||
"tags": "key, Yml, Yaml"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "95cf0237f8cdfc0686a29df08260d8635f46c9b0",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"commitMessage": "AWS Key in properties\n\n",
|
|
||||||
"author": "Noel Algora",
|
|
||||||
"email": "noealgigu@gmail.com",
|
|
||||||
"file": "config/application.properties",
|
|
||||||
"date": "2020-02-19T04:04:15-05:00",
|
|
||||||
"tags": "key, AWS"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "api_token: exampleSecretPassword",
|
|
||||||
"lineNumber": 2,
|
|
||||||
"offender": "token: exampleSecretPassword",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "Generic password",
|
|
||||||
"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, Yml, Yaml",
|
|
||||||
"operation": "addition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "db_password: verySecretProductionPassword",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "password: verySecretProductionPassword",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "Generic password",
|
|
||||||
"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, Yml, Yaml",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "apiToken=d41d8cd98f00b204e9800998ecf8427e",
|
|
||||||
"lineNumber": 2,
|
|
||||||
"offender": "Token=d41d8cd98f00b204e9800998ecf8427e",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "Generic password",
|
|
||||||
"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, Yml, Yaml",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIAIO5FODNN7EXAMPLE",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_6",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 5,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "deea550dd6c7acaf0e59432600593533984a2125",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_3",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": 4,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"",
|
|
||||||
"lineNumber": -1,
|
|
||||||
"offender": "AKIALALEMEL33243OLIB",
|
|
||||||
"commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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 Access Key",
|
|
||||||
"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 Access Key",
|
|
||||||
"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 Access Key",
|
|
||||||
"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 Access Key",
|
|
||||||
"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 Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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",
|
|
||||||
"lineNumber": 3,
|
|
||||||
"offender": "AKIALALEMEL33243OLIA",
|
|
||||||
"commit": "b10b3e2cb320a8c211fda94c4567299d37de7776",
|
|
||||||
"repo": "test_repo_2",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "AWS Access Key",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/README.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_10/README.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/secrets.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_2/secrets.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/no_secrets.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_2/no_secrets.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_3/no_secrets.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_3/no_secrets.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_3/secrets.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_3/secrets.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/secrets.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_4/secrets.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/no_secrets.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_4/no_secrets.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_5/notes.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_5/notes.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"line": "",
|
|
||||||
"lineNumber": 1,
|
|
||||||
"offender": "Filename or path offender: ../test_data/test_repos/test_repo_8/README.md",
|
|
||||||
"commit": "",
|
|
||||||
"repo": "",
|
|
||||||
"repoURL": "",
|
|
||||||
"leakURL": "",
|
|
||||||
"rule": "flag go",
|
|
||||||
"commitMessage": "",
|
|
||||||
"author": "",
|
|
||||||
"email": "",
|
|
||||||
"file": "../test_data/test_repos/test_repo_8/README.md",
|
|
||||||
"date": "0001-01-01T00:00:00Z",
|
|
||||||
"tags": "key, extensions"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
d8ac0b73aeeb45843319cdc5ce506516eb49bf7a
|
|
||||||
996865bb912f3bc45898a370a13aadb315014b55
|
|
||||||
17471a5fda722a9e423f1a0d3f0d267ea009d41c
|
|
||||||
51f6dcf6b89b93f4075ba92c400b075631a6cc93
|
|
||||||
b10b3e2cb320a8c211fda94c4567299d37de7776
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
null
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
|
|
||||||
"lineNumber": 6,
|
|
||||||
"offender": "'ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'",
|
|
||||||
"commit": "6557c92612d3b35979bd426d429255b3bf9fab74",
|
|
||||||
"repo": "test_repo_1",
|
|
||||||
"rule": "entropy and regex",
|
|
||||||
"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": "entropy",
|
|
||||||
"operation": "addition"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
tmp
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# Do not hard code credentials
|
|
||||||
client = boto3.client(
|
|
||||||
's3',
|
|
||||||
# Hard coded strings as credentials, not recommended.
|
|
||||||
aws_access_key_id='AKIAIO5FODNN7EXAMPLE',
|
|
||||||
aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'
|
|
||||||
)
|
|
||||||
|
|
||||||
# adding another line
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# Do not hard code credentials
|
|
||||||
client = boto3.client(
|
|
||||||
's3',
|
|
||||||
# Hard coded strings as credentials, not recommended.
|
|
||||||
aws_access_key_id='AKIAIO5FODNN7EXAMPLE',
|
|
||||||
aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'
|
|
||||||
)
|
|
||||||
|
|
||||||
# adding another line
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
comment
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[core]
|
|
||||||
repositoryformatversion = 0
|
|
||||||
filemode = true
|
|
||||||
bare = false
|
|
||||||
logallrefupdates = true
|
|
||||||
ignorecase = true
|
|
||||||
precomposeunicode = true
|
|
||||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
|||||||
# git ls-files --others --exclude-from=.git/info/exclude
|
|
||||||
# Lines that start with '#' are comments.
|
|
||||||
# For a project mostly in C, the following would be a good set of
|
|
||||||
# exclude patterns (uncomment them if you want to use them):
|
|
||||||
# *.[oa]
|
|
||||||
# *~
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
0000000000000000000000000000000000000000 6557c92612d3b35979bd426d429255b3bf9fab74 zach rice <zricer@protonmail.com> 1571923767 -0400 commit (initial): commit 1 with secrets
|
|
||||||
6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice <zricer@protonmail.com> 1571925818 -0400 commit: comment
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
0000000000000000000000000000000000000000 6557c92612d3b35979bd426d429255b3bf9fab74 zach rice <zricer@protonmail.com> 1571923767 -0400 commit (initial): commit 1 with secrets
|
|
||||||
6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice <zricer@protonmail.com> 1571925818 -0400 commit: comment
|
|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
-3
@@ -1,3 +0,0 @@
|
|||||||
xMŽO‚@Ĺ;ď§č`‘%:XjE ˘<Éş;�¤»°ł~űĚ
|
|
||||||
z§÷`~ďMVęFţ´Ó…P�ŇnÜHZ"�•-xIL”Eca™¶Ú÷>±Ç ‘Cľă¶®«,�¬)TNŔéżČm7
|
|
||||||
]U¨$JŻ%ů“R.Ąw¬ÓBÎś`łÖ‡q|÷űIt␍vÇmôÝy_6ďŮ?¨!ć‹0Šb´ťÔW\>ε9ć …ęr:-†Aň+a}Ć^K§N$
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
xuPMOÃ0åÚüŠGV1lc.LEB`†Ä¸!Miç*a]R5!þ;N‡øââÄö{ÏÏÎ+—ãìôt§³;Ì�z-:¢ƒKzQ«º"hç–ðEcê€à°RKÂÚ\‰zí5\Œ³~À¬™¦/š7Ì~Ú‘‡ªª_h|PMÀÆ�næªXf]Rv�†ž¨ßTVÙh²Ì$ÈmSþÔ„ñÑׂ�D+dUÎþƒæF\âˆ%Z}VJ{²n¨ßPAæ™ä@S"�è[Èôz2›ß=Üß̧w³Éôv~5}¸�IÁ¬HLv,’�nu"C¦F¢_ÅÏ?¼dáD’гª 9¬){üeÆŠ/,Ó$axZòu ƒgm
|
|
||||||
‹(·jÏòc•~Üøé[+Ñ9ÈÞ%.öN"s<æ¸=àVéÅŒâ¯
|
|
||||||
~L–îïbÔãþÂY¥eMª$
|
|
||||||
Loaded 100 of 524 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user