Compare commits

..
1114 Commits
Author SHA1 Message Date
Bryan Beverly 5f6ec56cfa Merge pull request #2283 from gitleaks/dependabot/github_actions/actions-b1afc76d04
build(deps): bump the actions group across 1 directory with 4 updates
2026-10-23 15:44:59 -05:00
dependabot[bot] 4695bdb828 build(deps): bump the actions group across 1 directory with 4 updates
Bumps the actions group with 4 updates in the / directory: [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/login-action](https://github.com/docker/login-action) and [docker/build-push-action](https://github.com/docker/build-push-action).


Updates `docker/setup-qemu-action` from 4.2.0 to 4.4.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/96fe6ef7f33517b61c61be40b68a1882f3264fb8...99012661954931238ded8c8b007157a8430204e1)

Updates `docker/setup-buildx-action` from 4.2.0 to 4.4.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/bb05f3f5519dd87d3ba754cc423b652a5edd6d2c...f87e5991a6d7451dcb8d9637bfbc97413f497069)

Updates `docker/login-action` from 4.4.0 to 4.6.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/af1e73f918a031802d376d3c8bbc3fe56130a9b0...dbcb813823bdd20940b903addbd779551569679f)

Updates `docker/build-push-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-23 04:13:59 +00:00
Bryan Beverly b58d3f102c Merge pull request #2197 from gitleaks/dependabot/github_actions/actions-26c4f860fb
build(deps): bump the actions group with 2 updates
2026-07-22 09:50:33 -07:00
dependabot[bot] e18d0da14b build(deps): bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-go](https://github.com/actions/setup-go).


Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1)

Updates `actions/setup-go` from 6.5.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/924ae3a1cded613372ab5595356fb5720e22ba16...b7ad1dad31e06c5925ef5d2fc7ad053ef454303e)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-go
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-22 04:15:03 +00:00
Bryan Beverly c33331503a Merge pull request #2189 from gitleaks/dependabot/github_actions/actions-c4a6c7cd8e
build(deps): bump the actions group with 5 updates
2026-07-20 09:05:23 -07:00
dependabot[bot] d68f282a94 build(deps): bump the actions group with 5 updates
Bumps the actions group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `4.1.0` | `4.2.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.1.0` | `4.2.0` |
| [docker/login-action](https://github.com/docker/login-action) | `4.2.0` | `4.4.0` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `6.1.0` | `6.2.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `7.2.0` | `7.3.0` |


Updates `docker/setup-qemu-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/06116385d9baf250c9f4dcb4858b16962ea869c3...96fe6ef7f33517b61c61be40b68a1882f3264fb8)

Updates `docker/setup-buildx-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5...bb05f3f5519dd87d3ba754cc423b652a5edd6d2c)

Updates `docker/login-action` from 4.2.0 to 4.4.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/650006c6eb7dba73a995cc03b0b2d7f5ca915bee...af1e73f918a031802d376d3c8bbc3fe56130a9b0)

Updates `docker/metadata-action` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9...dc802804100637a589fabce1cb79ff13a1411302)

Updates `docker/build-push-action` from 7.2.0 to 7.3.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/f9f3042f7e2789586610d6e8b85c8f03e5195baf...53b7df96c91f9c12dcc8a07bcb9ccacbed38856a)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/metadata-action
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/build-push-action
  dependency-version: 7.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-08 04:13:09 +00:00
Bryan Beverly 4c232b5014 Merge pull request #2179 from gitleaks/dependabot/github_actions/actions-9e904a7c11
build(deps): bump the actions group with 2 updates
2026-07-01 16:33:03 -07:00
dependabot[bot] 652f743b43 build(deps): bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-go](https://github.com/actions/setup-go).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

Updates `actions/setup-go` from 6.4.0 to 6.5.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/4a3601121dd01d1626a1e23e37211e3254c1c06c...924ae3a1cded613372ab5595356fb5720e22ba16)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-go
  dependency-version: 6.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 04:11:57 +00:00
Bryan Beverly 8ad8470035 Merge pull request #2157 from gitleaks/dependabot/github_actions/actions-6a98abd9ac
build(deps): bump actions/checkout from 6.0.2 to 6.0.3 in the actions group
2026-06-13 10:33:47 -07:00
dependabot[bot] ad138e213f build(deps): bump actions/checkout in the actions group
Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-04 01:09:53 +00:00
Bryan Beverly 81fc7f93b7 Merge pull request #2142 from gitleaks/dependabot/github_actions/actions-738cee76bf
build(deps): bump the actions group across 1 directory with 5 updates
2026-06-01 13:05:36 -07:00
Bryan Beverly c63f9c6f61 Merge pull request #2146 from gitleaks/dependabot/go_modules/github.com/mholt/archives-0.1.5
build(deps): bump github.com/mholt/archives from 0.1.2 to 0.1.5
2026-06-01 13:02:10 -07:00
dependabot[bot] dfcab34362 build(deps): bump the actions group across 1 directory with 5 updates
Bumps the actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3.7.0` | `4.1.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.12.0` | `4.1.0` |
| [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.2.0` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `5.10.0` | `6.1.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.19.2` | `7.2.0` |



Updates `docker/setup-qemu-action` from 3.7.0 to 4.1.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/c7c53464625b32c7a7e944ae62b3e17d2b600130...06116385d9baf250c9f4dcb4858b16962ea869c3)

Updates `docker/setup-buildx-action` from 3.12.0 to 4.1.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/8d2750c68a42422c14e847fe6c8ac0403b4cbd6f...d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5)

Updates `docker/login-action` from 3.7.0 to 4.2.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/c94ce9fb468520275223c153574b00df6fe4bcc9...650006c6eb7dba73a995cc03b0b2d7f5ca915bee)

Updates `docker/metadata-action` from 5.10.0 to 6.1.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/c299e40c65443455700f0fdfc63efafe5b349051...80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9)

Updates `docker/build-push-action` from 6.19.2 to 7.2.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/10e90e3645eae34f1e60eeb005ba3a3d33f178e8...f9f3042f7e2789586610d6e8b85c8f03e5195baf)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.2.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/metadata-action
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-01 19:30:12 +00:00
dependabot[bot] d8fafb2396 build(deps): bump github.com/mholt/archives from 0.1.2 to 0.1.5
Bumps [github.com/mholt/archives](https://github.com/mholt/archives) from 0.1.2 to 0.1.5.
- [Release notes](https://github.com/mholt/archives/releases)
- [Commits](https://github.com/mholt/archives/compare/v0.1.2...v0.1.5)

---
updated-dependencies:
- dependency-name: github.com/mholt/archives
  dependency-version: 0.1.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-01 19:30:09 +00:00
Bryan Beverly 5454f7bdec Merge pull request #2138 from gitleaks/chore/supply-chain-hardening 2026-05-31 18:30:34 -07:00
Bryan Beverly 7900fbae49 Merge pull request #2137 from gitleaks/chore/node24-bumps 2026-05-31 18:28:39 -07:00
Bryan BeverlyandCursor 2719f0e001 trigger CI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 15:59:09 -07:00
Bryan BeverlyandCursor 9ea08626dc trigger CI after enabling Actions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 15:53:58 -07:00
Bryan BeverlyandCursor 22e600ebe3 trigger CI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 15:45:47 -07:00
Bryan BeverlyandCursor 1207d58159 chore: supply-chain hardening
- Add CODEOWNERS with default owner and release-critical path protection
- Add SECURITY.md with vulnerability disclosure policy
- Add .github/dependabot.yml for Go modules + GitHub Actions updates

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 15:35:44 -07:00
Bryan BeverlyandCursor db3bc42b83 chore: bump GitHub Actions to Node 24
- gitleaks.yml: gitleaks-action v2 -> v3 (Node 24)
- test.yml: setup-go v5 -> v6
- release.yml: Docker actions to latest (setup-qemu v3,
  setup-buildx v3, login v3, metadata v5, build-push v6)
- Add version comments to all SHA-pinned references

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 15:34:47 -07:00
Zachary Rice 80093b8a7b Update Readme 2026-05-21 07:29:43 -05:00
Zachary Rice 9febafb621 broken link
Removed Gitleaks Playground badge and link from README.
2026-05-13 08:53:48 -05:00
Zachary Rice b5cb8ad01b Update README.md
Removed GitHub Action section from README.md.
2026-05-13 08:53:02 -05:00
Zachary Rice 8863af47d6 bruh (#2067) 2026-03-25 08:57:43 -05:00
Zachary Rice 67fcd836b3 Update README.md 2026-03-20 21:23:42 -05:00
Fatih Çelik 8d1f98c796 Removed unnecessary functions from report template (#2040) 2026-02-21 07:30:12 -06:00
Zachary Rice ca20267a84 its the simple things (#2020) 2026-01-08 14:48:47 -06:00
Richard Gomez b66ac75e4f build: switch to Go 1.24 (#2002) 2025-12-09 09:15:58 -06:00
Zachary Rice 6eaad03960 0 to 5 - notes on recursive decoding (#1994) 2025-11-26 10:25:37 -06:00
Chris 09242ce9c8 Add new Looker client ID and client secret rules (#1947) 2025-11-20 09:12:31 -06:00
Samuel Gaist c98e5e0d27 feat: add Airtable Personnal Access Token detection (#1952) 2025-11-20 08:29:19 -06:00
4ed0ca4902 build: upgrade Go & alpine version (#1989)
Co-authored-by: Michel Tu <michel.tu@databricks.com>
Co-authored-by: Jiri Stary <72435227+Jiri-Stary@users.noreply.github.com>
2025-11-20 07:29:50 -06:00
Zach fb5d707e08 thats a paddlin 2025-11-19 15:11:04 -06:00
Richard Gomez 50493dbe1f feat: document stdout report path (#1990) 2025-11-17 10:57:25 -06:00
bplaxco ed65b65095 Add trace log for skipped archive file when not enabled (#1961)
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
2025-10-24 12:30:33 -05:00
bplaxco c5ccbb9468 Respect contexts with timeouts (#1948)
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
2025-10-24 12:30:13 -05:00
Zachary Rice 3821f30b06 Config min version (#1955)
* init

* minVersion set

* sigh

* addressed some comments, fixed double validate bug
2025-10-16 13:53:00 -05:00
Richard Gomez d22371873b fix(config): validate rules when [extend] is used (#1592) 2025-10-16 10:54:59 -05:00
Darran BoydandDarran Boyd 87d96295d6 feat: add Amazon Bedrock API key detection (#1935)
Co-authored-by: Darran Boyd <drboyd@example.com>
2025-09-25 07:35:30 -05:00
Zachary Rice 228396b37b Add GitHub Sponsors section and Discord link
Updated README to add GitHub Sponsors section and reintroduced Discord link.
2025-09-16 19:00:16 -05:00
Bruno Guimarães a82bc53d89 feat: improve regex to detect Sonar tokens with prefixes (#1931)
Since Sonar 9.5, a prefix was added to the tokens.

See: https://www.sonarsource.com/products/sonarqube/whats-new/sonarqube-9-5/
2025-08-14 12:49:28 -05:00
Zachary Rice 4fb43823ef cant count 2025-07-20 11:14:25 -05:00
Zachary Rice b1c9c7ecbe Composite rules (#1905)
* composite rules

* add test config

* tests

* taking care of some pr comments

* naming
2025-07-20 11:13:38 -05:00
Hasnain Lakhani 72977e41b6 feat: add Anthropic API key detection (#1910)
Add detection rules for Anthropic API keys:
- anthropic-api-key: detects sk-ant-api03-... keys
- anthropic-admin-api-key: detects sk-ant-admin01-... keys

Both key types follow the pattern sk-ant-{type}-{93 chars}AA
and are detected as separate rules to align with gitleaks
patterns for multi-token providers.

The base regex patterns are aligned with what TruffleHog uses here: https://github.com/trufflesecurity/trufflehog/blob/main/pkg/detectors/anthropic/anthropic.go
2025-07-15 09:21:58 -05:00
Richard Gomez 7b02c98eb4 fix(git): handle port (#1912)
This fixes #1911
2025-07-14 19:00:48 -05:00
Zachary Rice 2a7bcffd7c dont prematurely calculate fragment newlines (#1909) 2025-07-08 20:48:55 -05:00
Richard Gomez bd79c3eaca feat(allowlist): promote optimizations (#1908) 2025-07-08 19:34:24 -05:00
Christophe Goessen 7fb4eda723 Fix: CVEs on go and go crypto (#1868)
* fix(CVE-2025-22871): update go to 1.23.8

* fix(CVE-2025-22869): update go crypto to 0.35.0
2025-07-08 09:13:33 -05:00
Christophe Goessen a044b815b3 feat: add artifactory reference token and api key detection (#1906)
* feat: add artifactory reference token and api key detection

* fix: match word boundary, add false positive tests

* fix: increase minimum entropy and fix tests
2025-07-07 20:11:05 -05:00
Zachary Rice bf380d4767 silly 2025-07-07 20:10:18 -05:00
Zachary Rice f487f85378 Update gitleaks.yml 2025-06-16 09:37:32 -05:00
Zach 958f55ac62 add just like that, no leaks 2025-06-08 19:51:04 -05:00
Zach c7acf33d96 Merge branch 'master' of github.com:gitleaks/gitleaks 2025-06-08 19:31:25 -05:00
Richard Gomez 9faaa4a09c Add experimental allowlist optimizations (#1731)
* feat(allowlist): optimization experiments

* refactor(allowlist): remove useOptimizations flag

* refactor(allowlist): simplify Validate() with helper func

* refactor(config): replace global feature flag
2025-06-08 10:33:05 -05:00
Lisa LinandRichard Gomez 79068b35e5 Detect Notion Public API Keys #1889 (#1890)
* add notion api rule

* Update cmd/generate/config/rules/notion.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Update cmd/generate/config/rules/notion.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* change gitleaks toml

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-06-08 07:07:00 -05:00
Zach 80468eff1d Merge branch 'master' of github.com:gitleaks/gitleaks 2025-06-07 20:53:32 -05:00
Richard Gomez ef8223700a fix(atlassian): reduce false-positives for v1 pattern (#1892) 2025-06-07 20:33:34 -05:00
bplaxco 2463f11e71 Fix log suppresion issue (#1887)
The check for log suppresion enables archive scanning by default with no
max depth.
2025-06-05 08:26:06 -05:00
Kashif Khan 6f251eef65 Added Heroku API Key New Version (#1883)
* Added Heroku API Key New Version

* updated rule
2025-06-04 19:47:19 -05:00
Tilo Brueckner 20f9a1d4eb Add Platform Bitbucket (#1886) 2025-06-04 19:46:01 -05:00
Tilo Brueckner 722ce8213a Add Platform Gitea (#1884) 2025-06-04 09:15:06 -05:00
Zach 79780b884d Merge branch 'master' of github.com:gitleaks/gitleaks 2025-06-02 10:22:51 -05:00
Zachary Rice c5683ca6a3 prevent default warn message when max-archive-depth not set (#1881) 2025-06-01 12:10:45 -05:00
Zach 0357c3cbf6 prevent default warn message when max-archive-depth not set 2025-06-01 12:07:47 -05:00
bplaxcoandAlex Layne 782f310478 Archive support (#1872)
* Start Files Source

* Keep cmd the same for now

* Get tests to pass

* s.MaxTargetMegaBytes -> s.MaxFileSize

* Tweak some log messages & use q semgroup for files

* Just call yield inside the semgroup

* Refactor a check and revert some log lines

* Move mg && misc tuning

* Add `make profile`

(Benchmark results are only added if tools are installed)

Example output:

```
========================================================================
generating profile data
------------------------------------------------------------------------
- mode: dir
  benchmark:
    tool: hyperfine
    path: profile/1748019612/dir/benchmark.json
    results:
      mean: 1.12852930166
      stddev: 0.12163775966037399
      median: 1.07242928416
      user: 3.9699382799999996
      system: 0.04382341999999999
      min: 1.03207673016
      max: 1.3913475181600001
  profile:
    - mode: cpu
      path: profile/1748019612/dir/cpu.pprof
      view: go tool pprof -http=localhost: ./gitleaks profile/1748019612/dir/cpu.pprof
    - mode: mem
      path: profile/1748019612/dir/mem.pprof
      view: go tool pprof -http=localhost: ./gitleaks profile/1748019612/dir/mem.pprof
    - mode: trace
      path: profile/1748019612/dir/trace.out
      view: go tool trace profile/1748019612/dir/trace.out
- mode: git
  ...snip...
```

* Archive support for File based sources

* Move Git to Source interface

* Scan archives in git

* Misc linter fixes

* Exclude certain diffs: --diff-filter=tuxdb

* Add git archives tests

* Log error instead of fatal

* Fix spacing in test config

* Refine source comments/wording

* Make MB conversions more readable

* Format cmd

* Adjust DetectSource logging

* MiB -> MB in logs

* Add testdata/repos/archives/dotGit/refs/.gitkeep

Without it the refs folder gets deleted and the
and then it isn't detected as a git repo ¯\_(ツ)_/¯

So then the test starts scanning the whole gitleaks
repo instead :D

* Handle finding links for archives

* Working on archive depth

* Fixes from failfast test

* cmd max-archive-depth

* added comments, fixed warnings

* removed test print

* Update README.md

* Set archive depth for DetectFiles

* Tweak logs & pass max archive for readers

* Pass ctx to Fragments

* Add make lint target and address some issues

* Fix compat issue

* Report path in fragment errors

* Apply PR suggestions & misc changes

- Update blobReader.Close() to discard the buffer
- Misc logger issues & uses
- Tweak .golangci.yaml to default to none
- Discard remaining blobReader data on close
- Undo a De Morgan's Law suggestion (and disable QF1001)

* Add http mode for diagnostics

gitleaks --diagnostics=http ...
-----

From the net/http/pprof docs:

Use the pprof tool to look at the heap profile:
```
go tool pprof http://localhost:6060/debug/pprof/heap
```

Or to look at a 30-second CPU profile:
```
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
```

Or to look at the goroutine blocking profile, after calling runtime.SetBlockProfileRate in your program:
```
go tool pprof http://localhost:6060/debug/pprof/block
```

Or to look at the holders of contended mutexes, after calling runtime.SetMutexProfileFraction in your program:
```
go tool pprof http://localhost:6060/debug/pprof/mutex
```

(For more info see https://pkg.go.dev/net/http/pprof)

---------

Co-authored-by: Alex Layne <alayne@redhat.com>
2025-06-01 11:29:34 -05:00
Zachary Rice 489d13c14e Update README.md 2025-05-31 14:12:05 -05:00
bplaxco d29ee55171 Reduce aws-access-token false positives (#1876)
* Adjust aws-access-token regex

AWS Access Key IDs are [base32 encoded][1] so the numerical values here
will [only be 2-7][2]

[1]: https://medium.com/@TalBeerySec/a-short-note-on-aws-key-id-f88cc4317489
[2]: https://en.wikipedia.org/wiki/Base32#Base_32_Encoding_with_Extended_Hex_Alphabet_per_%C2%A77:~:text=It%20uses%20an%20alphabet%20of%20A%E2%80%93Z%2C%20followed%20by%202%E2%80%937

* Update config/gitleaks.toml during build and test

Summary:

- Add `config/gitleaks.toml` make target
- Make it a dep of `build` and `test`
- Update CONTRIBUTING.md to reference the new target

Reason: Makes dev easier because you can just tweak the code and run
`make test` without an extra step.

* Resolve lint issues in cmd/diagnostics.go

```
$ golangci-lint run cmd/
cmd/diagnostics.go:128:10: Error return value of `f.Close` is not checked (errcheck)
                f.Close()
                       ^
cmd/diagnostics.go:191:10: Error return value of `f.Close` is not checked (errcheck)
                f.Close()
                       ^
2 issues:
* errcheck: 2
```
2025-05-27 09:37:52 -05:00
Jordan Bradford 611db6579b Set pass_filenames to false for Docker hook (#1850) 2025-05-15 13:07:29 -05:00
Zachary Rice 0589ae0298 unicode decoding (#1854) 2025-05-14 10:14:31 -05:00
Zachary Rice 82f7e32b71 Diagnostics (#1856)
* init diagnostics

* update usage readme
2025-05-13 09:22:20 -05:00
Richard Gomez f97a9ee872 chore: include decoder in debug log (#1853) 2025-05-12 21:54:55 -05:00
bplaxco 78eebaca9d Percent/URL Decoding Support (#1831)
* Add initial percent decoding support

* Refactor multi encoding support

* Add detect tests to confirm positions

* Avoid a few extra passes during decoding

* Do multiple passes for finding encodings re

* Fix issue with overlapping encodings when doing separate passes
2025-05-12 11:22:36 -05:00
Richard Gomez 6f967cad68 fix(kubernetes): remove slow element from pat (#1848) 2025-05-02 20:16:30 -05:00
Richard Gomez 88f56d3695 feat: identify slow file (#1479) 2025-05-01 07:39:13 -05:00
Zach 9609928c02 rm 1password detect test since we test it in cfg gen 2025-04-30 09:57:28 -05:00
Jordan BradfordandRichard Gomez 23cb69fba4 feat(rules): Add 1Password secret key detection (#1834)
* Add `1password-secret-key` detection

* Document key details

* Update cmd/generate/config/rules/1password.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Generate new `.toml`

* Use `GenerateSampleSecrets` to test more scenarios

* Comment lowercase `fps`

* Decrease entropy

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-04-30 09:30:58 -05:00
Richard Gomez d1c77598da fix(detect): test all allowlists (#1845) 2025-04-30 08:29:57 -05:00
Richard Gomez 4451b455f3 feat(config): define multiple global allowlists (#1777) 2025-04-29 08:49:04 -05:00
7fb21a4e61 feat(rules): Add Perplexity AI API key detection (#1825)
* feat(rules): Add Perplexity AI API key detection

* Fix generation

* Fix imports

* Update cmd/generate/config/rules/perplexity.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Update cmd/generate/config/rules/perplexity.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Update cmd/generate/config/rules/perplexity.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Adjust regex, add imports

* Generate config

---------

Co-authored-by: vno <vno@serity.io>
Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-04-28 14:06:48 -05:00
Richard Gomez f6193bc92c feat(gcp): increase rule entropy (#1840) 2025-04-26 19:28:32 -05:00
San Tran 9bc725786d Adding clickhouse scanner (#1826)
* Adding clickhouse scanner

* removing mention of aws as i used it as template
2025-04-16 16:10:47 -05:00
Richard Gomez b6cc71aa3a fix(baseline): work with --redact (#1741) 2025-04-13 09:40:15 -05:00
Richard Gomez cfdeb0d7e0 feat(rule): validate & sort rule when generating (#1817) 2025-04-12 10:09:19 -05:00
NicholasandNicholas Wittstruck 107a41827b Add support for GitLab Runner Tokens (Routable) (#1820)
This commit adds support for GitLabs routable runner tokens.

For the specification see:
https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/routable_tokens/#proposal

Issue: https://github.com/gitleaks/gitleaks/issues/1819

Co-authored-by: Nicholas Wittstruck <1283061+nwittstruck@users.noreply.github.com>
2025-04-09 09:35:56 -05:00
Yann Lacroix 7fac002325 bump repo version in pre-commit example (#1815) 2025-04-06 19:32:32 -05:00
bplaxco 4b541044e8 Fix currentLine out of bounds error (#1810)
Because `segment.adjustMatchIndex(matchIndex)` was above
`segment.lineEndIndex(currentRaw, matchIndex[1]-matchIndex[0])` there
were cases where it would cause an out of bounds error.

This change resolves the issue by just assuming the whole segment is a
opaque chunk of text and starts at the boundaries of the segment instead
so that the order doesn't matter as much.

The other option would have been to reorder the assignments and add
tests to account for that case, but I figured this option is less likely
to have gotchas when working with different encoding formats at the
potential expense of getting an extra line or two if an encoding format
in the future ever allows multiple lines of encoded content to be
considered a single segment.
2025-04-02 20:10:47 -05:00
Joost Voskuil af7d5bcb83 add support for Azure DevOps platform in SCM detection and link (#1807)
* feat: add support for Azure DevOps platform in SCM detection and link generation

* feat: add support for visualstudio.com in Azure DevOps platform detection

* feat: consolidate Azure DevOps platform detection for dev.azure.com and visualstudio.com
2025-03-31 08:38:08 -05:00
mmpnelson 3e8cd2d1ab Add MaxMind license key rule (#1771)
* Add MaxMind license key rule

* Address review feedback for MaxMind license key rule
2025-03-29 08:42:16 -05:00
Tomás Ralph ddcc75371f implement new openai regex pattern (#1780)
* implement new openai regex pattern

* implement key in config generation

* support admin keys, support 58 char length keys

* add examples to tp slice
2025-03-27 17:48:57 -05:00
Thomas Nilsson 9708e65c25 A first attempt adding hooks.slack.com/triggers/ (#1792)
As described in issue 1791, the hooks.slack.com/triggers should perhaps
also be detected.

Reference
https://slack.com/help/articles/360041352714-Build-a-workflow--Create-a-workflow-that-starts-outside-of-Slack

Feel free to use, change any part of this proposed fix, or to simply
discard it.

(ps. I did a minor typo in a comment in issue 1791, proposing this
change but that was corrected here. ds.)
2025-03-27 13:50:19 -05:00
Richard Gomez 198e41051e feat(generic): tweak false-positives (#1803) 2025-03-24 08:14:46 -05:00
Richard Gomez e273a970a4 chore: tweak logging and readme for GITLEAKS_CONFIG_TOML feature (#1802) 2025-03-22 13:03:09 -05:00
Roger MeierandRichard Gomez a503b583ba feat: add option to set config from env var with toml content (#1662)
* feat: add option to set config from env var with toml content

* Update README.md

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* fix: check if config provided by GITLEAKS_CONFIG_TOML can be loaded

* docs: move load configuration section to have it before configuration

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-03-22 10:03:52 -05:00
Zach d5c275d6b2 me dumbass 2025-03-22 07:04:57 -05:00
Zachary Rice 5361c7c917 mhm (#1801) 2025-03-22 06:50:51 -05:00
Tom Payne 6cc0e386ac feat(regexp): use standard regexp by default, make go-re2 opt-in (#1798) 2025-03-20 19:48:18 -05:00
Zachary Rice b4df42364d Update README.md 2025-03-17 19:26:18 -05:00
Jesse Portnoy 4344b00934 Readme badge revisions (#1744)
* - Added badges:
    * Go docs
    * Go report card
    * License
- Replaced HTML code for badges with Markdown

* Amend CI badge
2025-03-17 16:08:57 -05:00
Zach f74ced7985 ignore 2025-03-12 20:30:06 -05:00
Zachary Rice c08cb1dc9a Fix decoded line allowlist (#1788)
* fix

* B patch

* buh bye
2025-03-12 20:16:16 -05:00
Nikolas Grottendieck 991a940412 Prevent Yocto/BitBake false positives with generic-api-key rule (#1783)
* fix: make config template work when providing non-iota values for MatchCondition

https://pkg.go.dev/text/template#hdr-Actions

> {{with pipeline}} T1 {{end}}
>	If the value of the pipeline is empty, no output is generated;
>	otherwise, dot is set to the value of the pipeline and T1 is
>	executed.

Within the `with` block `.MatchCondition` is implicit and must be omitted to
work. The fault/bug was not triggered before because this is the first
non-default MatchCondition apparently.

* feat: exclude false positive matches for Yocto/Bitbake from generic-api-key rule

Fixes #1775
2025-03-11 09:58:56 -05:00
Richard Gomez ade376ab77 feat(generic): ignore csrf-tokens (#1779) 2025-03-06 19:32:36 -06:00
Zach 1c81ae02fa leet and myspace 2025-03-02 21:00:13 -06:00
Zach e9b93c6033 report templates 2025-03-02 20:41:52 -06:00
Zachary Rice de105fca6d smdh 2025-03-02 20:25:21 -06:00
Richard Gomez a3be7222a6 feat(report): infer format from file extension (#1776) 2025-03-01 10:33:08 -06:00
Zachary Rice b44958220e Merge branch 'master' of github.com:gitleaks/gitleaks 2025-02-26 12:07:01 -06:00
Zachary Rice 2f6b9f72d1 tech influencer larp 2025-02-26 12:06:52 -06:00
Richard Gomez 3fdc9c13d2 build: upgrade rs/zerolog, spf13/cobra, and spf13/viper (#1769)
This eliminates golang.org/x/text@v0.3.0 from the dependency chain, which is associated with a critical CVE that can cause Gitleaks to be flagged in regulated environments.
2025-02-24 08:50:31 -06:00
Christophe GoessenandChristophe Goessen 96b92c3d07 fix: upgrade x/crypto to 0.31.0 to get rid of CVE-2024-45337 (#1768)
Co-authored-by: Christophe Goessen <christophe@gssn.net>
2025-02-24 08:42:05 -06:00
bplaxco f6a7439306 Make AddFindings public (#1767)
- Rename d.addFindings -> d.AddFindings
- Add d.Findings()

To allow other tools using d.Detect() to leverage the code in
AddFindings
2025-02-24 08:28:06 -06:00
Richard Gomez 59fdd904af fix(cmd): parse platform in detect (#1765) 2025-02-20 11:32:47 -06:00
Richard Gomez c2afd56bbe Make paths and fingerprints platform-agnostic (#1622)
* test: windows

* fix: make paths platform-agnostic

this change also fixes, or skips, windows failures
2025-02-19 19:36:42 -06:00
Ricardo Zandonai 818e32f7a4 Add Sonar rule (#1756) 2025-02-19 08:02:35 -06:00
Richard Gomez 3fa5a3a954 Minor false positive improvements (#1758)
* feat(generic): add 'keypress' to allowlist

* feat(privatekey): ignore empty/impossible matches

* feat(config): ignore 'secrets' that are file paths

* fix(sentry): handle special character at end
Prevent common test error of 'Failed to Validate. True positive was not detected by regex.' because the generated value didn't play nicely with word boundary.
2025-02-19 07:46:09 -06:00
ahrav 2020e6a9ab Add support for streaming DetectReader (#1760) 2025-02-19 07:38:34 -06:00
Daniel Bos 9122a2d359 chore: Update github.com/wasilibs/go-re2 to v1.9.0 (#1763)
Fixes #1751
2025-02-19 05:15:04 -06:00
Roger Meier 398d0c46dd docs: describe extended rules take precedence over base rules (#1563)
Closes #1384
2025-02-11 07:53:00 -06:00
Richard Gomez ae26eff464 feat(git): disable link generation (#1748)
Add an option to disable link creation. If there are any weird edge cases, it shouldn't block scanning
2025-02-10 13:15:44 -06:00
Kashif KhanandRichard Gomez c6424a6fc3 added sourcegraph token rule (#1736)
* added sourcegraph token rule

* updated ruleid

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* added more true positive test cases

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-01-31 09:34:37 -06:00
Richard Gomez 6411402d43 feat(config): add rule for .p12 files (#1738) 2025-01-31 09:33:38 -06:00
Jan-Otto Kröpke d71d95d65e add deno.lock to default exclusions (#1740)
* add deno.lock to default exclusions

* Update config.go
2025-01-31 09:32:41 -06:00
Daniel Grimm 3188ad6005 Don't exit with error if git repacking is required (#1711)
Repacking writes a message to stderr but is not problematic. It is
required quite often when using shallow/treeless clones, which is common
in CI/CD environments. Fixes #1168.
2025-01-28 19:58:15 -06:00
Richard Gomez 7fc11bb264 refactor(config): use non-capture groups for allowlists (#1735)
Non-capture groups appear to be measurably faster.
2025-01-28 19:54:20 -06:00
Aris Zagakos 36c52c6b73 chore: Enhance curl-auth-user to detect empty usernames or passwords (#1726) 2025-01-27 08:49:40 -06:00
Richard Gomez 1f323d8b69 fix(cmd): read log-opts before GitLogCmd (#1730) 2025-01-27 08:41:33 -06:00
Zachary Rice d88bc094f7 facebook keyword 2025-01-22 19:15:25 -06:00
Richard Gomez 3fdaefdaa3 fix(meraki): restrict keyword case (#1722) 2025-01-22 10:25:45 -06:00
Richard Gomez f3ae52e138 feat(generic-api-key): detect base64 (#1598) 2025-01-22 09:27:45 -06:00
Zachary Rice d6a828a530 great branch name (#1721)
* great branch name

* update test
2025-01-21 19:52:05 -06:00
Richard Gomez d2ffffecbd fix(git): remove .git suffix for links (#1716) 2025-01-21 19:17:26 -06:00
Richard Gomez a43dc0d3d0 chore: refine generic-api-key fps + trace logging (#1720) 2025-01-21 08:29:24 -06:00
Richard Gomez 69ed20e25e fix(generate): move newline out of char range (#1719) 2025-01-21 08:25:27 -06:00
Zachary Rice 52b895a603 newline literal (#1718) 2025-01-20 21:37:19 -06:00
Richard Gomez 3f4d91fc22 build: support either stdlib or 3rd-party regexp (#1706) 2025-01-20 10:45:31 -06:00
Richard Gomez 049f5b2435 chore(detect): update trace logging (#1713) 2025-01-20 09:30:59 -06:00
Richard Gomez 7a6183dab0 feat(git): redact passwords from remote URL (#1709) 2025-01-19 15:17:07 -06:00
Richard Gomez 3c7f3f0e08 feat(git): include link in report (#1698) 2025-01-19 14:03:57 -06:00
Richard Gomez 0e3f4f7abb chore: reduce generic-api-key fps (#1707)
Based on scanning ziglang/zig and oven-sh/bun
2025-01-19 07:37:39 -06:00
Zach 3ed85671a4 blorp 2025-01-17 19:24:22 -06:00
Kashif KhanandRichard Gomez e977850ab4 added new rule for cisco meraki api key (#1700)
* added new rule for cisco meraki cloud api key

* Updated style preference

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* updated keywords

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Added entropy

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* resolved comments

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-01-17 19:17:49 -06:00
Richard Gomez ad7a4fb4ea feat: general fp tweaks (#1703) 2025-01-17 19:13:33 -06:00
Richard Gomez b2cf03c7e3 chore(generate): use \x60 instead of literal (#1702) 2025-01-17 09:37:50 -06:00
Ben-grmbl a3f623cc69 chore(regex): simplify secretPrefix, suffix (#1620)
combined character ranges,
removed duplicates in same character range,
replaced \x060 with literal `
combined \s with \r\n
2025-01-15 18:21:44 -06:00
William Bille Meyling cc71bb1e9a update version for pre-commit in README.md (#1699) 2025-01-15 15:12:07 -06:00
Roger Meier 7bad9f7654 chore(gcp): add firebase example keys to the gcp-api-key allowlists (#1635) 2025-01-15 06:47:08 -06:00
Richard Gomez 977236cb5f fix: unaligned 64-bit atomic operation panic (#1696) 2025-01-15 06:45:37 -06:00
Zach a211b1601f force push to master everyday 2025-01-14 19:14:21 -06:00
Richard Gomez 0e5f644b67 feat(config): disable extended rule (#1535) 2025-01-14 18:52:57 -06:00
Piotr Idzik f320a60e6f style: prevent globbing and word splitting (#1543) 2025-01-14 16:42:07 -06:00
Richard Gomez c4526b2c55 refactor(generic-api-key): remove hard-coded 'magic' (#1600) 2025-01-13 19:57:25 -06:00
Richard Gomez 748076d976 chore(generate): add failing test case (#1690) 2025-01-13 10:21:29 -06:00
Richard Gomez db8e5e672e feat(generate): use multiple allowlists (#1691) 2025-01-13 08:49:12 -06:00
Richard Gomez 973c794cf0 chore(rules): include fps in reference (#1471) 2025-01-13 08:40:20 -06:00
rmdwe f0d4499064 Add comma as operator for GenerateSemiGenericRegex (#1679)
* feat: add comma as operator for GenerateSemiGenericRegex

* test: fix tests.
2025-01-13 08:21:45 -06:00
Richard Gomez ab38a46986 refactor: central logger (#1692) 2025-01-13 08:09:22 -06:00
Zachary Rice b022d1c856 friendship ended with tines 2025-01-02 10:24:13 -06:00
almaz045andAlmaz Vakhitov b69b5157a0 Entropy trace (#1659)
* I do an entropy check earlier than the others and add the info to the trace

Maybe I'm wrong, but it seems to me that if the regex allowlist is large, it's easier to first check for entropy, since we won't have to go through all these regexes. Plus, we need to check entropy anyway.
Additionally, when using -l trace, there was no information that the find was missed precisely because of entropy. Now it will be shown

* adding info into trace about entropy

* Fixed name of variables

---------

Co-authored-by: Almaz Vakhitov <a.vakhitov@vk.team>
2024-12-30 10:15:51 -06:00
Richard Gomez 7357adca5e build: add 'toolchain' to go.mod (#1682) 2024-12-30 10:08:24 -06:00
Richard Gomez 4c3da6ebb7 refactor(detect): create readUntilSafeBoundary + add tests (#1676) 2024-12-28 15:14:49 -06:00
Zachary Rice dbe3746455 twitter really does suck ass now 2024-12-28 10:22:25 -06:00
Ben-grmbl 7edfc6b5d5 chore(tests): test cases for generate.go (#1623)
GenerateSemiGenericRegex,
GenerateUniqueTokenRegex

to clarify and document current behavior
2024-12-20 20:55:10 -06:00
Richard Gomez efe40cae39 fix: only use non-empty secret groups (#1632) 2024-12-20 20:53:44 -06:00
Richard Gomez 7cb5f6f64c build: upgrade sprig v2->v3 (#1674) 2024-12-20 19:44:18 -06:00
Kenichi Kamiya 2930537190 fix: generate report file even if no findings (#1673) 2024-12-20 10:17:23 -06:00
ahrav a91c6717a0 replace std library regex engine with go-re2 (#1669) 2024-12-20 09:53:01 -06:00
David Mateo 906085fba6 Update golang version to 1.23 (#1672)
Because go mod 1.23 has been updated, the golang image needs it too
2024-12-20 08:38:11 -06:00
Zach d0ba52e2be bump go in dockerfile 2024-12-20 05:54:52 -06:00
Zachary Rice 8a8306288e log bytes (#1670) 2024-12-20 05:46:25 -06:00
Zach a9e6d8c9a7 go mod 1.23 2024-12-19 09:27:43 -06:00
Craig SmithandCraig Smith 2f73a3e3cf Ensure keywords are downcased (#1633)
* Ensure keywords are downcased

* Update tests

* Remove unnecessary code

* Add msg to test expectation

* Update the keywords as we iterate through them

* Remove unnecessary to lower

---------

Co-authored-by: Craig Smith <5344211-craigmsmith@users.noreply.gitlab.com>
2024-12-19 09:22:03 -06:00
Bert Coppens f6966057f5 feat: add settlemint api keys detection (#1663)
* feat: add settlemint api keys detection

* fix regex creation

* use GenerateUniqueTokenRegex

* trigger ci

* ensure tokens have min length of 12

* ensure to set minLength on settlemint token pattern

* set base entropy for settlemint detectors

* update settlemint token regexes to be more precise
2024-12-13 09:18:30 -06:00
Richard Gomez 0bf13fc25a feat(dir): better chunking (#1665) 2024-12-12 10:27:27 -06:00
Richard Gomez 83e99bacf1 feat(report): allow user-defined templates (#1650) 2024-12-10 18:56:11 -06:00
e393d299bc Add support for GitLab routable tokens (#1656)
* Add support for GitLab routable tokens #1655

This commit adds support for GitLabs routable tokens.

For the specification see:
https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/routable_tokens/#proposal

Issue: https://github.com/gitleaks/gitleaks/issues/1655

* Add support for GitLab routable tokens #1655

This commit adds increases the entropy.

For the specification see:
https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/routable_tokens/#proposal

Issue: https://github.com/gitleaks/gitleaks/issues/1655

* add word boundary to regex

Co-authored-by: Ben-grmbl <173737458+Ben-grmbl@users.noreply.github.com>

* chore: re-generate gitleaks.toml

Co-authored-by: Ben-grmbl <173737458+Ben-grmbl@users.noreply.github.com>

---------

Co-authored-by: Nicholas Wittstruck <1283061+nwittstruck@users.noreply.github.com>
Co-authored-by: Ben-grmbl <173737458+Ben-grmbl@users.noreply.github.com>
2024-12-06 07:41:41 -06:00
naveen 263ce82365 Add freemius secret key detection (#1611) 2024-12-05 10:37:53 -06:00
Richard Gomez 3c0e068b69 fix(kubernetes): only match 'kind: secret' (#1649) 2024-12-05 10:22:34 -06:00
Bryce Thuilot f3adda07ca feat: use STDOUT when report file not specified (#1642)
* feat: use STDOUT when report file not specified

Signed-off-by: Bryce Thuilot <bryce@thuilot.io>

* fix: update tests

Signed-off-by: Bryce Thuilot <bryce@thuilot.io>

* fix: use only '-' for stdout report

Signed-off-by: Bryce Thuilot <bryce@thuilot.io>

---------

Signed-off-by: Bryce Thuilot <bryce@thuilot.io>
2024-12-05 09:44:07 -06:00
Richard Gomez ed205a5f63 fix(dir): skip opening file&dir if allowlist matches (#1653) 2024-12-05 08:35:42 -06:00
Richard Gomez 6018012b7e fix: increase chunk size 10kb -> 100kb (#1652) 2024-12-01 19:42:40 -06:00
Ben-grmbl 7f77987d91 feat: detect sentry.io tokens in the new format (#1640)
sntrys_..., sntryu_...
2024-11-19 09:46:19 -06:00
Adam Moss 48a2e0e318 refactor: pre-commit hooks (#1627)
Signed-off-by: Adam Moss <2951486+adam-moss@users.noreply.github.com>
2024-11-05 12:05:21 -06:00
Ben-grmbl 4e303d0284 fix(easypost): only detect tokens of correct length (#1628) 2024-11-05 11:50:41 -06:00
Richard Gomez c1add1d268 feat(dir): continue on permission error (#1621) 2024-11-05 07:58:36 -06:00
amanda-friesen 202106a190 Add human readable description for curl rules (#1625)
Provides more context to the user than the base rule name.
2024-11-05 07:40:29 -06:00
Taiki Ono 8e94f98e92 Add option to include Line field in report (#1616)
Signed-off-by: Taiki Ono <taiki@finatext.com>
2024-10-31 15:51:53 -05:00
Zach dbb42a727d hm 2024-10-31 08:35:55 -05:00
Zachary Rice 259946000b Update README.md 2024-10-31 08:31:50 -05:00
Zachary Rice 8ffb980ee5 nop for stupid build 2024-10-31 08:30:57 -05:00
Oscar BlancoandRichard Gomez 4181ad647a Add new jira api token pattern (#1601)
* add new jira api token pattern

* Apply suggestions from code review

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* apply comments from PR

* Apply suggestions from code review

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* apply comments from PR

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2024-10-31 08:19:05 -05:00
Richard Gomez 48ea14bd47 feat: update global & generic allowlist (#1618) 2024-10-30 19:23:23 -05:00
81f0002845 fix(vault-service-token): ensure that TPS contains digits (#1614)
* fix(vault-service-token): ensure that TPS contains digits

Chances of randomly generating a 24 letter string without digits:
P = ( (26+26) / (26+26+10) ) ^ 24 = 1.46 %

* fixt

---------

Co-authored-by: Zachary Rice <zricer@protonmail.com>
Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-10-30 15:49:06 -05:00
Richard Gomez c11adc91ad Generate comprehensive secret samples (#1484)
* feat(config): comprehensive samples

* refactor(config): use new generate func

* chore(config): comment unsupported cases

* feat(config): enable '?=' case

* feat(config): enable '+=' case

* feat(config): enable escaped json case

* feat(config): enable '<' (xml) case

* feat(config): enable multiline yaml case

* chore(config): add comment case

* feat(config): add php cases

* feat(config): add java case

* chore(config): address review comments

* fix(config): prevent matching '=='

* feat(config): add URL cases

* chore(config): revert regex changes
To be tackled in separate PRs.
2024-10-30 09:34:21 -05:00
Ben-grmbl d1d9054ef0 fix(aws): detect token in url (#1615) 2024-10-30 08:21:14 -05:00
Ben-grmbl 5fe58bf0b0 fix(rules): entropy, uppercase in samples (#1593)
`go generate` was slightly flaky,
since the example true positive secrets for these rules
did not include uppercase letters
and/or the min entropy was just barely too high
2024-10-29 16:33:09 -05:00
Richard Gomez 5c2e8132f2 feat: tweak rules (#1608) 2024-10-29 01:47:12 -05:00
Richard Gomez 43fae355e6 feat(rules): create Octopus Deploy api key (#1602) 2024-10-28 08:25:25 -05:00
Ben-grmbl a158e4fc15 fix(aws-access-token): only match if correct length (#1584)
Previously, the rule matched for any long string
containing e.g. ASIA, ACCA somewhere,
as long as the next 16 chars were also uppercase letters.

This change checks for word boundaries before and after the secret.

Also the prefix (AKIA|ASIA|...) was moved from the non-capturing group
into the secret matching group,
since it is part of the token

fix(aws-access-token): non-capture for prefix

Review findings https://github.com/gitleaks/gitleaks/pull/1584/files#r1807793907
2024-10-28 08:19:48 -05:00
Richard Gomez b6e0eeeb0a fix(config): ignore jquery/swagger w/o version (#1607) 2024-10-28 08:18:42 -05:00
Roger Meier 722e7d8e73 feat: add new GitLab tokens (#1560)
Closes #1401
2024-10-28 08:15:36 -05:00
Richard Gomez 961f2e674f feat(generic-api-key): tune false positives (#1606) 2024-10-27 19:24:06 -05:00
Zachary Rice e734fcf01d Create .gitleaks.toml (#1605) 2024-10-27 08:01:40 -05:00
Richard Gomez 7206d6bc56 feat(curl): tweak tps and fps (#1603) 2024-10-27 07:43:55 -05:00
Richard Gomez 2db25f1367 feat(config): ignore swagger-ui assets (#1604)
also, ignore public known checkmarx secret
2024-10-27 07:43:14 -05:00
Ben-grmbl e97695b852 feat(generic-api-key): exclude keywords (#1587)
* fix(config.tmpl) missing \n for rules with regexes AND stopwords

patch provided by rgmx

fix(config.tmpl) omit `condition=OR`

* feat(generic-api-key): exclude keywords

prevent matching the rule generic-api-key on e.g.
- public_key
- api_version
- client_id
- client_name
- keyword
- monkey

feat(generic-api-key): review findings

- combine capture groups
- remove mapKey from allowList

fix(generic): make monkey, donkey, case-sensitive

avoids matching on e.g. pokemonKey=

* feat(generic) remove client, add credential

exclude more composite words with key
2024-10-25 15:26:00 -05:00
Richard Gomez 0afb525e59 feat(okta): bump entropy to 4 (#1599) 2024-10-25 08:00:59 -05:00
Richard Gomez 2068870c8d feat: update global allowlist (#1597) 2024-10-24 08:17:27 -05:00
Richard Gomez 8cf93b9ad5 refactor(allowlist): deduplicate commits & keywords (#1596) 2024-10-24 07:28:55 -05:00
Richard Gomez 50c2818167 feat(config): ignore jquery static assets (#1595) 2024-10-23 07:30:48 -05:00
Richard Gomez 455ae0aab7 More rule fixes (#1586)
* feat: tweak more rules

* fix(curl): update pattern & ignore more stuff

* chore: update .gitleaksignore
2024-10-22 08:23:47 -05:00
Richard Gomez 5407c44e0c chore: log skipped symlinks (#1591) 2024-10-22 08:23:10 -05:00
Richard Gomez d03d6c401b feat: match left side of identifier (#1585) 2024-10-20 09:38:18 -05:00
Zach 851c11ab1a what secrets? 2024-10-19 19:58:07 -05:00
Richard Gomez 8cfa6b2e43 fix(rules): add entropy (#1580) 2024-10-19 19:49:36 -05:00
Richard Gomez 9152eaa57a feat(aws): add entropy & allowlist (#1582) 2024-10-19 19:47:45 -05:00
Richard Gomez 93acc6e82a feat(rules): add 1password token (#1583) 2024-10-19 19:47:07 -05:00
Richard Gomez 83a57244cd feat(config): add curl header rule (#1576) 2024-10-18 20:06:31 -05:00
Richard Gomez cf5334fd61 feat: add curl basic auth rule (#1575) 2024-10-17 19:15:30 -05:00
ReRetriever d07b394b08 Update spelling in README.md (#1574) 2024-10-17 10:53:30 -05:00
Richard Gomez 5c03fa4a3e refactor(allowlist): use iota for condition (#1569) 2024-10-16 14:59:37 -05:00
Richard Gomez 12034a71c5 refactor(config): temporarily switch to [rules.allowlist] (#1573) 2024-10-16 14:49:34 -05:00
Richard Gomez aabe381539 Define multiple allowlists per rule (#1496)
* feat: multiple rule allowlists

* feat(config): add allowlist 'condition'
2024-10-14 19:17:37 -05:00
Richard Gomez 8ea608595c build: upgrade gitleaks/go-gitdiff to v0.9.1 (#1559) 2024-10-13 06:46:44 -05:00
Rebecca Turner be9d0f8930 Fix rule extension (#1556)
* Reimplement the ability to override built-in rules

PR #1524 broke the ability to specify a `[[rules]]` with the same ID as
a built-in rule in order to extend the default configuration.

This PR restores this ability, but merges the provided configuration
with the default rule instead of overwriting the default rule wholesale.

* Add tests

* Append keywords and tags
2024-10-10 16:50:29 -05:00
Richard Gomez 9988e5224c Update base config allowlist (#1555)
* feat(config): add String fmt placeholders

* feat(config): ignore font files

* feat(config): ignore repeated characters
2024-10-10 02:05:16 -05:00
Richard Gomez 8fb39ba8dc feat(azure): detect Azure AD client secrets (#1199) 2024-10-09 06:44:19 -05:00
Richard Gomez 14c924dd02 chore: match gitleaks.toml anywhere (#1553) 2024-10-08 09:39:44 -05:00
Richard Gomez b2fbaeb900 feat(config): add placeholder regexes to global allowlist (#1547) 2024-10-07 07:30:01 -05:00
Richard Gomez 00bb82153e feat: add PrivateAI rule (#1548) 2024-10-06 07:28:47 -05:00
Jannik Hollenbach 445abe356b Bump golang verion used in docker build to match version specified in go.mod (#1551)
Signed-off-by: Jannik Hollenbach <jannik.hollenbach@owasp.org>
2024-10-06 06:48:00 -05:00
Richard Gomez 1a2f656278 feat: add cohere rule (#1549) 2024-10-04 19:39:53 -05:00
Richard Gomez 82d737d851 feat(generate): generate global (#1546) 2024-10-04 10:28:34 -05:00
Roger Meier f6e549901c Feat/nuget config password rule (#1540)
* feat: add new rule nuget-config-password

* docs: correct function names within CONTRIBUTING.md
2024-10-04 08:19:15 -05:00
bplaxco bf8a49fc29 Make private key check less greedy and include fifth dash (#1440)
* Make private key check less greedy and include fifth dash

* Remove trailing space
2024-10-03 09:50:15 -05:00
Zach 9c354f51c3 print tags if they exist 2024-10-02 20:06:31 -05:00
bplaxcoandRichard Gomez 2278a2a97e Decode Base64 (#1488)
* Support base64 decoding during scans

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Add failing tests for the case when the match starts outside the decoded value

* Align locations for overlapping, encoded matches

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Add --max-decode-depth flag and update README help output

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Move keywords off of fragment

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Fix comment typo

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Refactor how keywords are used in detect

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Clarify comments and rename method to match

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Improve performance

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Fix issues after rebase

Only adjust matchIndex to fix the following line issue when not working
with encoded segments since they handle adjusting the index themselves.

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Update detect/decoder.go

Don't escape characters that don't need escaping

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Update flag help text

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

* Add meta data tags from decoding

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2024-10-02 19:33:55 -05:00
Richard Gomez c5b15c9d74 refactor(config): keyword map (#1538) 2024-09-30 07:32:25 -05:00
Roger Meier a971a324fa fix: use regexTarget for extend config (#1536)
* fix: use regexTarget for extend config

* fix: add keywords from base and extended rule into global keywords list

* docs: add an example to extend default rules

* chore: update project URL references
2024-09-29 15:45:56 -05:00
Roger Meier a0f2f4671c feat: bump go to 1.22 (#1537)
support for 1.19 ended, see https://endoflife.date/go
2024-09-29 11:59:46 -05:00
Richard Gomez 4e8d7d3790 fix: handle pre-commit and staged (#1533) 2024-09-27 19:11:48 -05:00
recreator66 f8dcd838da Bugfix/1352 incorrect report multiple lines (#1501)
* fix: add logic to modify endline & endcolumn

* doc: update comment for #1352

* test: adding test file

* chore: updating generic rule

* test: adding test to TestFromFile #1352 & change static viper ConfigName

* chore: remove interim fix for #1352

* fix: adjust matchIndex[1] to fix #1352

* test: adjust expectedFinding in TestFromFiles

* chore: go fmt

* test: rm identification of start/endlineIndex

* fix: rm unused fmt pkg
2024-09-27 09:41:26 -05:00
Richard Gomez ed19c4e8b4 fix(config): extend allowlist & handle extend when validating (#1524) 2024-09-25 08:20:19 -05:00
Richard Gomez 989ef19fb0 refactor(kubernetes-secret): tweak variable chars (#1520) 2024-09-25 08:02:15 -05:00
Richard Gomez 191eb43841 Revert "remove validate config test temporarily" (#1529)
* Revert "remove validate config test temporarily"

This reverts commit 1a6d2b0a7a.

* style: fix lint error
2024-09-25 08:01:26 -05:00
Richard Gomez 78f7d3f5df feat: create fly.io rule (#1528) 2024-09-24 16:09:15 -05:00
Roger Meier 7098f6d958 fix: to many false-positive for gltf files, add gltf suffix to allowlist (#1527)
Closes #1526
2024-09-24 08:48:25 -05:00
97dbe1ef09 Add support in .gitleaksignore file comment strings (#1425) (#1502)
* Add support in .gitleaksignore file comment strings  (#1195)

* Apply suggestions from code review

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

---------

Co-authored-by: Zachary Rice <zricezrice@gmail.com>
Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2024-09-18 13:44:44 -05:00
Richard Gomez 9e06824372 Restrict Etsy keywords (#1491)
* feat(etsy): tweak keywords

* fix(etsy): make identifiers case sensitive
The prior commit didn't work because the identifiers are made intentionally case insensitive.
See: https://github.com/gitleaks/gitleaks/blob/4e43d1109303568509596ef5ef576fbdc0509891/cmd/generate/config/utils/generate.go#L35-L37
2024-09-18 10:24:41 -05:00
Richard Gomez db782603f7 feat(github): add entropy to rule (#1489) 2024-09-18 10:23:44 -05:00
Richard Gomez df126a7473 feat(gcp): update api key rule (#1481) 2024-09-18 10:23:18 -05:00
Richard Gomez 75dd70e59a fix(hashicorp): ignore common fps (#1498)
Based on discussion in https://github.com/gitleaks/gitleaks/issues/1490
2024-09-18 10:22:47 -05:00
Richard Gomez 8510d39ffe fix(square): make prefix case sensitive (#1469) 2024-09-18 10:22:25 -05:00
Richard Gomez 3698060a2b refactor(kubernetes-secret): collapse rules and update regex (#1462) 2024-09-18 10:22:10 -05:00
Richard Gomez 128cd22f7c fix(rule): comment out errant validation case (#1509)
This should be re-enabled once a more suitable fix is implemented.
2024-09-16 06:17:26 -05:00
Zachary Rice 1a6d2b0a7a remove validate config test temporarily 2024-09-14 05:49:13 -05:00
Zachary Rice 0874ebcc3f Update README.md 2024-09-14 05:46:28 -05:00
Zachary Rice 9463ffaa5e fix flag access (#1506) 2024-09-14 04:01:27 -05:00
Zachary Rice 44ad62e0b1 Deprecate detect and protect. Add git, dir, stdin (#1504)
* init backwards compatible cmd

* update readme, todos

* ...

* moar comments, sprucing up root

* readme change
2024-09-13 19:44:22 -05:00
Dewan Ishtiaque Ahmed e93a7c0d26 Update Harness rules to add _ and - in the account ID part. (#1503) 2024-09-11 19:48:12 -05:00
Richard Gomez 4e43d11093 chore: fix gl workflow error (#1487) 2024-08-26 17:47:02 -05:00
Richard Gomez bd81872eee Make config generation utils public (#1480)
* chore(generate): make utils public

* chore(generate): change validate log messages

* chore(generate): split functions into files

* chore(config): add warning for public funcs
2024-08-26 13:11:18 -05:00
Richard Gomez 3be7faa1ff Update Hashicorp Vault token pattern (#1483)
* feat(vault): add old pat, tweak new pat

* feat(hashicorp): add entropy to tf rule
2024-08-25 15:19:37 -05:00
Richard Gomez 1aae66d564 feat(config): update rule validation (#1466) 2024-08-22 09:55:44 -05:00
Zachary Rice 6dfcf5e949 Update .gitleaksignore 2024-08-20 06:57:30 -05:00
Richard Gomez f361c5ef71 fix(detect): handle EOF with bytes (#1472) 2024-08-19 14:00:47 -05:00
malmor 8a1ca9ecc9 Added poetry.lock to default allowlist paths (#1474) 2024-08-19 11:47:42 -05:00
Richard Gomez 525c4b4451 refactor(sarif): remove |name| and change |shortDescription| (#1473) 2024-08-19 09:11:31 -05:00
Richard Gomez c0fda4358e Use rule id for config validation error (#1463)
* chore(config): use rule id for error

* feat(config): ensure rule.id is not empty
2024-08-08 15:47:34 -05:00
Richard Gomez d3c4b9078e Use first non-empty group if secretGroup isn't set (#1459)
* feat(detect): secret is first non-empty group

* test: fix errors

- update capture groups
- update expected data
2024-08-07 12:10:05 -05:00
Richard Gomez b4009bfba4 chore: remove unnecessary capture groups (#1460) 2024-08-07 12:09:16 -05:00
Richard Gomez 80bd1779e3 Return non-0 exit code from DetectGit (#1461)
* fix(detect): exit code for git errors

* chore(detect): add consistent error msgs
2024-08-07 10:14:00 -05:00
niklas-w7andniklas.w 0334ec1076 add gradle verification-metadata.xml to global allowlist (#1446)
Co-authored-by: niklas.w <niklas.wissmueller@ext.ibmix.de>
2024-08-05 20:35:54 -05:00
Richard Gomez c1345e1b2b feat(openshift): add user token (#1449) 2024-08-05 20:22:31 -05:00
LeonandZach 7697b3e989 (feat): Adding secret detection rule for Kubernetes secrets (#1454)
* (feat): Adding secret detection rule for Kubernetes secrets

Signed-off-by: localleon <me@lrau.xyz>

* (fix): Limiting kubernetes secret detection only to .yaml/.yml files

Signed-off-by: localleon <me@lrau.xyz>

* (fix): Fixing path validation testing for kubernetes-secret

Signed-off-by: localleon <me@lrau.xyz>

* (fix): refactoring path validation regex for kubernetes secret

* (fix): fixing keyword for kubernetes secret

Signed-off-by: localleon <me@lrau.xyz>

* (fix): fixing config.toml for kubernetes-secret and reording rules/main.go

Signed-off-by: localleon <me@lrau.xyz>

* (feat): Implementing proxmitiy matching for data-key in kubernetes secrets

Signed-off-by: localleon <me@lrau.xyz>

* (fix): Adding regex sugestions for quoted strings and qouted test-cases

* (fix): Updating kubernetes-secret regex to allow '-character before secret e.g if theres quoting

* limit whitespace

---------

Signed-off-by: localleon <me@lrau.xyz>
Co-authored-by: Zach <zricer@protonmail.com>
2024-08-05 20:20:52 -05:00
Zachary Rice 26f34692fa add version to default 2024-06-14 16:48:12 -04:00
AislingHPE bc979deb0f Add go.work and go.work.sum to global allowlist (#1353) 2024-06-14 15:31:04 -04:00
Dewan Ishtiaque AhmedandZachary Rice b899915813 Add harness PAT and SAT rules (#1406)
* Add Harness PAT rule.

* Add support for Harness PAT and SAT.

* Update comment for Harness SAT.

* Consolidate PAT and SAT into Harness API Key

* add ignore and capture group to match

---------

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-06-14 15:30:07 -04:00
Zachary Rice 4c5195b700 Update README.md 2024-06-14 15:22:23 -04:00
becojoandBecojo 02808f45d0 Limit hashicorp-tf-password to .tf/.hcl files (#1420)
* Limit hashicorp-tf-password to .tf/.hcl files

* fix tests

---------

Co-authored-by: Becojo <Becojo@users.noreply.github.com>
2024-06-13 11:23:26 -04:00
Zachary Rice 07e1c30592 rm print 2024-06-13 11:14:44 -04:00
Zachary Rice db63fc1bf4 reduce telegram... todo url and xml for later 2024-06-13 11:14:02 -04:00
Zachary Rice 9a4538c4d6 coderabbit.ai <3 2024-06-13 09:16:17 -04:00
danielap-ma fe94ef9ca3 Add NewRelic insert key detection (#1417) 2024-06-02 18:18:52 -05:00
Toxandtoxyl bb4424d454 Improved Telegram bot token rule regex and added more test cases (#1404)
Co-authored-by: toxyl <tox@novasonica.com>
2024-06-01 18:56:14 -05:00
Alexandre GUIOT--VALENTIN 575e923cf8 Add intra42 client secret (#1408)
intra42 is the intranet and API of "42 School", a CS school.
The API is open to all students in 57 campus around the world.
It is thus often subject to credentials leaks on GitHub
See https://42.fr and https://api.intra.42.fr/
2024-06-01 18:55:04 -05:00
shahar4200 39947b0b0d extend FB access token discovery (#1407)
* extend FB access token discovery

* validate config

* set upper 40

* set upper 40
2024-05-31 15:51:43 -05:00
Baruch Odem (Rothkoff)andBaruch Odem 79cac73f72 tests: scalingo validation consistent test (#1359)
* Refactor Scalingo API token regex and add sample token

* improve docs for allowlist

I didn't know it when I made #1358

---------

Co-authored-by: Baruch Odem <baruch.odem@checkmarx.com>
2024-04-29 13:46:16 -05:00
Baruch Odem (Rothkoff)andBaruch Odem 247f423a39 add real (test) standard and restricted keys (#1375)
Co-authored-by: Baruch Odem <baruch.odem@checkmarx.com>
2024-04-29 13:45:32 -05:00
Baruch Odem (Rothkoff)andBaruch Odem 821b232394 Add Cloudflare API and Origin CA keys (#1374)
* add real heroku example

* Add Cloudflare API and Origin CA keys

---------

Co-authored-by: Baruch Odem <baruch.odem@checkmarx.com>
2024-04-29 13:44:19 -05:00
Katrin Leinweber 57ac4b3dc7 Update "contributing guidelines" link (#1390) 2024-04-15 09:13:43 -05:00
Baruch Odem (Rothkoff) db69e8266e add update token from square (#1370) 2024-03-22 13:31:09 -05:00
Baruch Odem (Rothkoff) 4b543280a1 feat: facebook secret, access token, and page access token rules (#1372)
* Add Facebook secret, access token, and page access token rules

* comment
2024-03-22 13:30:42 -05:00
Baruch Odem (Rothkoff) 979f213b93 update mailchimp with new tokens (#1376) 2024-03-22 13:29:59 -05:00
Jarek Porzucek 59c0cc7183 Append ordered rules when extending (#1304) 2024-03-22 11:21:26 -05:00
Baruch Odem (Rothkoff) 6c52f878cc fix: age rule id with dashes (#1349) 2024-02-19 09:26:41 -06:00
dutchhaag 247a5e7214 patching golang.org/x/text for CVE-2021-38561 and CVE-2022-32149 (#1342) 2024-02-15 11:54:47 -06:00
anotherbridge 8d23afd45d Use latest base images. (#1334)
* Use latest images.

* Fix version
2024-02-02 11:29:44 -06:00
João Filipe Silva ac4b5146b0 removed gitleaks user from Dockerfile (#1313) 2024-02-01 08:23:13 -06:00
Kieran Smith 76c9e3175b Remove IAM identifiers for non-credential resources in the aws-access-token rule (#1307)
* Remove IAM identifiers for non-credential resources

Only detects: 
AWS STS service bearer token
Context-specific credential
Access key
Temporary (AWS STS) access key IDs use this prefix, but are unique only in combination with the secret access key and the session token.

* Update gitleaks.toml

* Update testdata

* Update tests
2024-01-31 13:21:53 -06:00
afe046b3b4 Update stripe rule to not alert on publishable keys (#1320)
* Update stripe rule to not alert on publishable keys

* run go gen

---------

Co-authored-by: Erin Browning <ebrowning@makenotion.com>
Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-01-31 13:13:04 -06:00
eyalatox 8b8920d4c3 --max-target-megabytes flag now supported for --no-git flag as well (#1330) 2024-01-24 16:08:05 -06:00
Christian Groschupp a59289ca9b add pre-commit hook gitleaks-system (#1225) 2024-01-10 13:09:00 -06:00
Zachary Rice 870194be13 fix errors when using protect and an external git diff tool (#1318) 2023-12-23 15:52:41 -06:00
Zachary Rice 179c607541 rename filesystem to directory (#1317) 2023-12-22 11:08:00 -06:00
Liron Biam 8de8938ad4 Enhance Secret Descriptions (#1300)
* Enhance secret descriptions in gitleaks.toml

* adjust the rule configuration descriptions

* missing spaces in gitleaks.toml
2023-11-29 17:03:11 -06:00
Zachary Rice ca7aa14542 Small refactor detect and sources (#1297) 2023-11-22 10:37:29 -06:00
Oleksandr Redko 01e60c81e6 chore(config): refactor to go generate; simplify configRules init (#1295) 2023-11-21 19:52:50 -06:00
Zach 54f5f04a1f forgot symlinks 2023-11-19 11:32:10 -06:00
Zachary Rice 221d5c40e7 pretty apparent 'protect' and 'detect' should be merged into one command (#1294) 2023-11-19 11:21:40 -06:00
128b50f67b style: sort the stopwords (#1289)
* style: sort the stopwords

* run cmd

---------

Co-authored-by: Nick Nungester <nick.nungester@acaglobal.com>
Co-authored-by: Zach <zricer@protonmail.com>
2023-11-18 12:28:17 -06:00
Zachary Rice dab7d0292a dont crash on 100gb files pls (#1292) 2023-11-17 14:56:02 -06:00
Zachary Rice e63b657bcf remove secretgroup from default config (#1288)
* remove secretgroup from default config

* update test data and AWS

* leave secretgroup
2023-11-10 12:53:07 -06:00
Baruch Odem (Rothkoff) 20fcf5009f feat: Hashicorp Terraform fields for password (#1237)
* Hashicorp Terraform fields for password
Fixes #1236

* fix duplicate description

* set caseInsensitive
2023-11-09 14:31:16 -06:00
Eng Zer Jun b49667786e perf: avoid allocations with (*regexp.Regexp).MatchString (#1283)
We should use `(*regexp.Regexp).MatchString` instead of
`(*regexp.Regexp).Match([]byte(...))` when matching string to avoid
unnecessary `[]byte` conversions and reduce allocations.

Example benchmark:

var pathRegex = regexp.MustCompile(".*.yaml")

func BenchmarkMatch(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := pathRegex.Match([]byte("./config/deploy.yaml")); !match {
			b.Fail()
		}
	}
}

func BenchmarkMatchString(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := pathRegex.MatchString("./config/deploy.yaml"); !match {
			b.Fail()
		}
	}
}

goos: linux
goarch: amd64
pkg: github.com/zricethezav/gitleaks/v8/detect
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkMatch-16          	 2167712	       657.9 ns/op	      24 B/op	       1 allocs/op
BenchmarkMatchString-16    	 3275372	       324.8 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/zricethezav/gitleaks/v8/detect	3.436s

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-28 16:31:43 -05:00
wayne-snyk a3ab4e8ac5 refactor: more explicit rules (#1280) 2023-10-23 14:11:37 -05:00
Norman Soetbeer bd9a25a379 bugfix: reduce false positives for stripe tokens by using word boundaries in regex (#1278) 2023-10-15 21:41:38 -05:00
Yeonghae Choi 6d0d8b5068 add Infracost API rule (#1273) 2023-10-08 20:44:02 -05:00
Oleksandr Redko 2959fc072c refactor: simplify test asserts (#1271) 2023-10-03 10:38:08 -05:00
Zachary Rice d37b38f2ee Update Makefile 2023-09-22 09:29:19 -05:00
Oleksandr Redko 14b1ca9fd9 refactor: change detect tests to t.Fatal instead of log.Fatal (#1270) 2023-09-20 13:46:35 -05:00
Brandon Welsch d9f86d6123 feat(rules): Add detection for Scalingo API Token (#1262)
* feat(rules): Add detection for Scalingo API Token

* fix(rules): Add boundary on both ends of Scalingo API Token regex to avoid falve positives
2023-09-04 10:20:56 -05:00
Richard Gomez ed34259e9c feat(jwt): detect base64-encoded tokens (#1256) 2023-08-30 10:39:10 -05:00
Savely Krasovsky 0d5e46fecb feat: add --ignore-gitleaks-allow cmd flag (#1260)
* feat: add --ignore-gitleaks-allow cmd flag

* typo: fix
2023-08-30 09:34:59 -05:00
Zachary Rice a82ac29976 switch out libs (#1259) 2023-08-29 12:01:36 -05:00
Savely Krasovsky 0b84afa0fa fix: no-color option should also affect zerolog output (#1242) 2023-08-29 11:17:29 -05:00
Gian Miguel Del Mundo 8976539177 Fixed lineEnd indexing if the match is the whole line (#1223) 2023-08-29 11:09:47 -05:00
FrankandZachary Rice 30c6117aaa feat: Add optional redaction value, default 100 (#1229)
This commit introduces an optional value for the --redact flag, allowing
users to specify the extent of redaction for secrets. The valid range of
values is from 0 (no redaction) to 100 (full redaction).

If no value is provided, the default redaction value is set to 100,
resulting in complete redaction by replacing the secret with the term
'REDACTED'. This preserves the original behavior of the --redact flag.

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2023-08-29 11:03:23 -05:00
Richard Gomez e9135cf0b5 fix(jwt): longer segment lengths (#1214) 2023-08-29 10:54:09 -05:00
Jasper Boeijenga f65f9157ff Added yarn.lock file to default allowlist paths (#1258) 2023-08-29 10:41:03 -05:00
Zachary Rice abfd0f3fdc Update README.md 2023-08-28 13:10:03 -05:00
Richard Gomez 18283bb48e feat(rules): make case insensitivity optional (#1215) 2023-08-24 10:41:52 -05:00
Richard Gomez 9fb36b242d feat(rules): detect Hugging Face access tokens (#1204) 2023-08-24 10:38:19 -05:00
Matjaž Domen Pečan db4bc0fe76 Resolve #1170 - Enable selection of a single rule (#1183)
* Gitleaks issue #1170 - Feature request to add a flag to enable a subset of rules on the command line.

* Added documentation.
2023-08-24 09:56:17 -05:00
Warren Parad 3cbcda20d2 Update authress.go to include alternate form account dash (-) (#1224) 2023-08-24 09:28:39 -05:00
Oleksandr Redko 46c627212c refactor: remove unnecessary removing temp files in tests (#1255) 2023-08-24 09:16:00 -05:00
Oleksandr Redko 963a6976d1 refactor: use os.ReadFile instead of os.Open + io.ReadAll (#1254) 2023-08-23 16:08:38 -05:00
Richard Gomez 163ec21120 fix(sumologic): improve patterns (#1218)
This fixes #1149.
2023-08-23 10:15:20 -05:00
Savely Krasovsky 45266551ba refactor: fix #722 properly (#1250)
* refactor: fix #722 properly

* fix(deps): update go-gitdiff to v0.9.0

* refactor: second attempt

* refactor: better git package api

* fix: add comments
2023-08-22 14:00:33 -05:00
Richard Gomez b1a2ce7296 fix(plaid): include entropy in go definition (#1252) 2023-08-21 09:06:26 -05:00
Richard Gomez 34e67229e6 feat(config): update template logic (#1201) 2023-08-17 12:42:07 -05:00
Samuel Mortenson 61513d6772 Add entropy check to plaid client/secret ID rules (#1213) 2023-08-17 12:41:14 -05:00
Baruch Odem (Rothkoff) f0dcd4d9cf feat: add JFrog API and Identity keys (#1233)
* first commit

* feat: add JFrog API and Identity key
2023-07-17 07:27:15 -05:00
Richard Gomez 06db3b91d7 chore(config): fix inconsistent generated values (#1200) 2023-06-16 11:27:53 -05:00
Zachary Rice 7804d652c0 Revert "Initial set of Azure secrets for #539 (#1079)" (#1197)
This reverts commit 7911ac60d7.
2023-06-15 07:44:13 -05:00
Dimitri VasdekisandJesse Houwing 7911ac60d7 Initial set of Azure secrets for #539 (#1079)
* Initial secret set

* Covered off all rule types in comments

* Finished Azure and Ansible rules

* About to run go run main.go

* Fixed some rules, but tests need work

* Initial secret set for Azure

Needs work - many tests fail

* Fix remaining Azure secrets - but couldn't get XML to work

* Update .gitignore

Co-authored-by: Jesse Houwing <jesse.houwing@gmail.com>

---------

Co-authored-by: Jesse Houwing <jesse.houwing@gmail.com>
2023-06-15 07:23:08 -05:00
Richard Gomez 463d24618f feat(slack): update token regex (#1161) 2023-06-15 07:17:01 -05:00
eyalatox 86197b0848 add tags support for csv and sarif formats (#1176)
* add tags support for csv and sarif formats

* add tests
2023-06-15 07:16:23 -05:00
Ian Moroney 3f894cbafc Fixed docker run command in README.md (#1194)
The docker run command was missing `ghcr.io/` in the image name, which resulted in an error:

Unable to find image 'gitleaks/gitleaks:latest' locally
docker: Error response from daemon: pull access denied for gitleaks/gitleaks, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
2023-06-15 07:15:57 -05:00
Richard GomezandRichard Gomez 7f53b033fe feat: add warning for quoted --log-opts values (#1160)
Co-authored-by: Richard Gomez <richard@rbcrt.com>
2023-06-14 09:26:24 -05:00
Becojo 7dc9ba40a7 Add detection for OpenAI API keys (#1148)
* Add detection for OpenAI API keys

* Remove `sk-` keyword
2023-06-14 09:02:37 -05:00
sergiomarotco c101fa88d2 Add some useless files (#1193)
These files do not contain secrets
2023-06-13 20:12:19 -05:00
Zach 257c703add add tests for commits 2023-06-13 16:07:19 -05:00
Zach b1d59bf890 fix broken vet, format some stuff 2023-06-13 16:05:04 -05:00
Zachary Rice fab4f4e97d Merge branch 'master' of github.com:gitleaks/gitleaks 2023-06-13 13:51:52 -05:00
Zachary Rice 289062acd8 add some gl ignores 2023-06-13 13:51:12 -05:00
Richard Gomez 91ff8f9b70 Ignore all comits when .gitleaksignore fingerprint lacks SHA (#1156)
* fix: .gitleaksignore without sha in fingerprint

* chore: add prior commit to .gitleaksignore
2023-06-13 13:42:51 -05:00
Malte Morgenstern 0dbdde837f Add junit report format (#920)
* add junit report format

* add fingerprint to expected test result to fix tests

* fix expected junit test report
2023-06-13 13:37:32 -05:00
Gaige B Paulsen bc599446dc chore: update deps to fix solaris link (#1159) 2023-06-13 13:27:30 -05:00
wayne-snyk a685551299 Add makefile variable detections (#1191)
* add makefile variable definitions

* update snyk tests

* regenerate config
2023-06-12 08:14:15 -05:00
wayne-snyk ab5fc21e82 Add detection for Snyk tokens (#1190)
* add snyk token

* add snyk token to rules

* s/snyk_token/snyk
2023-06-09 10:08:48 -05:00
Rebecca Turner d6fccc87d3 Add REDACTED to stopwords for generic-api-key rule (#1188) 2023-06-07 13:46:41 -05:00
Paulo Correia 6f75511665 Added option to specify .gitleaksignore path (#1179) 2023-06-05 17:03:26 -05:00
Oleksandr Redko 190ac977be Fix closing file in writeJson and writeSarif (#1187) 2023-06-05 10:43:04 -05:00
Oleksandr Redko 6dbb0c5af5 Simplify tests by using T.TempDir (#1186) 2023-05-30 07:24:59 -05:00
Oleksandr Redko 6705461b33 Fix typos in *.md, comments and logs (#1185) 2023-05-30 07:08:42 -05:00
Zachary Rice 9869eab4c2 Update README.md 2023-05-01 19:01:05 -05:00
Zachary Rice 16f1ec0f1e Update bug_report.md 2023-05-01 17:10:00 -05:00
Zachary Rice 8d80a5a5a2 Adding discord channel to readme 2023-05-01 16:43:06 -05:00
Dariusz Porowski 146f69e51b 🐛 fix(sarif): update report to pass validator (#1167)
* 🐛 fix(sarif): update report to pass validator

* ✅ test(sarif): update sarif report testdata
2023-04-28 14:15:18 -05:00
Richard Gomez 51ca0f89b9 fix(detect): extra secret from group before checking allowlist (#1152) 2023-04-19 11:57:24 -05:00
Richard Gomez 81cf30855c Fix G307 warning: Deferring unsafe method "Close" on type "*os.File" (#1154)
* fix: check potential error from file.Close

* fix(detect): use existing logger
2023-04-19 11:56:08 -05:00
Richard Gomez bd8b145bea fix(detect): avoid panic with verbose flag (#1143)
* fix(detect): avoid panic with verbose flag

* chore: fix minor syntax error

* fix: properly print secret with colour

* fix(detect): use lineEndIdx
2023-04-19 11:55:33 -05:00
Edward Wang 839f114f2b Fix typo (#1142) 2023-04-08 17:56:58 -05:00
Zachary Rice 63c3076ea2 No color (#1136)
* safer out of bounds

* no color option

* readme
2023-03-29 16:56:01 -05:00
Zachary Rice b5a726e96a Update README.md 2023-03-29 14:33:34 -05:00
Zachary Rice 56079dc9ea safer out of bounds (#1135) 2023-03-29 08:37:46 -05:00
Warren Parad 9c6650d14a Add Authress access key format: https://authress.io/knowledge-base/docs/authorization/service-clients/secrets-scanning/ (#1131) 2023-03-28 11:23:34 -05:00
SADIK KUZU 6fa63f41d8 Update pre-commit address and rev tag in README (#1125)
* Update pre-commit address and rev tag in README

* Upgrade actions/checkout@v2 to v3
2023-03-22 10:18:07 -05:00
Zachary Rice fe9fb37c36 Update gitleaks.yml 2023-03-22 10:12:52 -05:00
Zachary Rice c3b7a98911 Update README.md 2023-03-22 09:59:48 -05:00
Zachary Rice 6c4a88c5a4 Update README.md 2023-03-21 08:53:29 -05:00
Zachary Rice 27481a9071 Update .gitleaksignore 2023-03-21 08:52:34 -05:00
Rafael FigueiredoandRafael Figueiredo 9701bf1724 Bufix/1100 protect stagged files (#1121)
* create repo with stagged secrets

* add .gitleaksignore to testdata repo

* fix typo

* add gitleaksignore to detector on protect command

---------

Co-authored-by: Rafael Figueiredo <rfigueiredo@garoa.cloud>
2023-03-21 08:50:34 -05:00
Zach a5b9c24779 remove extra default on source option 2023-03-21 08:08:04 -05:00
sergiomarotco db79d8194f fix README.md !? (#1123) 2023-03-21 08:07:22 -05:00
Florian Greinacher 8a31f4a4be Improve rule descriptions for Stripe and Facebook access tokens (#1119) 2023-03-17 09:50:09 -05:00
Caleb Jasik 6b0c303b26 Add Defined Networking API Tokens (#1096)
Adds detection support for Defined Networking tokens (https://docs.defined.net/guides/automating-host-creation/)

I added a fixture in addition to the generator, I think I may be able to use the `generateUniqueToken` instead of the semi-generic option? Let me know if I should update accordingly.

Remove testing fixture
2023-03-14 14:46:45 -05:00
wolframhaussig 1fb3a77eb8 Update gitleaks.toml (#1116)
Use Word Boundaries for EasyPost Tokens
2023-03-14 11:06:17 -05:00
Zachary Rice 765bcd5854 Update gitleaks.yml (#1117) 2023-03-13 08:35:03 -05:00
Juan C. Mancebo 11c2ad01a4 Add gradle.lockfile to allowlist (#1112) 2023-03-03 10:24:21 -06:00
SADIK KUZU e55d3975ec Update pre-commit rev tag in README (#1108) 2023-03-01 10:55:35 -06:00
Joost Voskuil 2dd9946052 Add pnpm-lock.yaml and Database.refactorlo (#1109) 2023-02-28 15:07:38 -06:00
Zachary Rice 4b5e8e1829 Feat/allowlist regex target (#1107)
* adding regexTarget entry in allowlist

* update readme

* add globalregextarget to check

* update readme
2023-02-26 08:51:59 -06:00
C.J. May 343e69399b ignore package-lock.json (#1076)
* ignore package-lock.json

`package-lock.json` is automatically generated by npm

* add package-lock.json to global allowlist
2023-02-25 08:39:18 -06:00
Sandeep Bhat 0060ab636a Fix typos in README.md and CONTRIBUTING.md (#1090) 2023-02-25 08:38:41 -06:00
raffis 025908808f fix: ignore baseline if path was not relative in source (#1101)
* fix: ignore baseline if path was not relative in source

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>

* test: ignore test secret

---------

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-02-25 08:36:23 -06:00
SADIK KUZU 088f8b8074 Fix H in GitHub and update pre-commit rev tag in README (#1087) 2023-02-02 08:45:54 -06:00
Nejc Habjan afdccad46f Add missing GitLab token patterns (#1077) 2023-01-21 20:03:05 -06:00
very-doge-wowandFabian F Groß e002920355 Fix rule for private keys (#1072)
* refactor: fix rule for private keys

Wouldn't match old keys which have been created with the BLOCK statement at the beginning and end of the key.

* fix: rule for private keys

* fix: missing comma

Co-authored-by: Fabian F Groß <fabian.f.gross@deutschebahn.com>
2023-01-12 08:38:48 -06:00
Zachary Rice d805fb9144 remove color formatting when #1042 is encountered (#1050) 2022-12-01 19:11:44 -06:00
Zachary Rice 391d4d75f6 Update README.md 2022-11-28 09:16:32 -06:00
icecream-monsterandEsther f77493274a adding jwt tokens with padding format "=" (#1031)
* adding jwt tokens with padding format =

* forgot to run go run main.go

* manually putting database.refractorlog back

Co-authored-by: Esther <esther.ay@snaptravel.com>
2022-11-22 15:55:03 -06:00
Zachary Rice 7f229faf12 include default newline pairs when calculating location (#1038)
* include default newline pairs when calculating location
2022-11-20 12:34:38 -06:00
Becojo d0733f96f3 Add rule for fine-grained GitHub PAT (#1026) 2022-11-09 17:02:35 -06:00
Zachary Rice 6ef704f28f Add scanning from a pipe with --pipe (#1012) 2022-10-13 09:08:43 -05:00
Zachary 7cfebca510 add a few fingerprints for test data 2022-10-12 19:34:14 -05:00
Ricky GrassmuckandZachary Rice 6d801ed61c Add support for following symlinks (#1010)
* Add support for following symlinks

* Update detect/detect.go

Co-authored-by: Zachary Rice <zricezrice@gmail.com>

* Update cmd/detect.go

Co-authored-by: Zachary Rice <zricezrice@gmail.com>
2022-10-12 19:28:53 -05:00
sergiomarotco e15ab0dc2a fix bug in readme (#1011)
--max-target-megabytes INT
2022-10-12 09:22:37 -05:00
Zachary Rice c39e7640e2 define log-opts, odd that this wasn't failing before... (#1009) 2022-10-11 07:11:02 -05:00
roma8389 c0caab0355 add --max-target-megabytes : maximum size for a file/blob to be scanned (#1003)
* add --max-target-megabytes : maximum size for a file/blob to be scanned

* add --max-target-megabytes : maximum size for a file/blob to be scanned

* add --max-target-megabytes : maximum size for a file/blob to be scanned

* adjust readme comment

* fix on prem
2022-10-10 16:07:06 -05:00
Zachary Rice 81c92c78ca Update USERS.md 2022-10-10 13:37:56 -05:00
Zachary Rice bf031592b8 Update .gitleaksignore 2022-10-10 08:23:17 -05:00
Zachary Rice acce01f233 Update README.md 2022-10-10 08:22:27 -05:00
Michael Henriksen 2678a54290 Add detection rules for DigitalOcean tokens (#1002)
* Add detection rules for DigitalOcean tokens

* go fmt correction
2022-10-06 08:03:46 -05:00
Furkan Türkal 289b757158 docs: add Trendyol to users (#998) 2022-10-04 07:40:44 -05:00
Carlos Alexandro Becker c02d830494 docs: added goreleaser to user list (#997)
Thanks for gitleaks, its amazing to have it in the pipeline so I can have some extra peace of mind!
2022-10-03 14:10:33 -05:00
Zachary Rice 67b0a29ab6 Update USERS.md (#996) 2022-10-03 08:29:30 -05:00
Zachary Rice f710d680dd Create USERS.md 2022-10-02 16:45:51 -05:00
Joost Voskuil eb2bfe5e16 Exclude dacpac refactorlogs (#990)
Dacpac refactorlogs contains Key's that are false positives. This commit excludes those files.
2022-09-30 07:32:50 -05:00
alexgit2k 55d1da131a Output number of commits at info-level. (#991) 2022-09-28 07:32:24 -05:00
Becojo 177e9f4fc2 Detect Slack Workflow Webhook URLs (#989) 2022-09-27 13:56:48 -05:00
naoki kuroda e93d8cb696 Upgrade go version to 1.19 (#987)
* upgrade go version to 1.19

* upgrade go version to 1.19 in dockerfile and test.yml
2022-09-25 09:06:50 -05:00
Michael Jarvis db43f9a342 Minor cleanup to error handling and logging (#985)
* silence warning about unchecked errors

* go-fmt change to add newline

* Zerolog requires you to always call .Msg()

When logging with zerolog, you need to always end with .Msg(), even if
you just pass an empty string.

If you read the README on https://github.com/rs/zerolog, they write:

> It is very important to note that when using the zerolog
> chaining API, as shown above (log.Info().Msg("hello world"), the
> chain must have either the Msg or Msgf method call. If you
> forget to add either of these, the log will not occur and there
> is no compile time error to alert you of this.

* Create empty slice without literal

* Fix variable / package name collision with literal

instead of having a variable named "config", which collides with the
package name "config", just pass a literal config.Config{} struct to the
function

* Replace call to deprecated ioutil.ReadAll()

Use io.ReadAll() instead

* Check error when closing jsonFile

Make it a warning and log error
2022-09-23 08:06:41 -05:00
Zachary Rice 9b15f0d33e Update README.md 2022-09-21 20:00:02 -05:00
Zachary Rice 817aa7b8d0 Update .gitleaksignore 2022-09-21 10:12:48 -05:00
Zachary Rice 33082a9967 Update README.md 2022-09-21 10:04:51 -05:00
Zane Durkin 7dbfe8db2f Adding quiet mode to silence banner (#852)
* Adding quiet mode to silence banner

* Changing flag description. Adding flag to README

* Updating argument name

* updating variable name to aline with argument

* fixing readme spacing

* Fixing variable name
2022-09-17 12:32:52 -04:00
Alex GoncharovandAlex Goncharov fc98cbf159 Issue #980: Add support for Telegram Bot API Token (#981)
* Issue #980: Add support for Telegram Bot API Token

* Replace test with random bot_id length by tests with fixed one.
Add tests for the corner cases.

Co-authored-by: Alex Goncharov <b4bay@users.noreply.github.com>
2022-09-17 11:26:29 -04:00
Malte Morgenstern 3f0293dab0 add rule for microsoft teams webhooks (#970) 2022-09-16 09:19:59 -05:00
Gawan SchroederandZachary Rice 4f6ee2bcf1 Add baseline (#975)
* Add baseline

* Update doc, add error, move baseline to detect namespace, ignore findings instead of reactively filter them out

* Update detect/detect.go

Co-authored-by: Zachary Rice <zricezrice@gmail.com>

* Update IsNew function (no check on tags - omit finger print check)

* Update README.md

Co-authored-by: Zachary Rice <zricezrice@gmail.com>

* Update examples in readme to make it ensure it's clear that a baseline is indeed a gitleaks report

* Fix test - updated tags doesn't make a finding new

* Add missing err assignment

* Allow scanner to continue without baseline if file is malformed

* Fix typo in comment

* Fix control flow err. (Real life testing)

* Fix wording

* Auto-ignore baseline path
2022-09-16 08:18:31 -05:00
Akash Chandwani 62020539f4 Add pre-commit autoupdate command to README.md (#978) 2022-09-07 08:06:31 -05:00
very-doge-wowandFabian F Groß c8681e4858 refactor: more precise rule for private keys (#930)
* refactor: more precise rule for private keys

The current regex didn't match PGP private keys anymore, since they start with `BEGIN PGP PRIVATE KEY BLOCK` and the `BLOCK` never matched for the existing regex. I've made that part optional so that all strings matching for the current regex will still match for the new regex.

* refactor: more precise rule for private keys

Co-authored-by: Fabian F Groß <fabian.f.gross@deutschebahn.com>
2022-09-05 10:18:44 -05:00
Zachary b93459160a update gitleaksignore 2022-09-04 09:07:32 -05:00
Zachary 8622c39e88 add fingerprint to output 2022-09-04 09:04:53 -05:00
Zachary Rice 96eed6aa0f Pretty output (#973)
pretty output
2022-09-04 08:58:57 -05:00
Akash Chandwani 7d9dd260f4 Update version in readme file (#972) 2022-09-03 07:25:45 -05:00
Zachary Rice e47867d802 ignore empty files (#965) 2022-08-26 09:48:33 -05:00
jmatosgrafana adf512e2ac Add grafana tokens rules (#959)
* Add grafana tokens rules

* Adding upper bound limits to Grafana tokens
2022-08-19 10:43:01 -05:00
Zachary Rice e35cb6707a add prefect and readme rules (#961) 2022-08-19 08:24:15 -05:00
Zachary Rice b6b7cfb6d3 draft: bump gitdiff, add git.Err state, better log messages (#954)
* bump gitdiff, add git.Err state, better log messages

* remove cmd.Start

* forgot to start...
2022-08-16 19:36:25 -05:00
Zachary Rice 1b3f10cb79 Feat/add fingerprint no git (#952)
* no-git support fingerprint support

* updating gitleaksignore w/ no-git false positives

* fix test
2022-08-12 08:08:13 -05:00
Zachary Rice 6748a89bf4 safe file checking (#946) 2022-08-08 14:16:50 -05:00
Zachary Rice 6f6e057042 Update README.md 2022-08-08 11:23:52 -05:00
Zachary Rice b8f236c9b3 Explicit fingerprint (#944) 2022-08-08 07:55:57 -05:00
Zachary c5fc080aa0 add two test findings to gitleaksignore 2022-08-07 13:11:04 -05:00
Zachary Rice 3bace4c735 Feat/ignore finding (#938) 2022-08-07 12:53:58 -05:00
Zachary Rice e890a8e809 add jwt rule (#943)
* add jwt support

* ignore sample secrets
2022-08-06 11:23:23 -05:00
Zachary Rice 49b0b097e4 bump golang test version (#942) 2022-08-06 09:16:16 -05:00
Zachary Rice 31a8e9db7a gitleaks allow docs (#941)
* gitleaks allow docs

* reorder
2022-08-06 08:59:51 -05:00
Malte Morgenstern b1853bd032 Add new rules for vault tokens (#919)
* add new rules for vault tokens

* Configure max length for vault rules
2022-08-03 15:46:46 -05:00
AndrewandAndrew Weiner cd52267113 Feature/add sidekiq rules (#933)
* Add sidekiq rules

* Added two new rules for sidekiq
* Other: Add keywords to square rules per Zach's instructions

* Validate now works, but test suite is failing

* Tests are now passing

* Add Sidekiq Rules: Ran go fmt

* * After resolving conflicts, had to rerun the rule generator to add back the semicolon char
* After running tests, had to fix one line in testdata/expected/report/sarif_simple.sarif

* * Added keywords to simple.toml for sidekiq-sensitive-url so that the rule matches what is in gitleaks.toml

Co-authored-by: Andrew Weiner <aweiner@frontrush.com>
2022-08-03 07:31:40 -05:00
Zachary afc89f91c0 update readme 2022-07-27 18:27:04 -05:00
Zachary 5ae1023aa3 add url for config 2022-07-24 11:57:01 -05:00
Zachary Rice 31650f01e7 Feature: Adding the ability to extend configuration files (#926)
* init

* working on default and path config extensions

* adding trace log level, consolidating some code

* cleaning things up, updating generate package

* fix tests

* formatting

* adding tests for extend

* extend not extends

* formatting

* only allow usedefault or path to be set

* update readme

* add note about allowlists

* more readme, expand env var for path

* actually dont support env var. ez attack
2022-07-24 11:51:50 -05:00
anotherbridgeandAndré Breuer 0d471653b5 Add fix for issue #915 (#916)
Co-authored-by: André Breuer <andre.breuer@ndaal.eu>
2022-07-14 07:20:55 -05:00
Zachary Rice f615d0397d Update README.md 2022-07-12 09:23:53 -05:00
Zachary Rice 40e9172ab3 Update README.md 2022-07-08 17:19:12 -05:00
Zachary Rice 9033132143 Update README.md 2022-07-08 17:07:58 -05:00
Zachary 1fc27eebda adding access to generic rule keywords and identifiers 2022-07-05 15:33:06 -05:00
Craig SmithandCraig Smith f4ddeda433 Fix proper names capitalization (#907)
Co-authored-by: Craig Smith <5344211-craigmsmith@users.noreply.gitlab.com>
2022-07-05 08:26:41 -05:00
Romain Barissat 6210a7e832 Add multi platform build (#897)
Signed-off-by: Romain Barissat <romain-noreply@barissat.com>
2022-07-02 15:28:01 -05:00
Zachary e300b31be5 update twitter rule generation description and id 2022-06-28 06:13:07 -05:00
Zachary 3073e45b0a capitilze twitter description 2022-06-28 06:11:10 -05:00
Zachary d401bd337a Merge branch 'master' of github.com:zricethezav/gitleaks 2022-06-28 06:10:14 -05:00
Zachary 1297b41b10 adding travis ci 2022-06-28 06:10:02 -05:00
Craig SmithandCraig Smith d44cb91306 Fix id and description for twitter tokens (#905)
Co-authored-by: Craig Smith <5344211-craigmsmith@users.noreply.gitlab.com>
2022-06-28 06:09:04 -05:00
Zachary Rice efdc7749df Adding okta, codecov, zendesk, and updating Atlassian's rule to include jira keyword (#904)
* okta

* adding codecov

* add jira to atlassians keywords

* adding zendesk
2022-06-27 20:49:08 -05:00
Zachary Rice e78a22e19c Fix Plaid, add Plaid access token (#903)
* adding airtable and adafruit

* Fix plaid, add plaid-access-token
2022-06-27 18:49:32 -05:00
Zachary Rice 9cc19ec0f8 adding airtable and adafruit (#902) 2022-06-27 18:31:06 -05:00
Zachary 05c165deb2 Fixes accidental type typos while translating rules from validation spreadsheet, adds bittrex rule 2022-06-27 17:03:32 -05:00
Zachary Rice f6a87ca58c Remove ssn allowlist (#898)
* Adding a bunch of new rules, update allowlist to include node_modules and vendor folders, extend helper config functions

* remove ssns from allowlist since default config does not detect ssn
2022-06-27 08:58:00 -05:00
Zachary Rice 73a3cf8afb Adding a bunch of new rules, update allowlist to include node_modules… (#896)
* Adding a bunch of new rules, update allowlist to include node_modules and vendor folders, extend helper config functions

* use func instead of function in stopwords
2022-06-25 11:43:51 -05:00
Zachary Rice d196b83ca6 contributing guidelines first draft (#895)
* contributing guidelines first draft

* update links, add readme note
2022-06-23 17:17:39 -05:00
Alex 35f2ea5da2 Lint python commit script to satisfy PEP8 (#893) 2022-06-21 06:55:43 -05:00
Zachary Rice 70028079b4 Update generate (#892)
* maintain parity with recent changes... need to create rule contributing guidelines

* missed on, ensure uniqueness in rule-id
2022-06-20 14:57:48 -05:00
Zachary Rice c14af5ffdf maintain parity with recent changes... need to create rule contributing guidelines (#891) 2022-06-20 14:14:14 -05:00
Craig SmithandCraig Smith 06b1396a2a Fix duplicate TOML Rules and IDs (#889)
* Remove duplicate rule

* Fix duplicate rule IDs

Co-authored-by: Craig Smith <5344211-craigmsmith@users.noreply.gitlab.com>
2022-06-20 08:49:47 -05:00
Zachary Rice 5d3f247d7d Update README.md 2022-06-16 08:11:20 -05:00
Zachary Rice 404dd8e0c0 Update gitleaks.yml 2022-06-15 17:20:08 -05:00
Zachary Rice 3a1ab48818 Update README.md 2022-06-12 13:25:03 -05:00
Zachary Rice f5c2b636f3 user accounts don't need gitleaks license 2022-06-07 11:48:43 -05:00
Zachary Rice b5ed7ff1b2 Update README.md 2022-06-02 17:47:36 -05:00
Zachary Rice 09007da395 Add gitleaks badge 2022-06-02 17:46:47 -05:00
Zachary Rice d51ce47d86 Create gitleaks.yml (#884) 2022-06-02 17:40:57 -05:00
Zachary Rice 6919447094 add link to gitleaks.io 2022-06-02 17:21:08 -05:00
fooliooandx c3b7932544 fix git unsafe directory (#883)
* fix git unsafe directory

fixes https://github.com/zricethezav/gitleaks/issues/846

* Update Dockerfile

Co-authored-by: x <>
2022-06-02 14:22:03 -05:00
Zachary Rice 82e409a434 Limit newlines regex (#881)
* improve regex to reduce fps with newlines

* remove version from regex and rely on stopwords instead

* add false positive for validation
2022-05-30 12:07:06 -05:00
Zachary 0eb57cbe4d add combo to stopwords, update cmd/generate 2022-05-28 11:47:17 -05:00
Don C. Bigler 3531887941 Fix generic-api-key detected erroneously (zricethezav#877) (#878) 2022-05-28 11:44:49 -05:00
Zachary Rice e9ebde73bc ignore end line when comparing generic rules (#879) 2022-05-28 09:49:27 -05:00
Zachary Rice 469cd22f61 updating generic regex and algoia regex (#875) 2022-05-25 08:00:10 -05:00
SimonGurney 93e72c215d feat: add algolia key support (#866)
* feat: add algolia key support

* feat: add algolia key to generator

* chore: update algolia regex to match gen
2022-05-25 07:39:20 -05:00
Dirkjan Bussink 865478bcdc Improve PlanetScale token detection (#874)
This improves the PlanetScale token detection. It add some flexibility
in length. There is no guarantee that the length is always 43 characters
(in fact, it's very likely to change a bit soon).

Additionally, it adds support for detecting oauth tokens as well.
2022-05-24 22:15:36 -05:00
Zachary Rice d6c0de7c85 Update README.md 2022-05-16 19:08:06 -05:00
Zachary Rice 0266ab8958 Adding JIT Security messages 2022-05-10 11:21:04 -05:00
Zachary Rice 6b7ab73a52 Update README.md 2022-05-02 10:21:40 -05:00
Zachary Rice 61ee7c58cc fix no-git bug (#859) 2022-04-27 21:48:56 -05:00
Zachary Rice ad7509e3b4 Removing private keyword from private key rule (#858) 2022-04-27 07:29:09 -05:00
Zachary Rice a62cc52aba nasty little bug (#853) 2022-04-23 11:18:56 -05:00
Zachary Rice f93e5dc844 adding a ton of stopwords to the generic rule only as that is the loudest rule (#851) 2022-04-21 17:01:21 -05:00
Zachary Rice 8481f0e9cd adding stopwords (#849)
* adding stopwords

* format readme, update default config
2022-04-21 08:31:58 -05:00
Zachary Rice 82f7d61593 Update dockerfile (#848)
* bump alpine and add default safe dir for git

* comment out safe dir fix

* update deps
2022-04-20 18:19:33 -05:00
Zachary Rice a42b32bdf1 fix EOL in secret suffix (#847)
* fix EOL in secret suffix

* allow quoted key value syntax
2022-04-20 17:55:07 -05:00
foolioo 79638b080c unpin docker version in pre-commit hook (#832)
eliminating inconsistency. e.g. for version 8.6.1, pre-commit hooks points to outdated version https://github.com/zricethezav/gitleaks/blob/c33ee3f25215635c0afbb210672779e7efb6f1d2/.pre-commit-hooks.yaml#L10
2022-04-19 21:33:23 -05:00
Zachary Rice 3474c58c9e Generate tps (#845)
* WIP

* simplify tp generation
2022-04-18 21:59:38 -05:00
Zachary Rice d8cd93cabe maybe fix out of bounds (#843) 2022-04-18 14:57:40 -05:00
Zachary Rice 48b79facfa optimize keywords (#841)
* optimize keywords

* use defaults for concurrency again
2022-04-16 17:41:40 -05:00
0xn3va e23f7f58f3 Update detect.go (#839) 2022-04-12 21:44:00 -05:00
Zachary Rice 606bb1a13b Standardize/alphabetize rules, add cmd/generate/config package (#840) 2022-04-12 21:40:48 -05:00
aeongdesu e784980515 fix ghcr.io typo in README.md (#835) 2022-04-08 08:05:06 -05:00
Zachary Rice c33ee3f252 normalize keyword check (#830) 2022-04-06 09:55:36 -05:00
Zachary Rice b0a958f55e Keyword (#825)
* wip keywords optimization

* update readme

* limit concurrency to 4

* update readme
2022-04-05 11:50:50 -05:00
foolioo 237b03af18 doc gitleaks-docker pre-commit hook (#819)
relates to #818
2022-03-29 20:05:28 -05:00
Zach Rice f348991d21 Merge branch 'master' of github.com:zricethezav/gitleaks 2022-03-29 11:54:05 -05:00
Zach Rice e0745adbd2 skip content checks for path only rules 2022-03-29 11:53:48 -05:00
foolioo 1ddc924a67 use official docker image as pre-commit hook (#818)
* use official docker image as pre-commit hook

* Update .pre-commit-hooks.yaml

* Update .pre-commit-hooks.yaml

* Update .pre-commit-hooks.yaml

* Update .pre-commit-hooks.yaml

* Update .pre-commit-hooks.yaml
2022-03-28 17:18:12 -05:00
Zach Rice 0b07625567 remove stopwords from global allowlist 2022-03-28 08:03:16 -05:00
Adam Shannon 0cabbf8ca8 detect: skip binary files with --no-git (#810) 2022-03-22 14:32:47 -05:00
Zachary Rice ba9e089e35 fixing a location off by one edge case for --no-git (#812) 2022-03-22 14:22:46 -05:00
Zachary Rice 31ff8677dd Update README.md 2022-03-21 13:36:29 -05:00
Zachary Rice 3e5e63956e Allow tag (#809)
* gitleaks:allow signature

* readd all tests

* fixing tests
2022-03-19 10:32:04 -05:00
Zachary Rice 57f9bc83d1 Stop words (#808)
* use regex for stopwords

* fix up regex

* rm stopwords
2022-03-19 09:31:38 -05:00
Zachary Rice 6e72472b60 Refactor detect, add entropy to all findings (#804)
Refactor `detect`, add `entropy` to all findings
2022-03-12 11:50:01 -06:00
Isaac Dawson 9326f35380 Escape - character in regex character groups (#802)
* fix char escape

* add test

* fix verbosity in make test
2022-03-07 08:33:06 -06:00
jetexe 19555579c8 adding go mod/sum to ignore (#797) 2022-03-01 10:16:17 -06:00
Greg JohnsonandGreg Johnson 60dd607312 GitLab pats may contain underscores as well as dashes (#794)
* gitlab pats may contain underscores as well as dashes

* include testdata index binary

Co-authored-by: Greg Johnson (codeEmitter) <gjohnson@gitlab.com>
2022-02-28 08:03:09 -06:00
Andrzej Amghar c3b799ec63 ignore k8s apiVersion in generic-api-key pattern (#760) 2022-02-22 17:00:20 -06:00
rui 4b6f4d0de5 build: updates for go1.17 (#769)
* build: remove `GO111MODULE` as it turned on by default

Signed-off-by: Rui Chen <rui@chenrui.dev>

* build: update for go1.17

* run test

Signed-off-by: Rui Chen <rui@chenrui.dev>

* lint: remove unused code
2022-02-22 16:49:45 -06:00
Zachary Rice fbfb3f591e allow non-last-element secret groups (#792) 2022-02-22 16:34:56 -06:00
Zachary Rice b91799aa18 fixing segfault when using a rule with only a path (#791)
* fixing segfault when using a rule with only a path

* DRYing
2022-02-22 15:58:03 -06:00
Luca Regne db1b54bf9f Fix: Typo in LinkedIn id (#789) 2022-02-22 09:49:55 -06:00
Ian Mckay e9529744f8 Fix vendor name casing, Flutterwave typo (#785) 2022-02-19 10:24:47 -06:00
Chris Wolf d1f642a9df Sarif results with empty rules now represents as [] instead of null/nil (#786) 2022-02-19 10:20:35 -06:00
Greg Myers 9261f1c47f Fix typos in README.md (#780)
comand ==> command
awsome ==> awesome
precendence ==> precedence
2022-01-29 12:08:55 -06:00
Zachary Rice 991223abab remove godoc text filtering (#763) 2022-01-07 10:59:51 -06:00
Zachary Rice 801d44a6e4 limit number of goroutines for historic scanning as well (#761) 2022-01-07 08:58:47 -06:00
Zach Rice 44d7d89e19 always write sarif results 2021-12-28 19:13:26 -06:00
Zachary Rice aae23acff3 limit goroutines on file scanning to avoid pegging them cores (#759) 2021-12-21 18:10:29 -06:00
Zachary Rice 705595aaf6 Adding Typeform to sponsorships 2021-12-21 08:26:47 -06:00
Zachary Rice 43ec22429f write a report regardless if leaks are present (#758) 2021-12-17 17:26:14 -06:00
Zachary Rice 36779df3bb stricter ionic regex for less fps (#757) 2021-12-17 10:13:44 -06:00
Zachary Rice 3d3d801729 fixing eof location bug (#756) 2021-12-17 09:49:12 -06:00
Zachary Rice 0f2ffee6f9 Adding Tines sponsorship to readme 2021-12-16 10:39:45 -06:00
Andrzej Amghar f4d37a2c0d fix regexp for aws_key and slack_webhook (#754) 2021-12-16 07:48:18 -06:00
Zachary Rice be5596df1d Update README.md 2021-12-12 13:38:43 -06:00
Zachary Rice e97f26bb5f better asciinema 2021-12-12 13:36:57 -06:00
Zachary Rice ae13c96df8 Update README.md 2021-12-12 13:19:58 -06:00
Zachary Rice d15dfdc387 Update README.md 2021-12-12 13:19:06 -06:00
Zach Rice 631d8dcf03 bump go-gitdiff 2021-12-12 12:23:59 -06:00
Zachary Rice 192b96289f do not fail on git rename warning (#750) 2021-12-12 11:43:03 -06:00
Zachary Rice b8141713e8 add pre-commit instructions (#749) 2021-12-10 18:08:31 -06:00
Zachary Rice 3fedf6f8e7 remove writing default config, introduce GITLEAKS_CONFIG (#746)
* remove writing default config, introduce GITLEAKS_CONFIG

* setting report format default to json, update readme
2021-12-09 09:21:17 -06:00
Zach Rice 6f6ebd454f fix off by one line number for --no-git 2021-12-08 15:04:32 -06:00
Zachary Rice ce42947cae fix deduplication issue caused by clobbered findings (#742)
* fix deduplication issue caused by clobbered findings

* fix index

* remove indexing, slow is better than wrong
2021-12-07 19:11:37 -06:00
Zach Rice 84e285e4ce ignore gitleaks.toml by default 2021-12-06 10:43:21 -06:00
Ben Randall 928c6a6043 Update pre-commit step to run gitleaks checks (#729)
* Fix pre-commit config.

* Debug output

* No debug and use redacted.

* Typo

* Add back staged.

* Update .pre-commit-hooks.yaml

* Update .pre-commit-hooks.yaml
2021-12-03 16:09:05 -06:00
Florian Greinacher 106897fdf0 fix: format dates in log in a portable way (#735)
The output of time.String() depends on the runtime environment and should only be used for debugging.

This commit ensures that a well-defined UTC time is written to the report.
2021-12-03 09:34:57 -06:00
Zachary Rice 98d5648f6e introducing secretGroup, the best group (#734)
* working on deduping

* my eyes... oh god my poor eyes

* more readme

* more readme

* more readme

* more readme and formatting
2021-12-02 20:04:36 -06:00
zricethezav 9358e84588 fix typo in readme 2021-12-02 13:55:43 -06:00
zricethezav 958c18f0b7 fix typo in config help 2021-12-02 13:44:39 -06:00
Zachary Rice 089639e9fb bump go-gitdiff (#731) 2021-12-02 08:29:38 -06:00
Zachary Rice 85afd767f7 Update README.md 2021-12-01 18:38:22 -06:00
Zachary Rice 38006fb93b Update README.md 2021-11-30 14:31:08 -06:00
Zachary Rice 9ae1def963 lil hack to avoid scans 'finishing' when git errors are present (#726) 2021-11-30 12:31:25 -06:00
Zachary Rice 6517900e5a Update README.md 2021-11-30 12:24:10 -06:00
Zachary Rice 5e51da600b use exit code 126 on 'unknown-flag' errors (#723) 2021-11-30 09:47:00 -06:00
Zachary Rice f0b8d26c99 Update README.md 2021-11-27 10:40:00 -06:00
Zachary Rice 1724591029 remove generic api key from default gitleaks config (#719) 2021-11-27 10:01:52 -06:00
Zachary Rice 80d29764a0 add global regex check (#717) 2021-11-25 11:17:03 -06:00
Zachary Rice f498b1d308 Commit debug log (#716)
* adding debug log for number of commits scanned

* change debug text

* readd commitsha
2021-11-25 10:46:47 -06:00
Joost Voskuil 8eabfd614e Update sarif.go (#713)
* Update sarif.go

Provide correct version information for Sarif Reports

* Update test

Set version to correct Sarif version
2021-11-25 10:46:31 -06:00
Zachary Rice 4acd7a3c8d adding logic to ignore gitleaks config during scans (#710) 2021-11-24 20:27:19 -06:00
zricethezav a37822dffd remove --show-pulls from git log 2021-11-24 08:06:13 -06:00
Zachary Rice 1c6b28aa61 removing --simplify-merges and --show-pulls (#707) 2021-11-24 07:30:59 -06:00
Zachary Rice f15b4e408b Update README.md 2021-11-22 14:25:42 -06:00
Zachary Rice d5f9d2b5d2 Update README.md 2021-11-22 14:25:06 -06:00
zricethezav 67a7069bb8 trying again 2021-11-22 12:15:31 -06:00
zricethezav fd5d786538 override version in goreleaser 2021-11-22 12:11:02 -06:00
zricethezav c017b763f3 actually we gonna use git describe for docker build 2021-11-22 11:46:24 -06:00
zricethezav e796458763 remove sorting tags 2021-11-22 11:29:31 -06:00
zricethezav 2a9fbbc64d remove git fetch tag from docker build process, already available 2021-11-22 11:21:55 -06:00
zricethezav d6081d0cc4 actually use github.actor 2021-11-22 11:09:08 -06:00
zricethezav e6c3a495ce hardcode username to avoid redaction in action 2021-11-22 11:07:40 -06:00
Zachary Rice 93f292c3df Introducing v8.0.0 changes (#701)
* Introducing v8.0.0 changes
2021-11-22 10:43:51 -06:00
Ramon 780fb4a8f1 Merge pull request #653 from w0rmr1d3r/document_issue_638
Updating documentation on how to build the docker image (issue #638)
2021-10-28 08:50:04 +02:00
Ramon 0d9ab37ba4 Merge pull request #678 from ihassanyousaf/patch-1
fix possible typo in README.md `leaves` had been written instead of `leaks`
2021-10-28 08:48:52 +02:00
Ramon acffe44440 Merge pull request #658 from w0rmr1d3r/update_pre-commit_example
Update readme
2021-10-28 08:48:37 +02:00
M.Hassan Yousaf 178f78fa14 fix possible typo in README.md 2021-10-27 19:07:21 +02:00
Ramon 1ab1ae0e70 Merge pull request #673 from dirkaholic/fix/issue-672
Update regex for AWS secret key (issue #672)
2021-10-26 15:43:47 +02:00
Dirk Pahl 9f8ca91b8b Adjust AWS secret key rule 2021-10-26 15:09:42 +02:00
Dirk Pahl eec6c5a391 Fix tests with existing AWS secret keys 2021-10-26 13:29:36 +02:00
Dirk Pahl 714c0bef1e Update regex for AWS secret key 2021-10-26 12:35:35 +02:00
Ramon e9b699dda1 Merge branch 'master' of https://github.com/w0rmr1d3r/gitleaks into update_pre-commit_example
 Conflicts:
	README.md
2021-10-19 14:57:53 +02:00
Ramon 5afe59d2fa Merge pull request #662 from lucas-apd/patch-1
ADD_installation_from_bin
2021-10-19 14:54:11 +02:00
Lucas Alcântara 8adf27b1ea Update README.md 2021-10-19 09:50:39 -03:00
Ramon aecd32075e Merge pull request #665 from krsche/feature/fix-typo-in-readme
fix: typo in readme
2021-10-19 09:44:36 +02:00
Fabian Kirschner 290118cbbe fix: typo in readme 2021-10-14 22:12:24 +02:00
Lucas Alcântara d2e1e43a25 ADD_installation_from_bin
ADD_installation_from_bin
2021-10-13 16:41:36 -03:00
Ramon 2161ff358b Merge pull request #654 from nickrussler/master
Bump alpine to v3.14.2
2021-10-11 08:19:22 +02:00
Ramon f338bc584f Merge pull request #558 from AmitHofree/fix_default_config
Removed unnecessary backslashes in default config
2021-10-11 08:17:17 +02:00
Ramon e6a132bf4f Merge pull request #660 from GrahlmanMatthew/master
Fixed bug in extractLine function which was returning incorrect line # …
2021-10-11 08:16:57 +02:00
Ramon 8625cc30db Merge pull request #661 from danielorihuela/fix/loading-csv-reports-in-excel-with-commits-with-new-lines-characters
fix: csv report in excel
2021-10-11 08:16:33 +02:00
Matthew E. Grahlman 7cc3d7e467 Fix for Windows OS 2021-10-10 17:27:45 -04:00
Matthew E. Grahlman b8ff5eec73 Had to re-add testdata/ folder to project in order to get scan tests passing on Windows 2021-10-10 16:40:13 -04:00
Matthew E. Grahlman 36a4871585 Made changes to add support for cross-platform (os) testing as tests would pass on MacOS but no Windows 2021-10-10 16:38:24 -04:00
amith-legit c85ebbb2ba Try to revert index file 2021-10-10 22:51:54 +03:00
amith-legit 3a3e13c3b5 Added EOL to sample file 2021-10-10 22:51:44 +03:00
dani 14a00e1ffd chore: lint code 2021-10-10 12:47:46 +02:00
Ramon bd707fa9c4 fix: csv report in excel 2021-10-10 12:45:35 +02:00
Ramon 5e6b1840df Merge pull request #659 from chenrui333/add-apple-m1-support
build: add apple m1 support
2021-10-10 11:41:37 +02:00
Matthew E. Grahlman d8e3a694f2 Fixed bug in extractLine function which was returning incorrect line # when the line contains multiple vuln types 2021-10-09 10:55:39 -04:00
Rui Chen 05e3462025 build: add apple m1 support
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-10-08 16:53:52 -04:00
AmitHofree b83fe80968 Merge branch 'master' into fix_default_config 2021-10-08 22:26:35 +03:00
Ramon 5db0159c52 update readme 2021-10-08 15:05:34 +02:00
Nick Russler 5f87c4137c Bump alpine to v3.14.2
This alpine release includes fixes for openssl CVE-2021-3711 and CVE-2021-3712
2021-10-04 21:51:59 +02:00
Ramon ea94318ba3 updating documentation on how to build the docker image 2021-10-04 12:48:15 +02:00
Dustin Shimonoanddustin 3128789777 Add clarification in README.md that Go 1.16+ required. (#651)
* fix: fix the multiple scan executions from pre-commit hook

* docs: add clarification note about Go version required\

Ref 646

Co-authored-by: dustin <dustinshimono@gmail.com>
2021-09-30 11:00:21 -05:00
Dustin Shimonoanddustin 270207e5eb fix: fix the multiple scan executions from pre-commit hook (#649)
Co-authored-by: dustin <dustinshimono@gmail.com>
2021-09-30 09:49:09 -05:00
Ramon efe96640fc Merge pull request #645 from b-abderrahmane/patch-1
Fixed minor typo in Readme.md
2021-09-26 18:59:43 +02:00
b-abderrahmane 0137637c2c Fixed typo in Readme.md
Fixed description of main example rule
2021-09-25 11:14:52 +02:00
Zachary Rice 6adc045580 Simplify tests and continue on object not found errors (#633)
* adding files

* init better tests

* add basic .git

* more tests and test data

* nogit, unstaged tests

* removing unused testdata

* adding empty testdata

* rm gitmodules

* fixing tests

* remove with config

* adding with_config

* removing old test_data, updating config tests

* removing hooks in testdata repos
2021-09-09 11:46:31 -05:00
amith-legit 45c898c5ea Added a test for fixed Google and Square config 2021-09-09 11:29:34 +03:00
Ramon 95f8bd0daa Merge pull request #631 from EliSchleifer/elischleifer/fix-readme
Fix README link
2021-09-09 09:54:48 +02:00
Eli Schleifer 2cc2519302 Fix README link
Fix up readme link
2021-09-09 00:06:48 -07:00
amith-legit be13bba64c Merge branch 'master' into fix_default_config 2021-09-09 10:02:53 +03:00
Ramon 7111a698c0 Merge pull request #621 from Ido-DY/master
fix(git-symlink-new-repo): fix handling symbolic links in new git repo
2021-09-08 11:00:58 +02:00
Zachary Rice 8b9092a248 Create README.md 2021-09-07 15:29:56 -05:00
Ramon 0aa05133a9 Merge pull request #627 from w0rmr1d3r/update_documentation
Update documentation
2021-09-07 15:32:37 +02:00
Ramon 2952df5432 update documentation 2021-09-07 08:44:46 +02:00
Zachary Rice 541e26b067 Update FUNDING.yml 2021-09-06 16:51:38 -05:00
Eddie Austinandeddie-northcutt-wfp0 6018a6bb70 No longer generate empty reports (#577)
* return nil when no leaks found and lowercase report format option (#3)

* lowercase format options for consistency

* lowercase report format description

Co-authored-by: eddie-northcutt-wfp0 <eddie.northcutt.wfp0@statefarm.com>
2021-09-06 16:39:50 -05:00
Zachary Rice ca987b3842 Update README.md 2021-09-04 19:27:44 -05:00
Ido Markovitz 67f8d28d7f fix(git-symlink-files): fix handling symbolic links in unstaged changes 2021-09-04 11:10:53 +03:00
Ido-DY f88abe99d7 Merge branch 'zricethezav:master' into master 2021-09-04 10:36:26 +03:00
Zachary Rice 6ddf27c5c3 Fix premature exit for nogit scans, limit goroutines (#619)
* fix premature exit on nogit scan, actually limit concurreny for nogit

* removing files scanned log
2021-09-03 19:32:33 -05:00
Zachary Rice aadd9387b2 Create maintenance.md 2021-09-03 11:01:05 -05:00
Zachary Rice 0fd68c901d GitHub test (#617)
* drop travis

* remove travis

* rename, use example

* typo

* different syntax

* rename to test

* split test and build into two jobs

* add gosec job

* drop gosec for now
2021-09-03 08:41:17 -05:00
zricethezav 17a3943afe bump golang docker version 2021-09-02 14:44:58 -05:00
Zachary Rice abc73e2443 use embed pkg for default config, update deps (#616) 2021-09-02 14:42:14 -05:00
Zachary Rice 3c1751e5c4 Update alpine, use gitleaks user instead of root (#615)
* Updating alpine, use gitleaks user instead of root

* remove comments
2021-09-02 10:21:22 -05:00
Ido-DY a32ef6afc4 fix(git-symlink-commits): fix handling symbolic links in a git repository (#612) 2021-09-02 09:35:38 -05:00
rotem-cider 127df8a6f0 Updated RuleId in Sarif (#613) 2021-09-02 09:34:45 -05:00
Ivan Kalita aa91fd3e5e Fix default twitter rules (#614)
Regexps for default Twitter rules ("Twitter Secret Key" and "Twitter Client
ID") have a small flaw that make the default configuration vulnerable to
some false-positives.

I believe these rules should detect the cases like (SOME_CLIENT_ID should
be longer):
```
"twitter_client_id": "SOME_CLIENT_ID"
```

However, currently the twitter rules also detect the false positives for the
cases like:
```
someObj := twitter.NewObjectWithALongName()
config.Twitter.DomainAccessToken
```

I'm trying to address this issue the similar way it's done for facebook client
ids and AWS secret keys, where the secret is expected to be quoted.
2021-09-02 09:26:01 -05:00
Ido Markovitz c8e97d97f9 fix(git-symlink-commits): fix handling symbolic links in a git repository 2021-08-29 15:02:37 +03:00
Emma Sax 67e3603ba4 Remove --commit-from and --commit-to from docs (#605) 2021-08-20 12:18:27 -05:00
Tomasz Wierzchowski f62617d7a6 Update type in config example (#597) 2021-08-13 08:42:31 -05:00
Zachary Rice 9324184c24 Update README.md 2021-08-13 08:29:42 -05:00
Zachary Rice a80ce0d251 Update README.md 2021-07-29 17:40:34 -05:00
Ramon c1c4a93f98 Fix issue #523 (#561)
* updating documentation regarding issue #523

* improving README.md file
2021-05-10 11:39:09 -05:00
Norman Ziegner e74e6292ee Fix example in leaky-repo.toml (#559)
Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
2021-05-07 09:08:03 -04:00
Tomy Guichard 25c3e92c2a SSH auth: Add custom username support (#536)
* Add support for custom username when using SSH auth
Previously, the user "git" was hard-coded
This commit also adds support for ssh:// URLs

* Add comment to explain username parsing
2021-05-05 12:30:12 -04:00
Zachary Rice 9ab424172d Update README.md 2021-05-05 09:22:56 -04:00
zricethezav 28fd47e170 Bump version for pre-commit 2021-05-05 09:10:47 -04:00
bplaxco 8250e40a75 Include offenderEntropy in the JSON output (#549)
* Pass the entropy data back to the Leak struct

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

~ B'ezrat Hashem ~

* Return negative number when entropy not checked

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

~ B'ezrat Hashem ~

* Make sure to handle range checks properly

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

~ B'zrat Hashem ~

* Add a few doc strings

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

~ B'ezrat Hashem ~

* Update tests and get them to pass

~ B'ezrat Hashem ~

* Remove checked in `.got` files

~ B'ezrat Hashem ~

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

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

~ B'ezrat Hashem ~
2021-05-03 20:22:20 -04:00
AmitHofree f735c9a5c9 Removed unnecessary backslashes 2021-05-02 15:47:05 +03:00
Pavel Shklovsky e7553b0168 Add pre-commit support (#552)
* Add pre-commit support

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

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

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

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

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

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

* Update README.md

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

* Revert accidentally modified files

Co-authored-by: Seb Elttam <seb@elttam.com>
2021-01-21 15:31:21 -05:00
Paweł Kowalczyk 8be91eea5d Add exit code 1 on invalid usage, fixes #500 (#501) 2021-01-10 09:34:31 -05:00
Zachary Rice 1c6f2252b8 Update README.md 2020-12-11 20:55:32 -05:00
Zachary RiceandZach Rice 58d130c5f3 Quiet flag (#491)
* Adding a quiet option

* better description

Co-authored-by: Zach Rice <zrice@gitlab.com>
2020-12-11 09:56:09 -05:00
Zachary Rice 091ea81e68 nosec gosec (#490) 2020-12-10 22:32:32 -05:00
Zachary Rice f036dce6ab Dotgit bug (#488)
* fix allowlist bug

* Adding new repo for testing allowlisting

* adding additional constraints on the dotgit regex
2020-12-10 17:41:26 -05:00
Zachary Rice 2d58f1f94e Files at commit allow list bug (#485)
* fix allowlist bug

* Adding new repo for testing allowlisting

* Adding missing allowlist checks for commits and files/paths
2020-12-09 15:55:01 -05:00
Zachary Rice 86cfe0848b Allow list bugs (#484)
* fix allowlist bug
2020-12-09 13:21:15 -05:00
Zachary Rice 973d74e592 Update README.md 2020-12-08 20:55:53 -05:00
Zachary Rice 3909ebe03b Exit code update, introduce leaks-exit-code flag (#481) 2020-12-08 17:41:02 -05:00
Zachary Rice 65f42020af Go repo scan (#480)
* Real fast

* Addressing some golint stuff
2020-12-08 17:22:28 -05:00
Zachary Rice 65a91ae976 Removing base scanner (#477) 2020-12-08 09:24:38 -05:00
Zachary Rice 7db08bfd90 Bugs v7 (#475)
* fixing some v7 bugs
2020-12-05 11:57:43 -05:00
Matt Bartel af26553292 Performance improvement for uncommitted files (#463)
* attempt to use 'git status' when scanning uncommitted files

* fix comment

* correct copy/rename handling

* use 'git status' for unstaged changes
2020-12-04 18:08:27 -05:00
Zachary Rice d5e431e7d4 Update README.md 2020-12-03 17:20:46 -05:00
Zachary Rice 54ba3ec377 Update README.md 2020-12-03 17:09:59 -05:00
Zachary Rice 656ef1c9a7 Update README.md 2020-12-03 16:56:16 -05:00
zricethezav b8accd7273 rm unimplemented cleanpath option 2020-12-03 15:43:06 -05:00
zricethezav 238c31beaa Merge branch 'master' of github.com:zricethezav/gitleaks into master 2020-12-03 10:08:41 -05:00
Zachary Rice eb31190f31 Removing limiting line/offender length (#470) 2020-12-03 09:32:57 -05:00
zricethezav 389d45e380 Removing limiting line/offender length 2020-12-03 09:28:30 -05:00
zricethezav 81b3a6e279 Update readme 2020-12-02 17:11:47 -05:00
Zachary Rice c50906373c update to V7 (#469) 2020-12-02 17:07:31 -05:00
Zachary Rice 40545fb680 Need to include offender in line extraction memoization (#466) 2020-11-21 15:49:59 -05:00
Daniel Paul SearlesandDaniel Paul Searles 2acc34dfdf Add support for reportGroup (#456)
Why:

* There are times where it would be nice to have a group from the regex
  reported rather than the complete match.

This change addresses the need by:

* Add the reportGroup configuration option for a rule.
* Update scan.CheckRules to return the reportGroup if set.

Co-authored-by: Daniel Paul Searles <dsearles@gitlab.com>
2020-11-03 15:15:48 -05:00
zricethezav ede68fd95d fix off by one 2020-09-02 08:36:19 -04:00
Zachary Rice 6c60c3dde3 Adding some logic to fix line number extractor when there are multipl… (#436)
* Adding some logic to fix line number extractor when there are multiple secrets of the same offender within the same patch

* formatting some consts
2020-09-01 20:48:43 -04:00
Zachary Rice ad505754fc Add commits and commits-file option (#433) 2020-08-31 10:29:04 -04:00
Zachary Rice 21d81879e2 Update README.md 2020-08-27 14:11:11 -04:00
Lars Lehtonen b5ca2ba614 scan: fix dropped errors (#424) 2020-08-20 15:42:42 -04:00
Zachary Rice ef4655fcf1 Sarif (#421)
* init

* more work

* more sarif work

* mergin
2020-08-12 18:07:24 -04:00
Zachary Rice 01b553a75d Update Makefile 2020-08-12 17:51:56 -04:00
Zachary Rice fae366a404 Global allowlist regex (#422)
* work in progress

* Update test configs

* adding test

* golint and change to allowlist

* fix race condition, this mistakenly got committed

* Updating tests and examples

* bump to v6 as this is a breaking change to the config

* More consistent variables
2020-08-12 17:18:25 -04:00
Lars Lehtonen 6129b1a15d hosts: dropped error (#417) 2020-07-31 08:45:47 -04:00
Manuel Jeckelmann 31d03a1146 Clean up 'uncommitted' diff. (#416) 2020-07-28 08:55:33 -04:00
Zachary Rice eabc7b5c12 Fixing merge commit scans and large patch rule checking (#414)
* Fixing merge commit scans and large patch rule checking

* Adding tests for merge request scans
2020-07-25 14:55:59 -04:00
zricethezav 1dc7569f95 removing extra log import... 2020-07-24 14:42:54 -04:00
zricethezav 1797e9c966 Merge branch 'master' of github.com:zricethezav/gitleaks 2020-07-24 14:07:25 -04:00
zricethezav e2eaceb4cd rm bad example config 2020-07-24 14:07:00 -04:00
Zachary Rice c637b129ec Validate config (#412)
* validate config

* fix import fmt

* cleaning
2020-07-24 14:02:48 -04:00
zricethezav 8470e43d7f validate config 2020-07-24 13:54:01 -04:00
Zachary Rice 94f5950d68 Use allowlist (#411) 2020-07-24 11:58:43 -04:00
Zachary Rice fe69a17c9c Change remaining audits to scan (#410) 2020-07-24 11:30:33 -04:00
Zachary Rice 6ca7a11d88 Add line number to report plus some other things (#409)
* Init refactor

* think i got it working

* we got em

* Updating tests

* fixing tests

* Better comments, more test fixing

* Bumping to v5

* Fixing golint messages

* Replacing usage of audit with scan in comments

* bumping go-git

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

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

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

* fixing SIGSEGV

* adding options for date and time format + tests

* Update repo.go

* Update github.go

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

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

* bumping go-git and adding repo whitelist

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

* updating readme

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2020-04-28 17:43:01 -04:00
zricethezav e87c62fe72 Merge branch 'master' of github.com:zricethezav/gitleaks 2020-04-23 11:23:46 -04:00
Zachary Rice 4801818e3d fixing commit latest bug (#365) 2020-04-05 11:36:37 -04:00
zricethezav b4a0577786 fixing commit latest bug 2020-04-05 11:31:22 -04:00
Zachary Rice 212232f80a Empty repo audit (#364)
* bump to go 1.14 and alpine to 3.11

* audit before commit

* adding test

* rm hooks in test repo
2020-04-05 11:18:33 -04:00
Zachary Rice 11dcb44e41 bump to go 1.14 and alpine to 3.11 (#363) 2020-04-05 09:38:27 -04:00
Prabhu Subramanian af0df6ea2c Added gosec scan (#311) 2020-04-05 09:38:10 -04:00
Zachary Rice 9db91442b3 ignoring config when using custom config (#362) 2020-04-04 14:49:54 -04:00
Zachary Rice 9d76070806 Update README.md 2020-03-25 11:22:32 -04:00
Zachary Rice 2fa580f1bb fix the empty repo org scan error (#358) 2020-03-20 22:44:17 -04:00
Zach Stone c6f15b768e Improve default pattern configuration (#356)
* Add GCP, fix Mailgun format, and loosen format for other keys (don't require quotes)

* Add more match cases to generic credential pattern

* Fix quotation for valid toml

* Update tests
2020-03-20 21:14:30 -04:00
Zachary Rice 779937ca87 Update README.md 2020-03-06 18:59:03 -05:00
Zachary Rice 731856e974 Update README.md 2020-03-06 18:55:24 -05:00
Zachary Rice baf54631c7 Update README.md 2020-03-06 18:43:40 -05:00
zricethezav 3e760d7fed updating help message 2020-03-02 20:24:22 -05:00
Noel Algora 679f00dc9c Scan files at latest commit (#348)
* Inspect files at latest commit

Added option to scan files at latest commit

* Files at latest commit test
2020-03-02 20:22:14 -05:00
Zachary Rice dae5c142d7 Fix host clone auth (#350)
* trying auth fix

* fixing github private user auth and donate msg

* formatting

* go fmt...
2020-02-29 13:30:08 -05:00
Zachary Rice 8e8873286e Update leaky-repo.toml 2020-02-29 13:19:55 -05:00
Zachary Rice 6693cbdde3 Update README.md 2020-02-27 09:29:52 -05:00
Zachary Rice 8b3ce2cb1e forgot to bump in code... (#347) 2020-02-26 20:41:54 -05:00
Zachary Rice 94cae90d1e duplicate leak logic includes the line in hash (#345) 2020-02-26 17:38:16 -05:00
Noel Algora c4b07f5113 Add file regex support (#340)
* Modified Entropy to be able to apply it on regex match or specific capture group

* Config tests

* Small fixes on entropy ranges

* Fix toml configs
Fix tests

* Start adding support for rules with filename regex

Changed how config is parsed
Created new functions to inspect files and content

* File regex working

* Fixing tests and configs

* Implemented different regex for filename and filepath

* Fix comments

* Audit tests

* Config rename vars

* Fix audit tests

* Filename offender

* Indents and code styles

* Indents and code styles

* Removing bad test repo

* Adding test repo 6 for filename and filepath tests

* global whitelist path and fixes

* Fixes on tests and new test for global whitelisting paths

* Removing unused test

* Fix comment
2020-02-26 15:33:14 -05:00
Alexander Curtiss 01d73028f8 Fixed bug where the repo name was removed on a user or org audit. (#344) 2020-02-26 14:42:44 -05:00
Dmitry Ivanov 862f1203ed Minor formatting fix (#330) 2020-02-25 18:24:27 -05:00
Zachary Rice 581e81c16e Update README.md 2020-02-25 17:39:41 -05:00
Zachary Rice 6c166c9530 Update README.md 2020-02-25 17:32:40 -05:00
Zachary Rice 4181ede6cd Update FUNDING.yml 2020-02-25 11:55:18 -05:00
Zachary Rice 10745be661 fixing commit counts (#342)
* fixing commit counts

* fixing commit to test
2020-02-25 10:28:03 -05:00
Noel Algora ee2d73c740 Enhance entropy (#333)
* Modified Entropy to be able to apply it on regex match or specific capture group

* Config tests

* Small fixes on entropy ranges

* Fix toml configs
Fix tests

* Indents and code styles
2020-02-24 13:44:38 -05:00
zricethezav e7fbcf5333 updating readme and comments 2020-02-01 16:48:05 -05:00
Zachary Rice 2810eccc82 Merge pull request #329 from zricethezav/bug/commit-scan
Bug/commit scan
2020-02-01 11:38:02 -05:00
zricethezav baff419091 removing hooks 2020-02-01 11:23:11 -05:00
zricethezav d13e0fdfde adding more tests 2020-02-01 11:18:27 -05:00
zricethezav 5a300c3c64 fixing --commit bug, adding --files-at-commit option 2020-01-30 20:08:01 -05:00
Zachary Rice d8ddb9630a Merge pull request #327 from zricethezav/bug/timeoutcancel
Adding timeout check in context select so we dont log erroneously
2020-01-24 18:16:59 -05:00
zricethezav 1537eeb5fa Adding timeout check in context select so we dont log erroneously 2020-01-24 18:07:16 -05:00
Zachary Rice 1a492537dd Merge pull request #325 from zricethezav/bug/timeoutcancel
defer cancel in audit
2020-01-23 18:52:56 -05:00
zricethezav bd4107b002 ensuring cancel is called after audit is complete so context can be dropped 2020-01-23 18:47:37 -05:00
Zach Rice 7b48cadf6d fixing version loading in makefile 2020-01-22 20:42:14 -05:00
Zachary Rice 6eab8a7a0a Update README.md 2020-01-22 20:00:27 -05:00
Zachary Rice c6d14e5b7d Merge pull request #323 from zricethezav/bug/fix-go-module
fixing modules, adding v3 in path
2020-01-22 18:10:23 -05:00
zricethezav ce95cafd54 fixing modules, adding v3 in path 2020-01-22 10:21:00 -05:00
Zachary Rice 4024faceab Merge pull request #322 from zricethezav/exclude-forks
exclude-forks gitlab and github
2020-01-19 12:41:07 -05:00
zricethezav 1afa931248 exclude-forks gitlab and github 2020-01-19 12:35:52 -05:00
Zachary Rice 2474c39311 Merge pull request #321 from zricethezav/depth
reimplementing depth feature
2020-01-19 12:17:42 -05:00
zricethezav f6460a7365 reimplementing depth feature 2020-01-19 12:14:14 -05:00
Zachary Rice b47e00858e Merge pull request #320 from zricethezav/bug/manager-ptr
bug/manager-ptr
2020-01-19 11:56:29 -05:00
zricethezav b200a13c8d bug fix: use manager pointers instead of value for gitleaks hosts... this was causing an issue with metadata logging 2020-01-19 11:51:52 -05:00
Zachary Rice e6fabdbb31 Merge pull request #319 from zricethezav/repo-timeout
Repo timeout
2020-01-19 11:48:57 -05:00
Zachary Rice cdd654eab7 pr template 2020-01-19 10:17:08 -05:00
zricethezav 2f07b96333 adding test, cancelfunc (for go vet) 2020-01-19 10:07:01 -05:00
zricethezav 62e74b2b18 let the repo handle timeouts... better for automating audits anyway 2020-01-19 09:26:06 -05:00
Zachary Rice e75693b131 Update feature_request.md 2020-01-12 12:22:54 -05:00
Zachary Rice 3cd14d4696 Update bug_report.md 2020-01-12 12:22:14 -05:00
Zachary Rice d29cc9892c Update bug_report.md 2020-01-12 12:21:33 -05:00
Zachary Rice d996882f4e Update bug_report.md 2020-01-12 12:20:44 -05:00
Zachary Rice 17b6aa856d Update issue templates 2020-01-12 11:07:45 -05:00
Zachary Rice c21a9cf121 Merge pull request #317 from zricethezav/feature/commit-range
Adding commit range feature via 'commit-to' and 'commit-from' options
2020-01-11 17:01:53 -05:00
zricethezav d3c4342c15 Updating README 2020-01-11 16:58:59 -05:00
zricethezav b4c2f8e69c cleaning up some comments 2020-01-11 16:54:09 -05:00
Zach Rice a0f72a4e35 Adding commit range feature via 'commit-to' and 'commit-from' options 2020-01-11 16:46:58 -05:00
Zachary Rice 24844002de Update README.md 2020-01-03 16:15:54 -05:00
Zachary Rice 593edeae21 Update README.md 2019-12-24 10:03:02 -06:00
Zachary Rice 6df770d261 Merge pull request #313 from zricethezav/bug/docker-update
adding docker push support again to Make and fixed a go vet nit
2019-12-24 09:13:01 -06:00
zach rice 4f0c9dcede adding docker push support again to Make and fixed a go vet nit 2019-12-17 20:44:20 -05:00
Zachary Rice 52425a8ca9 Merge pull request #307 from pegasd/add_pkcs8_key_support
Add support for PKCS8 key
2019-12-07 19:33:54 -05:00
Zachary Rice 454acebe5a Merge pull request #303 from petegallagher/host-base-url
Adding baseurl flag to allow self-hosted GitLab/GitHub servers
2019-12-05 10:32:52 -05:00
Peter Gallagher 6fcf91e934 Removing logging of git client errors as these are now returned in main.go 2019-12-05 15:22:18 +00:00
Peter Gallagher f89b8f2b29 Return errors for failed host clients 2019-12-05 12:11:46 +00:00
Zachary Rice 648a7ba577 Merge pull request #304 from chapeupreto/patch-1
fix typo
2019-12-04 14:47:12 -05:00
Zachary Rice 7c5594c39d Merge pull request #305 from zricethezav/limit-leak-len
Limit leak len
2019-12-04 14:46:36 -05:00
Zachary Rice 274e8212a6 adding license 2019-12-04 08:48:37 -05:00
Eugene Piven 36c6ddaf86 Add support for PKCS8 key 2019-12-03 20:24:33 +03:00
zach rice 15ed72bc09 updating test data 2019-12-01 21:33:40 -05:00
zach rice ace8de93a9 limit leak len to 200 characters 2019-12-01 21:30:40 -05:00
Rod Elias 45a4c0a284 fix typo 2019-12-01 17:10:26 -03:00
Peter Gallagher c5e1e8abc0 Adding baseurl flag to allow self-hosted GitLab/GitHub servers 2019-12-01 10:49:32 +00:00
Zachary Rice ef38b69c39 Merge pull request #302 from petegallagher/whitelist-gitleaks.toml
Update default whitelist to include gitleaks.toml
2019-11-30 09:44:23 -06:00
Zachary Rice ac6bde9996 Merge pull request #296 from petegallagher/private-key
Update asymmetric private key regex
2019-11-30 09:41:35 -06:00
Zachary Rice 23568cc0ba Merge pull request #295 from petegallagher/sendgrid
Adding regex for SendGrid API keys
2019-11-30 09:41:10 -06:00
Zachary Rice e61c2cfae7 Merge pull request #301 from petegallagher/AuditUncommitted
Fix repo-config and file whitelist for AuditUncommitted function
2019-11-30 09:40:24 -06:00
Peter Gallagher 38e0b11995 Fix test data for AuditUncommitted 2019-11-29 10:22:02 +00:00
Peter Gallagher 31903d1a80 Update default whitelist to include gitleaks.toml 2019-11-29 10:14:03 +00:00
Peter Gallagher 3655284b57 Fix test data for AuditUncommitted 2019-11-29 10:07:56 +00:00
Peter Gallagher db79a96118 Use Unix Epoch time for staged commit time 2019-11-29 10:07:27 +00:00
Peter Gallagher999 5152e1fc63 Reset commit values when auditing uncommitted changes 2019-11-28 23:13:59 +00:00
Peter Gallagher c04e137b28 Adding global file regex to AuditUncommitted 2019-11-28 22:53:08 +00:00
Peter Gallagher 9b3342fbff Allow use of --repo-config for AuditUncommitted function 2019-11-28 13:53:52 +00:00
Peter Gallagher d9a060a12d Honour file whitelist for AuditUncommitted function 2019-11-28 13:53:18 +00:00
Peter Gallagher 77f2fdd09a Update asymmetric private key regex 2019-11-25 15:59:40 +00:00
Peter Gallagher dba1ef6104 Adding regex for SendGrid API keys 2019-11-25 15:49:47 +00:00
Zachary Rice 725da55905 Merge pull request #289 from zricethezav/fix/3.0.2
recover on panic in patch generation, full filepath for report, versi…
2019-11-23 09:56:27 -05:00
zach rice cfac551ab8 recover on panic in patch generation, full filepath for report, version message if not built with LDFLAGS 2019-11-23 09:50:16 -05:00
Zachary Rice c559fdbf04 Merge pull request #287 from chenrui333/go-1.13.4
Bump golang and alpine to latest
2019-11-17 13:41:43 -06:00
Rui Chen e2ac47cd06 Bump alpine to v3.10 2019-11-17 14:37:04 -05:00
Rui Chen 8ef16d9efb Bump golang to v1.13.4 2019-11-17 14:36:37 -05:00
Zachary Rice b6f726654e Merge pull request #286 from zricethezav/v3.0.1
V3.0.1
2019-11-17 12:12:54 -06:00
zach rice 8cbb84c50f fixing tests 2019-11-17 11:56:16 -06:00
zach rice f3eac0c958 adding report-format to tests since we dont parse flags 2019-11-17 11:34:15 -06:00
zach rice 3211cfbbb1 fixing a bug, adding csv report option and leak caching 2019-11-17 11:13:34 -06:00
zach rice c6934f5eab updating readme 2019-11-15 13:52:05 -06:00
zach rice f8c054b879 gotta log the reponame on cloned repos 2019-11-15 13:35:34 -06:00
Zachary Rice ad2a64c82b Merge pull request #285 from zricethezav/v3
metadata sync
2019-11-15 13:26:46 -06:00
zach rice 9e0028fe73 Merge branch 'master' of github.com:zricethezav/gitleaks into v3 2019-11-15 13:22:18 -06:00
zach rice dfbd01a980 sync bug w/ timings 2019-11-15 13:22:03 -06:00
Zachary Rice 86737955de Merge pull request #281 from zricethezav/v3
V3
2019-11-14 07:38:34 -05:00
zach rice 7f0b027486 changing ret err to warning for owner-path scan 2019-11-13 20:03:51 -05:00
zach rice 4d04ea079f fixing test data 2019-11-12 22:32:15 -05:00
zach rice 6e1c41b536 more examples 2019-11-12 22:17:56 -05:00
zach rice 275232f8c8 examples and more tests 2019-11-12 20:08:17 -05:00
zach rice c8f9560aa3 adding pretty print option 2019-11-12 18:18:51 -05:00
zach rice 315ee56024 opts guard and removing severity 2019-11-12 15:18:13 -05:00
zach rice e446ba0738 fixing all golint and adding some more tests 2019-11-11 21:50:50 -05:00
zach rice 2ccd40677d adding alt config test 2019-11-10 19:28:02 -05:00
zach rice 41ef2a8cd2 rm hooks from test repos 2019-11-10 18:35:07 -05:00
zach rice d8acd1354f no more automatic deploys... doing it manually from now on 2019-11-10 17:18:52 -05:00
zach rice e28cfd1ad5 audit test import 2019-11-10 17:08:56 -05:00
zach rice e5f5e64cdb fixing module name, updating gitignore and travis 2019-11-10 17:05:36 -05:00
zach rice b55d88dc15 v3 work... lots of things 2019-11-10 13:30:43 -05:00
Zachary Rice f3360cbf66 Create FUNDING.yml 2019-10-13 10:39:08 -04:00
Zachary Rice 065b621604 Merge pull request #262 from siemens/feat/relax-repo-config
feat(repo-config): do not fail if no repo-config is available
2019-09-08 16:59:01 -04:00
Roger Meier fd87df475c feat(repo-config): do not fail if no repo-config is available 2019-09-08 20:49:29 +02:00
Zachary Rice c7b6792956 Merge pull request #261 from siemens/fix/sigsegv-repo-config
fix(repo-config): avoid SIGSEGV if there is no .gitleaks.toml
2019-09-08 08:57:49 -04:00
Roger Meier 1f2d11003d fix(repo-config): avoid SIGSEGV if there is no .gitleaks.toml 2019-09-08 13:07:17 +02:00
Zachary Rice 6432f11a6b Merge pull request #249 from siemens/bufferoverflow-patch-1
fix(gitleaks.toml): LinkedIn had a Twitter tag
2019-08-14 10:04:27 -04:00
Roger Meier 7d53fb5951 fix(gitleaks.toml): LinkedIn had a Twitter tag 2019-08-14 11:22:19 +02:00
Zachary Rice b9aa3ef97d readme 2019-08-13 08:54:33 -04:00
zach rice c271497ecb more generic api key regex 2019-08-02 17:16:20 -05:00
Zachary Rice e05c4645ac Merge pull request #246 from hughsaunders/regexes_in_sample
Regex whitelist example in sample config
2019-08-02 17:10:28 -05:00
Hugh Saunders 63d8e6e21b Regex whitelist example in sample config
Users looking to the sample config to discover possible options may
not notice that its possible to whitelist by regex. This commit adds
an example to aid discovery.

Related: conjurinc/ops#246
2019-08-02 21:15:15 +01:00
zach rice 5bd59b0d8c bump 2019-08-01 17:39:09 -05:00
zach rice 464e152783 rm vendor and changelog 2019-08-01 17:15:28 -05:00
Zachary Rice 91406b0c4c Merge pull request #184 from JCofman/feature/gitlabTokenSupport
Feature/gitlab token support
2019-08-01 17:13:44 -05:00
Zachary Rice 04e81270cb Merge pull request #244 from cfzlp/non-zero-exit-for-leaks
Return exit code 1 when leaks are found
2019-08-01 09:50:24 -05:00
Ixl123 69c6695765 resolve merge conflicts 2019-08-01 13:46:51 +02:00
Carlos Pereira 9e0e050f92 Return exit code 1 when leaks are found 2019-07-31 23:21:30 +02:00
Zachary Rice b2efcf36c8 Merge pull request #241 from manasmbellani/enhance_apikey_rule
constants.go(enhance): added an enhancement to include apikey without…
2019-07-15 21:54:16 -05:00
Manas Bellani ba39abfb19 constants.go(enhance): added an enhancement to include apikey without underscore as another detection for api keys that might be present in source code 2019-07-16 12:31:49 +10:00
zricethezav f47e1f71ee cleaner and bounded regex for generic keys and secrets 2019-07-14 15:16:46 -05:00
Zachary Rice 6d980b4eab Code cleaning (#240) 2019-07-10 10:32:51 -05:00
Zachary Rice ca18e8e2f6 Merge pull request #239 from cfzlp/fix-repo-config
Fix updating config from repo-config
2019-07-09 16:52:08 -05:00
Zachary Rice ec436d7b33 Merge pull request #230 from eargollo/windows-log
Fixed Windows output to be consistent with Linux output (colors)
2019-07-09 16:48:54 -05:00
Zachary Rice 38a511f6ba Merge pull request #236 from dorneanu/fix-commit-option
Implemented right way to scan for files in a commit (by using --commit)
2019-07-09 16:42:31 -05:00
Carlos Pereira 15ac1ffdd1 Fix updating config from repo-config 2019-07-07 14:57:57 +02:00
Victor Dorneanu eb977ba237 Differentiate between commits with parents and commits w/o parents 2019-06-19 14:28:10 +02:00
Victor Dorneanu 9a6b1c3bbb Implemented right way to scan for files in a commit (by using --commit) 2019-06-18 19:03:54 +02:00
Zachary Rice 95443e742c Merge pull request #231 from jesmg/master
Add new default rules
2019-06-18 07:56:55 -05:00
Jesús Marín 0c94db2d6b Improve rules 2019-06-18 10:27:50 +02:00
Jesús Marín 9808551eed Add new default rules 2019-06-17 15:04:33 +02:00
Eduardo Argollo b6fe5b08d3 Added colors to Windows output making it consistent with Linux one 2019-06-06 11:30:33 -07:00
Eduardo Argollo 5309811a09 Merge remote-tracking branch 'upstream/master' 2019-06-06 11:13:51 -07:00
zach rice 3b6c198715 fixing test 2019-06-02 20:55:24 -05:00
Zachary Rice 57bfa41b33 Merge pull request #224 from eargollo/overwrite-error
Solved bug on error being overwritten and not passed to postAudit, closes #223
2019-06-02 17:53:05 -05:00
Zachary Rice 474266c0b5 Merge pull request #226 from eargollo/windows-test
Adapt test message to run tests in Windows
2019-06-02 17:49:26 -05:00
Eduardo Argollo c891470344 Merge pull request #1 from eargollo/windows-test
Adapt test message to run tests in Windows
2019-05-31 09:56:44 -07:00
Eduardo Argollo e6004da801 Adapt test message to run tests in Windows 2019-05-31 09:52:21 -07:00
Eduardo Argollo e18b1a884a Updating expected error message 2019-05-30 15:11:37 -07:00
Eduardo Argollo faeb0914b2 Solving error on authentication 2019-05-30 15:09:45 -07:00
Eduardo Argollo d6578df998 Solved bug on error being overwritten and not passed to postAudit, closes #223 2019-05-28 15:35:10 -07:00
Zachary Rice f010513d17 Merge pull request #222 from martelo/modify-single-commit-audit
Modify single commit audit
2019-05-28 17:00:13 -05:00
Cassio Berra d4be9602e3 Removing other unnecessary references to opts.Commit 2019-05-18 01:24:18 +00:00
Cassio Berra 7676690697 Audit single commit without iterating through all commits 2019-05-18 01:02:46 +00:00
Zachary Rice f4b9b6d0b3 Merge pull request #204 from luispollo/fix-repo-path-logging
Fix logging of repo paths
2019-05-06 10:00:27 -05:00
Luis Pollo 7a3d155675 Fix logging of repo paths 2019-05-06 08:53:02 -05:00
Zachary Rice 68b6388ef7 Merge pull request #202 from MaxymVlasov/docs/improve_examples
Add more examples and improve README structure
2019-04-30 11:30:31 -05:00
MaxymVlasov 547e9768ec Add more examples and improve README structure 2019-04-30 18:08:58 +03:00
Zachary Rice 8608cf5b48 Merge pull request #198 from theoretick/patch-1
Update README - formatting fixes
2019-04-19 10:34:46 -05:00
Lucas Charles a08ddedb88 Update README - formatting fixes 2019-04-19 08:28:33 -07:00
Zachary Rice 398366a615 Merge pull request #196 from zricethezav/v2.0.0
V2.0.0
2019-04-16 19:00:12 -05:00
zach rice 7dfa3f2b48 last updates? 2019-04-16 18:13:24 -05:00
zach rice 2e7325ce03 adding some more tests during lunch 2019-04-16 12:04:00 -05:00
zach rice cb74386ef0 working on filetype filtering 2019-04-13 16:48:57 -05:00
zach rice 87d6c588a6 removing validating config, already handled 2019-04-13 14:09:16 -05:00
zach rice df8a2d35a8 cleaning up 2019-04-13 13:50:14 -05:00
zach rice c4da547503 fmt 2019-04-13 13:12:58 -05:00
zach rice 7bd55e33b5 working tests out 2019-04-13 12:30:00 -05:00
zach rice 256ace38d7 workin on new filters 2019-04-11 18:06:18 -05:00
zach rice 4c20d5d85c bumping version 2019-03-30 15:29:52 -05:00
Zachary Rice ac43c67a47 Merge pull request #190 from zricethezav/bug/singleCommit
Bug/single commit
2019-03-30 15:24:42 -05:00
zach rice d2d68a7e44 fixing commit target bug 2019-03-30 15:19:31 -05:00
zach rice 27aee19a35 Merge branch 'master' of github.com:zricethezav/gitleaks 2019-03-29 19:41:33 -05:00
Zachary Rice 2a6bd1636f Merge pull request #189 from zricethezav/debt/breakout
Debt/breakout
2019-03-29 19:27:54 -05:00
zach rice 7b82e29e7e updating readme 2019-03-29 19:23:28 -05:00
zach rice 4fd2f06a0d rm vendor and updating dockerfile 2019-03-29 19:12:28 -05:00
zach rice 8016dffe18 more travis 2019-03-29 18:52:38 -05:00
zach rice 10004da36f travis version 2019-03-29 18:46:45 -05:00
zach rice 633e06a7c7 updating travis 2019-03-29 18:39:52 -05:00
zach rice 660350c9b1 gofmt 2019-03-29 18:11:01 -05:00
zach rice 9122aa6cf4 updating changelog 2019-03-29 18:09:34 -05:00
zach rice 56c89866a2 spliting up email and author 2019-03-29 18:04:49 -05:00
zach rice f9be4e543a working on coverage 2019-03-29 15:54:42 -05:00
zach rice 042b82e2af more test work 2019-03-29 15:02:25 -05:00
zach rice 9176896742 getting testing there 2019-03-29 13:02:59 -05:00
zach rice 4ea0c66bec making good progress on tests 2019-03-28 21:28:16 -05:00
zach rice ae4542abf0 working on tests now 2019-03-28 13:13:26 -05:00
zach rice ac14d347de more refactoring 2019-03-28 10:42:43 -05:00
zach rice c2143c5843 repoDescriptor->repoInfo 2019-03-28 08:06:38 -05:00
zach rice e79ffc6ae8 go mod and even more work 2019-03-27 17:26:27 -05:00
zach rice a56c2341cf Merge branch 'master' of github.com:zricethezav/gitleaks 2019-03-26 16:11:12 -05:00
zach rice 1c14586cde main.go, need to work on tests next 2019-03-26 16:06:43 -05:00
zach rice 2b995fda44 init 2019-03-26 13:57:55 -05:00
Zachary Rice 5d68b48af3 Update README.md 2019-03-21 19:31:26 -05:00
Zachary Rice f90a00b564 Update README.md 2019-03-20 20:36:11 -05:00
Ixl123 4bc7c13310 Merge branch 'master' of https://github.com/zricethezav/gitleaks 2019-03-08 14:44:56 +01:00
Ixl123 771055fd59 add changelog and format go code 2019-03-08 14:38:47 +01:00
Jacob Cofman 75c70bf804 try this 2019-03-06 23:31:15 +01:00
Zachary Rice c5f34a6704 Update README.md 2019-03-06 08:45:30 -06:00
Zachary Rice 463871a307 Update README.md 2019-03-06 08:43:45 -06:00
Zachary Rice fa1080d066 Update README.md 2019-02-16 10:31:27 -06:00
Zachary Rice 52cfad1d08 Update CHANGELOG.md 2019-02-06 20:06:20 -06:00
Zachary Rice 9e294f5910 Merge pull request #179 from zricethezav/single-commit
Single commit
2019-02-06 20:04:54 -06:00
zach rice 9f8326de56 updating changelog and readme 2019-02-06 19:56:02 -06:00
zach rice 79c3f99165 fixing tests 2019-02-06 19:48:17 -06:00
zach rice d4925443c8 workin on tests 2019-02-06 19:20:52 -06:00
zach rice fa27d32bfe ref is not ordered... so the depth option is wack 2019-02-06 18:36:05 -06:00
zach rice 230a52e3e3 reworking logic 2019-02-06 17:50:55 -06:00
zach rice 15dedda59a single commit and bumping go-git version 2019-02-06 09:26:41 -06:00
Zachary Rice 3b45fb91e3 Update README.md 2019-01-21 18:18:57 +01:00
Zachary Rice f378319395 Merge pull request #174 from zricethezav/revert-169-add_support_for_branch
Revert "Add support for scanning single branch"
2019-01-13 17:17:49 -06:00
Zachary Rice 98173b3aa6 Revert "Add support for scanning single branch" 2019-01-13 17:13:36 -06:00
Zachary Rice 36340c8f2f Merge pull request #169 from AdamKobi/add_support_for_branch
Add support for scanning single branch
2019-01-13 10:20:37 -06:00
Adam Kobi 77b6d90a16 Merge branch 'master' into add_support_for_branch 2019-01-13 13:58:07 +02:00
Adam Kobi 6b3bd46fa8 added tests for scanning single branch and non-existing branch 2019-01-13 13:55:01 +02:00
Zachary Rice 8485f88158 Update README.md 2019-01-11 15:35:29 -06:00
Zachary Rice d2baa9e675 jk i am prepared. no more games 2019-01-06 19:57:46 -06:00
Zachary Rice 7fa9c802f5 u r not prepared 2019-01-06 18:47:43 -06:00
zach rice 8f1bc74e26 new logo 2019-01-06 18:29:02 -06:00
zach rice 8de38be418 bump version 2019-01-06 17:48:08 -06:00
Zachary Rice ec1ebd4686 Merge pull request #171 from milo-minderbinder/bugfix/report-memory
fix memory issue when writing json report (#168)
2019-01-06 08:58:43 -06:00
zach rice 81ddfbed88 dupe code 2019-01-06 08:52:31 -06:00
Zachary Rice 63814f1eaf Merge pull request #172 from zricethezav/repo-config
Repo config
2019-01-05 21:35:51 -06:00
zach rice 38a36add57 typo 2019-01-05 20:51:59 -06:00
zach rice 9e39927ac6 turning down logging, adding test 2019-01-05 20:50:17 -06:00
Milo Minderbinder 0ba9dda0f0 fix memory issue when writing json report (#168)
Previously, gitleaks.writeReport used json.MarshallIndent on the entire
set of leaks when writing json reports, which would cause failures due
to excessive memory consumption when a large number of leaks were
identified.

This PR addresses the problem by doing incremental marshalling and
writing of leaks to the report file, and reduces the memory footprint by
several GB in tests with >30k leaks.
2019-01-04 18:49:25 -05:00
zach rice a24f9a2c92 working on getting pinned config working 2019-01-04 16:31:33 -06:00
Zachary Rice f57158a893 Merge pull request #170 from syk0saje/master
Fix typo in recovery message
2019-01-04 09:45:13 -06:00
Pepe Bawagan 1e3bf42464 Fix typo in recovery message 2019-01-04 15:23:26 +08:00
Zachary Rice 9d6a75fbab Merge pull request #163 from milo-minderbinder/bugfix/whitelist-checks
fix file (#162) & line (#161) whitelist checks
2019-01-01 11:09:54 -06:00
Milo Minderbinder 6fa52ae7cc Merge remote-tracking branch 'upstream/master' into bugfix/whitelist-checks 2018-12-31 16:54:53 -05:00
Milo Minderbinder bb9c459a1a check whiteListFiles for root commit & GitHub PRs
add missing checks against `whiteListFiles` regexes for files in the
root/initial commit and in GitHub PRs (in `auditGithubPR` function)
2018-12-31 12:49:49 -05:00
Adam Kobi 432c76a9d9 added support for scanning only single remote branch 2018-12-29 13:10:39 +02:00
Adam Kobi 1cdf315bfa Merge pull request #1 from zricethezav/master
update upstream
2018-12-29 02:24:01 +02:00
Zachary Rice 777601a0ea Merge pull request #165 from camaya/update-report-creation
Write report only when leaks are found
2018-12-27 16:16:24 -06:00
Zachary Rice 35d170018e Merge pull request #166 from arbazkiraak/patch-1
Adding Stripe API Regex
2018-12-27 16:15:38 -06:00
Arbaz Hussain af2e99ef45 Adding Strip API Regex
```
→ printf '  Stripe.api_key = "Sk_test_41u0zAKbiWmTVhvHcS6gAjp9"
  Stripe.api_key = "sk_live_VhYCleaZwuUBGSFYFc7WUboz"
  STRIPE_PUBLIC_KEY= "pk_live_8sCPFZoLtW5pXuVHGrRKrROs"' | grep -P "(?i)(sk|pk)_(test|live)_[0-9a-zA-Z]{10,32}"
  Stripe.api_key = "Sk_test_41u0zAKbiWmTVhvHcS6gAjp9"
  Stripe.api_key = "sk_live_VhYCleaZwuUBGSFYFc7WUboz"
  STRIPE_PUBLIC_KEY= "pk_live_8sCPFZoLtW5pXuVHGrRKrROs"
```
2018-12-27 21:45:39 +05:30
Zachary Rice 734befb555 bad cops bad cops 2018-12-25 09:31:58 -06:00
Milo Minderbinder 64c8d618a2 fix file (#162) & line (#161) whitelist checks
* only check entropyRegexes and whiteListRegexes once per line, and only
  if regex or entropy leak type was found, since regex checks are expensive
* check whiteListFiles once for each FilePatch, instead of for
  every Chunk
2018-12-13 13:14:54 -05:00
Cristhian Amaya 92bb4ea6fc Write report only when leaks are found 2018-12-11 18:33:11 +01:00
zach rice 98b025da72 bumping versions 2018-12-10 09:48:48 -06:00
Zachary Rice af7717412f Merge pull request #159 from camaya/reduce-entropy-noise
Reduce noise when running entropy checks
2018-12-10 09:40:05 -06:00
Cristhian Amaya 68c2a18f6f Update entropy noise reduction
Instead of reducing noise by default, there's a new flag called
`--noise-reduction` to enable that.
2018-12-10 16:24:53 +01:00
Cristhian Amaya ea49078ffd Reduce noise when running entropy checks
When there's a word on a line with high entropy, we check if the line
matches any of the regex configured on the `lineregexes` element of the
`entropy` section. If so, it's marked as a leaked.

This has reduced the number of leaks found with entropy enabled up to
80%
2018-12-04 10:23:42 +01:00
Zachary Rice b902d7310a Merge pull request #158 from camaya/redact-only-secret-on-line
Change redacted behaviour on the line information
2018-11-30 08:55:22 -06:00
Zachary Rice 3591560b34 Merge pull request #157 from camaya/add-commit-date-prs
Add commit date to Github PRs checks
2018-11-30 08:54:56 -06:00
Cristhian Amaya 949029ca89 Change redacted behaviour on the line information
The line information sometimes contains useful context information so
instead of redacting the whole line, this change redacts only the
secret
2018-11-30 14:13:18 +01:00
Cristhian Amaya cde0894711 Add commit date to Github PRs checks 2018-11-30 13:37:18 +01:00
Zachary Rice 342e9f80db Merge pull request #152 from camaya/fix-github-pr-nilcheck
Fix Github PR checks error
2018-11-29 09:10:36 -06:00
Zachary Rice 96b0f4aab7 Merge pull request #153 from madblobfish/patch-1
Fix releases link in readme
2018-11-26 12:03:40 -06:00
madblobfish 3af6a546ac fix releases link in readme 2018-11-26 11:20:17 +01:00
Cristhian Amaya 6e086c4297 Fix Github PR checks error
When a commit contained a file without patch information like an added
empty file, there was a nil pointer dereference.
2018-11-23 11:56:49 +01:00
zricethezav db08fc0564 actually bump version in code >.< 2018-11-18 08:43:05 -06:00
zricethezav dbb6d4cc5f including camayas changes in version bump 2018-11-18 08:42:32 -06:00
Zachary Rice d0f44da4c2 Merge pull request #151 from AdamKobi/add_support_for_tokens
Add support for tokens
2018-11-18 08:39:17 -06:00
Zachary Rice cb6b01cc5d Merge pull request #149 from camaya/fix-files-whitelist-github-prs
Fix files whitelisting when checking Github PRs
2018-11-18 08:36:47 -06:00
Adam Kobi 392d79b9e2 added changes to changelog 2018-11-15 19:04:51 +02:00
Adam Kobi f8e609d4bf added case for when using oauth token for both listing and cloning repos 2018-11-15 17:58:54 +02:00
Zachary Rice 573bf46fd1 grammar not my best subject 2018-11-13 20:01:44 -06:00
Zachary Rice d65592bbcc Update to readme 2018-11-13 19:57:52 -06:00
Cristhian Amaya 169a137e7f Fix files whitelisting when checking Github PRs
Files whitelisting code was not executed when running the tool against a
Github PR so the config was ignored.

To avoid duplication, the whitelist files check has been moved to the `inspect`
function which is always executed.
2018-11-13 11:54:25 +01:00
Zachary Rice bd61f2d2f7 Merge pull request #148 from zricethezav/gitlab-support
bumping version, format, changelog, uhhhhhh, test... a single test
2018-11-12 21:45:35 -06:00
zricethezav 793bbc793f bumping version, format, changelog, uhhhhhh, test... a single test 2018-11-12 21:42:45 -06:00
Zachary Rice 4aa7be2dbf Merge pull request #120 from denwwer/115-gitlab
115 gitlab
2018-11-12 21:30:06 -06:00
Zachary Rice 35531233d9 Merge pull request #147 from zricethezav/fix/first-commit
fixing commit count
2018-11-07 19:39:52 -06:00
zach rice 54949bd62a fixing commit count 2018-11-07 19:33:39 -06:00
Zachary Rice e95a8a7158 Merge pull request #146 from zricethezav/fix/first-commit
Fix/first commit
2018-11-06 22:35:26 -06:00
zach rice de0a70a835 changelog 2018-11-06 22:27:52 -06:00
zach rice 9f8feca926 gotta check the root 2018-11-06 22:20:42 -06:00
Zachary Rice c50187559b Merge pull request #145 from camaya/update-report-commit-message
Remove break lines in commit messages
2018-11-06 08:31:49 -06:00
boris c2cf6327c2 adjusted perPage; minor fixes 2018-11-06 15:29:10 +02:00
boris 1ea773ddfb support self hosted GitLab server 2018-11-06 15:10:12 +02:00
boris 79a8983bac support GitLab 2018-11-06 15:10:09 +02:00
Cristhian Amaya 7d5ed837a4 Remove break lines in commit messages
Breaklines in a csv report caused issues when importing the data to an
spreadsheet application like LibreOffice Calc or Microsoft Excel.
2018-11-06 11:41:38 +01:00
Zachary Rice 60267523e9 Merge pull request #144 from zricethezav/fix/files
readding default whitelist
2018-11-05 18:18:36 -06:00
zach rice 8153da6e9c readding default whitelist 2018-11-05 18:13:50 -06:00
Zachary Rice 5f6fb388ec Merge pull request #141 from zricethezav/feature/default-all
removing branch from report
2018-11-03 11:37:21 -05:00
zach rice ba49396755 updating tests 2018-11-03 11:34:07 -05:00
zach rice 40240cb5ee removing branch from report 2018-11-03 11:31:18 -05:00
Zachary Rice bba926693e Merge pull request #140 from zricethezav/feature/default-all
Feature/default all
2018-11-03 11:29:20 -05:00
zach rice 9103834503 tests, readme, bumping version 2018-11-03 11:11:50 -05:00
zach rice 7e3c740592 audit all branches by default, memoize commits, smarter regexes 2018-11-02 21:58:09 -05:00
Zachary Rice 35a59746df Merge pull request #135 from camaya/add-commit-date-to-leaks
Add commit date to leaks
2018-10-28 12:21:45 -05:00
Cristhian Amaya 23b5ce3264 Add commit date to leaks 2018-10-28 17:13:59 +01:00
zach rice 03c53d2978 version again, pushing to master because thats what we do here 2018-10-27 19:30:58 -05:00
Zachary Rice 695449d73d Merge pull request #134 from zricethezav/fix/threads
Fix/threads
2018-10-27 19:25:40 -05:00
zach rice 6bad1e7194 updating readme 2018-10-27 19:20:11 -05:00
zach rice 77dec1461b better language 2018-10-27 19:19:07 -05:00
Zachary Rice 14d77f59d4 Merge pull request #133 from akerl/fix/slack-tokens
fix slack token format
2018-10-27 16:13:17 -05:00
Les Aker afb598cf15 update defaultConfig with new Slack regex 2018-10-27 14:29:25 -04:00
Les Aker b4c6fe92e0 fix slack token format 2018-10-27 10:56:41 -04:00
Zachary Rice f50577be1c Merge pull request #131 from zricethezav/feature/default-regex
Feature/default regex
2018-10-26 14:04:15 -05:00
zach rice c358ae9310 changelog 2018-10-26 13:53:16 -05:00
zach rice 9554258d02 adding some more defaults 2018-10-26 13:48:14 -05:00
Zachary Rice 95ee2cc30e Merge pull request #128 from r--w/patch-1
Telegram bot API token
2018-10-26 13:26:08 -05:00
Zachary Rice 79a35f0c27 Merge branch 'master' into patch-1 2018-10-26 13:25:58 -05:00
Zachary Rice 7a021cda9e Merge pull request #129 from harston/patch-1
Add PGP header
2018-10-26 13:25:23 -05:00
Zachary Rice 447f7a04cb Merge branch 'master' into patch-1 2018-10-26 13:24:55 -05:00
Zachary Rice e5b62cbc7c Merge pull request #130 from harston/patch-2
Add slack token
2018-10-26 13:24:01 -05:00
Paweł Gawinek 6739a34f74 Add slack token
Add Slack token from https://api.slack.com/docs/token-types 

#hactoberfest #greywizard
2018-10-26 10:36:04 +02:00
Paweł Gawinek e502bf29de Add PGP header
Add PGP private key header 

#hactoberfest #greywizard
2018-10-26 10:23:26 +02:00
Radoslaw Wesolowski 51b504bf99 Telegram bot API token
Format is described here: https://core.telegram.org/bots/api#authorizing-your-bot

#hactoberfest #greywizard
2018-10-26 09:22:18 +02:00
Zachary Rice 107d582e7b Merge pull request #127 from zricethezav/fix/ssh-logic
fixing default ssh logic
2018-10-25 12:38:14 -05:00
zach rice ea42ed406f fixing default ssh logic 2018-10-25 12:27:50 -05:00
Zachary Rice c869812875 Merge pull request #125 from ziyaddin/patch-1
Fix typos in docs
2018-10-24 17:06:43 -05:00
Zachary Rice 4f7ce9c195 Merge pull request #126 from zricethezav/fix/concurrency
Fix/concurrency
2018-10-24 16:56:01 -05:00
zach rice 847687a637 fixing test. travis doesnt have rsa id 2018-10-24 16:48:34 -05:00
zach rice 94389137e8 removing private opts 2018-10-24 16:00:15 -05:00
zach rice 98e6ba9378 better ssh handling 2018-10-24 15:49:53 -05:00
zach rice e288db29a8 fixing tests 2018-10-24 12:40:05 -05:00
zach rice 98aeee9b1d fixing everything 2018-10-24 12:28:54 -05:00
Ziyaddin Sadigov 45a2aa8495 Fix typos in changelog 2018-10-24 21:19:40 +04:00
Ziyaddin Sadigov 4b350987a1 Fix typos in contributing.md 2018-10-24 21:11:29 +04:00
Ziyaddin Sadigov 3b2b754fe5 Fix typos in readme 2018-10-24 21:06:08 +04:00
zach rice 64e7afea98 updating version 2018-10-24 09:58:39 -05:00
zach rice 16765c19cf adding go routines does not help performance much.... posting benchmarks soon 2018-10-24 09:38:36 -05:00
Zachary Rice 87d916fc24 Merge pull request #123 from zricethezav/update/whitelist-repo
whitelist repo update
2018-10-23 16:38:17 -05:00
zach rice 21b59fab5d whitelist repo update 2018-10-23 16:34:36 -05:00
Zachary Rice 9272e1e556 Merge pull request #122 from zricethezav/feature/entropy-range
entropy ranges
2018-10-22 18:55:51 -05:00
zach rice 0a51dabb17 entropy ranges 2018-10-22 18:51:01 -05:00
Zachary Rice 8c1cee4e00 Merge pull request #116 from keirans/documentation_updates
Documentation enhancements
2018-10-21 10:23:48 -05:00
Keiran Sweet 4d5315e2ca Documentation updates 2018-10-21 17:12:00 +11:00
zach rice 88cc9bb363 committing to master nbd.... stupid version 2018-10-20 17:28:42 -05:00
Zachary Rice 80e41ee14c Merge pull request #118 from zricethezav/feature/github-pr
Feature/GitHub pr
2018-10-20 18:27:27 -04:00
zach rice 23489f3f18 updating changelog, readme, some other things 2018-10-20 17:16:35 -05:00
zach rice a998ddc9d4 adding github.go, pagination working 2018-10-20 16:31:52 -05:00
zach rice 833963c1c1 refactoring 2018-10-19 19:53:10 -05:00
zach rice 4b11f87f80 poc seems to work fine w token auth 2018-10-19 15:58:25 -04:00
Zachary Rice 923dcf0311 Merge pull request #117 from camaya/update-help-option
Update help option
2018-10-17 08:42:20 -04:00
Cristhian Amaya 8896cf66cd Update help option
* Show program usage when no arguments are provided
* Exit program after the -h or --help options are used
2018-10-15 17:10:44 +02:00
zach rice df133ccaf8 version boss strikes AGAIN 2018-10-12 19:01:42 -05:00
Zachary Rice 23cd693d71 Merge pull request #114 from zricethezav/report
report filetype enforcement, time to audit
2018-10-12 18:53:38 -05:00
zach rice 524d81fde9 durafmt 2018-10-12 18:43:03 -05:00
zach rice d387f528c4 update lint 2018-10-12 18:22:33 -05:00
zach rice dcda26578b report filetype enforcement, time to audit 2018-10-12 17:01:24 -05:00
Zachary Rice 28639d3a49 Merge pull request #112 from zricethezav/wl-commit
look at prev commit too
2018-10-10 12:19:21 -05:00
zach rice 19e23c9cbe look at prev commit too 2018-10-10 12:16:31 -05:00
Zachary Rice 160015b872 Merge pull request #111 from zricethezav/fix-wl-commit
rm commit count log
2018-10-10 09:50:28 -05:00
zach rice abdf2c47f0 cl update 2018-10-10 09:43:01 -05:00
zach rice 8536f16ceb rm commit count log 2018-10-10 09:41:49 -05:00
Zachary Rice 6862c13bf7 Merge pull request #109 from zricethezav/depth
Depth
2018-10-09 21:13:29 -05:00
zach rice 9939c638ec better log 2018-10-09 21:07:49 -05:00
zach rice ed3a512b4b commit depth option 2018-10-09 21:01:56 -05:00
Zachary Rice 7c988c927d Merge pull request #107 from camaya/feature/add-entropy-checks
Add option to check string entropy
2018-10-09 18:46:21 -05:00
zach rice bde9af44ea merging, adding comments, updating flag description 2018-10-09 18:42:09 -05:00
Zachary Rice eee4d05642 Merge pull request #108 from camaya/fix-commit-option
Fix commit option
2018-10-09 16:18:54 -05:00
Cristhian Amaya 9144594d77 Fix commit option
The --commit option was being ignored becase the Close() function doesn't stop
the iterator.
According to the documentation:
https://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/object#FileIter.ForEach
an ErrStop error should be send to stop it.
2018-10-09 16:49:16 +02:00
Cristhian Amaya 1cb15242fd Add option to check string entropy
Strings with high entropy have a good probability of being a secret.
2018-10-08 16:08:04 +02:00
Zachary Rice 08498600d1 Merge pull request #106 from zricethezav/exclude-fork
exclude fork
2018-10-07 18:42:42 -05:00
zach rice 88c0c7779b exclude fork 2018-10-07 18:39:17 -05:00
Zachary Rice 67454d109e Merge pull request #105 from zricethezav/wlrepo
Wlrepo
2018-10-07 18:26:18 -05:00
zach rice ce603c73b4 sample config opt 2018-10-07 18:19:43 -05:00
zach rice 55218fc8f8 whitelist repos 2018-10-07 18:09:10 -05:00
Zachary Rice 5d81c650e8 Merge pull request #104 from zricethezav/comments
Comments
2018-10-06 19:31:14 -05:00
zach rice 0726209172 maintenance 2018-10-06 19:27:54 -05:00
zach rice bfec8aca51 working on better comments 2018-10-05 22:55:19 -05:00
Zachary Rice a9b30edb06 Resource fix (#103)
* bumping version
2018-10-04 10:11:52 -05:00
Zachary Rice cc6d698e63 Resource fix (#102)
* no more dangling goroutines
2018-10-04 09:47:18 -05:00
Zachary Rice 2ba97d0fa3 fixing audit repo bug (#101)
* fixing audit repo bug

* bumping version
2018-10-02 12:34:05 -05:00
Zachary Rice d299b5aa7f Exitcode (#100)
* additional exit code, some more cleaning

* bump version
2018-10-02 09:52:18 -05:00
Zachary Rice 0a209b60a5 typo 2018-10-02 07:59:11 -05:00
Zachary Rice fe8c6271f2 panic plan (#99) 2018-10-01 22:44:25 -05:00
zach rice 42fb085684 pls contribute 2018-10-01 21:54:31 -05:00
Zachary Rice 3faec00bf9 Max go (#98)
* default max go, cleaning up for orgs

* bump changelog

* bumping version
2018-10-01 21:21:19 -05:00
Zachary Rice 93669f1ee8 Csv (#96)
* refactoring github audits, adding csv support

* working on tests

* test passing

* bumping version

* updating readme
2018-09-29 22:11:40 -05:00
Zachary Rice fad98cbde2 Single commit repo (#95)
* supporting repos with one commit
2018-09-26 14:28:22 -05:00
1327 changed files with 32824 additions and 324468 deletions

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
# Default — every PR requires at least one org member review.
* @bryanbeverly @dustin-decker @dxa4481 @zricethezav
# Release-critical paths
/.github/ @bryanbeverly @dustin-decker @dxa4481 @zricethezav
/.goreleaser.yml @bryanbeverly @dustin-decker @dxa4481 @zricethezav
/go.mod @bryanbeverly @dustin-decker @dxa4481 @zricethezav
/go.sum @bryanbeverly @dustin-decker @dxa4481 @zricethezav
+3
View File
@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [zricethezav]
+37
View File
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Basic Info (please complete the following information):**
- OS:
- Gitleaks Version:
**Additional context**
Add any other context about the problem here.
cc @zricethezav
<!--
Check out the Secret Scanning Discord Server for live discussions:
https://discord.gg/sydS6AHTUP
--->
+22
View File
@@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
cc @zricethezav
+16
View File
@@ -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
+8
View File
@@ -0,0 +1,8 @@
### Description:
Explain the purpose of the PR.
### Checklist:
* [ ] Does your PR pass tests?
* [ ] Have you written new tests for your changes?
* [ ] Have you lint your code locally prior to submission?
+17
View File
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
groups:
actions:
patterns:
- "*"
+17
View File
@@ -0,0 +1,17 @@
name: gitleaks
on:
push:
workflow_dispatch:
jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
if: ${{ github.repository == 'gitleaks/gitleaks' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}
+57
View File
@@ -0,0 +1,57 @@
name: Create and publish a Docker image
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Log in to Docker Hub
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Container registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: |
zricethezav/gitleaks
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+37
View File
@@ -0,0 +1,37 @@
name: Test
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
test:
strategy:
matrix:
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.25
- name: Build
run: go build ./...
- name: Set up gotestsum
run: |
go install gotest.tools/gotestsum@latest
- name: Test
run: |
gotestsum --raw-command -- go test -json ./... --race
- name: Validate Config
run: go generate ./... && git diff --exit-code
+24
View File
@@ -0,0 +1,24 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
*.DS_STORE
*.idea
*.got
gitleaks
build
profile
# configs
.gitleaks.toml
cmd/generate/config/gitleaks.toml
# test results
testdata/expected/report/*.got.*
# Test binary
*.out
dist/
+14
View File
@@ -0,0 +1,14 @@
# This is NOT the default gitleaks config. The default gitleaks config is located
# here: https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml
# This gitleaks config extends the default config and ignores secrets located in the `cmd/generate/config/rules`
title = "Gitleaks development"
[extend]
useDefault = true
[allowlist]
paths = [
'''(^|/)cmd/generate/config/rules''',
'''.*test\.go''',
'''testdata'''
]
+944
View File
@@ -0,0 +1,944 @@
418edf165dbb63d6f46993ae8f8818ffd87ea582:cmd/generate/config/rules/jwt.go:jwt:17
418edf165dbb63d6f46993ae8f8818ffd87ea582:cmd/generate/config/rules/jwt.go:jwt:19
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:46
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:48
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:50
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:52
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:54
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:55
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:56
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:57
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:22
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:23
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:24
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:28
525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:29
525d9792b1e3670b4630b8fcc385ca22e8544f9b:detect/detect_test.go:sidekiq-sensitive-url:164
525d9792b1e3670b4630b8fcc385ca22e8544f9b:detect/detect_test.go:sidekiq-sensitive-url:170
525d9792b1e3670b4630b8fcc385ca22e8544f9b:detect/detect_test.go:sidekiq-secret:120
525d9792b1e3670b4630b8fcc385ca22e8544f9b:detect/detect_test.go:sidekiq-secret:126
525d9792b1e3670b4630b8fcc385ca22e8544f9b:detect/detect_test.go:sidekiq-secret:142
31650f01e76858ce7a0490943426e84a0824bbc8:config/config_test.go:aws-access-token:31
5ed010c944ccc715cb9245abafd4e97d98d75e9f:config/config_test.go:aws-access-token:31
ad7509e3b47331ce9586743ace635422843b695b:cmd/generate/config/rules/privatekey.go:private-key:22
717cf1b10be1625875199eca8cdf48883348985f:README.md:aws-access-token:23
3474c58c9e25fe2b1cee855a35bd1bf8a8c0fae8:cmd/generate/config/rules/generic.go:clojars-api-token:38
a42b32bdf11b6f4ea5c32ec76a1731b4b0c5e52a:cmd/generate/config/rules/generic.go:generic-api-key:40
a42b32bdf11b6f4ea5c32ec76a1731b4b0c5e52a:cmd/generate/config/rules/generic.go:generic-api-key:41
3e5e63956ea770be734dcb7642cf515910154fb5:detect/detect_test.go:aws-access-token:50
3e5e63956ea770be734dcb7642cf515910154fb5:detect/detect_test.go:aws-access-token:60
3e5e63956ea770be734dcb7642cf515910154fb5:detect/detect_test.go:aws-access-token:61
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:pypi-upload-token:29
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:51
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:73
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:81
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:89
33082a996774ba4c8ad4ba26fd219d77497eb960:README.md:sidekiq-secret:43
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:discord-api-token:98
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:235
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:236
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:253
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:254
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:278
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:279
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:343
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:344
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:362
57d2d345b6b6ea220be9d99792b21a75359555c0:detect/detect_test.go:aws-access-token:363
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:pypi-upload-token:27
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:aws-access-token:49
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:aws-access-token:71
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:aws-access-token:79
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:aws-access-token:87
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:discord-api-token:120
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:discord-api-token:96
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:discord-api-token:128
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:discord-api-token:118
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:discord-api-token:150
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:discord-api-token:126
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:discord-api-token:166
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:175
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:183
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:238
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:239
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:256
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:257
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:281
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:282
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:356
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:357
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:375
6e72472b6019d29eaa4b76b39700cd2418741f0c:detect/detect_test.go:aws-access-token:376
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:discord-api-token:148
17b5540fb16bd9816d2a3a83f65cedf5918eaf70:detect/detect_test.go:pypi-upload-token:27
17b5540fb16bd9816d2a3a83f65cedf5918eaf70:detect/detect_test.go:pypi-upload-token:32
17b5540fb16bd9816d2a3a83f65cedf5918eaf70:detect/detect_test.go:pypi-upload-token:33
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:discord-api-token:164
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:aws-access-token:173
c9bc6b46087e700a42eb3492cf2053b7da4a6d9e:detect/detect_test.go:aws-access-token:181
ce42947cae32cda8d5d8813c1a8ce82eb06f018e:detect/git_test.go:aws-access-token:43
ce42947cae32cda8d5d8813c1a8ce82eb06f018e:detect/git_test.go:aws-access-token:60
ce42947cae32cda8d5d8813c1a8ce82eb06f018e:detect/git_test.go:aws-access-token:85
b8141713e89f5acec500c7a62415f0f1cb7234dc:README.md:discord-client-secret:273
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:README.md:aws-access-token:130
b8141713e89f5acec500c7a62415f0f1cb7234dc:README.md:discord-client-secret:289
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:README.md:discord-client-secret:251
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:README.md:discord-client-secret:267
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:detect/detect_test.go:aws-access-token:33
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:detect/files_test.go:aws-access-token:32
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:detect/files_test.go:aws-access-token:50
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:config/config_test.go:generic-api-key:133
80d29764a0bc0f269607d3eb7b2774a0f31e5da3:detect/detect_test.go:aws-access-token:123
80d29764a0bc0f269607d3eb7b2774a0f31e5da3:testdata/config/allow_global_aws_re.toml:aws-access-token:8
4acd7a3c8d20b7116a32f9bbade6a3cf15f741e4:detect/detect_test.go:aws-access-token:117
f0b8d26c9988af725132c100dda5051586a3026e:README.md:discord-client-secret:225
98d5648f6e54ea84ca915c73fff88ad3bc5809e0:config/config_test.go:generic-api-key:144
93f292c3dfa2649ef91f8925b623e79546fa992e:README.md:aws-access-token:121
93f292c3dfa2649ef91f8925b623e79546fa992e:README.md:aws-access-token:122
93f292c3dfa2649ef91f8925b623e79546fa992e:README.md:aws-access-token:157
93f292c3dfa2649ef91f8925b623e79546fa992e:config/config_test.go:aws-access-token:31
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/files_test.go:aws-access-token:32
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/files_test.go:aws-access-token:33
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/files_test.go:aws-access-token:50
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/files_test.go:aws-access-token:51
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/git_test.go:aws-access-token:42
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/git_test.go:aws-access-token:44
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/git_test.go:aws-access-token:58
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/git_test.go:aws-access-token:60
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/git_test.go:aws-access-token:82
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/git_test.go:aws-access-token:83
93f292c3dfa2649ef91f8925b623e79546fa992e:config/config_test.go:generic-api-key:133
93f292c3dfa2649ef91f8925b623e79546fa992e:testdata/config/allow_aws_re.toml:aws-access-token:9
93f292c3dfa2649ef91f8925b623e79546fa992e:config/config_test.go:generic-api-key:144
93f292c3dfa2649ef91f8925b623e79546fa992e:testdata/expected/git/small-branch-foo.txt:aws-access-token:15
93f292c3dfa2649ef91f8925b623e79546fa992e:testdata/repos/nogit/main.go:aws-access-token:20
93f292c3dfa2649ef91f8925b623e79546fa992e:testdata/expected/git/small.txt:aws-access-token:15
93f292c3dfa2649ef91f8925b623e79546fa992e:testdata/expected/git/small.txt:aws-access-token:44
3a3e13c3b5f85b0116cf2a0cd92529baf22d0ac9:testdata/repos/with_square_and_google/env:generic-api-key:3
6adc045580c3911a7a936be7b977979a5519aa29:scan/unstaged_test.go:aws-access-token:38
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_208ae46.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_208ae46.json:aws-access-token:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_ae8db4a2_208ae46.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_ae8db4a2_208ae46.json:aws-access-token:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results.json:aws-access-token:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results.json:aws-access-token:20
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results.json:aws-access-token:22
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_depth_1.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_depth_1.json:aws-access-token:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_files_at_208ae46.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_files_at_208ae46.json:aws-access-token:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_files_at_208ae46.json:aws-access-token:20
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_files_at_208ae46.json:aws-access-token:22
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_no_git.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_no_git.json:aws-access-token:5
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:aws-access-token:26
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:aws-access-token:31
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:aws-access-token:40
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:aws-access-token:46
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:aws-access-token:52
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:discord-api-token:59
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:discord-api-token:74
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:discord-api-token:80
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:discord-api-token:95
93f292c3dfa2649ef91f8925b623e79546fa992e:detect/detect_test.go:discord-api-token:109
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_no_git.json:aws-access-token:20
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_no_git.json:aws-access-token:22
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/basic/results_unstaged.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/basic/secrets.py:generic-api-key:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/basic/secrets.py:generic-api-key:6
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/basic/secrets.py:aws-access-token:9
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/basic/secrets.py:aws-access-token:13
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:aws-access-token:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:aws-access-token:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:aws-access-token:54
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:aws-access-token:56
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:generic-api-key:20
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:generic-api-key:22
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:generic-api-key:37
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results.json:generic-api-key:39
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_e7c0aff3.json:generic-api-key:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_e7c0aff3.json:generic-api-key:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_e7c0aff3.json:generic-api-key:20
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_e7c0aff3.json:generic-api-key:22
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_e7c0aff3.json:aws-access-token:37
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_e7c0aff3.json:aws-access-token:39
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_ae8db4a_e7c0aff.json:aws-access-token:37
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_ae8db4a_e7c0aff.json:aws-access-token:39
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_ae8db4a_e7c0aff.json:generic-api-key:3
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_ae8db4a_e7c0aff.json:generic-api-key:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_ae8db4a_e7c0aff.json:generic-api-key:20
6adc045580c3911a7a936be7b977979a5519aa29:testdata/expect/with_config/results_ae8db4a_e7c0aff.json:generic-api-key:22
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/with_config/secrets.py:generic-api-key:5
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/with_config/secrets.py:generic-api-key:6
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/with_config/secrets.py:aws-access-token:9
6adc045580c3911a7a936be7b977979a5519aa29:testdata/repos/with_config/secrets.py:aws-access-token:13
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_repos/test_dir_2/env:generic-api-key:1
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_repos/test_dir_2/env:generic-api-key:3
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_dir_one_google_leak_and_square_leak.json:generic-api-key:3
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_dir_one_google_leak_and_square_leak.json:generic-api-key:20
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:35
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:37
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:259
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:261
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:339
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:51
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:83
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:85
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:131
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:133
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:147
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:149
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:179
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:227
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:229
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:323
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:355
65f42020afcc65de3b7dfe5a797b9f6396345250:test_data/test_local_owner_aws_leak.json:aws-access-token:357
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_file1_aws_leak.json:aws-access-token:3
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_file1_aws_leak.json:aws-access-token:5
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_dir1_aws_leak.json:aws-access-token:3
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_dir1_aws_leak.json:aws-access-token:5
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_dir1_aws_leak.json:aws-access-token:17
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_dir1_aws_leak.json:aws-access-token:19
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_repos/test_dir_1/server.test.py:aws-access-token:5
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_repos/test_dir_1/server.test2.py:aws-access-token:5
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:99
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:101
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:115
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:117
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:131
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:133
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:147
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:149
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:163
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:165
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:179
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:181
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:195
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:197
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:211
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:213
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:83
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:85
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:99
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:101
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:115
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:117
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:131
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:133
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:147
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:149
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:163
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:165
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:179
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:259
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:261
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:181
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:195
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:197
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:339
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak.json:aws-access-token:341
2acc34dfdfb0e7f1141eadd940ea933c645e0f86:test_data/test_local_repo_three_leaks_with_report_groups.json:aws-access-token:3
2acc34dfdfb0e7f1141eadd940ea933c645e0f86:test_data/test_local_repo_three_leaks_with_report_groups.json:aws-access-token:5
2acc34dfdfb0e7f1141eadd940ea933c645e0f86:test_data/test_local_repo_three_leaks_with_report_groups.json:aws-access-token:18
2acc34dfdfb0e7f1141eadd940ea933c645e0f86:test_data/test_local_repo_three_leaks_with_report_groups.json:aws-access-token:20
2acc34dfdfb0e7f1141eadd940ea933c645e0f86:test_data/test_local_repo_three_leaks_with_report_groups.json:aws-access-token:33
2acc34dfdfb0e7f1141eadd940ea933c645e0f86:test_data/test_local_repo_three_leaks_with_report_groups.json:aws-access-token:35
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:259
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:261
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_commit_to_from.json:aws-access-token:3
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_commit_to_from.json:aws-access-token:5
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:323
c50906373cc38206f3d41c57e2c413ce400e61e7:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:325
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:18
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:20
fae366a404357fa6c6611756a11e61546ebec4e0:examples/simple_regex_and_allowlist_config.toml:aws-access-token:12
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_file_commit_range.json:aws-access-token:3
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_file_commit_range.json:aws-access-token:5
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_file_commit_range.json:aws-access-token:18
ad505754fc6283523ef8dfa88ecb6559e0268ec3:test_data/test_local_repo_two_leaks_file_commit_range.json:aws-access-token:20
fae366a404357fa6c6611756a11e61546ebec4e0:test_data/test_configs/aws_key_aws_allowlisted.toml:aws-access-token:7
fae366a404357fa6c6611756a11e61546ebec4e0:test_data/test_local_owner_aws_leak.json:aws-access-token:185
fae366a404357fa6c6611756a11e61546ebec4e0:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:95
fae366a404357fa6c6611756a11e61546ebec4e0:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:185
fae366a404357fa6c6611756a11e61546ebec4e0:test_data/test_local_repo_nine_aws_leak.json:aws-access-token:3
fae366a404357fa6c6611756a11e61546ebec4e0:test_data/test_local_repo_nine_aws_leak.json:aws-access-token:5
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:78
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:80
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak.json:aws-access-token:138
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak.json:aws-access-token:140
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak.json:aws-access-token:153
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak.json:aws-access-token:155
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak.json:aws-access-token:168
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak.json:aws-access-token:170
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:138
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:140
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:153
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:155
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:168
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_owner_aws_leak_allowlist_repo.json:aws-access-token:170
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_repo_eight.json:aws-access-token:3
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_repo_eight.json:aws-access-token:5
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_repo_eight.json:aws-access-token:18
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_repo_eight.json:aws-access-token:20
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_repo_eight.json:aws-access-token:33
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_local_repo_eight.json:aws-access-token:35
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_repos/test_repo_8/dummy.txt:aws-access-token:2
eabc7b5c12cb89b4a828b7aaef00fdfa694a7e0a:test_data/test_repos/test_repo_8/dummy.txt:aws-access-token:6
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:48
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_owner_aws_leak.json:aws-access-token:48
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:33
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_owner_aws_leak.json:aws-access-token:93
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:78
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:18
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_repo_three_leaks.json:aws-access-token:48
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:78
6ca7a11d8846af2a3d26f71c4a9083eb0b3deeee:test_data/test_local_repo_two_leaks.json:aws-access-token:33
bdc688dd5351adf1cf5cbf734dfd104ea6bab92b:test_data/test_local_repo_two_whitelist_commits.json:aws-access-token:3
bdc688dd5351adf1cf5cbf734dfd104ea6bab92b:test_data/test_local_repo_two_whitelist_commits.json:aws-access-token:4
bdc688dd5351adf1cf5cbf734dfd104ea6bab92b:test_data/test_local_repo_two_whitelist_commits.json:aws-access-token:16
bdc688dd5351adf1cf5cbf734dfd104ea6bab92b:test_data/test_local_repo_two_whitelist_commits.json:aws-access-token:17
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_six_leaks_since_date.json:aws-access-token:3
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_six_leaks_since_date.json:aws-access-token:4
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_six_leaks_until_date.json:aws-access-token:3
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_six_leaks_until_date.json:aws-access-token:4
0d7c18cb39c60efb62a6c7b351f95d46ebe1f63e:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:172
0d7c18cb39c60efb62a6c7b351f95d46ebe1f63e:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:173
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:3
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:4
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:16
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:17
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:29
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:30
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:42
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:43
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:55
e0f6399d5ccadd44544cdfe5f630de57fced1473:test_data/test_local_repo_four_leaks_commit_timerange.json:aws-access-token:56
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:3
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:4
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:16
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:17
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:29
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:30
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:42
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:43
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:55
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:56
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:68
cfbb600fcb286e1323e2e4d24144eeca163ad396:test_data/test_local_repo_two_leaks_deletion.json:aws-access-token:69
212232f80a22c4c698dd2864006f398ea1f15107:test_data/test_local_repo_seven_aws_leak_uncommitted.json:aws-access-token:3
212232f80a22c4c698dd2864006f398ea1f15107:test_data/test_local_repo_seven_aws_leak_uncommitted.json:aws-access-token:4
212232f80a22c4c698dd2864006f398ea1f15107:test_data/test_repos/test_repo_7/file:aws-access-token:5
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:55
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:56
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:94
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:95
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:55
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:56
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:134
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:160
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:94
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:95
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:133
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:134
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:172
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:173
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:3
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:4
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:16
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:17
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:29
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:30
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:42
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:43
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:55
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:56
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:68
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:69
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:81
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:82
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:94
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:95
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:107
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:108
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:120
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:121
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:133
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:134
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:146
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:147
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:159
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:160
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:172
473d0d55a71097894c5c6b9a2968ad478d2e6edf:test_data/test_local_owner_aws_leak_whitelist_repo.json:aws-access-token:173
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:185
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:186
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:29
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:30
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:42
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:43
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:224
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:225
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:211
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:212
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:263
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:264
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:237
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:238
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_one_aws_leak.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_one_aws_leak.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_one_aws_leak_commit.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:276
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:277
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_one_aws_leak_commit.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:316
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:342
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:55
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:56
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:95
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:121
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:3
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:4
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:29
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:30
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:42
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_five_files_at_latest_commit.json:aws-access-token:43
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_one_aws_leak_uncommitted.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_one_aws_leak_uncommitted.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:43
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:43
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:146
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:147
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:380
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:381
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:406
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:407
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:445
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_owner_aws_leak.json:aws-access-token:446
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:16
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:17
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:68
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:69
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:55
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:56
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:172
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks.json:aws-access-token:173
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:68
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:69
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:95
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_owner_aws_leak.json:aws-access-token:120
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_owner_aws_leak.json:aws-access-token:121
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_two_leaks.json:aws-access-token:107
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_two_leaks.json:aws-access-token:108
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:94
c6f15b768e19613228b232a712f53a39cc5120a3:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:95
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_three_leaks.json:aws-access-token:81
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_three_leaks.json:aws-access-token:82
c4b07f5113bf39019374579a64d83959236295e4:audit/util.go:aws-access-token:66
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:55
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:56
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:55
94cae90d1eb208410073669de54a21fb65f23742:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:56
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_owner_aws_leak.json:aws-access-token:276
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_owner_aws_leak.json:aws-access-token:277
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_one_aws_leak_and_file_leak.json:aws-access-token:16
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_one_aws_leak_and_file_leak.json:aws-access-token:17
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:146
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:147
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_six.json:aws-access-token:31
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_six.json:aws-access-token:33
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_six_filepath.json:aws-access-token:3
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_six_filepath.json:aws-access-token:4
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_six_path_globally_whitelisted.json:aws-access-token:3
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_local_repo_six_path_globally_whitelisted.json:aws-access-token:4
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_repos/test_repo_6/server.test.py:aws-access-token:5
10745be661121f2e6577170419cf8ce3308ae311:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:55
10745be661121f2e6577170419cf8ce3308ae311:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:56
10745be661121f2e6577170419cf8ce3308ae311:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:68
10745be661121f2e6577170419cf8ce3308ae311:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:69
c4b07f5113bf39019374579a64d83959236295e4:test_data/test_repos/test_repo_6/config/application.properties:aws-access-token:3
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:133
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:134
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_owner_aws_leak.json:aws-access-token:250
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_owner_aws_leak.json:aws-access-token:251
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_owner_aws_leak.json:aws-access-token:263
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_owner_aws_leak.json:aws-access-token:264
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:3
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:4
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:16
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_local_repo_five_files_at_commit.json:aws-access-token:17
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:3
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:4
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:16
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:17
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:42
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:43
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:68
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:69
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:94
2474c39311296b4d48c284b1ce82e0c270854bde:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:95
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_repos/test_repo_5/secrets.py:aws-access-token:1
d13e0fdfde8f5c6261c9e893461f32861e21e8f5:test_data/test_repos/test_repo_5/secrets.py:aws-access-token:4
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:3
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:4
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:16
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:17
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:29
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:30
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:42
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_range.json:aws-access-token:43
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:3
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:4
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:29
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_to.json:aws-access-token:30
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:3
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:4
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:16
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:17
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:29
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:30
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:42
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:43
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:55
a0f72a4e3595ddb382a77804d2674d54b2b0e880:test_data/test_local_repo_two_leaks_commit_from.json:aws-access-token:56
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_repo_two_leaks.json:aws-access-token:68
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_repo_two_leaks.json:aws-access-token:69
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:81
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:82
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:107
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:108
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_repo_two_leaks.json:aws-access-token:94
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_repo_two_leaks.json:aws-access-token:95
6e1c41b536a514e1d17768eb42ebf5d87e61247d:examples/simple_regex_and_whitelist_config.toml:aws-access-token:4
6e1c41b536a514e1d17768eb42ebf5d87e61247d:examples/simple_regex_and_whitelist_config.toml:aws-access-token:12
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:211
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:212
275232f8c8f3ae4936667602a06a46caa156580b:audit/util.go:aws-access-token:90
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:237
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:238
275232f8c8f3ae4936667602a06a46caa156580b:test_data/test_configs/aws_key_aws_whitelisted.toml:aws-access-token:6
275232f8c8f3ae4936667602a06a46caa156580b:test_data/test_regex_whitelist.json.got:aws-access-token:3
275232f8c8f3ae4936667602a06a46caa156580b:test_data/test_regex_whitelist.json.got:aws-access-token:4
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:315
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:316
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:341
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:342
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:445
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:446
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:471
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:472
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:549
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:550
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:575
4d04ea079fc4e7f46c9f751fccde8f18c33b9e13:test_data/test_local_owner_aws_leak.json:aws-access-token:576
e446ba073804cf714316c5dc00d0ac41917b31f7:test_data/test_regex_entropy.json:aws-access-token:3
e446ba073804cf714316c5dc00d0ac41917b31f7:test_data/test_regex_entropy.json:aws-access-token:4
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:241
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:242
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:255
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:256
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:269
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:270
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:283
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:284
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:297
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:298
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:311
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:312
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:325
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:326
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:339
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:340
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:353
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:354
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:367
2ccd40677db07877be4a5919a16f6a180fc2a7e4:test_data/test_local_owner_aws_leak.json:aws-access-token:368
b55d88dc151f7022901cda41a03d43e0e508f2b7:audit/audit_test.go:aws-access-token:207
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_entropy.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak.json:aws-access-token:4
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak_and_file_leak.json:aws-access-token:17
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak_and_file_leak.json:aws-access-token:18
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak_commit.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak_commit.json:aws-access-token:4
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak_uncommitted.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_one_aws_leak_uncommitted.json:aws-access-token:4
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:4
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:17
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:18
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:31
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:32
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:45
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:46
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:59
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:60
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:73
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:74
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:87
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:88
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:101
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_three_leaks.json:aws-access-token:102
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_repos/test_repo_1/server.test.py:aws-access-token:5
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:4
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:17
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:18
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:31
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:32
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:45
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:46
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:59
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:60
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:73
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_repo_two_leaks.json:aws-access-token:74
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:3
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:4
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:17
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:18
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:31
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:32
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:45
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:46
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:59
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:60
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:73
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:74
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:87
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:88
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:101
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:102
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:115
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:116
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:129
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:130
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:143
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:144
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:157
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:158
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:171
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:172
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:185
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:186
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:199
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:200
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:213
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:214
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:227
b55d88dc151f7022901cda41a03d43e0e508f2b7:test_data/test_local_owner_aws_leak.json:aws-access-token:228
7bd55e33b504f76fc2aec27f4f479a5fb2606480:src/constants.go:private-key:32
e79ffc6ae8f66931d687407e07bc0632fb262091:src/constants.go:private-key:23
2b995fda446e03b7660c327fec41265f03199c71:config.go:private-key:28
1f80d14f3f069118a2e578d83bbc8440495fc906:main.go:private-key:118
fe977ea8577b739c34a0071ba34e98cf6b6fad38:checks_test.go:aws-access-token:52
4b4fa00b69a9a2e5f7619b1ff1dd6d160f588aec:README.md:aws-access-token:25
4b4fa00b69a9a2e5f7619b1ff1dd6d160f588aec:README.md:aws-access-token:27
2186f2299990290e4e19cf3b28906e2ec369d01e:main.go:private-key:44
9f694531b203663588c68c82dbbfb34d4f71863f:main.go:private-key:44
1e250f1a14eab6f457d61f5d7650b47c6ff43334:checks_test.go:aws-access-token:19
1e250f1a14eab6f457d61f5d7650b47c6ff43334:config.yml:private-key:2
bc26e979c5911cf647c1bede0b3700ebaaa454c8:checks_test.go:aws-access-token:36
8f352bd840f028b481dc725b77d2f4904b77913b:checks_test.go:aws-access-token:34
ec2fc9d6cb0954fb3b57201cf6133c48d8ca0d29:checks_test.go:aws-access-token:37
06c9e824d5985c8e8789321ae70de7ace3b093dc:main.go:aws-access-token:15
6d801ed61cf4d75d176cbf9062ec6ad706c9d1eb:detect/detect_test.go:private-key:567
6d801ed61cf4d75d176cbf9062ec6ad706c9d1eb:testdata/repos/symlinks/source_file/id_ed25519:private-key:1
acce01f2338434a78f6a4a06a097b0fd23280484:README.md:aws-access-token:218
README.md:aws-access-token:204
README.md:aws-access-token:205
README.md:aws-access-token:244
cmd/generate/config/rules/privatekey.go:private-key:19
cmd/generate/config/rules/generic.go:clojars-api-token:43
cmd/generate/config/rules/generic.go:generic-api-key:45
cmd/generate/config/rules/generic.go:generic-api-key:46
cmd/generate/config/rules/sidekiq.go:sidekiq-secret:22
cmd/generate/config/rules/sidekiq.go:sidekiq-secret:23
cmd/generate/config/rules/sidekiq.go:sidekiq-secret:24
cmd/generate/config/rules/sidekiq.go:sidekiq-secret:28
cmd/generate/config/rules/sidekiq.go:sidekiq-secret:29
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:46
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:48
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:50
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:52
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:54
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:55
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:56
cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:57
config/config_test.go:aws-access-token:31
detect/detect_test.go:sidekiq-secret:120
detect/detect_test.go:sidekiq-secret:126
detect/detect_test.go:sidekiq-secret:142
detect/detect_test.go:aws-access-token:50
detect/detect_test.go:aws-access-token:60
detect/detect_test.go:aws-access-token:61
detect/detect_test.go:aws-access-token:98
detect/detect_test.go:aws-access-token:104
detect/detect_test.go:aws-access-token:105
detect/detect_test.go:aws-access-token:186
detect/detect_test.go:aws-access-token:194
detect/detect_test.go:aws-access-token:202
detect/detect_test.go:aws-access-token:288
detect/detect_test.go:aws-access-token:296
detect/detect_test.go:aws-access-token:359
detect/detect_test.go:aws-access-token:360
detect/detect_test.go:aws-access-token:378
detect/detect_test.go:aws-access-token:379
detect/detect_test.go:aws-access-token:404
detect/detect_test.go:aws-access-token:405
detect/detect_test.go:aws-access-token:480
detect/detect_test.go:aws-access-token:481
detect/detect_test.go:aws-access-token:499
detect/detect_test.go:aws-access-token:500
detect/detect_test.go:sidekiq-sensitive-url:164
detect/detect_test.go:sidekiq-sensitive-url:170
detect/detect_test.go:pypi-upload-token:76
detect/detect_test.go:pypi-upload-token:82
detect/detect_test.go:pypi-upload-token:83
detect/detect_test.go:discord-api-token:211
detect/detect_test.go:discord-api-token:233
detect/detect_test.go:discord-api-token:241
detect/detect_test.go:discord-api-token:263
detect/detect_test.go:discord-api-token:279
testdata/config/allow_aws_re.toml:aws-access-token:9
testdata/config/allow_global_aws_re.toml:aws-access-token:8
testdata/expected/git/small-branch-foo.txt:aws-access-token:15
testdata/expected/git/small.txt:aws-access-token:15
testdata/expected/git/small.txt:aws-access-token:44
testdata/repos/nogit/main.go:aws-access-token:20
testdata/repos/nogit/api.go:aws-access-token:20
testdata/repos/small/api/ignoreCommit.go:aws-access-token:20
testdata/repos/small/api/ignoreGlobal.go:aws-access-token:20
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:513
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:492
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:414
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:388
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:366
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:discord-api-token:255
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:discord-api-token:224
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:sidekiq-sensitive-url:177
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:sidekiq-secret:154
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:sidekiq-secret:130
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:107
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:pypi-upload-token:84
3df8c3deb7bc1e34210bdbce114f1c6165bc6ac8:detect/detect_test.go:aws-access-token:62
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:62
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:pypi-upload-token:84
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:107
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:sidekiq-secret:130
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:sidekiq-secret:154
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:sidekiq-sensitive-url:177
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:discord-api-token:224
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:discord-api-token:255
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:366
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:388
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:414
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:492
96eed6aa0f507fe0c21bb46bec32637dc4cb1a9f:detect/detect_test.go:aws-access-token:513
bfbc39eb185a217ead81a7174026f1c55f963660:cmd/generate/config/rules/jwt.go:jwt:17
bfbc39eb185a217ead81a7174026f1c55f963660:cmd/generate/config/rules/jwt.go:jwt:19
acce01f2338434a78f6a4a06a097b0fd23280484:README.md:aws-access-token:220
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:514
111c8b47b65627db117bd20be85ff0aee8961eb9:detect/detect_test.go:private-key:567
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:512
99d620c719020fa24baa831299f0c964da79875e:detect/detect_test.go:aws-access-token:513
69f161c0a0cc0f7858f7d0609d656f4edcedd84c:detect/detect_test.go:discord-api-token:326
9701bf1724d822c0d5bbb7627535dd639a37bf56:testdata/repos/staged/api/api.go:aws-access-token:7
9701bf1724d822c0d5bbb7627535dd639a37bf56:detect/detect_test.go:aws-access-token:505
9701bf1724d822c0d5bbb7627535dd639a37bf56:detect/detect_test.go:aws-access-token:506
9701bf1724d822c0d5bbb7627535dd639a37bf56:detect/detect_test.go:aws-access-token:507
9701bf1724d822c0d5bbb7627535dd639a37bf56:testdata/repos/staged/api/api.go:aws-access-token:6
9701bf1724d822c0d5bbb7627535dd639a37bf56:testdata/repos/staged/api/api.go:aws-access-token:7
91ff8f9b7020a16dac9b8b9ef98560ea1cb464f8:testdata/repos/small/api/ignoreCommit.go:aws-access-token:20
91ff8f9b7020a16dac9b8b9ef98560ea1cb464f8:testdata/repos/small/api/ignoreGlobal.go:aws-access-token:20
91ff8f9b7020a16dac9b8b9ef98560ea1cb464f8:testdata/repos/nogit/api.go:aws-access-token:20
adf617b3b4628e1160fa3d135b4c3dfd45c05e15:testdata/repos/nogit/api.go:aws-access-token:20
adf617b3b4628e1160fa3d135b4c3dfd45c05e15:testdata/repos/small/api/ignoreGlobal.go:aws-access-token:20
adf617b3b4628e1160fa3d135b4c3dfd45c05e15:testdata/repos/small/api/ignoreCommit.go:aws-access-token:20
f361c5ef71853923277e3f284890083bc7825205:detect/reader_test.go:aws-access-token:12
8cfa6b2e43544895f52d2e37535ccfe29a6cdfd3:cmd/generate/config/rules/infracost.go:infracost-api-token:24
8cfa6b2e43544895f52d2e37535ccfe29a6cdfd3:cmd/generate/config/rules/infracost.go:generic-api-key:29
8cfa6b2e43544895f52d2e37535ccfe29a6cdfd3:cmd/generate/config/rules/discord.go:discord-client-secret:64
8cfa6b2e43544895f52d2e37535ccfe29a6cdfd3:cmd/generate/config/rules/grafana.go:grafana-cloud-api-token:42
8cfa6b2e43544895f52d2e37535ccfe29a6cdfd3:cmd/generate/config/rules/grafana.go:grafana-service-account-token:80
9152eaa57a91d7249bd0b3c3a86b9e837072a828:detect/reader_test.go:aws-access-token:12
9152eaa57a91d7249bd0b3c3a86b9e837072a828:cmd/generate/config/rules/aws.go:aws-access-token:42
93acc6e82adb46ef442fcb44bd9fd83489690ca3:cmd/generate/config/rules/1password.go:1password-service-account-token:25
93acc6e82adb46ef442fcb44bd9fd83489690ca3:cmd/generate/config/rules/1password.go:1password-service-account-token:27
93acc6e82adb46ef442fcb44bd9fd83489690ca3:cmd/generate/config/rules/1password.go:1password-service-account-token:28
93acc6e82adb46ef442fcb44bd9fd83489690ca3:cmd/generate/config/rules/1password.go:generic-api-key:37
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:openai-api-key:125
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:100
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:102
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:108
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:112
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:121
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:122
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:123
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:126
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:131
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:134
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:137
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:curl-auth-header:137
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:generic-api-key:139
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:jwt:134
83a57244cdd0bfe1634326ab04a29b9b139bf158:cmd/generate/config/rules/curl.go:jwt:170
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:32
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:33
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:40
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:42
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:43
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:44
cf5334fd61d16fb4af1362856ebfb98397c5d4b3:cmd/generate/config/rules/curl.go:curl-auth-user:45
aabe3815394d24d5b8198ba6068a99e0ba7601b1:config/config_test.go:aws-access-token:72
b9f7fdaacb9e3799a9b3e4f7f6181963b8931b73:config/config_test.go:aws-access-token:67
3ef444d24677c863bb724fa406dd12464b7f2362:config/config_test.go:aws-access-token:39
8fb39ba8dc9d872d57cc3151b3750e8234b9b980:cmd/generate/config/rules/azure.go:azure-ad-client-secret:33
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/decoder_test.go:generic-api-key:22
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/decoder_test.go:generic-api-key:32
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/decoder_test.go:generic-api-key:37
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/decoder_test.go:generic-api-key:54
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/decoder_test.go:generic-api-key:59
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/decoder_test.go:generic-api-key:64
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:private-key:23
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:generic-api-key:39
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:jwt:32
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:private-key:365
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:private-key:366
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:private-key:368
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:private-key:393
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:private-key:394
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:aws-access-token:407
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:aws-access-token:408
2278a2a97e422c8075207d17195b29e7f4ff15e1:detect/detect_test.go:generic-api-key:452
f8dcd838da26f591c70acbbc3dea8d8b4d1649c7:detect/detect_test.go:generic-api-key:616
f8dcd838da26f591c70acbbc3dea8d8b4d1649c7:detect/detect_test.go:generic-api-key:618
f8dcd838da26f591c70acbbc3dea8d8b4d1649c7:testdata/repos/nogit/.env.prod:generic-api-key:4
032c47e7e1ebfb745d3b66ef448697d4cbf6a406:detect/detect_test.go:generic-api-key:38
032c47e7e1ebfb745d3b66ef448697d4cbf6a406:detect/detect_test.go:generic-api-key:451
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:private-key:22
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:jwt:31
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/decoder_test.go:generic-api-key:22
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/decoder_test.go:generic-api-key:32
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/decoder_test.go:generic-api-key:37
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/decoder_test.go:generic-api-key:54
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/decoder_test.go:generic-api-key:59
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/decoder_test.go:generic-api-key:64
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:private-key:359
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:private-key:360
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:private-key:362
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:private-key:387
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:private-key:388
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:aws-access-token:401
6c5e01c144b3d5e48422ab66a353f4cbdc14b24a:detect/detect_test.go:aws-access-token:402
78f7d3f5dfba03f816418f987ff3a78643c1eda7:cmd/generate/config/rules/flyio.go:flyio-access-token:26
78f7d3f5dfba03f816418f987ff3a78643c1eda7:cmd/generate/config/rules/flyio.go:flyio-access-token:30
78f7d3f5dfba03f816418f987ff3a78643c1eda7:cmd/generate/config/rules/flyio.go:flyio-access-token:34
78f7d3f5dfba03f816418f987ff3a78643c1eda7:cmd/generate/config/rules/flyio.go:flyio-access-token:37
78f7d3f5dfba03f816418f987ff3a78643c1eda7:cmd/generate/config/rules/flyio.go:flyio-access-token:38
3698060a2bcf926b8ae459270d9bcb7b69339104:cmd/generate/config/rules/kubernetes.go:generic-api-key:56
3698060a2bcf926b8ae459270d9bcb7b69339104:cmd/generate/config/rules/kubernetes.go:generic-api-key:68
3698060a2bcf926b8ae459270d9bcb7b69339104:cmd/generate/config/rules/kubernetes.go:generic-api-key:79
3698060a2bcf926b8ae459270d9bcb7b69339104:cmd/generate/config/rules/kubernetes.go:generic-api-key:147
3698060a2bcf926b8ae459270d9bcb7b69339104:cmd/generate/config/rules/kubernetes.go:generic-api-key:153
3698060a2bcf926b8ae459270d9bcb7b69339104:cmd/generate/config/rules/kubernetes.go:generic-api-key:162
5740eddd75b2a1149374438afe80c7cf2535b35f:README.md:aws-access-token:221
5740eddd75b2a1149374438afe80c7cf2535b35f:README.md:aws-access-token:223
5740eddd75b2a1149374438afe80c7cf2535b35f:README.md:aws-access-token:259
5740eddd75b2a1149374438afe80c7cf2535b35f:cmd/generate/config/rules/generic.go:clojars-api-token:42
372d99cfdb92a1e177badbfc1cd65bd692df9025:cmd/generate/config/rules/hashicorp.go:hashicorp-tf-api-token:24
372d99cfdb92a1e177badbfc1cd65bd692df9025:cmd/generate/config/rules/vault.go:vault-service-token:22
372d99cfdb92a1e177badbfc1cd65bd692df9025:cmd/generate/config/rules/vault.go:vault-service-token:25
3be7faa1ffc80f1aa071192a09141d5e829e1af3:cmd/generate/config/rules/vault.go:vault-service-token:22
3be7faa1ffc80f1aa071192a09141d5e829e1af3:cmd/generate/config/rules/hashicorp.go:hashicorp-tf-api-token:24
3be7faa1ffc80f1aa071192a09141d5e829e1af3:cmd/generate/config/rules/vault.go:vault-service-token:25
840c3cb24dcf14bf3332793f0702e75085ff5de2:detect/verify_test.go:generic-api-key:39
840c3cb24dcf14bf3332793f0702e75085ff5de2:detect/verify_test.go:generic-api-key:47
840c3cb24dcf14bf3332793f0702e75085ff5de2:detect/verify_test.go:generic-api-key:88
c1345e1b2b63260d860637530ba4d17571d547d6:cmd/generate/config/rules/openshift.go:openshift-user-token:27
c1345e1b2b63260d860637530ba4d17571d547d6:cmd/generate/config/rules/openshift.go:openshift-user-token:28
821b2323940b1792d9001d0812a2a4f7480a69c0:cmd/generate/config/rules/cloudflare.go:cloudflare-origin-ca-key:20
821b2323940b1792d9001d0812a2a4f7480a69c0:cmd/generate/config/rules/cloudflare.go:cloudflare-origin-ca-key:21
e265bfbbc3b208a23f0e46dd4a96795817068b77:detect/validate_test.go:generic-api-key:93
9d06c40017ba6710032e9bc08ebbc056175629cf:detect/validate_test.go:github-pat:33
9d06c40017ba6710032e9bc08ebbc056175629cf:detect/validate_test.go:github-pat:36
9d06c40017ba6710032e9bc08ebbc056175629cf:detect/validate_test.go:generic-api-key:43
9d06c40017ba6710032e9bc08ebbc056175629cf:detect/validate_test.go:generic-api-key:49
9d06c40017ba6710032e9bc08ebbc056175629cf:detect/validate_test.go:generic-api-key:57
e9135cf0b598738b5fc63ca004db8ab30845393d:cmd/generate/config/rules/jwt.go:jwt:48
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:85
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:86
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:87
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:88
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:89
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:90
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:91
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:93
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:95
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:96
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-organization-api-token:97
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:30
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:31
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:32
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:33
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:34
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:35
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:36
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:37
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:38
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:39
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:40
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:41
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:42
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:43
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:45
9fb36b242d75aac1a2bf885724dfd9886db08ea7:cmd/generate/config/rules/huggingface.go:huggingface-access-token:46
463d24618fa42fc7629dc30c9744ebe36c5df1ab:cmd/generate/config/rules/slack.go:slack-user-token:66
463d24618fa42fc7629dc30c9744ebe36c5df1ab:cmd/generate/config/rules/slack.go:slack-config-access-token:115
463d24618fa42fc7629dc30c9744ebe36c5df1ab:cmd/generate/config/rules/slack.go:slack-legacy-workspace-token:210
025908808f2ad1ce244f9806b8dd593bd9afbab0:detect/detect_test.go:discord-api-token:326
e002920355ac91770a329cfa69d6359bd665ba66:cmd/generate/config/rules/privatekey.go:private-key:26
e890a8e8098ee8021d25a429315a6c153126db22:cmd/generate/config/rules/jwt.go:jwt:17
9326f35380636bcbe61e94b0584d1618c4b5c2c2:detect/detect_test.go:pypi-upload-token:27
9326f35380636bcbe61e94b0584d1618c4b5c2c2:detect/detect_test.go:pypi-upload-token:32
9326f35380636bcbe61e94b0584d1618c4b5c2c2:detect/detect_test.go:pypi-upload-token:33
3a3e13c3b5f85b0116cf2a0cd92529baf22d0ac9:testdata/repos/with_square_and_google/env:gcp-api-key:3
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_repos/test_dir_2/env:gcp-api-key:3
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_dir_one_google_leak_and_square_leak.json:gcp-api-key:20
45c898c5ea56ee503a048c1bac1404cf63855edc:test_data/test_dir_one_google_leak_and_square_leak.json:gcp-api-key:22
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:16
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:17
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:42
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:43
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:68
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:69
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:94
f6460a7365479a48581e0641b40147914542bb24:test_data/test_local_owner_aws_leak_depth_2.json:aws-access-token:95
7bd55e33b504f76fc2aec27f4f479a5fb2606480:src/constants.go:private-key:42
e79ffc6ae8f66931d687407e07bc0632fb262091:src/constants.go:private-key:29
2b995fda446e03b7660c327fec41265f03199c71:config.go:private-key:34
ccef3680d5552443c999345567ea60909c863c0a:checks_test.go:aws-access-token:52
1cecd5e0908ab581f217ebb2cb58829204530c79:README.md:aws-access-token:25
1cecd5e0908ab581f217ebb2cb58829204530c79:README.md:aws-access-token:27
e56870aecf8ac2733affc82e1ac25e3be9092db3:cmd/generate/config/rules/curl.go:generic-api-key:116
239e6323639b18ba8a1081f17788a658da075dd7:cmd/generate/config/rules/sumologic.go:sumologic-access-token:72
239e6323639b18ba8a1081f17788a658da075dd7:cmd/generate/config/rules/sumologic.go:sumologic-access-id:40
239e6323639b18ba8a1081f17788a658da075dd7:cmd/generate/config/rules/readme.go:readme-api-token:26
239e6323639b18ba8a1081f17788a658da075dd7:cmd/generate/config/rules/prefect.go:prefect-api-token:26
239e6323639b18ba8a1081f17788a658da075dd7:cmd/generate/config/rules/databricks.go:databricks-api-token:25
239e6323639b18ba8a1081f17788a658da075dd7:cmd/generate/config/rules/databricks.go:generic-api-key:22
c24a3a654b18d689732ec3199f0a19a254505b04:detect/detect_test.go:generic-api-key:52
c08cb1dc9aee87186dba4eebbc13b8aaa2351f0c:detect/detect_test.go:generic-api-key:52
ee0da5c7fa5f3c9a7f1617e162497199cac3537f:README.md:generic-api-key:480
782f3104786efdce0f809bce8a9ff31f2fa1c9ed:README.md:generic-api-key:481
+86
View File
@@ -0,0 +1,86 @@
version: '2'
linters:
default: none
# It might be worth going through some of the disabled linters and enabling
# them and fixing the items they call out e.g.: cyclop, prealloc,
# paralleltest, prealloc, errcheck, dupl, unused, testifylint, gosec,
# gocritic, perfsprint, exptostd, intrange, perfsprint (maybe others?)
disable:
- cyclop
- depguard
- dupl
- err113
- errcheck
- exhaustive
- exhaustruct
- exptostd
- forbidigo
- funcorder
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gosec
- gosmopolitan
- intrange
- lll
- maintidx
- mnd
- musttag
- nestif
- nilerr
- nlreturn
- nonamedreturns
- paralleltest
- perfsprint
- prealloc
- predeclared
- tagliatelle
- testifylint
- testpackage
- tparallel
- unparam
- unused
- varnamelen
- wastedassign
- whitespace
- wrapcheck
- wsl
- zerologlint # doesn't seem to catch gitleaks/v8/logging mistakes
enable:
- inamedparam
- misspell
- revive
- misspell
- inamedparam
- exhaustruct
- inamedparam
- misspell
- nonamedreturns
- staticcheck
- unconvert
exclusions:
rules:
- linters:
- staticcheck
source: 'detector\.Detect\w+\(|sources\.DirectoryTargets\(|detect\.(?:Fragment|RemoteInfo)'
- linters:
- misspell
source: '"(?:addres|busines|clas)",'
settings:
staticcheck:
checks:
- all
- '-QF1001'
- '-ST1000'
- '-ST1003'
- '-ST1018'
- '-ST1020'
- '-ST1021'
revive:
severity: error
+31
View File
@@ -0,0 +1,31 @@
project_name: gitleaks
builds:
- main: main.go
binary: gitleaks
goos:
- darwin
- linux
- windows
goarch:
- amd64
- "386"
- arm
- arm64
goarm:
- "6"
- "7"
tags:
- gore2regex
ldflags:
- -s -w -X=github.com/zricethezav/gitleaks/v8/version.Version={{.Version}}
archives:
- builds: [gitleaks]
format_overrides:
- goos: windows
format: zip
replacements:
amd64: x64
386: x32
release:
prerelease: true
+17
View File
@@ -0,0 +1,17 @@
- id: gitleaks
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
entry: gitleaks git --pre-commit --redact --staged --verbose
language: golang
pass_filenames: false
- id: gitleaks-docker
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
entry: zricethezav/gitleaks git --pre-commit --redact --staged --verbose
language: docker_image
pass_filenames: false
- id: gitleaks-system
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
entry: gitleaks git --pre-commit --redact --staged --verbose
language: system
-19
View File
@@ -1,19 +0,0 @@
sudo: required
language: go
go:
- 1.9
services:
- docker
script:
- make test
after_success:
- export REPO=zricethezav/gitleaks
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH;
fi`
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make deploy; fi
env:
global:
- secure: kUjq6Jgnm57V+ikDoYJ4IrFu4bLMHkaBb9uLtbQj0A545zZt4Dbooarnwqbfz2efqqMDZ9TXP6kN6677yWm0DyvFOCYx/Xq2innnVbBJczQciEUb5PI/9fcmLOfTe/QgGNi0GZOCdIOGlki2sbKxob6tTOUsm52ugRSJU92cXkX8w+Gzc6pC6fAb4moLE2QpwK1xWDHm2sHiZYExpBOH8eidSH5VPGVdNE9QmUA/FwwJ9NFGsZ8BgWCJPy7IJreyixsv2nNpiZNHoj0UgKe4wylzceu4sG/yQDIYk3fLVWBXSm/nSA17QYIjVMzQFjSAVC5dRqzq8HzFYiAYLKzkoOtrbBqEGtXzYZMN6yC8zEedk9gX6P6mvGpWYBy280uumcpGl6eoKYj5ke2H6kfcCUhMNTGZP17nmnTa1KFLAz1nxB1jfJwwO6v1l+xdytju5yAhm049Af7VyDM5GmE2x5ha48uKvK7wHtv+IKiZbbcR9ExsXvm21+7NVjQvRPzAw4/Sor9SG/yjoA/Sf7e4evy1w3fALv4WlaSisj5Yalmv7mzeeFZaIB7EIq6OryeRld2Rr1MZwwhZgIs7+SWwpjKfwhkfLVEUvSWCdnS2tnTydK6R6OFxfG5TGfR/WHooXLHEv5gMuKhUu/CqnbLyvI+8IOH2ybz2AtZWjf5n7oY=
- secure: cIxKSkBNkPFAn243eHtwHJb8z6Uty1cZ43ZK/UABjwJoSrhu/roK4soqdZLwdVRA/0QswAlp6AC25Zs3ngLKGxxFHoeB8Tx6VLanE1zoi8OT0I2KbT92FdrLV4HlcRshKZtTFoTCfgVKPnWNKC+hil97CQzQPGRpZLBSfNefk5uCMnQiAzaJ5lyWPx+sjLHzpVlGA6aQx9ZeBQqngQJoDHKc0K3hKwug4h9mkkhyaYE3kgxtsdOYlHvOtQgVk+Zih5uW7ABOQCyAOaQVipXBC+uiuNf2DeAuGDaX69DTRKqPzuIasbhwyGqlfsr2JeofEWgZGmTaWGKMi03hnIY+U9+lHjygBW1qqVglODboouUrV3LwER9kqrT+ZFTM5Ca8VB+Gx5khkknbjWd06jpzRQxNXdukYN89kEaAHkBH844G99pMDqcZ32lHK7lpCu8n1H/Liz3ygoV6ScJXnYAP6y9rrd3bb9KEmnKhmFacVLRIAUw1vN/cgspJpl/Mk6s5rvGwsbQih1OxGyooOLxGjEGWqVDFgHFtyiwX9s9kT+hNTwKgbhp7Ragk/QuDYUPZ3Vum7HoiNPS9KpQNstLvDckdtd8h13JIw6nX+xdWbNKjjdYbAZRstJHUROQtNq3XdWNQ9YjqbCoybaxCOwOUTwOiTSWNKXjTFbFI5mR/ZO0=
- COMMIT=${TRAVIS_COMMIT::8}
- secure: o6uPX071qGRKgOQmitxiDr1j+KRW8W6ru0wmKNBFuUlZvQudwCUZMnVfk6OeofT1IgLCHmLS8ST81cTyeXqOQhYVZrlxTmEUpDHHRTu6dOj3eqRzdJow1LIWNpw5xfOaqXUdQ8+SQ47ZeSFapsmaY9oeRDvSJ8zLS4qUdgUylvZFJWjSrjzi2xemJa1l3MDdZRhEaNkfMliDGCv2vuUFp7tYz0QtyqBkBMORQl53dzgrcQcsRjDSE274WJl9CUg1l0pNMFsAbVCUGwUqCmKace9LXZ9JV00TRdg4EpryDsUCi23q0THnwstvRffwyJrw+xbhY/X3GKC4zOKqiCLJ4MTPQEIKlpVJQ9e9lWJ8FYhpUrl3QaHfEPINJ0taUfGhCyNzi5QBkSWbTcWVmRMmu+QIy7moW9crcz2xmVEUey7AaGwZT2Kk6JGw26w5q9IUy1Z9mwaljmHrUTqZrOX4Hj3UblpkHN+mGkoia/ipta5KhN5lTTIs4N3V+El7O2R2GggBrVHNiSualfydo+RX8k/S6PM1/C88IQO3Y2utoJrr415CznncvhF9Sc6tncZcShcNQj1iEOSsGxY2noW265eHzTMKJ/xuN6Bp9OXVK+8iOcUsz1T7F0UqwY3xnD8F7fBZ7IGG41DsXBDIcPmb+SIYbhv0uJjm3BEuv4TzIU0=
-64
View File
@@ -1,64 +0,0 @@
CHANGELOG
=========
1.3.0
-----
- Target specific branch
1.2.1
-----
- Check errors when generating commit patch
1.2.0
-----
- Added support for providing an alternate GitHub URL to support scanning GitHub Enteprise repositories
1.1.2
-----
- Added version option
- Introduced changelog
1.1.1
-----
- Fixed commit patch order
- Updated Readme
1.1.0
-----
- Fixed Twitter typo
- Fixed sample docker command
- Default clone option to "in-memory"
- Added clone option for "disk"
- Updated Makefile
1.0.0
-----
- Rewrite, see Readme.md: https://github.com/zricethezav/gitleaks/releases/tag/v1.0.0
0.4.0
-----
- Added support for external regexes
0.3.0
-----
- Added local scan
- Meaningful exit codes
- Timestamped logs
- Refactored for some maintainability
0.2.0
-----
- Additionally regex checking
- $HOME/.gitleaks/ directory for clones and reports
- Pagination for Org/User list... no more partial repo lists
- Persistent repos for Orgs and Users (no more re-cloning)
- Updated README
- Multi-staged Docker build
- Travis CI
0.1.0
-----
- full git history search
- regex/entropy checks
- report generation
+102
View File
@@ -0,0 +1,102 @@
# Contribution guidelines
## General
### Issues
If you have a feature or bug fix you would like to contribute please check if
there are any open issues describing your proposed addition. If there are open
issues, make a comment stating you are working on fixing or implementing said
issue. If not, then please open an issue describing your addition. Make sure to
link your PR to an issue.
### Pull Requests
Fill out the template as best you can. Make sure your tests pass. If you see a
PR that isn't one you opened and want it introduced in the next release,
give it a :thumbsup: on the PR description.
## Adding new Gitleaks rules
If you want to add a new rule to the [default Gitleaks configuration](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) then follow these steps.
1. Create a `cmd/generate/config/rules/{provider}.go` file.
This file is used to generate a new Gitleaks rule.
Let's look at `beamer.go` for example. Comments have been added for context.
```golang
func Beamer() *config.Rule {
// Define Rule
r := config.Rule{
// Human readable description of the rule
Description: "Beamer API token",
// Unique ID for the rule
RuleID: "beamer-api-token",
// Regex capture group for the actual secret
// Regex used for detecting secrets. See regex section below for more details
Regex: GenerateSemiGenericRegex([]string{"beamer"}, `b_[a-z0-9=_\-]{44}`, true)
// Keywords used for string matching on fragments (think of this as a prefilter)
Keywords: []string{"beamer"},
}
// validate
tps := []string{
generateSampleSecret("beamer", "b_"+secrets.NewSecret(alphaNumericExtended("44"))),
}
fps := []string{
`R21A-A-V010SP13RC181024R16900-CN-B_250K-Release-OTA-97B6C6C59241976086FABDC41472150C.bfu`,
}
return validate(r, tps, fps)
}
```
Feel free to use this example as a template when writing new rules.
This file should be fairly self-explanatory except for a few items;
regex and secret generation. To help with maintence, _most_ rules should
be uniform. The functions,
[`GenerateSemiGenericRegex`](https://github.com/zricethezav/gitleaks/blob/master/cmd/generate/config/rules/rule.go#L31) and [`GenerateUniqueTokenRegex`](https://github.com/zricethezav/gitleaks/blob/master/cmd/generate/config/rules/rule.go#L44) will generate rules
that follow defined patterns.
The function signatures look like this:
```golang
func GenerateSemiGenericRegex(identifiers []string, secretRegex string, isCaseInsensitive bool) *regexp.Regexp
func GenerateUniqueTokenRegex(secretRegex string, isCaseInsensitive bool) *regexp.Regexp
```
`GenerateSemiGenericRegex` accepts a list of identifiers, a regex, and a boolean indicating whether the pattern should be case-insensitive.
The list of identifiers _should_ match the list of `Keywords` in the rule
definition above. Both `identifiers` in the `GenerateSemiGenericRegex`
function _and_ `Keywords` act as filters for Gitleaks telling the program
"_at least one of these strings must be present to be considered a leak_"
`GenerateUniqueTokenRegex` just accepts a regex and a boolean indicating whether the pattern should be case-insensitive. If you are writing a rule for a
token that is unique enough not to require an identifier then you can use
this function. For example, Pulumi's API Token has the prefix `pul-` which is
unique enough to use `GenerateUniqueTokenRegex`. But something like Beamer's API
token that has a `b_` prefix is not unique enough to use `GenerateUniqueTokenRegex`,
so instead we use `GenerateSemiGenericRegex` and require a `beamer`
identifier is part of the rule.
If a token's prefix has more than `3` characters then you could
probably get away with using `GenerateUniqueTokenRegex`.
Last thing you'll want to hit before we move on from this file is the
validation part. You can use `generateSampleSecret` to create a secret for the
true positives (`tps` in the example above) used in `validate`.
1. Update `cmd/generate/config/main.go`. Extend `configRules` slice with
the `rules.Beamer(),` in `main()`. Try and keep
this alphabetically pretty please.
1. Run `make config/gitleaks.toml`
1. Check out your new rules in `config/gitleaks.toml` and see if everything looks good.
1. Open a PR
+8 -11
View File
@@ -1,16 +1,13 @@
FROM golang:1.10.3 AS build
FROM golang:1.24 AS build
WORKDIR /go/src/github.com/zricethezav/gitleaks
COPY . .
RUN CGO_ENABLED=0 go build -o bin/gitleaks *.go
RUN VERSION=$(git describe --tags --abbrev=0) && \
CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X=github.com/zricethezav/gitleaks/v8/version.Version=${VERSION}"
FROM alpine:3.7
RUN apk add --no-cache bash git openssh
FROM alpine:3.22
RUN apk add --no-cache bash git openssh-client
COPY --from=build /go/src/github.com/zricethezav/gitleaks/bin/* /usr/bin/
RUN git config --global --add safe.directory '*'
ENTRYPOINT ["gitleaks"]
# How to use me :
# docker build -t gitleaks .
# docker run --rm --name=gitleaks gitleaks https://github.com/zricethezav/gitleaks
# This will check for secrets in https://github.com/zricethezav/gitleaks
Generated
-153
View File
@@ -1,153 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/BurntSushi/toml"
packages = ["."]
revision = "b26d9c308763d68093482582cea63d69be07a0f0"
version = "v0.3.0"
[[projects]]
name = "github.com/emirpasic/gods"
packages = ["containers","lists","lists/arraylist","trees","trees/binaryheap","utils"]
revision = "f6c17b524822278a87e3b3bd809fec33b51f5b46"
version = "v1.9.0"
[[projects]]
name = "github.com/franela/goblin"
packages = ["."]
revision = "cd5d08fb4ede9eaac1812fdb513552e7404eae2e"
version = "0.0.2"
[[projects]]
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265"
version = "v1.1.0"
[[projects]]
name = "github.com/google/go-github"
packages = ["github"]
revision = "e48060a28fac52d0f1cb758bc8b87c07bac4a87d"
version = "v15.0.0"
[[projects]]
branch = "master"
name = "github.com/google/go-querystring"
packages = ["query"]
revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a"
[[projects]]
branch = "master"
name = "github.com/jbenet/go-context"
packages = ["io"]
revision = "d14ea06fba99483203c19d92cfcd13ebe73135f4"
[[projects]]
name = "github.com/jessevdk/go-flags"
packages = ["."]
revision = "c6ca198ec95c841fdb89fc0de7496fed11ab854e"
version = "v1.4.0"
[[projects]]
name = "github.com/kevinburke/ssh_config"
packages = ["."]
revision = "9fc7bb800b555d63157c65a904c86a2cc7b4e795"
version = "0.4"
[[projects]]
branch = "master"
name = "github.com/mitchellh/go-homedir"
packages = ["."]
revision = "3864e76763d94a6df2f9960b16a20a33da9f9a66"
[[projects]]
name = "github.com/pelletier/go-buffruneio"
packages = ["."]
revision = "c37440a7cf42ac63b919c752ca73a85067e05992"
version = "v0.2.0"
[[projects]]
name = "github.com/sergi/go-diff"
packages = ["diffmatchpatch"]
revision = "1744e2970ca51c86172c8190fadad617561ed6e7"
version = "v1.0.0"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
version = "v1.0.5"
[[projects]]
name = "github.com/src-d/gcfg"
packages = [".","scanner","token","types"]
revision = "f187355171c936ac84a82793659ebb4936bc1c23"
version = "v1.3.0"
[[projects]]
name = "github.com/xanzy/ssh-agent"
packages = ["."]
revision = "640f0ab560aeb89d523bb6ac322b1244d5c3796c"
version = "v0.2.0"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["cast5","curve25519","ed25519","ed25519/internal/edwards25519","internal/chacha20","internal/subtle","openpgp","openpgp/armor","openpgp/elgamal","openpgp/errors","openpgp/packet","openpgp/s2k","poly1305","ssh","ssh/agent","ssh/knownhosts","ssh/terminal"]
revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["context","context/ctxhttp"]
revision = "d0887baf81f4598189d4e12a37c6da86f0bba4d0"
[[projects]]
branch = "master"
name = "golang.org/x/oauth2"
packages = [".","internal"]
revision = "ef147856a6ddbb60760db74283d2424e98c87bff"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows"]
revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4"
[[projects]]
name = "golang.org/x/text"
packages = ["internal/gen","internal/triegen","internal/ucd","transform","unicode/cldr","unicode/norm"]
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
version = "v0.3.0"
[[projects]]
name = "google.golang.org/appengine"
packages = ["internal","internal/base","internal/datastore","internal/log","internal/remote_api","internal/urlfetch","urlfetch"]
revision = "b1f26356af11148e710935ed1ac8a7f5702c7612"
version = "v1.1.0"
[[projects]]
name = "gopkg.in/src-d/go-billy.v4"
packages = [".","helper/chroot","helper/polyfill","osfs","util"]
revision = "83cf655d40b15b427014d7875d10850f96edba14"
version = "v4.2.0"
[[projects]]
name = "gopkg.in/src-d/go-git.v4"
packages = [".","config","internal/revision","plumbing","plumbing/cache","plumbing/filemode","plumbing/format/config","plumbing/format/diff","plumbing/format/gitignore","plumbing/format/idxfile","plumbing/format/index","plumbing/format/objfile","plumbing/format/packfile","plumbing/format/pktline","plumbing/object","plumbing/protocol/packp","plumbing/protocol/packp/capability","plumbing/protocol/packp/sideband","plumbing/revlist","plumbing/storer","plumbing/transport","plumbing/transport/client","plumbing/transport/file","plumbing/transport/git","plumbing/transport/http","plumbing/transport/internal/common","plumbing/transport/server","plumbing/transport/ssh","storage","storage/filesystem","storage/filesystem/dotgit","storage/memory","utils/binary","utils/diff","utils/ioutil","utils/merkletrie","utils/merkletrie/filesystem","utils/merkletrie/index","utils/merkletrie/internal/frame","utils/merkletrie/noder"]
revision = "3bd5e82b2512d85becae9677fa06b5a973fd4cfb"
version = "v4.5.0"
[[projects]]
name = "gopkg.in/warnings.v0"
packages = ["."]
revision = "ec4a0fea49c7b46c2aeb0b51aac55779c607e52b"
version = "v0.1.2"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "5af7c639081bd99afc4a673e96079d2ed9e76d0e1bf0d2cc5ad9c71274beaa86"
solver-name = "gps-cdcl"
solver-version = 1
-58
View File
@@ -1,58 +0,0 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/BurntSushi/toml"
version = "0.3.0"
[[constraint]]
name = "github.com/franela/goblin"
version = "0.0.2"
[[constraint]]
name = "github.com/google/go-github"
version = "15.0.0"
[[constraint]]
name = "github.com/jessevdk/go-flags"
version = "1.4.0"
[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.5"
[[constraint]]
branch = "master"
name = "golang.org/x/oauth2"
[[constraint]]
name = "gopkg.in/src-d/go-git.v4"
version = "4.5.0"
[prune]
go-tests = true
unused-packages = true
@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License
Copyright (c) 2014 Simon Eskildsen
Copyright (c) 2019 Zachary Rice
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+35 -21
View File
@@ -1,23 +1,37 @@
.PHONY: test build-all deploy
.PHONY: test test-cover failfast profile clean format build
test:
go get github.com/golang/lint/golint
go fmt
golint
go test --race -cover
deploy:
@echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
docker build -f Dockerfile -t $(REPO):$(TAG) .
echo "Pushing $(REPO):$(COMMIT) $(REPO):$(TAG)"
docker push $(REPO)
PKG=github.com/zricethezav/gitleaks
VERSION := `git fetch --tags && git tag | sort -V | tail -1`
LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks/v8/version.Version=$(VERSION)"
COVER=--cover --coverprofile=cover.out
build-all:
rm -rf build
mkdir build
env GOOS="windows" GOARCH="amd64" go build -o "build/gitleaks-windows-amd64.exe"
env GOOS="windows" GOARCH="386" go build -o "build/gitleaks-windows-386.exe"
env GOOS="linux" GOARCH="amd64" go build -o "build/gitleaks-linux-amd64"
env GOOS="linux" GOARCH="arm" go build -o "build/gitleaks-linux-arm"
env GOOS="linux" GOARCH="mips" go build -o "build/gitleaks-linux-mips"
env GOOS="linux" GOARCH="mips" go build -o "build/gitleaks-linux-mips"
env GOOS="darwin" GOARCH="amd64" go build -o "build/gitleaks-darwin-amd64"
test-cover:
go test -v ./... --race $(COVER) $(PKG)
go tool cover -html=cover.out
format:
go fmt ./...
test: config/gitleaks.toml format
go test -v ./... --race $(PKG)
failfast: format
go test -failfast ./...
build: config/gitleaks.toml format
go mod tidy
go build $(LDFLAGS)
lint:
golangci-lint run
clean:
rm -rf profile
find . -type f -name '*.got.*' -delete
find . -type f -name '*.out' -delete
profile: build
./scripts/profile.sh './gitleaks' '.'
config/gitleaks.toml: $(wildcard cmd/generate/config/**/*)
go generate ./...
+616 -51
View File
@@ -1,65 +1,630 @@
<p align="center">
<img alt="gitleaks" src="https://raw.githubusercontent.com/zricethezav/gifs/master/gitleaks5.png" height="140" />
<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>
</p>
</p>
# Gitleaks
## Audit git repos for secrets
### Powered by src-d's [go-git](https://github.com/src-d/go-git)
<p align="center">
<img src="https://cdn.rawgit.com/zricethezav/5bf8259b7fea0170becffc06b8588edb/raw/f762769fe20ef3669bff34612b1bede6457631e6/termtosvg_je8bp82s.svg">
</p>
```
┌─○───┐
│ │╲ │
│ │ ○ │
│ ○ ░ │
└─░───┘
```
#### Installing
> [!WARNING]
> Gitleaks is feature complete. I'm not merging new features into Gitleaks. Future releases will be security patches only. I'm shifting my focus to [Betterleaks](https://github.com/betterleaks/betterleaks)
[license]: ./LICENSE
[badge-license]: https://img.shields.io/github/license/gitleaks/gitleaks.svg
[go-docs-badge]: https://pkg.go.dev/badge/github.com/gitleaks/gitleaks/v8?status
[go-docs]: https://pkg.go.dev/github.com/zricethezav/gitleaks/v8
[badge-build]: https://github.com/gitleaks/gitleaks/actions/workflows/test.yml/badge.svg
[build]: https://github.com/gitleaks/gitleaks/actions/workflows/test.yml
[go-report-card-badge]: https://goreportcard.com/badge/github.com/gitleaks/gitleaks/v8
[go-report-card]: https://goreportcard.com/report/github.com/gitleaks/gitleaks/v8
[dockerhub]: https://hub.docker.com/r/zricethezav/gitleaks
[dockerhub-badge]: https://img.shields.io/docker/pulls/zricethezav/gitleaks.svg
[gitleaks-action]: https://github.com/gitleaks/gitleaks-action
[gitleaks-badge]: https://img.shields.io/badge/protected%20by-gitleaks-blue
[![GitHub Action Test][badge-build]][build]
[![Docker Hub][dockerhub-badge]][dockerhub]
[![Gitleaks Action][gitleaks-badge]][gitleaks-action]
[![GoDoc][go-docs-badge]][go-docs]
[![GoReportCard][go-report-card-badge]][go-report-card]
[![License][badge-license]][license]
Gitleaks is a tool for **detecting** secrets like passwords, API keys, and tokens in git repos, files, and whatever else you wanna throw at it via `stdin`. If you wanna learn more about how the detection engine works check out this blog: [Regex is (almost) all you need](https://lookingatcomputer.substack.com/p/regex-is-almost-all-you-need).
```
➜ ~/code(master) gitleaks git -v
○
│╲
│ ○
○ ░
░ gitleaks
Finding: "export BUNDLE_ENTERPRISE__CONTRIBSYS__COM=cafebabe:deadbeef",
Secret: cafebabe:deadbeef
RuleID: sidekiq-secret
Entropy: 2.609850
File: cmd/generate/config/rules/sidekiq.go
Line: 23
Commit: cd5226711335c68be1e720b318b7bc3135a30eb2
Author: John
Email: john@users.noreply.github.com
Date: 2022-08-03T12:31:40Z
Fingerprint: cd5226711335c68be1e720b318b7bc3135a30eb2:cmd/generate/config/rules/sidekiq.go:sidekiq-secret:23
```
## Getting Started
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/gitleaks/gitleaks/releases). In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo or as a GitHub action using [Gitleaks-Action](https://github.com/gitleaks/gitleaks-action).
### Installing
```bash
go get -u github.com/zricethezav/gitleaks
```
Or download from release binaries [here](https://github.com/zricethezav/gitleaks/releases)
# MacOS
brew install gitleaks
# Docker (DockerHub)
docker pull zricethezav/gitleaks:latest
docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH]
#### Usage and Options
# Docker (ghcr.io)
docker pull ghcr.io/gitleaks/gitleaks:latest
docker run -v ${path_to_host_folder_to_scan}:/path ghcr.io/gitleaks/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH]
# From Source (make sure `go` is installed)
git clone https://github.com/gitleaks/gitleaks.git
cd gitleaks
make build
```
### Pre-Commit
1. Install pre-commit from https://pre-commit.com/#install
2. Create a `.pre-commit-config.yaml` file at the root of your repository with the following content:
```
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.2
hooks:
- id: gitleaks
```
for a [native execution of gitleaks](https://github.com/gitleaks/gitleaks/releases) or use the [`gitleaks-docker` pre-commit ID](https://github.com/gitleaks/gitleaks/blob/master/.pre-commit-hooks.yaml) for executing gitleaks using the [official Docker images](#docker)
3. Auto-update the config to the latest repos' versions by executing `pre-commit autoupdate`
4. Install with `pre-commit install`
5. Now you're all set!
```
➜ git commit -m "this commit contains a secret"
Detect hardcoded secrets.................................................Failed
```
Note: to disable the gitleaks pre-commit hook you can prepend `SKIP=gitleaks` to the commit command
and it will skip running gitleaks
```
➜ SKIP=gitleaks git commit -m "skip gitleaks check"
Detect hardcoded secrets................................................Skipped
```
## Usage
```
Gitleaks scans code, past or present, for secrets
Usage:
gitleaks [OPTIONS]
gitleaks [command]
Application Options:
-r, --repo= Repo url to audit
--github-user= User url to audit
--github-org= Organization url to audit
--github-url= GitHub API Base URL, use for GitHub Enterprise. Example: https://github.example.com/api/v3/ (default: https://api.github.com/)
-p, --private Include private repos in audit
-b, --branch= branch name to audit (defaults to HEAD)
-c, --commit= sha of commit to stop at
--repo-path= Path to repo
--owner-path= Path to owner directory (repos discovered)
--max-go= Maximum number of concurrent go-routines gitleaks spawns
--disk Clones repo(s) to disk
--all-refs run audit on all refs
--single-search= single regular expression to search for
--config= path to gitleaks config
--ssh-key= path to ssh key
-l, --log= log level
-v, --verbose Show verbose output from gitleaks audit
--report= path to write report file
--redact redact secrets from log messages and report
--version version number
Available Commands:
completion Generate the autocompletion script for the specified shell
dir scan directories or files for secrets
git scan git repositories for secrets
help Help about any command
stdin detect secrets from stdin
version display gitleaks version
Help Options:
-h, --help Show this help message
```
#### Exit Codes
```
1: leaks present
0: no leaks
Flags:
-b, --baseline-path string path to baseline with issues that can be ignored
-c, --config string config file path
order of precedence:
1. --config/-c
2. env var GITLEAKS_CONFIG
3. env var GITLEAKS_CONFIG_TOML with the file content
4. (target path)/.gitleaks.toml
If none of the four options are used, then gitleaks will use the default config
--diagnostics string enable diagnostics (http OR comma-separated list: cpu,mem,trace). cpu=CPU prof, mem=memory prof, trace=exec tracing, http=serve via net/http/pprof
--diagnostics-dir string directory to store diagnostics output files when not using http mode (defaults to current directory)
--enable-rule strings only enable specific rules by id
--exit-code int exit code when leaks have been encountered (default 1)
-i, --gitleaks-ignore-path string path to .gitleaksignore file or folder containing one (default ".")
-h, --help help for gitleaks
--ignore-gitleaks-allow ignore gitleaks:allow comments
-l, --log-level string log level (trace, debug, info, warn, error, fatal) (default "info")
--max-archive-depth int allow scanning into nested archives up to this depth (default "0", no archive traversal is done)
--max-decode-depth int allow recursive decoding up to this depth (default "0", no decoding is done)
--max-target-megabytes int files larger than this will be skipped
--no-banner suppress banner
--no-color turn off color for verbose output
--redact uint[=100] redact secrets from logs and stdout. To redact only parts of the secret just apply a percent value from 0..100. For example --redact=20 (default 100%)
-f, --report-format string output format (json, csv, junit, sarif, template)
-r, --report-path string report file
--report-template string template file used to generate the report (implies --report-format=template)
--timeout int set a timeout for gitleaks commands in seconds (default "0", no timeout is set)
-v, --verbose show verbose output from scan
--version version for gitleaks
Use "gitleaks [command] --help" for more information about a command.
```
#### Additional Examples and Explanations
Check the wiki [here](https://github.com/zricethezav/gitleaks/wiki)
### Commands
### If you find a valid leak in a repo
Please read this [Github article on removing sensitive data from a repository](https://help.github.com/articles/removing-sensitive-data-from-a-repository/) to remove the sensitive information from your history.
⚠️ v8.19.0 introduced a change that deprecated `detect` and `protect`. Those commands are still available but
are hidden in the `--help` menu. Take a look at this [gist](https://gist.github.com/zricethezav/b325bb93ebf41b9c0b0507acf12810d2) for easy command translations.
If you find v8.19.0 broke an existing command (`detect`/`protect`), please open an issue.
### Run me with docker
Simply run `docker run --rm --name=gitleaks zricethezav/gitleaks --help`
There are three scanning modes: `git`, `dir`, and `stdin`.
#### Git
The `git` command lets you scan local git repos. Under the hood, gitleaks uses the `git log -p` command to scan patches.
You can configure the behavior of `git log -p` with the `log-opts` option.
For example, if you wanted to run gitleaks on a range of commits you could use the following
command: `gitleaks git -v --log-opts="--all commitA..commitB" path_to_repo`. See the [git log](https://git-scm.com/docs/git-log) documentation for more information.
If there is no target specified as a positional argument, then gitleaks will attempt to scan the current working directory as a git repo.
#### Dir
The `dir` (aliases include `files`, `directory`) command lets you scan directories and files. Example: `gitleaks dir -v path_to_directory_or_file`.
If there is no target specified as a positional argument, then gitleaks will scan the current working directory.
#### Stdin
You can also stream data to gitleaks with the `stdin` command. Example: `cat some_file | gitleaks -v stdin`
### Creating a baseline
When scanning large repositories or repositories with a long history, it can be convenient to use a baseline. When using a baseline,
gitleaks will ignore any old findings that are present in the baseline. A baseline can be any gitleaks report. To create a gitleaks report, run gitleaks with the `--report-path` parameter.
```
gitleaks git --report-path gitleaks-report.json # This will save the report in a file called gitleaks-report.json
```
Once as baseline is created it can be applied when running the detect command again:
```
gitleaks git --baseline-path gitleaks-report.json --report-path findings.json
```
After running the detect command with the --baseline-path parameter, report output (findings.json) will only contain new issues.
## Pre-Commit hook
You can run Gitleaks as a pre-commit hook by copying the example `pre-commit.py` script into
your `.git/hooks/` directory.
## Load Configuration
The order of precedence is:
1. `--config/-c` option:
```bash
gitleaks git --config /home/dev/customgitleaks.toml .
```
2. Environment variable `GITLEAKS_CONFIG` with the file path:
```bash
export GITLEAKS_CONFIG="/home/dev/customgitleaks.toml"
gitleaks git .
```
3. Environment variable `GITLEAKS_CONFIG_TOML` with the file content:
```bash
export GITLEAKS_CONFIG_TOML=`cat customgitleaks.toml`
gitleaks git .
```
4. A `.gitleaks.toml` file within the target path:
```bash
gitleaks git .
```
If none of the four options are used, then gitleaks will use the default config.
## Configuration
Gitleaks offers a configuration format you can follow to write your own secret detection rules:
```toml
# Title for the gitleaks configuration file.
title = "Custom Gitleaks configuration"
# You have basically two options for your custom configuration:
#
# 1. define your own configuration, default rules do not apply
#
# use e.g., the default configuration as starting point:
# https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml
#
# 2. extend a configuration, the rules are overwritten or extended
#
# When you extend a configuration the extended rules take precedence over the
# default rules. I.e., if there are duplicate rules in both the extended
# configuration and the default configuration the extended rules or
# attributes of them will override the default rules.
# Another thing to know with extending configurations is you can chain
# together multiple configuration files to a depth of 2. Allowlist arrays are
# appended and can contain duplicates.
# useDefault and path can NOT be used at the same time. Choose one.
[extend]
# useDefault will extend the default gitleaks config built in to the binary
# the latest version is located at:
# https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml
useDefault = true
# or you can provide a path to a configuration to extend from.
# The path is relative to where gitleaks was invoked,
# not the location of the base config.
# path = "common_config.toml"
# If there are any rules you don't want to inherit, they can be specified here.
disabledRules = [ "generic-api-key"]
# An array of tables that contain information that define instructions
# on how to detect secrets
[[rules]]
# Unique identifier for this rule
id = "awesome-rule-1"
# Short human-readable description of the rule.
description = "awesome rule 1"
# Golang regular expression used to detect secrets. Note Golang's regex engine
# does not support lookaheads.
regex = '''one-go-style-regex-for-this-rule'''
# Int used to extract secret from regex match and used as the group that will have
# its entropy checked if `entropy` is set.
secretGroup = 3
# Float representing the minimum shannon entropy a regex group must have to be considered a secret.
entropy = 3.5
# Golang regular expression used to match paths. This can be used as a standalone rule or it can be used
# in conjunction with a valid `regex` entry.
path = '''a-file-path-regex'''
# Keywords are used for pre-regex check filtering. Rules that contain
# keywords will perform a quick string compare check to make sure the
# keyword(s) are in the content being scanned. Ideally these values should
# either be part of the identiifer or unique strings specific to the rule's regex
# (introduced in v8.6.0)
keywords = [
"auth",
"password",
"token",
]
# Array of strings used for metadata and reporting purposes.
tags = ["tag","another tag"]
# ⚠️ In v8.21.0 `[rules.allowlist]` was replaced with `[[rules.allowlists]]`.
# This change was backwards-compatible: instances of `[rules.allowlist]` still work.
#
# You can define multiple allowlists for a rule to reduce false positives.
# A finding will be ignored if _ANY_ `[[rules.allowlists]]` matches.
[[rules.allowlists]]
description = "ignore commit A"
# When multiple criteria are defined the default condition is "OR".
# e.g., this can match on |commits| OR |paths| OR |stopwords|.
condition = "OR"
commits = [ "commit-A", "commit-B"]
paths = [
'''go\.mod''',
'''go\.sum'''
]
# note: stopwords targets the extracted secret, not the entire regex match
# like 'regexes' does. (stopwords introduced in 8.8.0)
stopwords = [
'''client''',
'''endpoint''',
]
[[rules.allowlists]]
# The "AND" condition can be used to make sure all criteria match.
# e.g., this matches if |regexes| AND |paths| are satisfied.
condition = "AND"
# note: |regexes| defaults to check the _Secret_ in the finding.
# Acceptable values for |regexTarget| are "secret" (default), "match", and "line".
regexTarget = "match"
regexes = [ '''(?i)parseur[il]''' ]
paths = [ '''package-lock\.json''' ]
# You can extend a particular rule from the default config. e.g., gitlab-pat
# if you have defined a custom token prefix on your GitLab instance
[[rules]]
id = "gitlab-pat"
# all the other attributes from the default rule are inherited
[[rules.allowlists]]
regexTarget = "line"
regexes = [ '''MY-glpat-''' ]
# ⚠️ In v8.25.0 `[allowlist]` was replaced with `[[allowlists]]`.
#
# Global allowlists have a higher order of precedence than rule-specific allowlists.
# If a commit listed in the `commits` field below is encountered then that commit will be skipped and no
# secrets will be detected for said commit. The same logic applies for regexes and paths.
[[allowlists]]
description = "global allow list"
commits = [ "commit-A", "commit-B", "commit-C"]
paths = [
'''gitleaks\.toml''',
'''(.*?)(jpg|gif|doc)'''
]
# note: (global) regexTarget defaults to check the _Secret_ in the finding.
# Acceptable values for regexTarget are "match" and "line"
regexTarget = "match"
regexes = [
'''219-09-9999''',
'''078-05-1120''',
'''(9[0-9]{2}|666)-\d{2}-\d{4}''',
]
# note: stopwords targets the extracted secret, not the entire regex match
# like 'regexes' does. (stopwords introduced in 8.8.0)
stopwords = [
'''client''',
'''endpoint''',
]
# ⚠️ In v8.25.0, `[[allowlists]]` have a new field called |targetRules|.
#
# Common allowlists can be defined once and assigned to multiple rules using |targetRules|.
# This will only run on the specified rules, not globally.
[[allowlists]]
targetRules = ["awesome-rule-1", "awesome-rule-2"]
description = "Our test assets trigger false-positives in a couple rules."
paths = ['''tests/expected/._\.json$''']
```
Refer to the default [gitleaks config](https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml) for examples or follow the [contributing guidelines](https://github.com/gitleaks/gitleaks/blob/master/CONTRIBUTING.md) if you would like to contribute to the default configuration. Additionally, you can check out [this gitleaks blog post](https://blog.gitleaks.io/stop-leaking-secrets-configuration-2-3-aeed293b1fbf) which covers advanced configuration setups.
### Additional Configuration
#### Composite Rules (Multi-part or `required` Rules)
In v8.28.0 Gitleaks introduced composite rules, which are made up of a single "primary" rule and one or more auxiliary or `required` rules. To create a composite rule, add a `[[rules.required]]` table to the primary rule specifying an `id` and optionally `withinLines` and/or `withinColumns` proximity constraints. A fragment is a chunk of content that Gitleaks processes at once (typically a file, part of a file, or git diff), and proximity matching instructs the primary rule to only report a finding if the auxiliary `required` rules also find matches within the specified area of the fragment.
**Proximity matching:** Using the `withinLines` and `withinColumns` fields instructs the primary rule to only report a finding if the auxiliary `required` rules also find matches within the specified proximity. You can set:
- **`withinLines: N`** - required findings must be within N lines (vertically)
- **`withinColumns: N`** - required findings must be within N characters (horizontally)
- **Both** - creates a rectangular search area (both constraints must be satisfied)
- **Neither** - fragment-level matching (required findings can be anywhere in the same fragment)
Here are diagrams illustrating each proximity behavior:
```
p = primary captured secret
a = auxiliary (required) captured secret
fragment = section of data gitleaks is looking at
*Fragment-level proximity*
Any required finding in the fragment
┌────────┐
┌──────┤fragment├─────┐
│ └──────┬─┤ │ ┌───────┐
│ │a│◀────┼─│✓ MATCH│
│ ┌─┐└─┘ │ └───────┘
│┌─┐ │p│ │
││a│ ┌─┐└─┘ │ ┌───────┐
│└─┘ │a│◀──────────┼─│✓ MATCH│
└─▲─────┴─┴───────────┘ └───────┘
│ ┌───────┐
└────│✓ MATCH│
└───────┘
*Column bounded proximity*
`withinColumns = 3`
┌────────┐
┌────┬─┤fragment├─┬───┐
│ └──────┬─┤ │ ┌───────────┐
│ │ │a│◀┼───┼─│+1C ✓ MATCH│
│ ┌─┐└─┘ │ └───────────┘
│┌─┐ │ │p│ │ │
┌──▶│a│ ┌─┐ └─┘ │ ┌───────────┐
│ │└─┘ ││a│◀────────┼───┼─│-2C ✓ MATCH│
│ │ ┘ │ └───────────┘
│ └── -3C ───0C─── +3C ─┘
│ ┌─────────┐
│ │ -4C ✗ NO│
└──│ MATCH │
└─────────┘
*Line bounded proximity*
`withinLines = 4`
┌────────┐
┌─────┤fragment├─────┐
+4L─ ─ ┴────────┘─ ─ ─│
│ │
│ ┌─┐ │ ┌────────────┐
│ ┌─┐ │a│◀──┼─│+1L ✓ MATCH │
0L ┌─┐ │p│ └─┘ │ ├────────────┤
│ │a│◀──┴─┴────────┼─│-1L ✓ MATCH │
│ └─┘ │ └────────────┘
│ │ ┌─────────┐
-4L─ ─ ─ ─ ─ ─ ─ ─┌─┐─│ │-5L ✗ NO │
│ │a│◀┼─│ MATCH │
└────────────────┴─┴─┘ └─────────┘
*Line and column bounded proximity*
`withinLines = 4`
`withinColumns = 3`
┌────────┐
┌─────┤fragment├─────┐
+4L ┌└────────┴ ┐ │
│ ┌─┐ │ ┌───────────────┐
│ │ │a│◀┼───┼─│+2L/+1C ✓ MATCH│
│ ┌─┐└─┘ │ └───────────────┘
0L │ │p│ │ │
│ └─┘ │
│ │ │ │ ┌────────────┐
-4L ─ ─ ─ ─ ─ ─┌─┐ │ │-5L/+3C ✗ NO│
│ │a│◀┼─│ MATCH │
└───-3C────0L───+3C┴─┘ └────────────┘
```
<details><summary>Some final quick thoughts on composite rules.</summary>This is an experimental feature! It's subject to change so don't go sellin' a new B2B SaaS feature built ontop of this feature. Scan type (git vs dir) based context is interesting. I'm monitoring the situation. Composite rules might not be super useful for git scans because gitleaks only looks at additions in the git history. It could be useful to scan non-additions in git history for `required` rules. Oh, right this is a readme, I'll shut up now.</details>
#### gitleaks:allow
If you are knowingly committing a test secret that gitleaks will catch you can add a `gitleaks:allow` comment to that line which will instruct gitleaks
to ignore that secret. Ex:
```
class CustomClass:
discord_client_secret = '8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ' #gitleaks:allow
```
#### .gitleaksignore
You can ignore specific findings by creating a `.gitleaksignore` file at the root of your repo. In release v8.10.0 Gitleaks added a `Fingerprint` value to the Gitleaks report. Each leak, or finding, has a Fingerprint that uniquely identifies a secret. Add this fingerprint to the `.gitleaksignore` file to ignore that specific secret. See Gitleaks' [.gitleaksignore](https://github.com/gitleaks/gitleaks/blob/master/.gitleaksignore) for an example. Note: this feature is experimental and is subject to change in the future.
#### Decoding
Sometimes secrets are encoded in a way that can make them difficult to find
with just regex. Now you can tell gitleaks to automatically find and decode
encoded text. The flag `--max-decode-depth` enables this feature (the default
value "0" means the feature is disabled by default).
Recursive decoding is supported since decoded text can also contain encoded
text. The flag `--max-decode-depth` sets the recursion limit. Recursion stops
when there are no new segments of encoded text to decode, so setting a really
high max depth doesn't mean it will make that many passes. It will only make as
many as it needs to decode the text. Overall, decoding only minimally increases
scan times.
The findings for encoded text differ from normal findings in the following
ways:
- The location points the bounds of the encoded text
- If the rule matches outside the encoded text, the bounds are adjusted to
include that as well
- The match and secret contain the decoded value
- Two tags are added `decoded:<encoding>` and `decode-depth:<depth>`
Currently supported encodings:
- **percent** - Any printable ASCII percent encoded values
- **hex** - Any printable ASCII hex encoded values >= 32 characters
- **base64** - Any printable ASCII base64 encoded values >= 16 characters
#### Archive Scanning
Sometimes secrets are packaged within archive files like zip files or tarballs,
making them difficult to discover. Now you can tell gitleaks to automatically
extract and scan the contents of archives. The flag `--max-archive-depth`
enables this feature for both `dir` and `git` scan types. The default value of
"0" means this feature is disabled by default.
Recursive scanning is supported since archives can also contain other archives.
The `--max-archive-depth` flag sets the recursion limit. Recursion stops when
there are no new archives to extract, so setting a very high max depth just
sets the potential to go that deep. It will only go as deep as it needs to.
The findings for secrets located within an archive will include the path to the
file inside the archive. Inner paths are separated with `!`.
Example finding (shortened for brevity):
```
Finding: DB_PASSWORD=8ae31cacf141669ddfb5da
...
File: testdata/archives/nested.tar.gz!archives/files.tar!files/.env.prod
Line: 4
Commit: 6e6ee6596d337bb656496425fb98644eb62b4a82
...
Fingerprint: 6e6ee6596d337bb656496425fb98644eb62b4a82:testdata/archives/nested.tar.gz!archives/files.tar!files/.env.prod:generic-api-key:4
Link: https://github.com/leaktk/gitleaks/blob/6e6ee6596d337bb656496425fb98644eb62b4a82/testdata/archives/nested.tar.gz
```
This means a secret was detected on line 4 of `files/.env.prod.` which is in
`archives/files.tar` which is in `testdata/archives/nested.tar.gz`.
Currently supported formats:
The [compression](https://github.com/mholt/archives?tab=readme-ov-file#supported-compression-formats)
and [archive](https://github.com/mholt/archives?tab=readme-ov-file#supported-archive-formats)
formats supported by mholt's [archives package](https://github.com/mholt/archives)
are supported.
#### Reporting
Gitleaks has built-in support for several report formats: [`json`](https://github.com/gitleaks/gitleaks/blob/master/testdata/expected/report/json_simple.json), [`csv`](https://github.com/gitleaks/gitleaks/blob/master/testdata/expected/report/csv_simple.csv?plain=1), [`junit`](https://github.com/gitleaks/gitleaks/blob/master/testdata/expected/report/junit_simple.xml), and [`sarif`](https://github.com/gitleaks/gitleaks/blob/master/testdata/expected/report/sarif_simple.sarif).
If none of these formats fit your need, you can create your own report format with a [Go `text/template` .tmpl file](https://www.digitalocean.com/community/tutorials/how-to-use-templates-in-go#step-4-writing-a-template) and the `--report-template` flag. The template can use [extended functionality from the `Masterminds/sprig` template library](https://masterminds.github.io/sprig/).
For example, the following template provides a custom JSON output:
```gotemplate
# jsonextra.tmpl
[{{ $lastFinding := (sub (len . ) 1) }}
{{- range $i, $finding := . }}{{with $finding}}
{
"Description": {{ quote .Description }},
"StartLine": {{ .StartLine }},
"EndLine": {{ .EndLine }},
"StartColumn": {{ .StartColumn }},
"EndColumn": {{ .EndColumn }},
"Line": {{ quote .Line }},
"Match": {{ quote .Match }},
"Secret": {{ quote .Secret }},
"File": "{{ .File }}",
"SymlinkFile": {{ quote .SymlinkFile }},
"Commit": {{ quote .Commit }},
"Entropy": {{ .Entropy }},
"Author": {{ quote .Author }},
"Email": {{ quote .Email }},
"Date": {{ quote .Date }},
"Message": {{ quote .Message }},
"Tags": [{{ $lastTag := (sub (len .Tags ) 1) }}{{ range $j, $tag := .Tags }}{{ quote . }}{{ if ne $j $lastTag }},{{ end }}{{ end }}],
"RuleID": {{ quote .RuleID }},
"Fingerprint": {{ quote .Fingerprint }}
}{{ if ne $i $lastFinding }},{{ end }}
{{- end}}{{ end }}
]
```
Usage:
```sh
$ gitleaks dir ~/leaky-repo/ --report-path "report.json" --report-format template --report-template testdata/report/jsonextra.tmpl
```
## Sponsorships
<p align="left">
<h3><a href="https://coderabbit.ai/?utm_source=oss&utm_medium=sponsorship&utm_campaign=gitleaks">coderabbit.ai</h3>
<a href="https://coderabbit.ai/?utm_source=oss&utm_medium=sponsorship&utm_campaign=gitleaks">
<img alt="CodeRabbit.ai Sponsorship" src="https://github.com/gitleaks/gitleaks/assets/15034943/76c30a85-887b-47ca-9956-17a8e55c6c41" width=200>
</a>
</p>
## Exit Codes
You can always set the exit code when leaks are encountered with the --exit-code flag. Default exit codes below:
```
0 - no leaks present
1 - leaks or error encountered
126 - unknown flag
```
### Join the Discord! [![Discord](https://img.shields.io/discord/1102689410522284044.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/8Hzbrnkr7E)
+19
View File
@@ -0,0 +1,19 @@
# Security Policy
## Supported Versions
| Version | Supported |
|---------|-----------|
| Latest | Yes |
## Reporting a Vulnerability
If you discover a security vulnerability in gitleaks, please report it responsibly:
1. **Do not open a public issue.**
2. Use [GitHub's private vulnerability reporting](https://github.com/gitleaks/gitleaks/security/advisories/new) to submit your report directly.
3. Include a description of the vulnerability, steps to reproduce, and any relevant logs or screenshots.
## Scope
This policy covers `gitleaks` (this repository). For vulnerabilities in `gitleaks-action`, please report them at [gitleaks/gitleaks-action](https://github.com/gitleaks/gitleaks-action/security/advisories/new).
+26
View File
@@ -0,0 +1,26 @@
## Who uses Gitleaks?
As the Gitleaks Community grows, we'd like to keep a list of our users.
Here's a running list of some organizations using Gitleaks[^1]:
1. [GitLab](https://docs.gitlab.com/ee/user/application_security/secret_detection/)
1. [Gitleaks](https://gitleaks.io)
1. [GoReleaser](https://goreleaser.com)
2. [Trendyol](https://trendyol.com)
Feel free to [add yours](https://github.com/zricethezav/gitleaks/edit/master/USERS.md)!
<!--
Hey! Thanks for looking into this file!
If you're going to edit it, please:
- keep a-z ordering :)
- edit only the USERS.md file at the repository's root folder
-->
[^1]: Entries were either added by the companies themselves or by the maintainers after seeing it in the wild.
You can see all public repositories using Gitleaks or Gitleaks-Action by [searching on GitHub](https://github.com/search?q=gitleaks).
<!--
Shout out to GoReleaser for this template: https://github.com/goreleaser/goreleaser/blob/main/USERS.md
-->
+136
View File
@@ -0,0 +1,136 @@
// The `detect` and `protect` command is now deprecated. Here are some equivalent commands
// to help guide you.
// OLD CMD: gitleaks detect --source={repo}
// NEW CMD: gitleaks git {repo}
// OLD CMD: gitleaks protect --source={repo}
// NEW CMD: gitleaks git --pre-commit {repo}
// OLD CMD: gitleaks protect --staged --source={repo}
// NEW CMD: gitleaks git --pre-commit --staged {repo}
// OLD CMD: gitleaks detect --no-git --source={repo}
// NEW CMD: gitleaks directory {directory/file}
// OLD CMD: gitleaks detect --no-git --pipe
// NEW CMD: gitleaks stdin
package cmd
import (
"os"
"time"
"github.com/spf13/cobra"
"github.com/zricethezav/gitleaks/v8/cmd/scm"
"github.com/zricethezav/gitleaks/v8/logging"
"github.com/zricethezav/gitleaks/v8/report"
"github.com/zricethezav/gitleaks/v8/sources"
)
func init() {
rootCmd.AddCommand(detectCmd)
detectCmd.Flags().Bool("no-git", false, "treat git repo as a regular directory and scan those files, --log-opts has no effect on the scan when --no-git is set")
detectCmd.Flags().Bool("pipe", false, "scan input from stdin, ex: `cat some_file | gitleaks detect --pipe`")
detectCmd.Flags().Bool("follow-symlinks", false, "scan files that are symlinks to other files")
detectCmd.Flags().StringP("source", "s", ".", "path to source")
detectCmd.Flags().String("log-opts", "", "git log options")
detectCmd.Flags().String("platform", "", "the target platform used to generate links (github, gitlab)")
}
var detectCmd = &cobra.Command{
Use: "detect",
Short: "detect secrets in code",
Run: runDetect,
Hidden: true,
}
func runDetect(cmd *cobra.Command, args []string) {
// start timer
start := time.Now()
sourcePath := mustGetStringFlag(cmd, "source")
// setup config (aka, the thing that defines rules)
initConfig(sourcePath)
initDiagnostics()
cfg := Config(cmd)
// create detector
detector := Detector(cmd, cfg, sourcePath)
// parse flags
detector.FollowSymlinks = mustGetBoolFlag(cmd, "follow-symlinks")
exitCode := mustGetIntFlag(cmd, "exit-code")
noGit := mustGetBoolFlag(cmd, "no-git")
fromPipe := mustGetBoolFlag(cmd, "pipe")
// determine what type of scan:
// - git: scan the history of the repo
// - no-git: scan files by treating the repo as a plain directory
var (
err error
findings []report.Finding
)
if noGit {
findings, err = detector.DetectSource(
cmd.Context(), &sources.Files{
Config: &cfg,
FollowSymlinks: detector.FollowSymlinks,
MaxFileSize: detector.MaxTargetMegaBytes * 1_000_000,
Path: sourcePath,
Sema: detector.Sema,
MaxArchiveDepth: detector.MaxArchiveDepth,
},
)
if err != nil {
// don't exit on error, just log it
logging.Error().Err(err).Msg("failed to scan directory")
}
} else if fromPipe {
findings, err = detector.DetectSource(
cmd.Context(), &sources.File{
Content: os.Stdin,
MaxArchiveDepth: detector.MaxArchiveDepth,
},
)
if err != nil {
// log fatal to exit, no need to continue since a report
// will not be generated when scanning from a pipe...for now
logging.Fatal().Err(err).Msg("failed scan input from stdin")
}
} else {
var (
gitCmd *sources.GitCmd
scmPlatform scm.Platform
)
logOpts := mustGetStringFlag(cmd, "log-opts")
if gitCmd, err = sources.NewGitLogCmdContext(cmd.Context(), sourcePath, logOpts); err != nil {
logging.Fatal().Err(err).Msg("could not create Git cmd")
}
if scmPlatform, err = scm.PlatformFromString(mustGetStringFlag(cmd, "platform")); err != nil {
logging.Fatal().Err(err).Send()
}
findings, err = detector.DetectSource(
cmd.Context(), &sources.Git{
Cmd: gitCmd,
Config: &detector.Config,
Remote: sources.NewRemoteInfoContext(cmd.Context(), scmPlatform, sourcePath),
Sema: detector.Sema,
MaxArchiveDepth: detector.MaxArchiveDepth,
},
)
if err != nil {
// don't exit on error, just log it
logging.Error().Err(err).Msg("failed to scan Git repository")
}
}
findingSummaryAndExit(detector, findings, exitCode, start, err)
}
+239
View File
@@ -0,0 +1,239 @@
package cmd
import (
"errors"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"path/filepath"
"runtime"
"runtime/pprof"
"runtime/trace"
"strings"
"github.com/zricethezav/gitleaks/v8/logging"
)
// DiagnosticsManager manages various types of diagnostics
type DiagnosticsManager struct {
Enabled bool
DiagTypes []string
OutputDir string
cpuProfile *os.File
memProfile string
traceProfile *os.File
}
// NewDiagnosticsManager creates a new DiagnosticsManager instance
func NewDiagnosticsManager(diagnosticsFlag string, diagnosticsDir string) (*DiagnosticsManager, error) {
if diagnosticsFlag == "" {
return &DiagnosticsManager{Enabled: false}, nil
}
dm := &DiagnosticsManager{
Enabled: true,
DiagTypes: strings.Split(diagnosticsFlag, ","),
OutputDir: diagnosticsDir,
}
if diagnosticsFlag == "http" {
if len(diagnosticsDir) != 0 {
return nil, errors.New("the diagnostics directory should not be set in http mode")
}
return dm, nil
}
// If no output directory is specified, use the current directory
if dm.OutputDir == "" {
var err error
dm.OutputDir, err = os.Getwd()
if err != nil {
return nil, fmt.Errorf("failed to get current directory: %w", err)
}
logging.Debug().Msgf("No diagnostics directory specified, using current directory: %s", dm.OutputDir)
}
// Create the output directory if it doesn't exist
if err := os.MkdirAll(dm.OutputDir, 0755); err != nil {
return nil, fmt.Errorf("failed to create diagnostics directory: %w", err)
}
// Make sure the output directory is absolute
if !filepath.IsAbs(dm.OutputDir) {
absPath, err := filepath.Abs(dm.OutputDir)
if err != nil {
return nil, fmt.Errorf("failed to get absolute path for diagnostics directory: %w", err)
}
dm.OutputDir = absPath
}
logging.Debug().Msgf("Diagnostics enabled: %s", strings.Join(dm.DiagTypes, ","))
logging.Debug().Msgf("Diagnostics output directory: %s", dm.OutputDir)
return dm, nil
}
// StartDiagnostics starts all enabled diagnostics
func (dm *DiagnosticsManager) StartDiagnostics() error {
if !dm.Enabled {
return nil
}
var err error
for _, diagType := range dm.DiagTypes {
diagType = strings.TrimSpace(diagType)
switch diagType {
case "cpu":
if err = dm.StartCPUProfile(); err != nil {
return err
}
case "mem":
if err = dm.SetupMemoryProfile(); err != nil {
return err
}
case "trace":
if err = dm.StartTraceProfile(); err != nil {
return err
}
case "http":
if err = dm.StartHttpHandler(); err != nil {
return err
}
default:
logging.Warn().Msgf("Unknown diagnostics type: %s", diagType)
}
}
return nil
}
// StopDiagnostics stops all started diagnostics
func (dm *DiagnosticsManager) StopDiagnostics() {
if !dm.Enabled {
return
}
logging.Debug().Msg("Stopping diagnostics and writing profiling data...")
for _, diagType := range dm.DiagTypes {
diagType = strings.TrimSpace(diagType)
switch diagType {
case "cpu":
dm.StopCPUProfile()
case "mem":
dm.WriteMemoryProfile()
case "trace":
dm.StopTraceProfile()
case "http":
// No need to stop the http one
}
}
}
func (dm *DiagnosticsManager) StartHttpHandler() error {
if len(dm.DiagTypes) > 1 {
return errors.New("other diagnostics modes should not be enabled when http mode is enabled")
}
go func() {
logging.Error().Err(http.ListenAndServe("localhost:6060", nil)).Send()
}()
logging.Info().Str("url", "http://localhost:6060/debug/pprof/").Msg("Diagnostics server started")
return nil
}
// StartCPUProfile starts CPU profiling
func (dm *DiagnosticsManager) StartCPUProfile() error {
cpuProfilePath := filepath.Join(dm.OutputDir, "cpu.pprof")
f, err := os.Create(cpuProfilePath)
if err != nil {
return fmt.Errorf("could not create CPU profile at %s: %w", cpuProfilePath, err)
}
if err := pprof.StartCPUProfile(f); err != nil {
_ = f.Close()
return fmt.Errorf("could not start CPU profile: %w", err)
}
dm.cpuProfile = f
return nil
}
// StopCPUProfile stops CPU profiling
func (dm *DiagnosticsManager) StopCPUProfile() {
if dm.cpuProfile != nil {
pprof.StopCPUProfile()
if err := dm.cpuProfile.Close(); err != nil {
logging.Error().Err(err).Msg("Error closing CPU profile file")
}
logging.Info().Msgf("CPU profile written to: %s", dm.cpuProfile.Name())
dm.cpuProfile = nil
}
}
// SetupMemoryProfile sets up memory profiling to be written when StopDiagnostics is called
func (dm *DiagnosticsManager) SetupMemoryProfile() error {
memProfilePath := filepath.Join(dm.OutputDir, "mem.pprof")
dm.memProfile = memProfilePath
return nil
}
// WriteMemoryProfile writes the memory profile to disk
func (dm *DiagnosticsManager) WriteMemoryProfile() {
if dm.memProfile == "" {
return
}
f, err := os.Create(dm.memProfile)
if err != nil {
logging.Error().Err(err).Msgf("Could not create memory profile at %s", dm.memProfile)
return
}
// Get memory profile
runtime.GC() // Run GC before taking the memory profile
if err := pprof.WriteHeapProfile(f); err != nil {
logging.Error().Err(err).Msg("Could not write memory profile")
} else {
logging.Info().Msgf("Memory profile written to: %s", dm.memProfile)
}
if err := f.Close(); err != nil {
logging.Error().Err(err).Msg("Error closing memory profile file")
}
dm.memProfile = ""
}
// StartTraceProfile starts execution tracing
func (dm *DiagnosticsManager) StartTraceProfile() error {
traceProfilePath := filepath.Join(dm.OutputDir, "trace.out")
f, err := os.Create(traceProfilePath)
if err != nil {
return fmt.Errorf("could not create trace profile at %s: %w", traceProfilePath, err)
}
if err := trace.Start(f); err != nil {
_ = f.Close()
return fmt.Errorf("could not start trace profile: %w", err)
}
dm.traceProfile = f
return nil
}
// StopTraceProfile stops execution tracing
func (dm *DiagnosticsManager) StopTraceProfile() {
if dm.traceProfile != nil {
trace.Stop()
if err := dm.traceProfile.Close(); err != nil {
logging.Error().Err(err).Msg("Error closing trace profile file")
}
logging.Info().Msgf("Trace profile written to: %s", dm.traceProfile.Name())
dm.traceProfile = nil
}
}
+74
View File
@@ -0,0 +1,74 @@
package cmd
import (
"time"
"github.com/spf13/cobra"
"github.com/zricethezav/gitleaks/v8/logging"
"github.com/zricethezav/gitleaks/v8/sources"
)
func init() {
rootCmd.AddCommand(directoryCmd)
directoryCmd.Flags().Bool("follow-symlinks", false, "scan files that are symlinks to other files")
}
var directoryCmd = &cobra.Command{
Use: "dir [flags] [path]",
Aliases: []string{"file", "directory"},
Short: "scan directories or files for secrets",
Run: runDirectory,
}
func runDirectory(cmd *cobra.Command, args []string) {
// grab source
source := "."
if len(args) == 1 {
source = args[0]
if source == "" {
source = "."
}
}
initConfig(source)
initDiagnostics()
var err error
// setup config (aka, the thing that defines rules)
cfg := Config(cmd)
// start timer
start := time.Now()
detector := Detector(cmd, cfg, source)
// set follow symlinks flag
if detector.FollowSymlinks, err = cmd.Flags().GetBool("follow-symlinks"); err != nil {
logging.Fatal().Err(err).Send()
}
// set exit code
exitCode, err := cmd.Flags().GetInt("exit-code")
if err != nil {
logging.Fatal().Err(err).Msg("could not get exit code")
}
findings, err := detector.DetectSource(
cmd.Context(),
&sources.Files{
Config: &cfg,
FollowSymlinks: detector.FollowSymlinks,
MaxFileSize: detector.MaxTargetMegaBytes * 1_000_000,
Path: source,
Sema: detector.Sema,
MaxArchiveDepth: detector.MaxArchiveDepth,
},
)
if err != nil {
logging.Error().Err(err).Msg("failed scan directory")
}
findingSummaryAndExit(detector, findings, exitCode, start, err)
}
+121
View File
@@ -0,0 +1,121 @@
package base
import (
"fmt"
"strings"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func CreateGlobalConfig() config.Config {
return config.Config{
Title: "gitleaks config",
Allowlists: []*config.Allowlist{
{
Description: "global allow lists",
Regexes: []*regexp.Regexp{
// ----------- General placeholders -----------
regexp.MustCompile(`(?i)^true|false|null$`),
// Awkward workaround to detect repeated characters.
func() *regexp.Regexp {
var (
letters = "abcdefghijklmnopqrstuvwxyz*."
patterns []string
)
for _, char := range letters {
if char == '*' || char == '.' {
patterns = append(patterns, fmt.Sprintf("\\%c+", char))
} else {
patterns = append(patterns, fmt.Sprintf("%c+", char))
}
}
return regexp.MustCompile("^(?i:" + strings.Join(patterns, "|") + ")$")
}(),
// ----------- Environment Variables -----------
regexp.MustCompile(`^\$(?:\d+|{\d+})$`),
regexp.MustCompile(`^\$(?:[A-Z_]+|[a-z_]+)$`),
regexp.MustCompile(`^\${(?:[A-Z_]+|[a-z_]+)}$`),
// ----------- Interpolated Variables -----------
// Ansible (https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html)
regexp.MustCompile(`^\{\{[ \t]*[\w ().|]+[ \t]*}}$`),
// GitHub Actions
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables
// https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions
regexp.MustCompile(`^\$\{\{[ \t]*(?:(?:env|github|secrets|vars)(?:\.[A-Za-z]\w+)+[\w "'&./=|]*)[ \t]*}}$`),
// NuGet (https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#using-environment-variables)
regexp.MustCompile(`^%(?:[A-Z_]+|[a-z_]+)%$`),
// String formatting.
regexp.MustCompile(`^%[+\-# 0]?[bcdeEfFgGoOpqstTUvxX]$`), // Golang (https://pkg.go.dev/fmt)
regexp.MustCompile(`^\{\d{0,2}}$`), // Python (https://docs.python.org/3/tutorial/inputoutput.html)
// Urban Code Deploy (https://www.ibm.com/support/pages/replace-token-step-replaces-replacement-values-windows-variables)
regexp.MustCompile(`^@(?:[A-Z_]+|[a-z_]+)@$`),
// ----------- Miscellaneous -----------
// File paths
regexp.MustCompile(`^/Users/(?i)[a-z0-9]+/[\w .-/]+$`), // MacOS
regexp.MustCompile(`^/(?:bin|etc|home|opt|tmp|usr|var)/[\w ./-]+$`), // Linux
// 11980 Jps -Dapplication.home=D:\develop_tools\jdk\jdk1.8.0_131 -Xms8m
//regexp.MustCompile(`^$`), // Windows
},
Paths: []*regexp.Regexp{
regexp.MustCompile(`gitleaks\.toml`),
// ----------- Documents and media -----------
regexp.MustCompile(`(?i)\.(?:bmp|gif|jpe?g|png|svg|tiff?)$`), // Images
regexp.MustCompile(`(?i)\.(?:eot|[ot]tf|woff2?)$`), // Fonts
regexp.MustCompile(`(?i)\.(?:docx?|xlsx?|pdf|bin|socket|vsidx|v2|suo|wsuo|.dll|pdb|exe|gltf)$`),
// ----------- Golang files -----------
regexp.MustCompile(`go\.(?:mod|sum|work(?:\.sum)?)$`),
regexp.MustCompile(`(?:^|/)vendor/modules\.txt$`),
regexp.MustCompile(`(?:^|/)vendor/(?:github\.com|golang\.org/x|google\.golang\.org|gopkg\.in|istio\.io|k8s\.io|sigs\.k8s\.io)(?:/.*)?$`),
// ----------- Java files -----------
// Gradle
regexp.MustCompile(`(?:^|/)gradlew(?:\.bat)?$`),
regexp.MustCompile(`(?:^|/)gradle\.lockfile$`),
regexp.MustCompile(`(?:^|/)mvnw(?:\.cmd)?$`),
regexp.MustCompile(`(?:^|/)\.mvn/wrapper/MavenWrapperDownloader\.java$`),
// ----------- JavaScript files -----------
// Dependencies and lock files.
regexp.MustCompile(`(?:^|/)node_modules(?:/.*)?$`),
regexp.MustCompile(`(?:^|/)(?:deno\.lock|npm-shrinkwrap\.json|package-lock\.json|pnpm-lock\.yaml|yarn\.lock)$`),
regexp.MustCompile(`(?:^|/)bower_components(?:/.*)?$`),
// TODO: Add more common static assets, such as swagger-ui.
regexp.MustCompile(`(?:^|/)(?:angular|bootstrap|jquery(?:-?ui)?|plotly|swagger-?ui)[a-zA-Z0-9.-]*(?:\.min)?\.js(?:\.map)?$`),
regexp.MustCompile(`(?:^|/)javascript\.json$`),
// ----------- Python files -----------
// Dependencies and lock files.
regexp.MustCompile(`(?:^|/)(?:Pipfile|poetry)\.lock$`),
// Virtual environments
regexp.MustCompile(`(?i)(?:^|/)(?:v?env|virtualenv)/lib(?:64)?(?:/.*)?$`),
regexp.MustCompile(`(?i)(?:^|/)(?:lib(?:64)?/python[23](?:\.\d{1,2})+|python/[23](?:\.\d{1,2})+/lib(?:64)?)(?:/.*)?$`),
// dist-info directory (https://py-pkgs.org/04-package-structure.html#building-sdists-and-wheels)
regexp.MustCompile(`(?i)(?:^|/)[a-z0-9_.]+-[0-9.]+\.dist-info(?:/.+)?$`),
// ----------- Ruby files -----------
regexp.MustCompile(`(?:^|/)vendor/(?:bundle|ruby)(?:/.*?)?$`),
regexp.MustCompile(`\.gem$`), // tar archive
// Misc
regexp.MustCompile(`verification-metadata\.xml`),
regexp.MustCompile(`Database.refactorlog`),
// ----------- Git files ------------
regexp.MustCompile(`(?:^|/)\.git$`),
},
StopWords: []string{
"abcdefghijklmnopqrstuvwxyz", // character range
// ----------- Secrets -----------
// Checkmarx client secret. (https://github.com/checkmarx-ts/checkmarx-python-sdk/blob/86560f6e2a3e46d16322101294da10d5d190312d/README.md?plain=1#L56)
"014df517-39d1-4453-b7b3-9930c563627c",
},
},
},
}
}
+203
View File
@@ -0,0 +1,203 @@
package base
import (
"testing"
)
var allowlistRegexTests = map[string]struct {
invalid []string
valid []string
}{
"general placeholders": {
invalid: []string{
`true`, `True`, `false`, `False`, `null`, `NULL`,
},
},
"general placeholders - repeated characters": {
invalid: []string{
`aaaaaaaaaaaaaaaaa`, `BBBBBBBBBBbBBBBBBBbBB`, `********************`,
},
valid: []string{`aaaaaaaaaaaaaaaaaaabaa`, `pas*************d`},
},
"environment variables": {
invalid: []string{`$2`, `$GIT_PASSWORD`, `${GIT_PASSWORD}`, `$password`},
valid: []string{`$yP@R.@=ibxI`, `$2a6WCust9aE`, `${not_complete1`},
},
"interpolated variables - ansible": {
invalid: []string{
`{{ x }}`, `{{ password }}`, `{{password}}`, `{{ data.proxy_password }}`,
`{{ dict1 | ansible.builtin.combine(dict2) }}`,
},
},
"interpolated variables - github actions": {
invalid: []string{
`${{ env.First_Name }}`,
`${{ env.DAY_OF_WEEK == 'Monday' }}`,
`${{env.JAVA_VERSION}}`,
`${{ github.event.issue.title }}`,
`${{ github.repository == "Gattocrucco/lsqfitgp" }}`,
`${{ github.event.pull_request.number || github.ref }}`,
`${{ github.event_name == 'pull_request' && github.event.action == 'unassigned' }}`,
`${{ secrets.SuperSecret }}`,
`${{ vars.JOB_NAME }}`,
`${{ vars.USE_VARIABLES == 'true' }}`,
},
},
"interpolated variables - nuget": {
invalid: []string{
`%MY_PASSWORD%`, `%password%`,
},
},
"interpolated variables - string fmt - golang": {
invalid: []string{
`%b`, `%c`, `%d`, `% d`, `%e`, `%E`, `%f`, `%F`, `%g`, `%G`, `%o`, `%O`, `%p`, `%q`, `%-s`, `%s`, `%t`, `%T`, `%U`, `%#U`, `%+v`, `%#v`, `%v`, `%x`, `%X`,
},
},
"interpolated variables - string fmt - python": {
invalid: []string{
`{}`, `{0}`, `{10}`,
},
},
"interpolated variables - ucd": {
invalid: []string{`@password@`, `@LDAP_PASS@`},
valid: []string{`@username@mastodon.example`},
},
"miscellaneous - file paths": {
invalid: []string{
// MacOS
`/Users/james/Projects/SwiftCode/build/Release`,
// Linux
`/tmp/screen-exchange`,
},
valid: []string{},
},
}
func TestConfigAllowlistRegexes(t *testing.T) {
cfg := CreateGlobalConfig()
allowlists := cfg.Allowlists
for name, cases := range allowlistRegexTests {
t.Run(name, func(t *testing.T) {
for _, c := range cases.invalid {
for _, a := range allowlists {
if !a.RegexAllowed(c) {
t.Errorf("invalid value not marked as allowed: %s", c)
}
}
}
for _, c := range cases.valid {
for _, a := range allowlists {
if a.RegexAllowed(c) {
t.Errorf("valid value marked as allowed: %s", c)
}
}
}
})
}
}
func BenchmarkConfigAllowlistRegexes(b *testing.B) {
cfg := CreateGlobalConfig()
allowlists := cfg.Allowlists
for n := 0; n < b.N; n++ {
for _, cases := range allowlistRegexTests {
for _, c := range cases.invalid {
for _, a := range allowlists {
a.RegexAllowed(c)
}
}
for _, c := range cases.valid {
for _, a := range allowlists {
a.RegexAllowed(c)
}
}
}
}
}
var allowlistPathsTests = map[string]struct {
invalid []string
valid []string
}{
"javascript - common static assets": {
invalid: []string{
`tests/e2e/nuget/wwwroot/lib/bootstrap/dist/js/bootstrap.esm.min.js`,
`src/main/static/lib/angular.1.2.16.min.js`,
`src/main/resources/static/jquery-ui-1.12.1/jquery-ui-min.js`,
`src/main/resources/static/js/jquery-ui-1.10.4.min.js`,
`src-static/js/plotly.min.js`,
`swagger/swaggerui/swagger-ui-bundle.js.map`,
`swagger/swaggerui/swagger-ui-es-bundle.js.map`,
`src/main/static/swagger-ui.min.js`,
`swagger/swaggerui/swagger-ui.js`,
},
},
"python": {
invalid: []string{
// lock files
`Pipfile.lock`, `poetry.lock`,
// virtual environments
"env/lib/python3.7/site-packages/urllib3/util/url.py",
"venv/Lib/site-packages/regex-2018.08.29.dist-info/DESCRIPTION.rst",
"venv/lib64/python3.5/site-packages/pynvml.py",
"python/python3/virtualenv/Lib/site-packages/pyphonetics/utils.py",
"virtualenv/lib64/python3.7/base64.py",
// packages
"cde-root/usr/lib64/python2.4/site-packages/Numeric.pth",
"lib/python3.9/site-packages/setuptools/_distutils/msvccompiler.py",
"lib/python3.8/site-packages/botocore/data/alexaforbusiness/2017-11-09/service-2.json",
"code/python/3.7.4/Lib/site-packages/dask/bytes/tests/test_bytes_utils.py",
"python/3.7.4/Lib/site-packages/fsspec/utils.py",
"python/2.7.16.32/Lib/bsddb/test/test_dbenv.py",
"python/lib/python3.8/site-packages/boto3/data/ec2/2016-04-01/resources-1.json",
// distinfo
"libs/PyX-0.15.dist-info/AUTHORS",
},
},
}
func TestConfigAllowlistPaths(t *testing.T) {
cfg := CreateGlobalConfig()
allowlists := cfg.Allowlists
for name, cases := range allowlistPathsTests {
t.Run(name, func(t *testing.T) {
for _, c := range cases.invalid {
for _, a := range allowlists {
if !a.PathAllowed(c) {
t.Errorf("invalid path not marked as allowed: %s", c)
}
}
}
for _, c := range cases.valid {
for _, a := range allowlists {
if a.PathAllowed(c) {
t.Errorf("valid path marked as allowed: %s", c)
}
}
}
})
}
}
func BenchmarkConfigAllowlistPaths(b *testing.B) {
cfg := CreateGlobalConfig()
allowlists := cfg.Allowlists
for n := 0; n < b.N; n++ {
for _, cases := range allowlistPathsTests {
for _, c := range cases.invalid {
for _, a := range allowlists {
a.PathAllowed(c)
}
}
for _, c := range cases.valid {
for _, a := range allowlists {
a.PathAllowed(c)
}
}
}
}
}
+301
View File
@@ -0,0 +1,301 @@
package main
import (
"os"
"slices"
"text/template"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/base"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/rules"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/logging"
)
const (
templatePath = "rules/config.tmpl"
)
//go:generate go run $GOFILE ../../../config/gitleaks.toml
func main() {
if len(os.Args) < 2 {
_, _ = os.Stderr.WriteString("Specify path to the gitleaks.toml config\n")
os.Exit(2)
}
gitleaksConfigPath := os.Args[1]
configRules := []*config.Rule{
rules.OnePasswordSecretKey(),
rules.OnePasswordServiceAccountToken(),
rules.AdafruitAPIKey(),
rules.AdobeClientID(),
rules.AdobeClientSecret(),
rules.AgeSecretKey(),
rules.AirtableApiKey(),
rules.AirtablePersonalAccessToken(),
rules.AlgoliaApiKey(),
rules.AlibabaAccessKey(),
rules.AlibabaSecretKey(),
rules.AmazonBedrockAPIKeyLongLived(),
rules.AmazonBedrockAPIKeyShortLived(),
rules.AnthropicAdminApiKey(),
rules.AnthropicApiKey(),
rules.ArtifactoryApiKey(),
rules.ArtifactoryReferenceToken(),
rules.AsanaClientID(),
rules.AsanaClientSecret(),
rules.Atlassian(),
rules.Authress(),
rules.AWS(),
rules.AzureActiveDirectoryClientSecret(),
rules.BitBucketClientID(),
rules.BitBucketClientSecret(),
rules.BittrexAccessKey(),
rules.BittrexSecretKey(),
rules.Beamer(),
rules.CodecovAccessToken(),
rules.CoinbaseAccessToken(),
rules.ClickHouseCloud(),
rules.Clojars(),
rules.CloudflareAPIKey(),
rules.CloudflareGlobalAPIKey(),
rules.CloudflareOriginCAKey(),
rules.CohereAPIToken(),
rules.ConfluentAccessToken(),
rules.ConfluentSecretKey(),
rules.Contentful(),
rules.CurlHeaderAuth(),
rules.CurlBasicAuth(),
rules.Databricks(),
rules.DatadogtokenAccessToken(),
rules.DefinedNetworkingAPIToken(),
rules.DigitalOceanPAT(),
rules.DigitalOceanOAuthToken(),
rules.DigitalOceanRefreshToken(),
rules.DiscordAPIToken(),
rules.DiscordClientID(),
rules.DiscordClientSecret(),
rules.Doppler(),
rules.DropBoxAPISecret(),
rules.DropBoxLongLivedAPIToken(),
rules.DropBoxShortLivedAPIToken(),
rules.DroneciAccessToken(),
rules.Duffel(),
rules.Dynatrace(),
rules.EasyPost(),
rules.EasyPostTestAPI(),
rules.EtsyAccessToken(),
rules.FacebookSecret(),
rules.FacebookAccessToken(),
rules.FacebookPageAccessToken(),
rules.FastlyAPIToken(),
rules.FinicityClientSecret(),
rules.FinicityAPIToken(),
rules.FlickrAccessToken(),
rules.FinnhubAccessToken(),
rules.FlutterwavePublicKey(),
rules.FlutterwaveSecretKey(),
rules.FlutterwaveEncKey(),
rules.FlyIOAccessToken(),
rules.FrameIO(),
rules.Freemius(),
rules.FreshbooksAccessToken(),
rules.GoCardless(),
// TODO figure out what makes sense for GCP
// rules.GCPServiceAccount(),
rules.GCPAPIKey(),
rules.GitHubPat(),
rules.GitHubFineGrainedPat(),
rules.GitHubOauth(),
rules.GitHubApp(),
rules.GitHubRefresh(),
rules.GitlabCiCdJobToken(),
rules.GitlabDeployToken(),
rules.GitlabFeatureFlagClientToken(),
rules.GitlabFeedToken(),
rules.GitlabIncomingMailToken(),
rules.GitlabKubernetesAgentToken(),
rules.GitlabOauthAppSecret(),
rules.GitlabPat(),
rules.GitlabPatRoutable(),
rules.GitlabPipelineTriggerToken(),
rules.GitlabRunnerRegistrationToken(),
rules.GitlabRunnerAuthenticationToken(),
rules.GitlabRunnerAuthenticationTokenRoutable(),
rules.GitlabScimToken(),
rules.GitlabSessionCookie(),
rules.GitterAccessToken(),
rules.GrafanaApiKey(),
rules.GrafanaCloudApiToken(),
rules.GrafanaServiceAccountToken(),
rules.HarnessApiKey(),
rules.HashiCorpTerraform(),
rules.HashicorpField(),
rules.Heroku(),
rules.HerokuV2(),
rules.HubSpot(),
rules.HuggingFaceAccessToken(),
rules.HuggingFaceOrganizationApiToken(),
rules.Intercom(),
rules.Intra42ClientSecret(),
rules.JFrogAPIKey(),
rules.JFrogIdentityToken(),
rules.JWT(),
rules.JWTBase64(),
rules.KrakenAccessToken(),
rules.KubernetesSecret(),
rules.KucoinAccessToken(),
rules.KucoinSecretKey(),
rules.LaunchDarklyAccessToken(),
rules.LinearAPIToken(),
rules.LinearClientSecret(),
rules.LinkedinClientID(),
rules.LinkedinClientSecret(),
rules.LobAPIToken(),
rules.LobPubAPIToken(),
rules.LookerClientID(),
rules.LookerClientSecret(),
rules.MailChimp(),
rules.MailGunPubAPIToken(),
rules.MailGunPrivateAPIToken(),
rules.MailGunSigningKey(),
rules.MapBox(),
rules.MattermostAccessToken(),
rules.MaxMindLicenseKey(),
rules.Meraki(),
rules.MessageBirdAPIToken(),
rules.MessageBirdClientID(),
rules.NetlifyAccessToken(),
rules.NewRelicUserID(),
rules.NewRelicUserKey(),
rules.NewRelicBrowserAPIKey(),
rules.NewRelicInsertKey(),
rules.Notion(),
rules.NPM(),
rules.NugetConfigPassword(),
rules.NytimesAccessToken(),
rules.OctopusDeployApiKey(),
rules.OktaAccessToken(),
rules.OpenAI(),
rules.OpenshiftUserToken(),
rules.PerplexityAPIKey(),
rules.PlaidAccessID(),
rules.PlaidSecretKey(),
rules.PlaidAccessToken(),
rules.PlanetScalePassword(),
rules.PlanetScaleAPIToken(),
rules.PlanetScaleOAuthToken(),
rules.PostManAPI(),
rules.Prefect(),
rules.PrivateAIToken(),
rules.PrivateKey(),
rules.PrivateKeyPKCS12File(),
rules.PulumiAPIToken(),
rules.PyPiUploadToken(),
rules.RapidAPIAccessToken(),
rules.ReadMe(),
rules.RubyGemsAPIToken(),
rules.ScalingoAPIToken(),
rules.SendbirdAccessID(),
rules.SendbirdAccessToken(),
rules.SendGridAPIToken(),
rules.SendInBlueAPIToken(),
rules.SentryAccessToken(),
rules.SentryOrgToken(),
rules.SentryUserToken(),
rules.SettlemintApplicationAccessToken(),
rules.SettlemintPersonalAccessToken(),
rules.SettlemintServiceAccessToken(),
rules.ShippoAPIToken(),
rules.ShopifyAccessToken(),
rules.ShopifyCustomAccessToken(),
rules.ShopifyPrivateAppAccessToken(),
rules.ShopifySharedSecret(),
rules.SidekiqSecret(),
rules.SidekiqSensitiveUrl(),
rules.SlackBotToken(),
rules.SlackUserToken(),
rules.SlackAppLevelToken(),
rules.SlackConfigurationToken(),
rules.SlackConfigurationRefreshToken(),
rules.SlackLegacyBotToken(),
rules.SlackLegacyWorkspaceToken(),
rules.SlackLegacyToken(),
rules.SlackWebHookUrl(),
rules.Snyk(),
rules.Sonar(),
rules.SourceGraph(),
rules.StripeAccessToken(),
rules.SquareAccessToken(),
rules.SquareSpaceAccessToken(),
rules.SumoLogicAccessID(),
rules.SumoLogicAccessToken(),
rules.TeamsWebhook(),
rules.TelegramBotToken(),
rules.TravisCIAccessToken(),
rules.Twilio(),
rules.TwitchAPIToken(),
rules.TwitterAPIKey(),
rules.TwitterAPISecret(),
rules.TwitterAccessToken(),
rules.TwitterAccessSecret(),
rules.TwitterBearerToken(),
rules.Typeform(),
rules.VaultBatchToken(),
rules.VaultServiceToken(),
rules.YandexAPIKey(),
rules.YandexAWSAccessToken(),
rules.YandexAccessToken(),
rules.ZendeskSecretKey(),
rules.GenericCredential(),
rules.InfracostAPIToken(),
}
// ensure rules have unique ids
ruleLookUp := make(map[string]config.Rule, len(configRules))
for _, rule := range configRules {
if err := rule.Validate(); err != nil {
logging.Fatal().Err(err).
Str("rule-id", rule.RuleID).
Msg("Failed to validate rule")
}
// check if rule is in ruleLookUp
if _, ok := ruleLookUp[rule.RuleID]; ok {
logging.Fatal().
Str("rule-id", rule.RuleID).
Msg("rule id is not unique")
}
// TODO: eventually change all the signatures to get ride of this
// nasty dereferencing.
ruleLookUp[rule.RuleID] = *rule
// Slices are de-duplicated with a map, every iteration has a different order.
// This is an awkward workaround.
for _, allowlist := range rule.Allowlists {
slices.Sort(allowlist.Commits)
slices.Sort(allowlist.StopWords)
}
}
tmpl, err := template.ParseFiles(templatePath)
if err != nil {
logging.Fatal().Err(err).Msg("Failed to parse template")
}
f, err := os.Create(gitleaksConfigPath)
if err != nil {
logging.Fatal().Err(err).Msg("Failed to create rules.toml")
}
defer f.Close()
cfg := base.CreateGlobalConfig()
cfg.Rules = ruleLookUp
for _, allowlist := range cfg.Allowlists {
slices.Sort(allowlist.Commits)
slices.Sort(allowlist.StopWords)
}
if err = tmpl.Execute(f, cfg); err != nil {
logging.Fatal().Err(err).Msg("could not execute template")
}
}
+81
View File
@@ -0,0 +1,81 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
// https://developer.1password.com/docs/service-accounts/security/?token-example=encoded
func OnePasswordServiceAccountToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "1password-service-account-token",
Description: "Uncovered a possible 1Password service account token, potentially compromising access to secrets in vaults.",
Regex: regexp.MustCompile(`ops_eyJ[a-zA-Z0-9+/]{250,}={0,3}`),
Entropy: 4,
Keywords: []string{"ops_"},
}
// validate
tps := []string{
utils.GenerateSampleSecret("1password", secrets.NewSecret(`ops_eyJ[a-zA-Z0-9+/]{250,}={0,3}`)),
`### 1Password System Vault Name
export OP_SERVICE_ACCOUNT_TOKEN=ops_eyJzaWduSW5BZGRyZXNzIjoibXkuMXBhc3N3b3JkLmNvbSIsInVzZXJBdXRoIjp7Im1ldGhvZCI6IlNSUGctNDA5NiIsImFsZyI6IlBCRVMyZy1IUzI1NiIsIml0ZXJhdGlvbnMiOjY1MdAwMCwic2FsdCI6InE2dE0tYzNtRDhiNUp2OHh1YVzsUmcifSwiZW1haWwiOiJ5Z3hmcm0zb21oY3NtQDFwYXNzd29yZHNlcnZpY2VhY2NvdW50cy5jb20iLCJzcnBYIjoiM2E5NDdhZmZhMDQ5NTAxZjkxYzk5MGFiY2JiYWRlZjFjMjM5Y2Q3YTMxYmI1MmQyZjUzOTA2Y2UxOTA1OTYwYiIsIm11ayI6eyJhbGciOiJBMjU2R0NNIiwiZXh0Ijp0cnVlLCJrIjoiVVpleERsLVgyUWxpa0VqRjVUUjRoODhOd29ZcHRqSHptQmFTdlNrWGZmZyIsImtleV9vcHMiOlsiZW5jcnlwdCIsImRlY3J5cHQiXSwia3R5Ijoib2N0Iiwia2lkIjoibXAifSwic2VjcmV0S2V5IjoiQTMtNDZGUUVNLUVZS1hTQS1NUU0yUy04U0JSUS01QjZGUC1HS1k2ViIsInRocm90dGxlU2VjcmV0Ijp7InNlZWQiOiJjZmU2ZTU0NGUxZTlmY2NmZjJlYjBhYWZmYTEzNjZlMmE2ZmUwZDVlZGI2ZTUzOTVkZTljZmY0NDY3NDUxOGUxIiwidXVpZCI6IjNVMjRMNVdCNkpFQ0pEQlhJNFZOSTRCUzNRIn0sImRldmljZVV1aWQiOiJqaGVlY3F4cm41YTV6ZzRpMnlkbjRqd3U3dSJ9
`,
`PYTEST_SVC_ACCT_TOKEN=ops_eyJzaWduSW5BZGRyZXNzIjoiemFjaC1hbmQtbGVhbm5lLjFwYXNzd29yZC5jb20iLCJ1c2VyQXV0aCI6eyJtZXRob2QiOiJTUlBnLTQwOTYiLCJhbGciOiJQQkVLMmctSFMyNTYiLCJpdGVyYXRpb25zIjo2NTAwMDAsInNhbHQiOiJlYUZRQmNVemJyTHhnM2d4bHFQLVVBIn0sImVtYWlsIjoiMm9iNGRpeDdiNTdrYUAxcGFzc3dvcmRzZXJ2aWNlYWNjb3VudHMuY29tIiwic3JwWCI6ImVmZDY4YjNhZTkwMmRjZjRiMzEzYjE5MjYwZmY0OGUzMjU2ZDlhOGNkM2JmMmY3YzI2YzU1ZWJkNjZlZGU4NWEiLCJtdWsiOnsiYWxnIjoiQTI1NkdDTSIsImV4dCI6dHJ1ZSwiayI6IlMwaGE0SDhqbEhRblJCWmxvYnBmR1BneERmbS1pRGNkZWY0bFdYU0VSbmMiLCJrZXlfb3BzIjpbImRlY3J5cHQiLCJlbmNyeXB0Il0sImt0eSI6Im9jdCIsImtpZCI6Im1wIn0sInNlY3JldEtleSI6IkEzLUdHOUVRNi1LUzQ0QVctQU5QVkYtUkdQTDktQlNKUTMtR1NHR0giLCJ0aHJvdHRsZVNlY3JldCI6eyJzZWVkIjoiN2I0OTMxMmJiOTlkZTFiNjU5ODZkYzIzOWU4YWNmZWMxMTU0M2E2OGQxYmYwMjZmZTgzMjg3NWYxNmJlOWY2NiIsInV1aWQiOiJDV1RHQ0hMNlNWRkdSTlg0SzNENUJVSDZDSSJ9LCJkZXZpY2VVdWlkIjoiMnFld3JpaGtqbmt1Zmh6ZGdmZ2hnNmM1cGUifQ`,
` "sourceContent": "ops_eyJlbWFpbCI6ImVqd2U2NHFtbHhocmlAMXBhc3N3b3Jkc2VydmljZWFjY291bnRzLmxjbCIsIm11ayI6eyJhbGciOiJBMjU2R0NNIiwiZXh0Ijp0cnVlLCJrIjoiTThWUGZJYzhWRWZUaGNNWExhS0NLRjhzTWg1Sk1ac1BBdHU5MmZRTmItbyIsImtleV9vcHMiOlsiZW5jcnlwdCIsImRlY3J5cHQiXSwia3R5Ijoib2N0Iiwia2lkIjoibXAifSwic2VjcmV0S2V5IjoiQTMtQzRaSk1OLVBRVFpUTC1IR0w4NC1HNjRNNy1LVlpSTi00WlZQNiIsInNycFgiOiI4NzBkNjdhOWU2MjY2MjVkOWUzNjg1MDc4MDRjOWMzMmU2NjFjNTdlN2U1NTg3NzgyOTFiZjI5ZDVhMjc5YWUxIiwic2lnbkluQWRkcmVzcyI6ImdvdGhhbS5iNWxvY2FsLmNvbTo0MDAwIiwidXNlckF1dGgiOnsibWV0aG9kIjoiU1JQZy00MDk2IiwiYWxnIjoiUEJFUzJnLUhTMjU2IiwiaXRlcmF0aW9ucyI6MTAwMDAwLCJzYWx0IjoiRk1SVVBpeXJONFhmXzhIb2g2WVJYUSJ9fQ\n\nops_token is secret.\n",`,
}
fps := []string{
// Invalid
` login:
serviceAccountToken:
fn::secret: ops_eyJzaWduSW5B..[Redacted]`,
`: To start using this service account, run the following command:
:
: export OP_SERVICE_ACCOUNT_TOKEN=ops_eyJzaWduSW5BZGRyZXNzIjoiaHR0cHM6...`,
// Low entropy.
`ops_eyJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,
}
return utils.Validate(r, tps, fps)
}
// Reference:
// - https://1passwordstatic.com/files/security/1password-white-paper.pdf
func OnePasswordSecretKey() *config.Rule {
// 1Password secret keys include several hyphens but these are only for readability
// and are stripped during 1Password login. This means that the following are technically
// the same valid key:
// - A3ASWWYB798JRYLJVD423DC286TVMH43EB
// - A-3-A-S-W-W-Y-B-7-9-8-J-R-Y-L-J-V-D-4-2-3-D-C-2-8-6-T-V-M-H-4-3-E-B
// But in practice, when these keys are added to a vault, exported in an emergency kit, or
// copied, they have hyphens that follow one of two patterns I can find:
// - A3-ASWWYB-798JRY-LJVD4-23DC2-86TVM-H43EB (every key I've generated has this pattern)
// - A3-ASWWYB-798JRYLJVD4-23DC2-86TVM-H43EB (the whitepaper includes this example, which could just be a typo)
// To avoid a complicated regex that checks for every possible situation it's probably best
// to scan for the these two patterns.
r := config.Rule{
Description: "Uncovered a possible 1Password secret key, potentially compromising access to secrets in vaults.",
RuleID: "1password-secret-key",
Regex: regexp.MustCompile(`\bA3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\b`),
Entropy: 3.8,
Keywords: []string{"A3-"},
}
// validate
tps := utils.GenerateSampleSecrets("1password", secrets.NewSecret(`A3-[A-Z0-9]{6}-[A-Z0-9]{11}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}`))
tps = append(tps, utils.GenerateSampleSecrets("1password", secrets.NewSecret(`A3-[A-Z0-9]{6}-[A-Z0-9]{6}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}`))...)
tps = append(tps,
// from whitepaper
`A3-ASWWYB-798JRYLJVD4-23DC2-86TVM-H43EB`,
`A3-ASWWYB-798JRY-LJVD4-23DC2-86TVM-H43EB`,
)
fps := []string{
// low entropy
`A3-XXXXXX-XXXXXXXXXXX-XXXXX-XXXXX-XXXXX`,
// lowercase
`A3-xXXXXX-XXXXXX-XXXXX-XXXXX-XXXXX-XXXXX`,
}
return utils.Validate(r, tps, fps)
}
+21
View File
@@ -0,0 +1,21 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AdafruitAPIKey() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified a potential Adafruit API Key, which could lead to unauthorized access to Adafruit services and sensitive data exposure.",
RuleID: "adafruit-api-key",
Regex: utils.GenerateSemiGenericRegex([]string{"adafruit"}, utils.AlphaNumericExtendedShort("32"), true),
Keywords: []string{"adafruit"},
}
// validate
tps := utils.GenerateSampleSecrets("adafruit", secrets.NewSecret(utils.AlphaNumericExtendedShort("32")))
return utils.Validate(r, tps, nil)
}
+39
View File
@@ -0,0 +1,39 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AdobeClientID() *config.Rule {
// define rule
r := config.Rule{
RuleID: "adobe-client-id",
Description: "Detected a pattern that resembles an Adobe OAuth Web Client ID, posing a risk of compromised Adobe integrations and data breaches.",
Regex: utils.GenerateSemiGenericRegex([]string{"adobe"}, utils.Hex("32"), true),
Entropy: 2,
Keywords: []string{"adobe"},
}
// validate
tps := utils.GenerateSampleSecrets("adobe", secrets.NewSecret(utils.Hex("32")))
return utils.Validate(r, tps, nil)
}
func AdobeClientSecret() *config.Rule {
// define rule
r := config.Rule{
RuleID: "adobe-client-secret",
Description: "Discovered a potential Adobe Client Secret, which, if exposed, could allow unauthorized Adobe service access and data manipulation.",
Regex: utils.GenerateUniqueTokenRegex(`p8e-(?i)[a-z0-9]{32}`, false),
Entropy: 2,
Keywords: []string{"p8e-"},
}
// validate
tps := []string{
"adobeClient := \"p8e-" + secrets.NewSecret(utils.Hex("32")) + "\"",
}
return utils.Validate(r, tps, nil)
}
+21
View File
@@ -0,0 +1,21 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func AgeSecretKey() *config.Rule {
// define rule
r := config.Rule{
Description: "Discovered a potential Age encryption tool secret key, risking data decryption and unauthorized access to sensitive information.",
RuleID: "age-secret-key",
Regex: regexp.MustCompile(`AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}`),
Keywords: []string{"AGE-SECRET-KEY-1"},
}
// validate
tps := utils.GenerateSampleSecrets("age", `AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ`) // gitleaks:allow
return utils.Validate(r, tps, nil)
}
+37
View File
@@ -0,0 +1,37 @@
package rules
import (
"regexp"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AirtableApiKey() *config.Rule {
// define rule
r := config.Rule{
Description: "Uncovered a possible Airtable API Key, potentially compromising database access and leading to data leakage or alteration.",
RuleID: "airtable-api-key",
Regex: utils.GenerateSemiGenericRegex([]string{"airtable"}, utils.AlphaNumeric("17"), true),
Keywords: []string{"airtable"},
}
// validate
tps := utils.GenerateSampleSecrets("airtable", secrets.NewSecret(utils.AlphaNumeric("17")))
return utils.Validate(r, tps, nil)
}
func AirtablePersonalAccessToken() *config.Rule {
// define rule
r := config.Rule{
Description: "Uncovered a possible Airtable Personal AccessToken, potentially compromising database access and leading to data leakage or alteration.",
RuleID: "airtable-personnal-access-token",
Regex: regexp.MustCompile(`\b(pat[[:alnum:]]{14}\.[a-f0-9]{64})\b`),
Keywords: []string{"airtable"},
}
// validate
tps := utils.GenerateSampleSecrets("airtable", "pat"+secrets.NewSecret(utils.AlphaNumeric("14")+"\\."+utils.Hex("64")))
return utils.Validate(r, tps, nil)
}
+21
View File
@@ -0,0 +1,21 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AlgoliaApiKey() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms.",
RuleID: "algolia-api-key",
Regex: utils.GenerateSemiGenericRegex([]string{"algolia"}, `[a-z0-9]{32}`, true),
Keywords: []string{"algolia"},
}
// validate
tps := utils.GenerateSampleSecrets("algolia", secrets.NewSecret(utils.Hex("32")))
return utils.Validate(r, tps, nil)
}
+40
View File
@@ -0,0 +1,40 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AlibabaAccessKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "alibaba-access-key-id",
Description: "Detected an Alibaba Cloud AccessKey ID, posing a risk of unauthorized cloud resource access and potential data compromise.",
Regex: utils.GenerateUniqueTokenRegex(`LTAI(?i)[a-z0-9]{20}`, false),
Entropy: 2,
Keywords: []string{"LTAI"},
}
// validate
tps := []string{
"alibabaKey := \"LTAI" + secrets.NewSecret(utils.Hex("20")) + "\"",
}
return utils.Validate(r, tps, nil)
}
// TODO
func AlibabaSecretKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "alibaba-secret-key",
Description: "Discovered a potential Alibaba Cloud Secret Key, potentially allowing unauthorized operations and data access within Alibaba Cloud.",
Regex: utils.GenerateSemiGenericRegex([]string{"alibaba"}, utils.AlphaNumeric("30"), true),
Entropy: 2,
Keywords: []string{"alibaba"},
}
// validate
tps := utils.GenerateSampleSecrets("alibaba", secrets.NewSecret(utils.AlphaNumeric("30")))
return utils.Validate(r, tps, nil)
}
+69
View File
@@ -0,0 +1,69 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AnthropicApiKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "anthropic-api-key",
Description: "Identified an Anthropic API Key, which may compromise AI assistant integrations and expose sensitive data to unauthorized access.",
Regex: utils.GenerateUniqueTokenRegex(`sk-ant-api03-[a-zA-Z0-9_\-]{93}AA`, false),
Keywords: []string{
"sk-ant-api03",
},
}
// validate
tps := []string{
// Valid API key example
"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",
// Generate additional random test keys
utils.GenerateSampleSecret("anthropic", "sk-ant-api03-"+secrets.NewSecret(utils.AlphaNumericExtendedShort("93"))+"AA"),
}
fps := []string{
// Too short key (missing characters)
"sk-ant-api03-abc123xyz-456de-klMnopqrstuvwx-3456yza789bcde-1234fghijklmnopAA",
// Wrong suffix
"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzBB",
// Wrong prefix (admin key, not API key)
"sk-ant-admin01-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",
}
return utils.Validate(r, tps, fps)
}
func AnthropicAdminApiKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "anthropic-admin-api-key",
Description: "Detected an Anthropic Admin API Key, risking unauthorized access to administrative functions and sensitive AI model configurations.",
Regex: utils.GenerateUniqueTokenRegex(`sk-ant-admin01-[a-zA-Z0-9_\-]{93}AA`, false),
Keywords: []string{
"sk-ant-admin01",
},
}
// validate
tps := []string{
// Valid admin key example
"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",
// Generate additional random test keys
utils.GenerateSampleSecret("anthropic", "sk-ant-admin01-"+secrets.NewSecret(utils.AlphaNumericExtendedShort("93"))+"AA"),
}
fps := []string{
// Too short key (missing characters)
"sk-ant-admin01-abc123xyz-456de-klMnopqrstuvwx-3456yza789bcde-1234fghijklmnopAA",
// Wrong suffix
"sk-ant-admin01-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzBB",
// Wrong prefix (API key, not admin key)
"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",
}
return utils.Validate(r, tps, fps)
}
+58
View File
@@ -0,0 +1,58 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func ArtifactoryApiKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "artifactory-api-key",
Description: "Detected an Artifactory api key, posing a risk unauthorized access to the central repository.",
Regex: regexp.MustCompile(`\bAKCp[A-Za-z0-9]{69}\b`),
Entropy: 4.5,
Keywords: []string{"AKCp"},
}
// validate
tps := []string{
"artifactoryApiKey := \"AKCp" + secrets.NewSecret(utils.AlphaNumeric("69")) + "\"",
}
// false positives
fps := []string{
`lowEntropy := AKCpXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`,
"wrongStart := \"AkCp" + secrets.NewSecret(utils.AlphaNumeric("69")) + "\"",
"wrongLength := \"AkCp" + secrets.NewSecret(utils.AlphaNumeric("59")) + "\"",
"partOfAlongUnrelatedBlob gYnkgAkCp" + secrets.NewSecret(utils.AlphaNumeric("69")) + "VyZSB2",
}
return utils.Validate(r, tps, fps)
}
func ArtifactoryReferenceToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "artifactory-reference-token",
Description: "Detected an Artifactory reference token, posing a risk of impersonation and unauthorized access to the central repository.",
Regex: regexp.MustCompile(`\bcmVmd[A-Za-z0-9]{59}\b`),
Entropy: 4.5,
Keywords: []string{"cmVmd"},
}
// validate
tps := []string{
"artifactoryRefToken := \"cmVmd" + secrets.NewSecret(utils.AlphaNumeric("59")) + "\"",
}
// false positives
fps := []string{
`lowEntropy := cmVmdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`,
"wrongStart := \"cmVMd" + secrets.NewSecret(utils.AlphaNumeric("59")) + "\"",
"wrongLength := \"cmVmd" + secrets.NewSecret(utils.AlphaNumeric("49")) + "\"",
"partOfAlongUnrelatedBlob gYnkgcmVmd" + secrets.NewSecret(utils.AlphaNumeric("59")) + "VyZSB2",
}
return utils.Validate(r, tps, fps)
}
+36
View File
@@ -0,0 +1,36 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AsanaClientID() *config.Rule {
// define rule
r := config.Rule{
Description: "Discovered a potential Asana Client ID, risking unauthorized access to Asana projects and sensitive task information.",
RuleID: "asana-client-id",
Regex: utils.GenerateSemiGenericRegex([]string{"asana"}, utils.Numeric("16"), true),
Keywords: []string{"asana"},
}
// validate
tps := utils.GenerateSampleSecrets("asana", secrets.NewSecret(utils.Numeric("16")))
return utils.Validate(r, tps, nil)
}
func AsanaClientSecret() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",
RuleID: "asana-client-secret",
Regex: utils.GenerateSemiGenericRegex([]string{"asana"}, utils.AlphaNumeric("32"), true),
Keywords: []string{"asana"},
}
// validate
tps := utils.GenerateSampleSecrets("asana", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
+36
View File
@@ -0,0 +1,36 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Atlassian() *config.Rule {
// define rule
r := config.Rule{
Description: "Detected an Atlassian API token, posing a threat to project management and collaboration tool security and data confidentiality.",
RuleID: "atlassian-api-token",
Regex: utils.MergeRegexps(
utils.GenerateSemiGenericRegex(
[]string{"(?-i:ATLASSIAN|[Aa]tlassian)", "(?-i:CONFLUENCE|[Cc]onfluence)", "(?-i:JIRA|[Jj]ira)"},
`[a-z0-9]{20}[a-f0-9]{4}`, // The last 4 characters are an MD5 hash.
true,
),
utils.GenerateUniqueTokenRegex(`ATATT3[A-Za-z0-9_\-=]{186}`, false),
),
Entropy: 3.5,
Keywords: []string{"atlassian", "confluence", "jira", "atatt3"},
}
// validate
tps := utils.GenerateSampleSecrets("atlassian", secrets.NewSecret(utils.AlphaNumeric("20")+"[a-f0-9]{4}"))
tps = append(tps, utils.GenerateSampleSecrets("confluence", secrets.NewSecret(utils.AlphaNumeric("20")+"[a-f0-9]{4}"))...)
tps = append(tps, utils.GenerateSampleSecrets("jira", secrets.NewSecret(utils.AlphaNumeric("20")+"[a-f0-9]{4}"))...)
tps = append(tps, `JIRA_API_TOKEN=HXe8DGg1iJd2AopzyxkFB7F2`)
tps = append(tps, utils.GenerateSampleSecrets("jira", "ATATT3xFfGF0K3irG5tKKi-6u-wwaXQFeGwZ-IHR-hQ3CulkKtMSuteRQFfLZ6jihHThzZCg_UjnDt-4Wl_gIRf4zrZJs5JqaeuBhsfJ4W5GD6yGg3W7903gbvaxZPBjxIQQ7BgFDSkPS8oPispw4KLz56mdK-G6CIvLO6hHRrZHY0Q3tvJ6JxE=C63992E6")...)
fps := []string{"getPagesInConfluenceSpace,searchConfluenceUsingCql"}
return utils.Validate(r, tps, fps)
}
+31
View File
@@ -0,0 +1,31 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Authress() *config.Rule {
// Rule Definition
// (Note: When changes are made to this, rerun `go generate ./...` and commit the config/gitleaks.toml file
r := config.Rule{
RuleID: "authress-service-client-access-key",
Description: "Uncovered a possible Authress Service Client Access Key, which may compromise access control services and sensitive data.",
Regex: utils.GenerateUniqueTokenRegex(`(?:sc|ext|scauth|authress)_(?i)[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.(?-i:acc)[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120}`, false),
Entropy: 2,
Keywords: []string{"sc_", "ext_", "scauth_", "authress_"},
}
// validate
// https://authress.io/knowledge-base/docs/authorization/service-clients/secrets-scanning/#1-detection
service_client_id := "sc_" + utils.AlphaNumeric("10")
access_key_id := utils.AlphaNumeric("4")
account_id := "acc_" + utils.AlphaNumeric("10")
signature_key := utils.AlphaNumericExtendedShort("40")
tps := utils.GenerateSampleSecrets("authress", secrets.NewSecret(fmt.Sprintf(`%s\.%s\.%s\.%s`, service_client_id, access_key_id, account_id, signature_key)))
return utils.Validate(r, tps, nil)
}
+109
View File
@@ -0,0 +1,109 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func AWS() *config.Rule {
// define rule
r := config.Rule{
RuleID: "aws-access-token",
Description: "Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",
Regex: regexp.MustCompile(`\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\b`),
Entropy: 3,
Keywords: []string{
// https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids
"A3T", // todo: might not be a valid AWS token
"AKIA", // Access key
"ASIA", // Temporary (AWS STS) access key
"ABIA", // AWS STS service bearer token
"ACCA", // Context-specific credential
},
Allowlists: []*config.Allowlist{
{
Regexes: []*regexp.Regexp{
regexp.MustCompile(`.+EXAMPLE$`),
},
},
},
}
// validate
tps := utils.GenerateSampleSecrets("AWS", "AKIALALEMEL33243OLIB") // gitleaks:allow
// current AWS tokens cannot contain [0,1,8,9], so their entropy is slightly lower than expected.
tps = append(tps, utils.GenerateSampleSecrets("AWS", "AKIA"+secrets.NewSecret("[A-Z2-7]{16}"))...)
tps = append(tps, utils.GenerateSampleSecrets("AWS", "ASIA"+secrets.NewSecret("[A-Z2-7]{16}"))...)
tps = append(tps, utils.GenerateSampleSecrets("AWS", "ABIA"+secrets.NewSecret("[A-Z2-7]{16}"))...)
tps = append(tps, utils.GenerateSampleSecrets("AWS", "ACCA"+secrets.NewSecret("[A-Z2-7]{16}"))...)
fps := []string{
`key = AKIAXXXXXXXXXXXXXXXX`, // Low entropy
`aws_access_key: AKIAIOSFODNN7EXAMPLE`, // Placeholder
`msgstr "Näytä asiakirjamallikansio."`, // Lowercase
`TODAYINASIAASACKOFRICEFELLOVER`, // wrong length
`CTTCATAGGGTTCACGCTGTGTAAT-ACG--CCTGAGGC-CACA-AGGGGACTTCAGCAACCGTCGGG-GATTC-ATTGCCA-A--TGGAAGCAATC-TA-TGGGTTA-TCGCGGAGTCCGCAAAGACGGCCAGTATG-AAGCAGATTTCGCAC-CAATGTGACTGCATTTCGTG-ATCGGGGTAAGTA-TC-GCCGATTC-GC--CCGTCCA-AGT-CGAAG-TA--GGCAATATAAAGCTGC-CATTGCCGAAGCTATCTCGCTA-TACTTGAT-AATCGGCGG-TAG-CACAG-GTCGCAGTATCG-AC-T--AGG-CCTCTCAAAAGTT-GGGTCCCGGCCTCTGGGAAAAACACCTCT-A-AGCGTCAATCAGCTCGGTTTCGCATATTA-TGATATCCCCCGTTGACCAATTGA--TAGTACCCGAGCTTACCGTCGG-ATTCTGGAGTCTT-ATGAGGTTACCGACGA-CGCAGTACCATAAGT-GCGCAATTTGACTGTTCCCGTCGAGTAACCA-AGCTTTGCTCA-CCGGGATGCGCGCCGATGTGACCAGGGGGCGCATGTTACATTGAC-A-GCTGGATCATGTTATGAC-GTGGGTC-ATGCTAAAAGCCTAAAGGACGGT-GCATTAGTAT-TACCGGGACCTCATATCAATGCGCTCGCTAGTTCCTCTTCTCTTGATAACGTATATGCGTCAGGCGCCCGTCCGCCTCCAATACGTG-ACAACGTC-AGTACTGAGCCTC--AA-ACATCGTCTTGTTCG-CC-TACAAAGGATCGGTAGAAAACTCAATATTCGGGTATAAGGTCGTAGGAAGTGTGTCGCCCAGGGCCG-CTAGA-AGCGCACACAAGCG-CTCCTGTCAAGGAGTTG-GTGAAAA-ATGAAC--GACT-ATTGCGTCAC--CTACCTCT-AAGTTTTT-GACAATTTCATGGACGAATTGA-AGCGTCCACAAGCATCTGCCGTAGATATGCGGTAGGTTTTTACATATG-TCACTGCAGAGTCACGGACA-CACATCGCTGTCAAAATGCTCGTACCTAGT-GT-TTGCGATCCCCC-GCGGCATTA-TCTTTTGAACCCTCGTCCCTGTGG-CTCTGATGATTGAG-GTCTGTA-TTCCCTCGTTGTGGGGGGATTGGACCTT-TGTATAGGTTCTTTAACCG-ATGGGGGGCCG--ATCGA-A-TA-TGCTCCTGTTTGCCCCGAACCTT-ACCTCGG-TCCAGACA-CTAAGAAAAACCCC-C-ACTGTAAGGTGCTGAGCCTTTGGATAGCC-CGCGAATGAT-CC-TAGTTGACAA-CTGAACGCGCTCGAACA-TGCCC-GCCCTCTGA--CTGCTGTCTG-GCACCTTTAGACACGCGTCGAC-CATATATT-AGCGCTGTCTGTGG-AGGT-TGTGTCTTGTTGCTCA-CT-CATTATCTGT-AACTGGCTCC-CTC-CCAT-TGGCGTCTTTACACCAACCGCTAGGTTACAGTGCA-TCTAGCGCCTATTATCAGGGCGT-TTGCAGCGGCGCGGTGGCTATGT-GTTAGACATATC-CTTACACTGTATGCTAG-AGCAAGCCAC-TCTGAATGGGTTGC-CGATGAATGA-TCTTGATC-GAGCTCGCA-AC---TACATGGAGTCCGAAGTGAACCTACGGATGATCGTATTCCAACACGAGGATC-TATACGTATAGG-A-GGCG-TAATCCACAATTTAGTAACTCTTGACGC---GGATGAAAAT-GTCGTTACACCTTCCAGAGGCTCGG-GTATATATATGACCT--TGTGATTGAGGACGATCTAGAATAA-CT-GT-G-CT-AAAGTACAGTAGTTTCTATGT-GGTAGGTGGAGAATACAGAGTAG-ATGATTC-GTGGGCCACA-C--T-ACTTTCAT-TAGAGCAGAGA-C-GTGAGTGAGTTTTACACTAGCCAGATGGACCG-GTGA-AGTCTAACAGCCACCGCTT-GTGAGGTCGTTTCCCAGTC-ACCCTACTACAGGCAAAAACTCAGTGT-CC-GTGA-GTGCGTTAGTGATATTCCCTAACGGTTAGGTAACT-CATGAATTCA-AT-TAAGCGTGTCC-CGGT-CACGCCCCCATGGGGGCCTTCTTGGGAGG--AGCATCTTAT--AT-GCTCACGTGGTT-GATAGG-A-T-AATACACTTTTAGTCAGTCCATCAATAAC-AAAGGAAC---CAGGTGGTCGCAGATA-TCCCGCTGATATAGCACTGTGTAAACTCAGGTGATA-CTAAGC--GCTCTAAT-ACG-CTTAATGGCAATGCCCAGTTC--ACGACTAGCTTATGAGGCCCAGCTATGGACTGCGGC-GGCATGTCGGC-GATGGTTGCCCTCGCCCTAAATTATGTACGA-T-ACCGCCT-CTTGTTCT-CCGCCCATAGGGT-C--AGCAGGCGATAGACTCCCAGAAATTTCCTCGTCGT-CCGAATAAGACTAACACGACTA-TT-CCTCTAC-GT-G-AA-CTTATCA-CAAATG-GCT-TACC-TAGGTGGTGGCAGATCACTTTCCGGTG-TATTACGAATTGACGCATACCGAC-A-CGC-GCTTGTTGGATAATCGACTCTAACCTCCTCTCTGGCACATGT-GCTGGATTACCTC-TATTTT-TCTCGCTTAG--GGAACG-T-CCTCTGTCGCGTGAG-GTACGTTTCACGGGAG-CGGCTTGTTCATGCCACGTCCATTATCGA-AGTG-C-GTAAGG-A-GAGCCCTA--GACTCTACACGGAAA-TC-AAC-GTAGAAGGCTC-A-CT`,
}
return utils.Validate(r, tps, fps)
}
func AmazonBedrockAPIKeyLongLived() *config.Rule {
// https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-how.html
// https://medium.com/@adan.alvarez/api-keys-for-bedrock-a-brief-security-overview-2133ed9a2b3f
r := config.Rule{
RuleID: "aws-amazon-bedrock-api-key-long-lived",
Description: "Identified a pattern that may indicate long-lived Amazon Bedrock API keys, risking unauthorized Amazon Bedrock usage",
Regex: utils.GenerateUniqueTokenRegex(`ABSK[A-Za-z0-9+/]{109,269}={0,2}`, false),
Entropy: 3,
Keywords: []string{
"ABSK", // Amazon Bedrock API Key (long-lived)
},
}
// validate
tps := []string{
// Valid API key example
"ABSKQmVkcm9ja0FQSUtleS1EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXM=",
// Generate additional random test keys
utils.GenerateSampleSecret("bedrock", "ABSKQmVkcm9ja0FQSUtleS1"+secrets.NewSecret(utils.AlphaNumeric("108"))+"="),
utils.GenerateSampleSecret("bedrock", "ABSKQmVkcm9ja0FQSUtleS1"+secrets.NewSecret(utils.AlphaNumeric("246"))),
}
fps := []string{
// Too short key (missing characters)
"ABSKQmVkcm9ja0FQSUtleS1EXAMPLE",
// Too long
"ABSKQmVkcm9ja0FQSUtleS1EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLE=",
// Wrong prefix
"AXSKQmVkcm9ja0FQSUtleS1EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXM=",
}
return utils.Validate(r, tps, fps)
}
func AmazonBedrockAPIKeyShortLived() *config.Rule {
// https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-how.html
// https://github.com/aws/aws-bedrock-token-generator-js/blob/86277e1489354192c64ffc8f995601daacc1f715/src/token.ts#L21
r := config.Rule{
RuleID: "aws-amazon-bedrock-api-key-short-lived",
Description: "Identified a pattern that may indicate short-lived Amazon Bedrock API keys, risking unauthorized Amazon Bedrock usage",
Regex: regexp.MustCompile(`bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29t`),
Entropy: 3,
Keywords: []string{
"bedrock-api-key-", // Amazon Bedrock API Key (short lived)
},
}
// validate
tps := utils.GenerateSampleSecrets("AmazonBedrockAPIKeyShortLived", `bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29t`)
fps := []string{
// Too short key (missing characters)
"bedrock-api-key-",
// Wrong prefix
"bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29x",
}
return utils.Validate(r, tps, fps)
}
+65
View File
@@ -0,0 +1,65 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
// References:
// - https://learn.microsoft.com/en-us/microsoft-365/compliance/sit-defn-azure-ad-client-secret
// - https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#add-credentials
func AzureActiveDirectoryClientSecret() *config.Rule {
// define rule
r := config.Rule{
RuleID: "azure-ad-client-secret",
Description: "Azure AD Client Secret",
// After inspecting dozens of secrets, I'm fairly confident that they start with `xxx\dQ~`.
// However, this may not be (entirely) true, and this rule might need to be further refined in the future.
// Furthermore, it's possible that secrets have a checksum that could be used to further constrain this pattern.
Regex: regexp.MustCompile(`(?:^|[\\'"\x60\s>=:(,)])([a-zA-Z0-9_~.]{3}\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\'"\x60\s<),])`), // wtf, Go? https://github.com/golang/go/issues/18221
Entropy: 3,
Keywords: []string{
"Q~",
},
}
// validate
tps := []string{
`client_secret=bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR`, // gitleaks:allow
`client_secret=bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR
`, // gitleaks:allow
`client_secret: .IQ8Q~79R7TOWOspFnWcEG-dYt4KXqFqxK16cxr`, // gitleaks:allow
`AUTH_CLIENTSECRET = _V28Q~IC8qxmlWNpHuDm34JlbKv9LXV5MvUR3a-P`, // gitleaks:allow
`<value xsi:type="xsd:string">~Gg8Q~nVhlLi2vpg_nXBGqFsbGK-t~Hus1JmTa0y</value>`, // gitleaks:allow
`"CLIENT_SECRET": "YYz7Q~Sudoqwap1PnzEBA3zqBK~i5uesDIv.C"`, // gitleaks:allow
`Set-PSUAuthenticationMethod -Type 'OpenIDConnect' -CallbackPath '/auth/oidc' -ClientId 'fake' -ClientSecret '2Vq7Q~q5VgKljZ7cb3.0sp0Apz.vOjRIPyeTr'`, // gitleaks:allow
`client-secret: "t028Q~-aLbmQuinnZtzbgtlEAYstnBWEmGPAoBm"`, // gitleaks:allow
`"cas.authn.azure-active-directory.client-secret=qHF8Q~PCM5HhMoyTFc5TYEomnzR6Kim9UJhe8a.P",`, // gitleaks:allow
`"line": "client_srt = \"qpF8Q~PCM5MhMoyTFc5TYEomnYRUKim9UJhe8a2P\";",`, // gitleaks:allow
`"client_secret": acctest.Representation{RepType: acctest.Required, Create: 'dO29Q~F5-VwnW.lZdd11xFF_t5NAXCaGwDl9NbT1'},`, // gitleaks:allow
`Example= GN.7Q~4AkLZBNEbz4Jxlm~O5G6SsyFxYg6zMR`, // gitleaks:allow
`"the_value": "QtT8Q~9C-_Ij~RouHVpD2Tuf3oHWGh.DQ3kcjbAn"`, // gitleaks:allow
`QtT8Q~9C-_Ij~RouHVpD2Tuf3oHWGh.DQ3kcjbAn`, // gitleaks:allow
`(use the client secret: QtT8Q~9C-_Ij~RouHVpD2Tuf3oHWGh.DQ3kcjbAn)`, // gitleaks:allow
`(QtT8Q~9C-_Ij~RouHVpD2Tuf3oHWGh.DQ3kcjbAn)`, // gitleaks:allow
`\"pass\": \"` + fmt.Sprintf("%s%sQ~%s", secrets.NewSecret(`[\w~.]{3}`), secrets.NewSecret(utils.Numeric("1")), secrets.NewSecret(`[\w~.-]{31,34}`)),
}
fps := []string{
`![图源:《深入拆解Tomcat & Jetty》](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6a9e704af49b4380bb686f0c96d33b81~tplv-k3u1fbpfcp-watermark.image)`,
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`,
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`,
`.ui.visible.right.sidebar~.ui.visible.left.sidebar~.pusher{transform:translate3d(0,0,0)}`,
`buf.WriteString("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n")`,
`'url': 'http://www.2doc.nl/speel~VARA_101375237~mh17-het-verdriet-van-nederland~.html',`,
`@ar = split("~", "965f1453~47~09414c93e4cef985416f472549220827da3ba6fed8ad28e29ef6ad170ad53a69051e9b06f439ef6da5df8670181f7eb2481650");`,
`'#!/registries/5/portainer.demo~2Fportainerregistrytesting~2Falpine',`,
`// CloudFront-Signature: Ixn4bF1LLrLcB8XG-t5bZbIB0vfwSF2s4gkef~PcNBdx73MVvZD3v8DZ5GzcqNrybMiqdYJY5KqK6vTsf5JXDgwFFz-h98wdsbV-izcuonPdzMHp4Ay4qyXM6Ed5jB9dUWYGwMkA6rsWXpftfX8xmk4tG1LwFuJV6nAsx4cfpuKwo4vU2Hyr2-fkA7MZG8AHkpDdVUnjm1q-Re9HdG0nCq-2lnBAdOchBpJt37narOj-Zg6cbx~6rzQLVQd8XIv-Bn7VTc1tkBAJVtGOHb0Q~PLzSRmtNGYTnpL0z~gp3tq8lhZc2HuvJW5-tZaYP9yufeIzk5bqsT6DT4iDuclKKw__, , , false`,
`+ "<Trust Comment=\"\" Identity=\"USK@u2vn3Lh6Kte2-TgBSNKorbsKkuAt34ckoLmgx0ndXO0,4~q8Q~3wIHjX9DT0yCNfQmr9oxmYrDZoQVLOdNg~yk0,AQACAAE/WebOfTrustRC2/2\" Value=\"100\"/>"`,
`client_secret=bP88Q~xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,
}
return utils.Validate(r, tps, fps)
}
+25
View File
@@ -0,0 +1,25 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Beamer() *config.Rule {
// define rule
r := config.Rule{
Description: "Detected a Beamer API token, potentially compromising content management and exposing sensitive notifications and updates.",
RuleID: "beamer-api-token",
Regex: utils.GenerateSemiGenericRegex([]string{"beamer"},
`b_[a-z0-9=_\-]{44}`, true),
Keywords: []string{"beamer"},
}
// validate
tps := utils.GenerateSampleSecrets("beamer", "b_"+secrets.NewSecret(utils.AlphaNumericExtended("44")))
fps := []string{
`│   ├── R21A-A-V010SP13RC181024R16900-CN-B_250K-Release-OTA-97B6C6C59241976086FABDC41472150C.bfu`,
}
return utils.Validate(r, tps, fps)
}
+36
View File
@@ -0,0 +1,36 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func BitBucketClientID() *config.Rule {
// define rule
r := config.Rule{
Description: "Discovered a potential Bitbucket Client ID, risking unauthorized repository access and potential codebase exposure.",
RuleID: "bitbucket-client-id",
Regex: utils.GenerateSemiGenericRegex([]string{"bitbucket"}, utils.AlphaNumeric("32"), true),
Keywords: []string{"bitbucket"},
}
// validate
tps := utils.GenerateSampleSecrets("bitbucket", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
func BitBucketClientSecret() *config.Rule {
// define rule
r := config.Rule{
Description: "Discovered a potential Bitbucket Client Secret, posing a risk of compromised code repositories and unauthorized access.",
RuleID: "bitbucket-client-secret",
Regex: utils.GenerateSemiGenericRegex([]string{"bitbucket"}, utils.AlphaNumericExtended("64"), true),
Keywords: []string{"bitbucket"},
}
// validate
tps := utils.GenerateSampleSecrets("bitbucket", secrets.NewSecret(utils.AlphaNumeric("64")))
return utils.Validate(r, tps, nil)
}
+36
View File
@@ -0,0 +1,36 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func BittrexAccessKey() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified a Bittrex Access Key, which could lead to unauthorized access to cryptocurrency trading accounts and financial loss.",
RuleID: "bittrex-access-key",
Regex: utils.GenerateSemiGenericRegex([]string{"bittrex"}, utils.AlphaNumeric("32"), true),
Keywords: []string{"bittrex"},
}
// validate
tps := utils.GenerateSampleSecrets("bittrex", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
func BittrexSecretKey() *config.Rule {
// define rule
r := config.Rule{
Description: "Detected a Bittrex Secret Key, potentially compromising cryptocurrency transactions and financial security.",
RuleID: "bittrex-secret-key",
Regex: utils.GenerateSemiGenericRegex([]string{"bittrex"}, utils.AlphaNumeric("32"), true),
Keywords: []string{"bittrex"},
}
// validate
tps := utils.GenerateSampleSecrets("bittrex", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
+30
View File
@@ -0,0 +1,30 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func ClickHouseCloud() *config.Rule {
// define rule
r := config.Rule{
RuleID: "clickhouse-cloud-api-secret-key",
Description: "Identified a pattern that may indicate clickhouse cloud API secret key, risking unauthorized clickhouse cloud api access and data breaches on ClickHouse Cloud platforms.",
Regex: regexp.MustCompile(`\b(4b1d[A-Za-z0-9]{38})\b`),
Entropy: 3,
Keywords: []string{
"4b1d", // Prefix
},
}
// validate
tps := utils.GenerateSampleSecrets("ClickHouse", "4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z")
tps = append(tps, utils.GenerateSampleSecrets("ClickHouse", "4b1d"+secrets.NewSecret("[A-Za-z0-9]{38}"))...)
fps := []string{
`key = 4b1dXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`, // Low entropy
`key = adf4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z`, // Not start of a word
}
return utils.Validate(r, tps, fps)
}
+23
View File
@@ -0,0 +1,23 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func Clojars() *config.Rule {
// define rule
r := config.Rule{
RuleID: "clojars-api-token",
Description: "Uncovered a possible Clojars API token, risking unauthorized access to Clojure libraries and potential code manipulation.",
Regex: regexp.MustCompile(`(?i)CLOJARS_[a-z0-9]{60}`),
Entropy: 2,
Keywords: []string{"clojars_"},
}
// validate
tps := utils.GenerateSampleSecrets("clojars", "CLOJARS_"+secrets.NewSecret(utils.AlphaNumeric("60")))
return utils.Validate(r, tps, nil)
}
+81
View File
@@ -0,0 +1,81 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
var global_keys = []string{
`cloudflare_global_api_key = "d3d1443e0adc9c24564c6c5676d679d47e2ca"`, // gitleaks:allow
`CLOUDFLARE_GLOBAL_API_KEY: 674538c7ecac77d064958a04a83d9e9db068c`, // gitleaks:allow
`cloudflare: "0574b9f43978174cc2cb9a1068681225433c4"`, // gitleaks:allow
}
var api_keys = []string{
`cloudflare_api_key = "Bu0rrK-lerk6y0Suqo1qSqlDDajOk61wZchCkje4"`, // gitleaks:allow
`CLOUDFLARE_API_KEY: 5oK0U90ME14yU6CVxV90crvfqVlNH2wRKBwcLWDc`, // gitleaks:allow
`cloudflare: "oj9Yoyq0zmOyWmPPob1aoY5YSNNuJ0fbZSOURBlX"`, // gitleaks:allow
}
var origin_ca_keys = []string{
`CLOUDFLARE_ORIGIN_CA: v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5`,
`CLOUDFLARE_ORIGIN_CA: v1.0-15d20c7fccb4234ac5cdd756-d5c2630d1b606535cf9320ae7456b090e0896cec64169a92fae4e931ab0f72f111b2e4ffed5b2bb40f6fba6b2214df23b188a23693d59ce3fb0d28f7e89a2206d98271b002dac695ed`,
}
var identifiers = []string{"cloudflare"}
func CloudflareGlobalAPIKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "cloudflare-global-api-key",
Description: "Detected a Cloudflare Global API Key, potentially compromising cloud application deployments and operational security.",
Regex: utils.GenerateSemiGenericRegex(identifiers, utils.Hex("37"), true),
Entropy: 2,
Keywords: identifiers,
}
// validate
tps := utils.GenerateSampleSecrets("cloudflare", secrets.NewSecret(utils.Hex("37")))
tps = append(tps, global_keys...)
fps := append(api_keys, origin_ca_keys...)
return utils.Validate(r, tps, fps)
}
func CloudflareAPIKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "cloudflare-api-key",
Description: "Detected a Cloudflare API Key, potentially compromising cloud application deployments and operational security.",
Regex: utils.GenerateSemiGenericRegex(identifiers, utils.AlphaNumericExtendedShort("40"), true),
Entropy: 2,
Keywords: identifiers,
}
// validate
tps := utils.GenerateSampleSecrets("cloudflare", secrets.NewSecret(utils.AlphaNumericExtendedShort("40")))
tps = append(tps, api_keys...)
fps := append(global_keys, origin_ca_keys...)
return utils.Validate(r, tps, fps)
}
func CloudflareOriginCAKey() *config.Rule {
ca_identifiers := append(identifiers, "v1.0-")
// define rule
r := config.Rule{
Description: "Detected a Cloudflare Origin CA Key, potentially compromising cloud application deployments and operational security.",
RuleID: "cloudflare-origin-ca-key",
Regex: utils.GenerateUniqueTokenRegex(`v1\.0-`+utils.Hex("24")+"-"+utils.Hex("146"), false),
Entropy: 2,
Keywords: ca_identifiers,
}
// validate
tps := utils.GenerateSampleSecrets("cloudflare", "v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5")
tps = append(tps, origin_ca_keys...)
fps := append(global_keys, api_keys...)
return utils.Validate(r, tps, fps)
}
+23
View File
@@ -0,0 +1,23 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func CodecovAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "codecov-access-token",
Description: "Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",
Regex: utils.GenerateSemiGenericRegex([]string{"codecov"}, utils.AlphaNumeric("32"), true),
Keywords: []string{
"codecov",
},
}
// validate
tps := utils.GenerateSampleSecrets("codecov", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
+32
View File
@@ -0,0 +1,32 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func CohereAPIToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "cohere-api-token",
Description: "Identified a Cohere Token, posing a risk of unauthorized access to AI services and data manipulation.",
Regex: utils.GenerateSemiGenericRegex([]string{"cohere", "CO_API_KEY"}, `[a-zA-Z0-9]{40}`, false),
Entropy: 4,
Keywords: []string{
"cohere",
"CO_API_KEY",
},
}
// validate
tps := []string{
utils.GenerateSampleSecret("cohere", secrets.NewSecret(`[a-zA-Z0-9]{40}`)),
// https://github.com/cohere-ai/cohere-go/blob/abe8044073ed498ffbb206a602d03c2414b64512/client/client.go#L38C30-L38C40
`export CO_API_KEY=` + secrets.NewSecret(`[a-zA-Z0-9]{40}`),
}
fps := []string{
`CO_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,
}
return utils.Validate(r, tps, fps)
}
+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func CoinbaseAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "coinbase-access-token",
Description: "Detected a Coinbase Access Token, posing a risk of unauthorized access to cryptocurrency accounts and financial transactions.",
Regex: utils.GenerateSemiGenericRegex([]string{"coinbase"},
utils.AlphaNumericExtendedShort("64"), true),
Keywords: []string{
"coinbase",
},
}
// validate
tps := utils.GenerateSampleSecrets("coinbase", secrets.NewSecret(utils.AlphaNumericExtendedShort("64")))
return utils.Validate(r, tps, nil)
}
+75
View File
@@ -0,0 +1,75 @@
# This file has been auto-generated. Do not edit manually.
# If you would like to contribute new rules, please use
# cmd/generate/config/main.go and follow the contributing guidelines
# at https://github.com/gitleaks/gitleaks/blob/master/CONTRIBUTING.md
#
# How the hell does secret scanning work? Read this:
# https://lookingatcomputer.substack.com/p/regex-is-almost-all-you-need
#
# This is the default gitleaks configuration file.
# Rules and allowlists are defined within this file.
# Rules instruct gitleaks on what should be considered a secret.
# Allowlists instruct gitleaks on what is allowed, i.e. not a secret.
title = "{{.Title}}"
# minVersion indicates the minimum Gitleaks version required to use this config.
# If the running version is older, a warning will be logged and not all
# config-enabled features are guaranteed to work.
minVersion = "v8.25.0"
{{ with .Allowlists }}{{ range $i, $allowlist := . }}{{ if or $allowlist.Regexes $allowlist.Paths $allowlist.Commits $allowlist.StopWords }}# TODO: change to [[allowlists]]{{println}}[allowlist]
{{- with .Description }}{{println}}description = "{{ . }}"{{ end }}
{{- with .MatchCondition }}{{println}}condition = "{{ .String }}"{{ end }}
{{- with .Commits -}}{{println}}commits = [
{{ range $j, $commit := . }}"{{ $commit }}",{{ end }}
]{{ end }}
{{- with .Paths }}{{println}}paths = [{{ range $j, $path := . }}
'''{{ $path }}''',{{ end }}
]{{ end }}
{{- if and .RegexTarget .Regexes }}{{println}}regexTarget = "{{ .RegexTarget }}"{{ end -}}
{{- with .Regexes }}{{println}}regexes = [{{ range $i, $regex := . }}
'''{{ $regex }}''',{{ end }}
]{{ end }}
{{- with .StopWords }}{{println}}stopwords = [{{ range $j, $stopword := . }}
"{{ $stopword }}",{{ end }}
]{{ end }}{{ end }}{{ end }}{{ end }}{{println}}
{{- range $i, $rule := .Rules }}{{println}}[[rules]]
id = "{{$rule.RuleID}}"
description = "{{$rule.Description}}"
{{- with $rule.Regex }}
regex = '''{{ . }}'''{{ end -}}
{{- with $rule.Path }}
path = '''{{ . }}'''{{ end -}}
{{- with $rule.SecretGroup }}
secretGroup = {{ . }}{{ end -}}
{{- with $rule.Entropy }}
entropy = {{ . }}{{ end -}}
{{- with $rule.Keywords }}
{{- if gt (len .) 1}}
keywords = [{{ range $j, $keyword := . }}
"{{ $keyword }}",{{ end }}
]{{else}}
keywords = [{{ range $j, $keyword := . }}"{{ $keyword }}"{{ end }}]{{end}}{{ end }}
{{- with $rule.Tags }}
tags = [
{{ range $j, $tag := . }}"{{ $tag }}",{{ end }}
]{{ end }}
{{- with $rule.Allowlists }}{{ range $i, $allowlist := . }}{{ if or $allowlist.Regexes $allowlist.Paths $allowlist.Commits $allowlist.StopWords }}{{println}}[[rules.allowlists]]
{{- with .Description }}{{println}}description = "{{ . }}"{{ end }}
{{- with .MatchCondition }}{{println}}condition = "{{ .String }}"{{ end }}
{{- with .Commits -}}{{println}}commits = [
{{ range $j, $commit := . }}"{{ $commit }}",{{ end }}
]{{ end }}
{{- with .Paths }}{{println}}paths = [
{{ range $j, $path := . }}'''{{ $path }}''',{{ end }}
]{{ end }}
{{- if and .RegexTarget .Regexes }}{{println}}regexTarget = "{{ .RegexTarget }}"{{ end -}}
{{- with .Regexes }}{{println}}regexes = [{{ range $i, $regex := . }}
'''{{ $regex }}''',{{ end }}
]{{ end }}
{{- with .StopWords }}{{println}}stopwords = [{{ range $j, $stopword := . }}
"{{ $stopword }}",{{ end }}
]{{ end }}{{ end }}{{ end }}{{ end }}
{{ end }}
+40
View File
@@ -0,0 +1,40 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func ConfluentSecretKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "confluent-secret-key",
Description: "Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",
Regex: utils.GenerateSemiGenericRegex([]string{"confluent"}, utils.AlphaNumeric("64"), true),
Keywords: []string{
"confluent",
},
}
// validate
tps := utils.GenerateSampleSecrets("confluent", secrets.NewSecret(utils.AlphaNumeric("64")))
return utils.Validate(r, tps, nil)
}
func ConfluentAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "confluent-access-token",
Description: "Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",
Regex: utils.GenerateSemiGenericRegex([]string{"confluent"}, utils.AlphaNumeric("16"), true),
Keywords: []string{
"confluent",
},
}
// validate
tps := utils.GenerateSampleSecrets("confluent", secrets.NewSecret(utils.AlphaNumeric("16")))
return utils.Validate(r, tps, nil)
}
+22
View File
@@ -0,0 +1,22 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Contentful() *config.Rule {
// define rule
r := config.Rule{
Description: "Discovered a Contentful delivery API token, posing a risk to content management systems and data integrity.",
RuleID: "contentful-delivery-api-token",
Regex: utils.GenerateSemiGenericRegex([]string{"contentful"},
utils.AlphaNumericExtended("43"), true),
Keywords: []string{"contentful"},
}
// validate
tps := utils.GenerateSampleSecrets("contentful", secrets.NewSecret(utils.AlphaNumeric("43")))
return utils.Validate(r, tps, nil)
}
+201
View File
@@ -0,0 +1,201 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
// https://curl.se/docs/manpage.html#-u
func CurlBasicAuth() *config.Rule {
r := config.Rule{
RuleID: "curl-auth-user",
Description: "Discovered a potential basic authorization token provided in a curl command, which could compromise the curl accessed resource.",
Regex: regexp.MustCompile(`\bcurl\b(?:.*|.*(?:[\r\n]{1,2}.*){1,5})[ \t\n\r](?:-u|--user)(?:=|[ \t]{0,5})("(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'([^:']{3,}:[^']{3,})'|((?:"[^"]{3,}"|'[^']{3,}'|[\w$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[\w${}@.-]+)))(?:\s|\z)`),
Keywords: []string{"curl"},
Entropy: 2,
Allowlists: []*config.Allowlist{
{
Regexes: []*regexp.Regexp{
regexp.MustCompile(`[^:]+:(?:change(?:it|me)|pass(?:word)?|pwd|test|token|\*+|x+)`), // common placeholder passwords
regexp.MustCompile(`['"]?<[^>]+>['"]?:['"]?<[^>]+>|<[^:]+:[^>]+>['"]?`), // <placeholder>
regexp.MustCompile(`[^:]+:\[[^]]+]`), // [placeholder]
regexp.MustCompile(`['"]?[^:]+['"]?:['"]?\$(?:\d|\w+|\{(?:\d|\w+)})['"]?`), // $1 or $VARIABLE
regexp.MustCompile(`\$\([^)]+\):\$\([^)]+\)`), // $(cat login.txt)
regexp.MustCompile(`['"]?\$?{{[^}]+}}['"]?:['"]?\$?{{[^}]+}}['"]?`), // ${{ secrets.FOO }} or {{ .Values.foo }}
},
},
},
}
// validate
tps := []string{
// short
`curl --cacert ca.crt -u elastic:P@ssw0rd$1 https://localhost:9200`, // same lines, no quotes
`sh-5.0$ curl -k -X POST https://infinispan:11222/rest/v2/caches/default/hello \
-H 'Content-type: text/plain' \
-d 'world' \
-u developer:yqDVtkqPECriaLRi`, // different line
`curl -u ":d2LkV78zLx!t" https://localhost:9200`, // empty username
`curl -u "d2LkV78zLx!t:" https://localhost:9200`, // empty password
// long
`curl -sw '%{http_code}' -X POST --user 'johns:h0pk1ns~21s' $GItHUB_API_URL/$GIT_COMMIT --data`,
`curl --user roger23@gmail.com:pQ9wTxu4Fg https://www.dropbox.com/cli_link?host_id=abcdefg -v`, // same line, no quotes
`curl -s --user 'api:d2LkV78zLx!t' \
https://api.mailgun.net/v2/sandbox91d3515882ecfaa1c65be642.mailgun.org/messages`, // same line, single quotes
`curl -s -v --user "j.smith:dB2yF6@qL9vZm1P#4J" "https://api.contoso.org/user/me"`, // same line, double quotes
`curl -X POST --user "{acd3c08b-74e8-4f44-a2d0-80694le24f46}":"{ZqL5kVrX1n8tA2}" --header "Accept: application/json" --data "{\"text\":\"Hello, world\",\"source\":\"en\",\"target\":\"es\"}" https://gateway.watsonplatform.net/language-translator/api`,
`curl --user kevin:'pRf7vG2h1L8nQkW9' -iX PATCH -H "Content-Type: application/json" -d`, // same line, mixed quoting
`$ curl https://api.dropbox.com/oauth2/token \
--user c28wlsosanujy2z:qgsnai0xokrw4j1 --data grant_type=authorization_code`, // different line
// TODO
//` curl -s --insecure --url "imaps://whatever.imap.server" --user\
//"myuserid:mypassword" --request "STATUS INBOX (UNSEEN)"`,
}
fps := []string{
// short
`curl -i -u 'test:test'`,
` curl -sL --user "$1:$2" "$3" > "$4"`, // environment variable
`curl -u <user:password> https://test.com/endpoint`, // placeholder
`curl --user neo4j:[PASSWORD] http://[IP]:7474/db/data/`, // placeholder
`curl -u "myusername" http://localhost:15130/api/check_user/`, // no password
`curl -u username:token`,
`curl -u "${_username}:${_password}"`,
`curl -u "${username}":"${password}"`,
`curl -k -X POST -I -u "SRVC_JENKINS:${APPID}"`,
`curl -u ":" https://localhost:9200`, // empty username and password
// long
`curl -sw '%{http_code}' -X POST --user '$USERNAME:$PASSWORD' $GItHUB_API_URL/$GIT_COMMIT --data`,
`curl --user "xxx:yyy"`,
` curl -sL --user "$GITHUB_USERNAME:$GITHUB_PASSWORD" "$GITHUB_URL" > "$TESTS_PATH"`, // environment variable
// variable interpolation
`curl --silent --fail {{- if and $.Values.username $.Values.password }} --user "{{ $.Values.username }}:{{ $.Values.password }}"`,
`curl -XGET -i -u "${{ env.ELK_ID }}:${{ build.env.ELK_PASS }}"`,
`curl -XGET -i -u "${{needs.vault.outputs.account_id}}:${{needs.vault.outputs.account_password}}"`,
`curl -XGET -i -u "${{ steps.vault.outputs.account_id }}:${{ steps.vault.outputs.account_password }}"`,
`curl -X POST --user "$(cat ./login.txt):$(cat ./password.txt)"`, // command
`curl http://127.0.0.1:5000/file --user user:pass --digest # digest auth`, // placeholder
` curl -X GET --insecure --user "username:password" \`, // placeholder
`curl --silent --insecure --user ${f5user}:${f5pass} \`, // placeholder
`curl --insecure --ssl-reqd "smtps://smtp.gmail.com" --mail-from "src@gmail.com" --mail-rcpt "dst@gmail.com" --user "src@gmail.com" --upload-file out.txt`, // no password
// different command
`#HTTP command line test
curl -X POST -H "Content-Type: application/json" -d '{"id":12345,"geo":{"latitude":28.50,"longitude":-81.14}}' http://<ip>:8080/serve
#UDP command line test
echo -n '{"type":"serve","channel":"/","data":{"site_id":8,"post_id":12345,"geo":{"lat":28.50,"long":-81.14}}}' >/dev/udp/127.0.0.1/41234
#UDP Listener (for confirmation)
nc -u -l 41234`,
}
return utils.Validate(r, tps, fps)
}
// https://curl.se/docs/manpage.html#-H
func CurlHeaderAuth() *config.Rule {
// language=regexp
authPat := `(?i)(?:Authorization:[ \t]{0,5}(?:Basic[ \t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \t]([\w=~@.+/-]{8,})|([\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \t]{0,5}([\w=~@.+/-]{8,}))`
r := config.Rule{
RuleID: "curl-auth-header",
Description: "Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.",
Regex: regexp.MustCompile(
// language=regexp
fmt.Sprintf(`\bcurl\b(?:.*?|.*?(?:[\r\n]{1,2}.*?){1,5})[ \t\n\r](?:-H|--header)(?:=|[ \t]{0,5})(?:"%s"|'%s')(?:\B|\s|\z)`, authPat, authPat)),
Entropy: 2.75,
Keywords: []string{"curl"},
//Allowlists: []*config.Allowlist{
// {
// Regexes: []*regexp.Regexp{},
// },
//},
}
tps := []string{
`curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'`,
// Short flag.
`curl -H 'Authorization: Basic YnJvd3Nlcjo=' \`, // same line, single quotes
// TODO: Handle short flags combined.
//`TOKEN=$(curl -sH "Authorization: Basic $BASIC_TOKEN" "https://$REGISTRY/oauth2/token?service=$REGISTRY&scope=repository:$REPO:pull" | jq -r .access_token)`,
// Long flag.
`curl -k -X POST --header "Authorization: Basic djJlNEpYa0NJUHZ5a2FWT0VRXzRqZmZUdDkwYTp2emNBZGFzZWpmlWZiUDc2VUJjNDNNVDExclVh" "https://api-qa.example.com:8243/token" -d "grant_type=client_credentials"`, // same line, double quotes
// Basic auth.
`curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=" \
-d '{"user":{"emailAddress":"test@example.com"}, "password":"password"}' \
'http://localhost:8080/oauth2-provider/v1.0/users'`, // different line, double quotes
`#curl -X POST \
# https://api.mailgun.net/v3/sandbox7dbcabccd4314c123e8b23599d35f5b6.mailgun.org/messages \
# -H 'Authorization: Basic YXBpOmtleS1hN2MzNDJ3MzNhNWQxLTU2M2U3MjlwLTZhYjI3YzYzNzM0Ng==' \
# -F from='Excited User <mailgun@sandbox7dbc123bccd4314c0aae8b23599d35f5b6.mailgun.org>' \
# -F to='joe@example.com' \
# -F subject='Hello' \
# -F text='Testing some Mailgun awesomness!'`, // different line, single quotes
// Bearer auth
`# curl -X GET "http://localhost:3000/api/cron/status" -H "Authorization: Bearer cfcabd11c7ed9a41b1a3e063c32d5114"`, // same line, double quotes
`curl -X PUT -H 'Authorization: Bearer jC+6TUUjCNHcVtAXpcqBCgxnA8r+qD6MatnYaf/+289y7HWpK0BWPyLHv/K4DMN32fufwmeVVjlo8zjgBh8kx3GfS6IqO70w1DVMSCTwX7fhEpiXaxzv0mhSMHDX9Kw63Q6DkavUWUV+MDNhCF5wGQrcdQNncVRF3YkuDHDT/xw2YWyZ/DX8k+gAYiC8gcD8Ueg0ljBVS1IDwPjuGoFPESJVxYr0MDPF2D8Pn2S5rq692U4D9ZLuluS46VA4DK6ig5P7QM5XVXi4V7vXM8qpN/zqneyz+w4PUh6NIX7QG6JczMhYd9maWRWVat5jDdyII63P6sNAy9QZjw+ClW211Q==' -d 'user={"account":"user@domain.com", "roles":["user"]}' http://127.0.0.1:8443/desks/1/occupy`, // same line, single quotes
`curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 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" \`, // different line, double quotes
`curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
-H "Authorization: Bearer _FXNljbSRYMWx3TWrd7lgKhLtVZX6iskC8Wcbb4b" \
-H "Content-Type:application/json"`,
`curl -H "Authorization: Bearer sha256~bRLFnzd59Z3XpZH5_seJPHALOuvbWiKwbFKSsoALkgp"`,
// Token auth
`curl -H "Authorization: Api-Token 22cb987851bc5659l29114c62e60c79abd0d2c08" --request PUT https://appsecclass.report/api/use/635`, // token
`curl -H "Authorization: Token 22cb987851bc5659229114c62e60c79abd0d2c08" --request PUT https://appsecclass.report/api/use/635`, // token
// Nothing
`curl -L -H "Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25maWRlbmNlIjowLjh9.kvRPfjAhLhtRTczoRgctVGp7KY1QVH3UBZM-gM0x8ec" service1.local -> correct jwt `, // no prefix
`curl -L -H "Authorization: sha256~bRLFnzd5@=-.a+/hgdS"`, // no prefix
// Non-authorization headers.
`curl -X GET \
-H "apikey: c4ed6c21-9dd5-4a05-8e3f-c56d1151cce8" \
-H "Accept: application/json" \`, // apikey
`curl -X POST --header "Api-Token: Sk94HG7f6KB"`, // api-token
`curl -XPOST http://localhost:8080/api/tasks -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "Token: 3fea6af1349166ea" -d "content=hello-curl"`, // token
`curl -X GET https://octopus.corp.net/
-H "X-Octopus-ApiKey: 3a16750d-d363-41a4-8ebd-035408f7730f" \`, // X-$thing-ApiKey
}
fps := []string{
// Placeholders
`curl https://example.com/micropub -d h=entry -d "content=Hello World" -H "Authorization: Bearer XXXXXXXXXXXX"`,
`curl -X POST https://accounts.spotify.com/api/token -d grant_type=client_credentials --header "Authorization: Basic ..."`,
`curl \
-H "Authorization: Bearer <Openverse API token>" \
"https://api.openverse.org/v1/audio/?q=test"`,
`curl -v -v -v -X POST https://domain/api/v1/authentication/sso/login-url/ \
-H 'Content-Type: application/json' \
-H "Authorization: Token **********" \
-d '{"username": "test", "next": "/luna/"}'`,
// Variables
`curl -XPOST http://localhost:8080/api/token -H "Authorization: basic {base64(email:password[\n])}" => token`, // same line, invalid base64
`curl -X GET \
-H "apikey: $API_KEY" \
-H "Accept: $FORMAT" \
"$API_URL/rest/v1/stats_derniere_labellisation"`, // API Key placeholder
`$ curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "chatglm3-6b-32k",
"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"}]
}'`, // different line, placeholder
`curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $(gcloud auth print-access-token)" https://workflowexecutions.googleapis.com/v1/projects/244283331594/locations/us-central1/workflows/sample-workflow/executions/43c925aa-514a-44c1-a0a4-a9f8f26fd2cb/callbacks/1705791f-d446-4e92-a6d0-a13622422e80_31864a51-8c13-4b03-ad4d-945cdc8d0631`, // script
// Not valid BASIC
`curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb25maWRlbmNlIjowLjh9.kvRPfjAhLhtRTczoRgctVGp7KY1QVH3UBZM-gM0x8ec" \`,
}
return utils.Validate(r, tps, fps)
}
+26
View File
@@ -0,0 +1,26 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Databricks() *config.Rule {
// define rule
r := config.Rule{
RuleID: "databricks-api-token",
Description: "Uncovered a Databricks API token, which may compromise big data analytics platforms and sensitive data processing.",
Regex: utils.GenerateUniqueTokenRegex(`dapi[a-f0-9]{32}(?:-\d)?`, false),
Entropy: 3,
Keywords: []string{"dapi"},
}
// validate
tps := utils.GenerateSampleSecrets("databricks", "dapi"+secrets.NewSecret(utils.Hex("32")))
tps = append(tps, `token = dapif13ac4b49d1cb31f69f678e39602e381-2`) // gitleaks:ignore
fps := []string{
`DATABRICKS_TOKEN=dapi123456789012345678a9bc01234defg5`,
}
return utils.Validate(r, tps, fps)
}
+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func DatadogtokenAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "datadog-access-token",
Description: "Detected a Datadog Access Token, potentially risking monitoring and analytics data exposure and manipulation.",
Regex: utils.GenerateSemiGenericRegex([]string{"datadog"},
utils.AlphaNumeric("40"), true),
Keywords: []string{
"datadog",
},
}
// validate
tps := utils.GenerateSampleSecrets("datadog", secrets.NewSecret(utils.AlphaNumeric("40")))
return utils.Validate(r, tps, nil)
}
@@ -0,0 +1,28 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func DefinedNetworkingAPIToken() *config.Rule {
// Define Rule
r := config.Rule{
// Human redable description of the rule
Description: "Identified a Defined Networking API token, which could lead to unauthorized network operations and data breaches.",
// Unique ID for the rule
RuleID: "defined-networking-api-token",
// Regex used for detecting secrets. See regex section below for more details
Regex: utils.GenerateSemiGenericRegex([]string{"dnkey"}, `dnkey-[a-z0-9=_\-]{26}-[a-z0-9=_\-]{52}`, true),
// Keywords used for string matching on fragments (think of this as a prefilter)
Keywords: []string{"dnkey"},
}
// validate
tps := utils.GenerateSampleSecrets("dnkey", "dnkey-"+secrets.NewSecret(utils.AlphaNumericExtended("26"))+"-"+secrets.NewSecret(utils.AlphaNumericExtended("52")))
return utils.Validate(r, tps, nil)
}
+46
View File
@@ -0,0 +1,46 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func DigitalOceanPAT() *config.Rule {
r := config.Rule{
RuleID: "digitalocean-pat",
Description: "Discovered a DigitalOcean Personal Access Token, posing a threat to cloud infrastructure security and data privacy.",
Regex: utils.GenerateUniqueTokenRegex(`dop_v1_[a-f0-9]{64}`, false),
Entropy: 3,
Keywords: []string{"dop_v1_"},
}
tps := utils.GenerateSampleSecrets("do", "dop_v1_"+secrets.NewSecret(utils.Hex("64")))
return utils.Validate(r, tps, nil)
}
func DigitalOceanOAuthToken() *config.Rule {
r := config.Rule{
RuleID: "digitalocean-access-token",
Description: "Found a DigitalOcean OAuth Access Token, risking unauthorized cloud resource access and data compromise.",
Entropy: 3,
Regex: utils.GenerateUniqueTokenRegex(`doo_v1_[a-f0-9]{64}`, false),
Keywords: []string{"doo_v1_"},
}
tps := utils.GenerateSampleSecrets("do", "doo_v1_"+secrets.NewSecret(utils.Hex("64")))
return utils.Validate(r, tps, nil)
}
func DigitalOceanRefreshToken() *config.Rule {
r := config.Rule{
Description: "Uncovered a DigitalOcean OAuth Refresh Token, which could allow prolonged unauthorized access and resource manipulation.",
RuleID: "digitalocean-refresh-token",
Regex: utils.GenerateUniqueTokenRegex(`dor_v1_[a-f0-9]{64}`, true),
Keywords: []string{"dor_v1_"},
}
tps := utils.GenerateSampleSecrets("do", "dor_v1_"+secrets.NewSecret(utils.Hex("64")))
return utils.Validate(r, tps, nil)
}
+61
View File
@@ -0,0 +1,61 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func DiscordAPIToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "discord-api-token",
Description: "Detected a Discord API key, potentially compromising communication channels and user data privacy on Discord.",
Regex: utils.GenerateSemiGenericRegex([]string{"discord"}, utils.Hex("64"), true),
Keywords: []string{"discord"},
}
// validate
tps := utils.GenerateSampleSecrets("discord", secrets.NewSecret(utils.Hex("64")))
return utils.Validate(r, tps, nil)
}
func DiscordClientID() *config.Rule {
// define rule
r := config.Rule{
RuleID: "discord-client-id",
Description: "Identified a Discord client ID, which may lead to unauthorized integrations and data exposure in Discord applications.",
Regex: utils.GenerateSemiGenericRegex([]string{"discord"}, utils.Numeric("18"), true),
Entropy: 2,
Keywords: []string{"discord"},
}
// validate
tps := utils.GenerateSampleSecrets("discord", secrets.NewSecret(utils.Numeric("18")))
fps := []string{
// Low entropy
`discord=000000000000000000`,
}
return utils.Validate(r, tps, fps)
}
func DiscordClientSecret() *config.Rule {
// define rule
r := config.Rule{
RuleID: "discord-client-secret",
Description: "Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks.",
Regex: utils.GenerateSemiGenericRegex([]string{"discord"}, utils.AlphaNumericExtended("32"), true),
Entropy: 2,
Keywords: []string{"discord"},
}
// validate
tps := utils.GenerateSampleSecrets("discord", secrets.NewSecret(utils.Numeric("32")))
fps := []string{
// Low entropy
`discord=00000000000000000000000000000000`,
// TODO:
//`discord=01234567890123456789012345678901`,
}
return utils.Validate(r, tps, fps)
}
+26
View File
@@ -0,0 +1,26 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func Doppler() *config.Rule {
// define rule
r := config.Rule{
RuleID: "doppler-api-token",
Description: "Discovered a Doppler API token, posing a risk to environment and secrets management security.",
Regex: regexp.MustCompile(`dp\.pt\.(?i)[a-z0-9]{43}`),
Entropy: 2,
Keywords: []string{`dp.pt.`},
}
// validate
tps := utils.GenerateSampleSecrets("doppler", "dp.pt."+secrets.NewSecret(utils.AlphaNumeric("43")))
return utils.Validate(r, tps, nil)
}
// TODO add additional doppler formats:
// https://docs.doppler.com/reference/auth-token-formats
+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func DroneciAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "droneci-access-token",
Description: "Detected a Droneci Access Token, potentially compromising continuous integration and deployment workflows.",
Regex: utils.GenerateSemiGenericRegex([]string{"droneci"}, utils.AlphaNumeric("32"), true),
Keywords: []string{
"droneci",
},
}
// validate
tps := utils.GenerateSampleSecrets("droneci", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
+48
View File
@@ -0,0 +1,48 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func DropBoxAPISecret() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified a Dropbox API secret, which could lead to unauthorized file access and data breaches in Dropbox storage.",
RuleID: "dropbox-api-token",
Regex: utils.GenerateSemiGenericRegex([]string{"dropbox"}, utils.AlphaNumeric("15"), true),
Keywords: []string{"dropbox"},
}
// validate
tps := utils.GenerateSampleSecrets("dropbox", secrets.NewSecret(utils.AlphaNumeric("15")))
return utils.Validate(r, tps, nil)
}
func DropBoxShortLivedAPIToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "dropbox-short-lived-api-token",
Description: "Discovered a Dropbox short-lived API token, posing a risk of temporary but potentially harmful data access and manipulation.",
Regex: utils.GenerateSemiGenericRegex([]string{"dropbox"}, `sl\.[a-z0-9\-=_]{135}`, true),
Keywords: []string{"dropbox"},
}
// validate TODO
return &r
}
func DropBoxLongLivedAPIToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "dropbox-long-lived-api-token",
Description: "Found a Dropbox long-lived API token, risking prolonged unauthorized access to cloud storage and sensitive data.",
Regex: utils.GenerateSemiGenericRegex([]string{"dropbox"}, `[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43}`, true),
Keywords: []string{"dropbox"},
}
// validate TODO
return &r
}
+23
View File
@@ -0,0 +1,23 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func Duffel() *config.Rule {
// define rule
r := config.Rule{
RuleID: "duffel-api-token",
Description: "Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",
Regex: regexp.MustCompile(`duffel_(?:test|live)_(?i)[a-z0-9_\-=]{43}`),
Entropy: 2,
Keywords: []string{"duffel_"},
}
// validate
tps := utils.GenerateSampleSecrets("duffel", "duffel_test_"+secrets.NewSecret(utils.AlphaNumericExtended("43")))
return utils.Validate(r, tps, nil)
}
+23
View File
@@ -0,0 +1,23 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func Dynatrace() *config.Rule {
// define rule
r := config.Rule{
RuleID: "dynatrace-api-token",
Description: "Detected a Dynatrace API token, potentially risking application performance monitoring and data exposure.",
Regex: regexp.MustCompile(`dt0c01\.(?i)[a-z0-9]{24}\.[a-z0-9]{64}`),
Entropy: 4,
Keywords: []string{"dt0c01."},
}
// validate
tps := utils.GenerateSampleSecrets("dynatrace", "dt0c01."+secrets.NewSecret(utils.AlphaNumeric("24"))+"."+secrets.NewSecret(utils.AlphaNumeric("64")))
return utils.Validate(r, tps, nil)
}
+55
View File
@@ -0,0 +1,55 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func EasyPost() *config.Rule {
// define rule
r := config.Rule{
RuleID: "easypost-api-token",
Description: "Identified an EasyPost API token, which could lead to unauthorized postal and shipment service access and data exposure.",
Regex: regexp.MustCompile(`\bEZAK(?i)[a-z0-9]{54}\b`),
Entropy: 2,
Keywords: []string{"EZAK"},
}
// validate
tps := utils.GenerateSampleSecrets("EZAK", "EZAK"+secrets.NewSecret(`[a-zA-Z0-9]{54}`))
tps = append(tps,
"EZAK"+secrets.NewSecret(`[a-zA-Z0-9]{54}`),
"example.com?t=EZAK"+secrets.NewSecret(`[a-zA-Z0-9]{54}`)+"&q=1",
)
fps := []string{
// random base64 encoded string
`...6wqX6fNUXA/rYqRvfQ+EZAKGqQRiRyqAFRQshGPWOIAwNWGORfKHSBnVNFtVmWYoW6PH23lkqbbDWep95C/3VmWq/edti6...`, // gitleaks:allow
}
return utils.Validate(r, tps, fps)
}
func EasyPostTestAPI() *config.Rule {
// define rule
r := config.Rule{
RuleID: "easypost-test-api-token",
Description: "Detected an EasyPost test API token, risking exposure of test environments and potentially sensitive shipment data.",
Regex: regexp.MustCompile(`\bEZTK(?i)[a-z0-9]{54}\b`),
Entropy: 2,
Keywords: []string{"EZTK"},
}
// validate
tps := utils.GenerateSampleSecrets("EZTK", secrets.NewSecret(`EZTK[a-zA-Z0-9]{54}`))
tps = append(tps, secrets.NewSecret(`EZTK[a-zA-Z0-9]{54}`))
tps = append(tps,
"EZTK"+secrets.NewSecret(`[a-zA-Z0-9]{54}`),
"example.com?t=EZTK"+secrets.NewSecret(`[a-zA-Z0-9]{54}`)+"&q=1",
)
fps := []string{
// random base64 encoded string
`...6wqX6fNUXA/rYqRvfQ+EZTKGqQRiRyqAFRQshGPWOIAwNWGORfKHSBnVNFtVmWYoW6PH23lkqbbDWep95C/3VmWq/edti6...`, // gitleaks:allow
}
return utils.Validate(r, tps, fps)
}
+34
View File
@@ -0,0 +1,34 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func EtsyAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "etsy-access-token",
Description: "Found an Etsy Access Token, potentially compromising Etsy shop management and customer data.",
Regex: utils.GenerateSemiGenericRegex([]string{"(?-i:ETSY|[Ee]tsy)"}, utils.AlphaNumeric("24"), true),
Entropy: 3,
Keywords: []string{
"etsy",
},
}
// validate
tps := utils.GenerateSampleSecrets("ETSY", secrets.NewSecret(utils.AlphaNumeric("24")))
tps = append(tps, utils.GenerateSampleSecrets("etsy", secrets.NewSecret(utils.AlphaNumeric("24")))...)
tps = append(tps, utils.GenerateSampleSecrets("Etsy", secrets.NewSecret(utils.AlphaNumeric("24")))...)
fps := []string{
fmt.Sprintf(`SetSysctl = "%s"`, secrets.NewSecret(utils.AlphaNumeric("24"))),
` if err := sysctl.SetSysctl(sysctlBridgeCallIPTables); err != nil {`,
`g6Rib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgETSYcPQGcaAxl8vuQDLahSfhxkEEHu2flbF9ErAooEoKp3BheWxvYWTFAwB7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTIwMTEzNDk4NzBmNDA2NzFhMDMxOTdjYmVlNDAzMmRhODUyN2UxYzY0MTA0MWVlZDlmOTViMTdkMTJiMDI4YTA0YTBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwMTEzNDk4NzBmNDA2NzFhMDMxOTdjYmVlNDAzMmRhODUyN2UxYzY0MTA0MWVlZDlmOTViMTdkMTJiMDI4YTA0YTBhIiwidWlkIjoiYzUyZjc2M2MxNzYyNWZiMTI5YWU1ZDZmZThhMGUzMTkiLCJ1c2VybmFtZSI6ImttYXJla3NwYXJ0eiJ9LCJzZXJ2aWNlIjp7Imhvc3RuYW1lIjoia3lsZS5tYXJlay1zcGFydHoub3JnIiwicHJvdG9jb2wiOiJodHRwOiJ9LCJ0eXBlIjoid2ViX3NlcnZpY2VfYmluZGluZyIsInZlcnNpb24iOjF9LCJjbGllbnQiOnsibmFtZSI6ImtleWJhc2UuaW8gZ28gY2xpZW50IiwidmVyc2lvbiI6IjEuMC4xNCJ9LCJjdGltZSI6MTQ1ODU5MDYyMSwiZXhwaXJlX2luIjo1MDQ1NzYwMDAsIm1lcmtsZV9yb290Ijp7ImN0aW1lIjoxNDU4NTkwNTgzLCJoYXNoIjoiODQ0ZWRkNGU0OTQ3MWUzNWQxZTFkOTM5YTc0ZjUwMDc5Nzg3NzljMTAwYzY1NGE2OGI1NDNhYzY2Y2NlYTQ1MGFjNTllNmY3Yjc4ZGZiN2MyYzdjMmYwMzJiYTA2MzdjMzVjZDk1ZGYyZmRiNjFlNjgxMjVmNDkxNjVlZDkwNzMiLCJzZXFubyI6NDE3Mjk5fSwicHJldiI6IjdmNWFkMGZlZmQxNjM4ZjBlOTc1MTk3NzA5YTk2OTVkZmQ1NzU0MTA4NTYxZGUzMDM0ODc2NDcxODdhMDkyYzUiLCJzZXFubyI6OSwidGFnIjoic2lnbmF0dXJlIn2jc2lnxEDDVCB/SdOzo+BznIUCCa5DgISbH+0noUjyAJ4r0sH/tj8lYNpHw3WR93SBCufeElsl7KrxVdg5qU5ADYj26wgOqHNpZ190eXBlIKN0YWfNAgKndmVyc2lvbgE=`,
`in XCBuild.XCBBuildServiceSession.setSystemInfo(operatingSystemVersion: __C.NSOperatingSystemVersion, productBuildVersion: Swift.String, nativeArchitecture: Swift.String, completion: (Swift.Bool) -> ()) -> ()`,
}
return utils.Validate(r, tps, fps)
}
+78
View File
@@ -0,0 +1,78 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
// This rule includes both App Secret and Client Access Token
// https://developers.facebook.com/docs/facebook-login/guides/access-tokens/
func FacebookSecret() *config.Rule {
// define rule
r := config.Rule{
RuleID: "facebook-secret",
Description: "Discovered a Facebook Application secret, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",
Regex: utils.GenerateSemiGenericRegex([]string{"facebook"}, utils.Hex("32"), true),
Entropy: 3,
Keywords: []string{"facebook"},
}
// validate
tps := utils.GenerateSampleSecrets("facebook", secrets.NewSecret(utils.Hex("32")))
tps = append(tps,
`facebook_app_secret = "6dca6432e45d933e13650d1882bd5e69"`, // gitleaks:allow
`facebook_client_access_token: 26f5fd13099f2c1331aafb86f6489692`, // gitleaks:allow
)
return utils.Validate(r, tps, nil)
}
// https://developers.facebook.com/docs/facebook-login/guides/access-tokens/#apptokens
func FacebookAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "facebook-access-token",
Description: "Discovered a Facebook Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",
Regex: utils.GenerateUniqueTokenRegex(`\d{15,16}(\||%)[0-9a-z\-_]{27,40}`, true),
Keywords: []string{"facebook"},
Entropy: 3,
}
// validate
tps := []string{
`{"facebook access_token":"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg","token_type":"bearer"}`, // gitleaks:allow
`facebook 1308742762612587|rhoK1cbv0DOU_RTX_87O4MkX7AI`, // gitleaks:allow
`facebook 1477036645700765|wRPf2v3mt2JfMqCLK8n7oltrEmc`, // gitleaks:allow
}
return utils.Validate(r, tps, nil)
}
// https://developers.facebook.com/docs/facebook-login/guides/access-tokens/#pagetokens
func FacebookPageAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "facebook-page-access-token",
Description: "Discovered a Facebook Page Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",
Regex: utils.GenerateUniqueTokenRegex("EAA[MC](?i)[a-z0-9]{100,}", false),
Entropy: 4,
Keywords: []string{"EAAM", "EAAC"},
}
// validate
tps := []string{
`EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD`, // gitleaks:allow
`EAAM9GOnCB9kBO2zXpAtRBmCrsPPjdA3KeBl4tqsEpcYd09cpjm9MZCBIklZBjIQBKGIJgFwm8IE17G5pipsfRBRBEHMWxvJsL7iHLUouiprxKRQfAagw8BEEDucceqxTiDhVW2IZAQNNbf0d1JhcapAGntx5S1Csm4j0GgZB3DuUfI2HJ9aViTtdfH2vjBy0wtpXm2iamevohGfoF4NgyRHusDLjqy91uYMkfrkc`, // gitleaks:allow
`- name: FACEBOOK_TOKEN
value: "EAACEdEose0cBA1bad3afsf286JZCOV1XmV4NobAXqUXZA7U9F1UaaOdQZABvz73030MJoC3gGoQrE8IEoMl4gFA6MmQadlJQBqtRsgIcIhtelIJOJaew"`, // gitleaks:allow
}
fps := []string{
`eaaaC0b75a9329fded2ffa9a02b47e0117831b82`,
`"strict-uri-encode@npm:^2.0.0":
version: 2.0.0
resolution: "strict-uri-encode@npm:2.0.0"
checksum: eaac4cf978b6fbd480f1092cab8b233c9b949bcabfc9b598dd79a758f7243c28765ef7639c876fa72940dac687181b35486ea01ff7df3e65ce3848c64822c581
languageName: node
linkType: hard`,
}
return utils.Validate(r, tps, fps)
}
+22
View File
@@ -0,0 +1,22 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func FastlyAPIToken() *config.Rule {
// define rule
r := config.Rule{
Description: "Uncovered a Fastly API key, which may compromise CDN and edge cloud services, leading to content delivery and security issues.",
RuleID: "fastly-api-token",
Regex: utils.GenerateSemiGenericRegex([]string{"fastly"}, utils.AlphaNumericExtended("32"), true),
Keywords: []string{"fastly"},
}
// validate
tps := utils.GenerateSampleSecrets("fastly", secrets.NewSecret(utils.AlphaNumericExtended("32")))
return utils.Validate(r, tps, nil)
}
+37
View File
@@ -0,0 +1,37 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func FinicityClientSecret() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified a Finicity Client Secret, which could lead to compromised financial service integrations and data breaches.",
RuleID: "finicity-client-secret",
Regex: utils.GenerateSemiGenericRegex([]string{"finicity"}, utils.AlphaNumeric("20"), true),
Keywords: []string{"finicity"},
}
// validate
tps := utils.GenerateSampleSecrets("finicity", secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
func FinicityAPIToken() *config.Rule {
// define rule
r := config.Rule{
Description: "Detected a Finicity API token, potentially risking financial data access and unauthorized financial operations.",
RuleID: "finicity-api-token",
Regex: utils.GenerateSemiGenericRegex([]string{"finicity"}, utils.Hex("32"), true),
Keywords: []string{"finicity"},
}
// validate
tps := utils.GenerateSampleSecrets("finicity", secrets.NewSecret(utils.Hex("32")))
return utils.Validate(r, tps, nil)
}
+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func FinnhubAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "finnhub-access-token",
Description: "Found a Finnhub Access Token, risking unauthorized access to financial market data and analytics.",
Regex: utils.GenerateSemiGenericRegex([]string{"finnhub"}, utils.AlphaNumeric("20"), true),
Keywords: []string{
"finnhub",
},
}
// validate
tps := utils.GenerateSampleSecrets("finnhub", secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func FlickrAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "flickr-access-token",
Description: "Discovered a Flickr Access Token, posing a risk of unauthorized photo management and potential data leakage.",
Regex: utils.GenerateSemiGenericRegex([]string{"flickr"}, utils.AlphaNumeric("32"), true),
Keywords: []string{
"flickr",
},
}
// validate
tps := utils.GenerateSampleSecrets("flickr", secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
+53
View File
@@ -0,0 +1,53 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func FlutterwavePublicKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "flutterwave-public-key",
Description: "Detected a Finicity Public Key, potentially exposing public cryptographic operations and integrations.",
Regex: regexp.MustCompile(`FLWPUBK_TEST-(?i)[a-h0-9]{32}-X`),
Entropy: 2,
Keywords: []string{"FLWPUBK_TEST"},
}
// validate
tps := utils.GenerateSampleSecrets("flutterwavePubKey", "FLWPUBK_TEST-"+secrets.NewSecret(utils.Hex("32"))+"-X")
return utils.Validate(r, tps, nil)
}
func FlutterwaveSecretKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "flutterwave-secret-key",
Description: "Identified a Flutterwave Secret Key, risking unauthorized financial transactions and data breaches.",
Regex: regexp.MustCompile(`FLWSECK_TEST-(?i)[a-h0-9]{32}-X`),
Entropy: 2,
Keywords: []string{"FLWSECK_TEST"},
}
// validate
tps := utils.GenerateSampleSecrets("flutterwavePubKey", "FLWSECK_TEST-"+secrets.NewSecret(utils.Hex("32"))+"-X")
return utils.Validate(r, tps, nil)
}
func FlutterwaveEncKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "flutterwave-encryption-key",
Description: "Uncovered a Flutterwave Encryption Key, which may compromise payment processing and sensitive financial information.",
Regex: regexp.MustCompile(`FLWSECK_TEST-(?i)[a-h0-9]{12}`),
Entropy: 2,
Keywords: []string{"FLWSECK_TEST"},
}
// validate
tps := utils.GenerateSampleSecrets("flutterwavePubKey", "FLWSECK_TEST-"+secrets.NewSecret(utils.Hex("12")))
return utils.Validate(r, tps, nil)
}
+57
View File
@@ -0,0 +1,57 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
// https://fly.io/docs/security/tokens/
// https://github.com/trufflesecurity/trufflehog/pull/2381/files#r1565860579
// https://github.com/superfly/macaroon-elixir/blob/8b42043b0a24aada5c8b8eb8505dbf1590557f1b/test/vectors.json#L7
func FlyIOAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "flyio-access-token",
Description: "Uncovered a Fly.io API key", // TODO
Regex: utils.GenerateUniqueTokenRegex(`(?:fo1_[\w-]{43}|fm1[ar]_[a-zA-Z0-9+\/]{100,}={0,3}|fm2_[a-zA-Z0-9+\/]{100,}={0,3})`, false),
Entropy: 4,
Keywords: []string{"fo1_", "fm1", "fm2_"},
}
// validate
// fo1_
tps := utils.GenerateSampleSecrets("fly", secrets.NewSecret(`fo1_[\w-]{43}`))
tps = append(tps,
`Fly access token: fo1_8rz-j7r2eqJ2U7affEOO3HJN0j63DInyog3eV-glQSc
`,
`=============================================================================================================
fo1_BtKlzvfztw0M2hlLgTdsfPgDFiwM2jJjQXXy6I2pjuQ
fly deploy`)
// fm1
tps = append(tps, utils.GenerateSampleSecrets("fly", secrets.NewSecret(`fm1[ar]_[a-zA-Z0-9+\/]{100,}={0,3}`))...)
tps = append(tps,
`ENV FLY_API_TOKEN="FlyV1 fm1r_lJPECAAAAAAAAMqcxBBLMJKXYKJiT0CI58XmukX/wrVodHlwczovL2FwaS5mbHkuaW8vdjGWAJLOAAFmXh8Lk7lodHRwczovL2FwaS5mbHkuaW8vYWFhL3YxxDy5OfA2M6K6aLEoEDKxehojbj+8ZT9IrXCF5sL/r8m6/1gylwySsNxpD40wnpd/G2ZdjwVaQev1kEuFUgzERxPbtWHDNa+NYIZwbKN6b7/JxdbUprq0M10HI4fwtlxhqhdA/mMaMw70EC4TsfJyghIL98KP4ry5AaXiroRdjrSsFExc/xRCDZKUA5GBzgATuNsfBZGCp2J1aWxkZXIfondnHwHEIMa6NWc4b52S+UY7vjPdwKrz00Uzrc1830mOHzQNLun7,fm1a_lJPERxPbtWHDNa+NYIZwbKN6b7/JxdbUprq0M10HI4fwtlxhqhdA/mMaMw70EC4TsfJyghIL98KP4ry4AaXiroRdjrSsFExc/xRCxBCVlAoRzKV/+qYkxuipIbIcw7lodHRwczovL2FwaS5mbHkuaW8vYWFhL3YxlgSSzmS4Y7nPAAAAASCwgdcKkc4AAUktDMQQURck2h+upbiOrW66Nf5SA8QgrD03xlWju1WQi0AUhlk7YYFzOLDfhRyJ6nEziO37NUE="`,
)
// fm2
tps = append(tps, utils.GenerateSampleSecrets("fly", secrets.NewSecret(`fm2_[a-zA-Z0-9+\/]{100,}={0,3}`))...)
tps = append(tps,
`# FLY_API_TOKEN: FlyV1 fm2_lJPECAAAAAAAAyZtxBD1hSZ7L5leXsj64ZbDlkm/wrVodHRwczovL2FwaS5mbHkuaW8vdjGWAJLOAAwMDB8Lk7lodHRwczovL2FwaS5mbHkuaW8vYWFhL3YxxDwDnhgJj/ML/nRKMiAYgnvXfNacrGWffj5TdfgGY2LU0ZetT7WzTLQQMO8cN2nRTztl/xLjnnZg5pBwFonETmhNA6Yl0X1tatt8ezA0UjVQiJr93VQ7qAmD5GG2Ce5txhbQv3tmIGsvaC7BOkIqAiR273bhZkO44AYsrCPr2XF8W6Twk7NyU+3UUeDwjw2SlAORgc4APu7vHwWRgqdidWlsZGVyH6J3Zx8BxCAlmLbu1HQDg8ZAGKKmEt4Mbnbqli6lbzBDHsawhcUF4A==,fm2_lJPETmhNA6Yl0X1tatt8ezA0UjVQiJr93VQ7qAmD5GG2Ce5txhbQv3tmIGsvaC7BOkIqAij273bhZkO44AYsrCPr2XF8W6Twk7NyU+3UUeDwj8QQbn07DOV+7SmoLj/uT+dbr8O5aHR0cHM6Ly9hcGkuZmx5LmlvL2FhYS92MZgEks5mqfbvzwAAAAE9PYz9F84AC7QACpHOAAu0AAzEEFfW3B+SzffV/KrAYa8qqpnEIIlD6DqZMZQ9Kt7fEenCCOLA+tUSJ+kmEFIUcc83npOI`,
`"BindToParentToken": "FlyV1 fm2_lJPEEKnzKy0lkwV3B+WIlmrdwejEEFv5qmevHU4fMs+2Gr6oOiPC2SAyOTc0NWI4ZmJlNjBlNjJmZTgzNTkxOThhZWE4MjY0M5IMxAMBAgPEIH7VG8u74KwO62hmx8SZO8WaU5o1g3W2IVc7QN6T1VTr",`,
)
fps := []string{
// fo1_
`resource "doppler_integration_flyio" "prod" {
name = "TF Fly.io"
api_key = "fo1_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}`, // https://github.com/DopplerHQ/terraform-provider-doppler/blob/a012e1a7903cce391be511b391850b29ebfdeb68/docs/resources/integration_flyio.md?plain=1#L17
`pub const MINIDUMP_SYSMEMINFO1_PERF_CCTOTALDIRTYPAGES_CCDIRTYPAGETHRESHOLD: u32 = 4u32;`, // https://github.com/microsoft/windows-rs/blob/0f7466c34e774e547d21c579b58b60168c4ee6bc/crates/libs/sys/src/Windows/Win32/System/Diagnostics/Debug/mod.rs#L1258
`<input type="hidden" name="authenticity_token" value="7SWa-Fo1_hsC6oovfBsJFLGPUl2EhkSWPbJhWANwgaJWBDl1vxd9VNqXTNAefsJqzIRYaZEfYZLffa31rw8zJA" autocomplete="off" />`,
// fm1
`signature":"I7l2ZXhw9ajjIE2w9tjHNvYjcHg7E2qldMMhoQKjborcWIj8c40rMj83venoy6gXsg6V6B7dlBWxUmzYJR3lJKGECtCSM5BqBvWhL6wX2CN2lZlvwNCyPjG4PCt5MAK1yV1Xv4fqfz8EfT_U49vOzfM1a_nfhXOzrvdg9XgLkAotWBI31vPKjMBrvPqiLcZ12MDNTSK7ubRpVaehSNxiGYHpLhWTkun9qm_APYYXJBjhJYkej50Qcp7Ou8fs3kH02prYIJt4JbWelr5vUDkgMH3AwEx1eYu5NI_8sESlqosl1nhSDx7zq3X1FV1iJlAYCNwGWzW1tjo8PCaJrIHVZZnhBPMN-6ahmOpKb8GViqd4fCQuNe4VUSOeJg8i97kMuk-4r7hwIubR0XfCGzxr7uGDQBdFANi3c4dLlzBAJNifa6b_hT4Xzqja6RCFSv6Cnalyx3hbSkjbyThnXFavJIiR7cvgTcdECg9VxkaxqqRhfAkLAS3hpXQAIYL_bw61M3LN37WHwdgxN_6yZhbSbOsYPmTxiWvdlDaCP_iaCgXgJNfdQ6kep_I89slynE9gdDZ6NSjFJH2Soml4pR6HnQKPjA3OpoTwPSmZjxXY5I78xvrRqRkjdnVzeufqG8LyA-sAEtC0G_312JOxV4GZINquPGk1qFx8WN59Rxw28Tg",`,
// fm2
`<p><span class="emoji">🗣️</span> Adobe illustrator软件基础精讲课程<br><br><span class="emoji">🏷️</span> <a href="https://t.me/abskoop/8565?q=%23%E8%AE%BE%E8%AE%A1%E5%B8%88">#设计师</a> <a href="https://t.me/abskoop/8565?q=%23%E8%B5%84%E6%BA%90">#资源</a> <a href="https://t.me/abskoop/8565?q=%23%E5%A4%B8%E5%85%8B%E7%BD%91%E7%9B%98">#夸克网盘</a><br><br><span class="emoji">👉</span> <a href="https://www.ahhhhfs.com/62409/" target="_blank" rel="noopener">https://www.ahhhhfs.com/62409/</a></p><img src="https://cdn5.cdn-telegram.org/file/uGoDMy0VXMbL1nki9OT0VbJYtfURvDNLurptsQVuhuzF45tNfm2_z5wgR7CnL7lTZ4bbotjXZtiLWvolNQqWBRFWkcidtzSyhWvta9yPB3E2uyvfJvGpditkaLVIiCCXt9BhFBEdgkXa8ODaM7geHK3pW0tmO_IViHBnG8VZqVfDpaQW0W9IRAUwGv2mPZWVRysPJyDSIuY9b-_3ElUml-Xlpm1r8EDcm9Q2WCTCOYur7Gmef4imQ5D-DLTviqmoONgQDLA10WVS3CApXBK4ADSjoIUeMck62owtjElSXnEYMaSGI_OE3B21QplsspPbPlXVUBScLfLOFb9tn-34tw.jpg" width="800" height="533" referrerpolicy="no-referrer">`,
}
return utils.Validate(r, tps, fps)
}
+22
View File
@@ -0,0 +1,22 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func FrameIO() *config.Rule {
// define rule
r := config.Rule{
Description: "Found a Frame.io API token, potentially compromising video collaboration and project management.",
RuleID: "frameio-api-token",
Regex: regexp.MustCompile(`fio-u-(?i)[a-z0-9\-_=]{64}`),
Keywords: []string{"fio-u-"},
}
// validate
tps := utils.GenerateSampleSecrets("frameio", "fio-u-"+secrets.NewSecret(utils.AlphaNumericExtended("64")))
return utils.Validate(r, tps, nil)
}
+47
View File
@@ -0,0 +1,47 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func Freemius() *config.Rule {
// define rule
r := config.Rule{
RuleID: "freemius-secret-key",
Description: "Detected a Freemius secret key, potentially exposing sensitive information.",
Regex: regexp.MustCompile(`(?i)["']secret_key["']\s*=>\s*["'](sk_[\S]{29})["']`),
Keywords: []string{"secret_key"},
Path: regexp.MustCompile(`(?i)\.php$`),
}
// validate
tps := map[string]string{
"file.php": `$config = array(
"secret_key" => "sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE",
);`,
}
// It's only used in PHP SDK snippet.
// see https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/
fps := map[string]string{
// Invalid format: missing quotes around `secret_key`.
"foo.php": `$config = array(
secret_key => "sk_abcdefghijklmnopqrstuvwxyz123",
);`,
// Invalid format: missing quotes around the key value.
"bar.php": `$config = array(
"secret_key" => sk_abcdefghijklmnopqrstuvwxyz123,
);`,
// Invalid: different key name.
"baz.php": `$config = array(
"other_key" => "sk_abcdefghijklmnopqrstuvwxyz123",
);`,
// Invalid: file extension, should validate only .php files.
"foo.html": `$config = array(
"secret_key" => "sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE",
);`,
}
return utils.ValidateWithPaths(r, tps, fps)
}
+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func FreshbooksAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "freshbooks-access-token",
Description: "Discovered a Freshbooks Access Token, posing a risk to accounting software access and sensitive financial data exposure.",
Regex: utils.GenerateSemiGenericRegex([]string{"freshbooks"}, utils.AlphaNumeric("64"), true),
Keywords: []string{
"freshbooks",
},
}
// validate
tps := utils.GenerateSampleSecrets("freshbooks", secrets.NewSecret(utils.AlphaNumeric("64")))
return utils.Validate(r, tps, nil)
}
+90
View File
@@ -0,0 +1,90 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
// TODO this one could probably use some work
func GCPServiceAccount() *config.Rule {
// define rule
r := config.Rule{
Description: "Google (GCP) Service-account",
RuleID: "gcp-service-account",
Regex: regexp.MustCompile(`\"type\": \"service_account\"`),
Keywords: []string{`\"type\": \"service_account\"`},
}
// validate
tps := []string{
`"type": "service_account"`,
}
return utils.Validate(r, tps, nil)
}
func GCPAPIKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "gcp-api-key",
Description: "Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.",
Regex: utils.GenerateUniqueTokenRegex(`AIza[\w-]{35}`, false),
Entropy: 4,
Keywords: []string{"AIza"},
Allowlists: []*config.Allowlist{
{
Regexes: []*regexp.Regexp{
// example keys from https://github.com/firebase/firebase-android-sdk
regexp.MustCompile(`AIzaSyabcdefghijklmnopqrstuvwxyz1234567`),
regexp.MustCompile(`AIzaSyAnLA7NfeLquW1tJFpx_eQCxoX-oo6YyIs`),
regexp.MustCompile(`AIzaSyCkEhVjf3pduRDt6d1yKOMitrUEke8agEM`),
regexp.MustCompile(`AIzaSyDMAScliyLx7F0NPDEJi1QmyCgHIAODrlU`),
regexp.MustCompile(`AIzaSyD3asb-2pEZVqMkmL6M9N6nHZRR_znhrh0`),
regexp.MustCompile(`AIzayDNSXIbFmlXbIE6mCzDLQAqITYefhixbX4A`),
regexp.MustCompile(`AIzaSyAdOS2zB6NCsk1pCdZ4-P6GBdi_UUPwX7c`),
regexp.MustCompile(`AIzaSyASWm6HmTMdYWpgMnjRBjxcQ9CKctWmLd4`),
regexp.MustCompile(`AIzaSyANUvH9H9BsUccjsu2pCmEkOPjjaXeDQgY`),
regexp.MustCompile(`AIzaSyA5_iVawFQ8ABuTZNUdcwERLJv_a_p4wtM`),
regexp.MustCompile(`AIzaSyA4UrcGxgwQFTfaI3no3t7Lt1sjmdnP5sQ`),
regexp.MustCompile(`AIzaSyDSb51JiIcB6OJpwwMicseKRhhrOq1cS7g`),
regexp.MustCompile(`AIzaSyBF2RrAIm4a0mO64EShQfqfd2AFnzAvvuU`),
regexp.MustCompile(`AIzaSyBcE-OOIbhjyR83gm4r2MFCu4MJmprNXsw`),
regexp.MustCompile(`AIzaSyB8qGxt4ec15vitgn44duC5ucxaOi4FmqE`),
regexp.MustCompile(`AIzaSyA8vmApnrHNFE0bApF4hoZ11srVL_n0nvY`),
},
},
},
}
// validate
tps := utils.GenerateSampleSecrets("gcp", secrets.NewSecret(`AIza[\w-]{35}`))
tps = append(tps,
// non-word character at end
`AIzaSyNHxIf32IQ1a1yjl3ZJIqKZqzLAK1XhDk-`, // gitleaks:allow
)
fps := []string{
`GWw4hjABFzZCGiRpmlDyDdo87Jn9BN9THUA47muVRNunLxsa82tMAdvmrhOqNkRKiYMEAFbTJAIzaTesb6Tscfcni8vIpWZqNCXFDFslJtVSvFDq`, // text boundary start
`AIzaTesb6Tscfcni8vIpWZqNCXFDFslJtVSvFDqabcd123`, // text boundary end
`apiKey: "AIzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"`, // not enough entropy
`AIZASYCO2CXRMC9ELSKLHLHRMBSWDEVEDZTLO2O`, // incorrect case
// example keys from https://github.com/firebase/firebase-android-sdk
`AIzaSyabcdefghijklmnopqrstuvwxyz1234567`,
`AIzaSyAnLA7NfeLquW1tJFpx_eQCxoX-oo6YyIs`,
`AIzaSyCkEhVjf3pduRDt6d1yKOMitrUEke8agEM`,
`AIzaSyDMAScliyLx7F0NPDEJi1QmyCgHIAODrlU`,
`AIzaSyD3asb-2pEZVqMkmL6M9N6nHZRR_znhrh0`,
`AIzayDNSXIbFmlXbIE6mCzDLQAqITYefhixbX4A`,
`AIzaSyAdOS2zB6NCsk1pCdZ4-P6GBdi_UUPwX7c`,
`AIzaSyASWm6HmTMdYWpgMnjRBjxcQ9CKctWmLd4`,
`AIzaSyANUvH9H9BsUccjsu2pCmEkOPjjaXeDQgY`,
`AIzaSyA5_iVawFQ8ABuTZNUdcwERLJv_a_p4wtM`,
`AIzaSyA4UrcGxgwQFTfaI3no3t7Lt1sjmdnP5sQ`,
`AIzaSyDSb51JiIcB6OJpwwMicseKRhhrOq1cS7g`,
`AIzaSyBF2RrAIm4a0mO64EShQfqfd2AFnzAvvuU`,
`AIzaSyBcE-OOIbhjyR83gm4r2MFCu4MJmprNXsw`,
`AIzaSyB8qGxt4ec15vitgn44duC5ucxaOi4FmqE`,
`AIzaSyA8vmApnrHNFE0bApF4hoZ11srVL_n0nvY`,
}
return utils.Validate(r, tps, fps)
}
+299
View File
@@ -0,0 +1,299 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func GenericCredential() *config.Rule {
// define rule
r := config.Rule{
RuleID: "generic-api-key",
Description: "Detected a Generic API Key, potentially exposing access to various services and sensitive operations.",
Regex: utils.GenerateSemiGenericRegex([]string{
"access",
"auth",
`(?-i:[Aa]pi|API)`,
"credential",
"creds",
"key",
"passw(?:or)?d",
"secret",
"token",
}, `[\w.=-]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3}`, true),
Keywords: []string{
"access",
"api",
"auth",
"key",
"credential",
"creds",
"passwd",
"password",
"secret",
"token",
},
Entropy: 3.5,
Allowlists: []*config.Allowlist{
{
// NOTE: this is a goofy hack to get around the fact there golang's regex engine does not support positive lookaheads.
// Ideally we would want to ensure the secret contains both numbers and alphabetical characters, not just alphabetical characters.
Regexes: []*regexp.Regexp{
regexp.MustCompile(`^[a-zA-Z_.-]+$`),
},
},
{
Description: "Allowlist for Generic API Keys",
MatchCondition: config.AllowlistMatchOr,
RegexTarget: "match",
Regexes: []*regexp.Regexp{
regexp.MustCompile(`(?i)(?:` +
// Access
`access(?:ibility|or)` +
`|access[_.-]?id` +
`|random[_.-]?access` +
// API
`|api[_.-]?(?:id|name|version)` + // id/name/version -> not a secret
`|rapid|capital` + // common words containing "api"
`|[a-z0-9-]*?api[a-z0-9-]*?:jar:` + // Maven META-INF dependencies that contain "api" in the name.
// Auth
`|author` +
`|X-MS-Exchange-Organization-Auth` + // email header
`|Authentication-Results` + // email header
// Credentials
`|(?:credentials?[_.-]?id|withCredentials)` + // Jenkins plugins
// Key
`|(?:bucket|foreign|hot|idx|natural|primary|pub(?:lic)?|schema|sequence)[_.-]?key` +
`|(?:turkey)` +
`|key[_.-]?(?:alias|board|code|frame|id|length|mesh|name|pair|press(?:ed)?|ring|selector|signature|size|stone|storetype|word|up|down|left|right)` +
// Azure KeyVault
`|key[_.-]?vault[_.-]?(?:id|name)|keyVaultToStoreSecrets` +
`|key(?:store|tab)[_.-]?(?:file|path)` +
`|issuerkeyhash` + // part of ssl cert
`|(?-i:[DdMm]onkey|[DM]ONKEY)|keying` + // common words containing "key"
// Secret
`|(?:secret)[_.-]?(?:length|name|size)` + // name of e.g. env variable
`|UserSecretsId` + // https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-8.0&tabs=linux
// Token
`|(?:csrf)[_.-]?token` +
`|(?:io\.jsonwebtoken[ \t]?:[ \t]?[\w-]+)` + // Maven library coordinates. (e.g., https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt)
// General
`|(?:api|credentials|token)[_.-]?(?:endpoint|ur[il])` +
`|public[_.-]?token` +
`|(?:key|token)[_.-]?file` +
// Empty variables capturing the next line (e.g., .env files)
`|(?-i:(?:[A-Z_]+=\n[A-Z_]+=|[a-z_]+=\n[a-z_]+=)(?:\n|\z))` +
`|(?-i:(?:[A-Z.]+=\n[A-Z.]+=|[a-z.]+=\n[a-z.]+=)(?:\n|\z))` +
`)`),
},
StopWords: append(DefaultStopWords,
"6fe4476ee5a1832882e326b506d14126", // https://github.com/yarnpkg/berry/issues/6201
),
},
{
RegexTarget: "line",
Regexes: []*regexp.Regexp{
// Docker build secrets (https://docs.docker.com/build/building/secrets/#using-build-secrets).
regexp.MustCompile(`--mount=type=secret,`),
// https://github.com/gitleaks/gitleaks/issues/1800
regexp.MustCompile(`import[ \t]+{[ \t\w,]+}[ \t]+from[ \t]+['"][^'"]+['"]`),
},
},
{
MatchCondition: config.AllowlistMatchAnd,
RegexTarget: "line",
Regexes: []*regexp.Regexp{
regexp.MustCompile(`LICENSE[^=]*=\s*"[^"]+`),
regexp.MustCompile(`LIC_FILES_CHKSUM[^=]*=\s*"[^"]+`),
regexp.MustCompile(`SRC[^=]*=\s*"[a-zA-Z0-9]+`),
},
Paths: []*regexp.Regexp{
regexp.MustCompile(`\.bb$`),
regexp.MustCompile(`\.bbappend$`),
regexp.MustCompile(`\.bbclass$`),
regexp.MustCompile(`\.inc$`),
},
},
},
}
// validate
tps := utils.GenerateSampleSecrets("generic", "CLOJARS_34bf0e88955ff5a1c328d6a7491acc4f48e865a7b8dd4d70a70749037443") //gitleaks:allow
tps = append(tps, utils.GenerateSampleSecrets("generic", "Zf3D0LXCM3EIMbgJpUNnkRtOfOueHznB")...)
tps = append(tps,
// Access
`'access_token': 'eyJ0eXAioiJKV1slS3oASx=='`,
// API
`some_api_token_123 = "`+newPlausibleSecret(`[a-zA-Z0-9]{60}`)+`"`,
// Auth
`"user_auth": "am9obmRvZTpkMDY5NGIxYi1jMTcxLTQ4ODYt+TMyYS0wMmUwOWQ1/mIwNjc="`,
// Credentials
`"credentials" : "0afae57f3ccfd9d7f5767067bc48b30f719e271ba470488056e37ab35d4b6506"`,
`creds = `+newPlausibleSecret(`[a-zA-Z0-9]{30}`),
// Key
`private-key: `+newPlausibleSecret(`[a-zA-Z0-9\-_.=]{100}`),
// Password
`passwd = `+newPlausibleSecret(`[a-zA-Z0-9\-_.=]{30}`),
// TODO: `ID=dbuser;password=` + newPlausibleSecret(`[a-zA-Z0-9+/]{30}={0,3}`) + `;"`,
// Secret
`"client_secret" : "6da89121079f83b2eb6acccf8219ea982c3d79bccc3e9c6a85856480661f8fde",`,
`mySecretString=`+newPlausibleSecret(`[a-zA-Z0-9]{30}`),
`todo_secret_do_not_commit = `+newPlausibleSecret(`[a-zA-Z0-9]{30}`),
// Token
` utils.GetEnvOrDefault("api_token", "dafa7817-e246-48f3-91a7-e87653d587b8")`,
// `"env": {
//"API_TOKEN": "Lj2^5O%xi214"`,
)
fps := []string{
// Access
`"accessor":"rA1wk0Y45YCufyfq",`,
`report_access_id: e8e4df51-2054-49b0-ab1c-516ac95c691d`,
`accessibilityYesOptionId = "0736f5ef-7e88-499a-80cc-90c85d2a5180"`,
`_RandomAccessIterator>
_LIBCPP_CONSTEXPR_AFTER_CXX11 `,
// API
`this.ultraPictureBox1.Name = "ultraPictureBox1";`,
`rapidstring:marm64-uwp=fail`,
`event-bus-message-api:rc0.15.0_20231217_1420-SNAPSHOT'`,
`COMMUNICATION_API_VERSION=rc0.13.0_20230412_0712-SNAPSHOT`,
`MantleAPI_version=9a038989604e8da62ecddbe2094b16ce1b778be1`,
`[DEBUG] org.slf4j.slf4j-api:jar:1.7.8.:compile (version managed from default)`,
`[DEBUG] org.neo4j.neo4j-graphdb-api:jar:3.5.12:test`,
`apiUrl=apigee.corpint.com`,
`X-API-Name": "NRG0-Hermes-INTERNAL-API",`,
// TODO: Jetbrains IML files (requires line-level allowlist).
// `<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.directory.api:api-asn1-api:1.0.0-M20" level="projcet" />`
// Auth
`author = "james.fake@ymail.com",`,
`X-MS-Exchange-Organization-AuthSource: sm02915.int.contoso.com`,
`Authentication-Results: 5h.ca.iphmx.com`,
// Credentials
`withCredentials([usernamePassword(credentialsId: '29f63271-dc2f-4734-8221-5b31b5169bac', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {`,
`credentialsId: 'ff083f76-7804-4ef1-80e4-fe975bb9141b'`,
`jobCredentialsId: 'f4aeb6bc-2a25-458a-8111-9be9e502c0e7'`,
` "credentialId": "B9mTcFSck2LzJO2S3ols63",`,
`environment {
CREDENTIALS_ID = "K8S_CRED"
}`,
`dev.credentials.url=dev-lb1.api.f4ke.com:5215`,
// Key
`keyword: "Befaehigung_P2"`,
`public_key = "9Cnzj4p4WGeKLs1Pt8QuKUpRKfFLfRYC9AIKjbJTWit"`,
`pub const X509_pubkey_st = struct_X509_pubkey_st;`,
`|| pIdxKey->default_rc==0`,
`monkeys-audio:mx64-uwp=fail`,
`primaryKey=` + newPlausibleSecret(`[a-zA-Z0-9\-_.=]{30}`),
`foreignKey=` + newPlausibleSecret(`[a-zA-Z0-9\-_.=]{30}`),
`key_down_event=` + newPlausibleSecret(`[a-zA-Z0-9\-_.=]{30}`),
`issuerKeyHash=` + newPlausibleSecret(`[a-zA-Z0-9\-_.=]{30}`),
`<entry key="jetbrains.mps.v8_elimination" value="executed" />`,
`minisat-master-keying:x64-uwp=fail`,
`IceSSL.KeyFile=s_rsa1024_priv.pem`,
`"bucket_key": "SalesResults-1.2"`,
`<key tag="SecurityIdentifier" name="SecurityIdentifier" type="STRING" />`,
// `packageKey":` + newPlausibleSecret(`[a-zA-Z0-9\-_.=]{30}`),
`schemaKey = 'DOC_Vector_5_32'`,
`sequenceKey = "18"`,
`app.keystore.file=env/cert.p12`,
`-DKEYTAB_FILE=/tmp/app.keytab`,
` doc.Security.KeySize = PdfEncryptionKeySize.Key128Bit;`,
`o.keySelector=n,o.haKey=!1,`,
// TODO: Requires line-level allowlists.
` "key_name": "prod5zyxlmy-cmk",`,
` "kms_key_id": "555ea4a3-d53a-4412-9c66-3a7cb667b0d6",`,
` "key_vault_name": "web21prqodx24021",`,
` keyVaultToStoreSecrets: cmp2-qat-1208358310`, // e.g., https://github.com/2uasimojo/community-operators-prod/blob/9e51e4c8e0b5caaa3087e8e18e6fb918b2c36643/operators/azure-service-operator/1.0.59040/manifests/azure.microsoft.com_cosmosdbs.yaml#L50
`,apiKey:"6fe4476ee5a1832882e326b506d14126",`,
`const validKeyChars = "0123456789abcdefghijklmnopqrstuvwxyz_-."`,
`const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"`,
`key_length = XSalsa20.key_length`,
`pub const SN_id_Gost28147_89_None_KeyMeshing = "id-Gost28147-89-None-KeyMeshing"`,
`KeyPair = X25519.KeyPair`,
`BlindKeySignatures = Ed25519.BlindKeySignatures`,
`AVEncVideoMaxKeyframeDistance, "2987123a-ba93-4704-b489-ec1e5f25292c"`,
` keyPressed = kVK_Return.u16`,
`timezone_mapping = {
"Turkey Standard Time": "Europe/Istanbul",
}`, // https://github.com/gitleaks/gitleaks/issues/1799
// `<add key="SchemaTable" value="G:\SchemaTable.xml" />`,
//` { key: '9df21e95-3848-409d-8f94-c675cdfee839', value: 'Americas' },`,
// `<TAR key="REF_ID_923.properties" value="/opts/config/alias/"/>`,
// `secret:
// secretName: app-decryption-secret
// items:
// - key: app-k8s.yml
// path: app-k8s.yml`,
// TODO: https://learn.microsoft.com/en-us/windows/apps/design/style/xaml-theme-resources
//`<Color x:Key="NormalBrushGradient1">#FFBAE4FF</Color>`,
// Password
`password combination.
R5: Regulatory--21`,
`PuttyPassword=0`,
// Secret
`LLM_SECRET_NAME = "NEXUS-GPT4-API-KEY"`,
` <UserSecretsId>79a3edd0-2092-40a2-a04d-dcb46d5ca9ed</UserSecretsId>`,
`secret_length = X25519.secret_length`,
`secretSize must be >= XXH3_SECRET_SIZE_MIN`,
`# get build time secret for authentication
#RUN --mount=type=secret,id=jfrog_secret \
# JFROG_SECRET = $(cat /run/secrets/jfrog_secret) && \`,
// Token
` access_token_url='https://github.com/login/oauth/access_token',`,
`publicToken = "9Cnzj4p4WGeKLs1Pt8QuKUpRKfFLfRYC9AIKjbJTWit"`,
`<SourceFile SourceLocation="F:\Extracts\" TokenFile="RTL_INST_CODE.cer">`,
`notes = "Maven - io.jsonwebtoken:jjwt-jackson-0.11.2"`,
`csrf-token=Mj2qykJO5rELyHgezQ69nzUX0i3OH67V7+V4eUrLfpuyOuxmiW9rhROG/Whikle15syazJOkrjJa3U2AbhIvUw==`,
// TODO: `TOKEN_AUDIENCE = "25872395-ed3a-4703-b647-22ec53f3683c"`,
// General
`clientId = "73082700-1f09-405b-80d0-3131bfd6272d"`,
`GITHUB_API_KEY=
DYNATRACE_API_KEY=`,
`snowflake.password=
jdbc.snowflake.url=`,
`import { chain_Anvil1_Key, chain_Anvil2_Key } from '../blockchain-tests/pallets/supported-chains/consts';`,
// Yocto/BitBake
`SRCREV_moby = "43fc912ef59a83054ea7f6706df4d53a7dea4d80"`,
`LIC_FILES_CHKSUM = "file://${WORKDIR}/license.html;md5=5c94767cedb5d6987c902ac850ded2c6"`,
}
return utils.Validate(r, tps, fps)
}
func newPlausibleSecret(regex string) string {
allowList := &config.Allowlist{StopWords: DefaultStopWords}
// attempt to generate a random secret,
// retrying until it contains at least one digit and no stop words
// TODO: currently the DefaultStopWords list contains many short words,
// so there is a significant chance of generating a secret that contains a stop word
for {
secret := secrets.NewSecret(regex)
if !regexp.MustCompile(`[1-9]`).MatchString(secret) {
continue
}
if ok, _ := allowList.ContainsStopWord(secret); ok {
continue
}
return secret
}
}
+111
View File
@@ -0,0 +1,111 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
var githubAllowlist = []*config.Allowlist{
{
Paths: []*regexp.Regexp{
// https://github.com/octokit/auth-token.js/?tab=readme-ov-file#createtokenauthtoken-options
regexp.MustCompile(`(?:^|/)@octokit/auth-token/README\.md$`),
},
},
}
func GitHubPat() *config.Rule {
// define rule
r := config.Rule{
RuleID: "github-pat",
Description: "Uncovered a GitHub Personal Access Token, potentially leading to unauthorized repository access and sensitive content exposure.",
Regex: regexp.MustCompile(`ghp_[0-9a-zA-Z]{36}`),
Entropy: 3,
Keywords: []string{"ghp_"},
Allowlists: githubAllowlist,
}
// validate
tps := utils.GenerateSampleSecrets("github", "ghp_"+secrets.NewSecret(utils.AlphaNumeric("36")))
fps := []string{
"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitHubFineGrainedPat() *config.Rule {
// define rule
r := config.Rule{
RuleID: "github-fine-grained-pat",
Description: "Found a GitHub Fine-Grained Personal Access Token, risking unauthorized repository access and code manipulation.",
Regex: regexp.MustCompile(`github_pat_\w{82}`),
Entropy: 3,
Keywords: []string{"github_pat_"},
}
// validate
tps := utils.GenerateSampleSecrets("github", "github_pat_"+secrets.NewSecret(utils.AlphaNumeric("82")))
fps := []string{
"github_pat_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitHubOauth() *config.Rule {
// define rule
r := config.Rule{
RuleID: "github-oauth",
Description: "Discovered a GitHub OAuth Access Token, posing a risk of compromised GitHub account integrations and data leaks.",
Regex: regexp.MustCompile(`gho_[0-9a-zA-Z]{36}`),
Entropy: 3,
Keywords: []string{"gho_"},
}
// validate
tps := utils.GenerateSampleSecrets("github", "gho_"+secrets.NewSecret(utils.AlphaNumeric("36")))
fps := []string{
"gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitHubApp() *config.Rule {
// define rule
r := config.Rule{
RuleID: "github-app-token",
Description: "Identified a GitHub App Token, which may compromise GitHub application integrations and source code security.",
Regex: regexp.MustCompile(`(?:ghu|ghs)_[0-9a-zA-Z]{36}`),
Entropy: 3,
Keywords: []string{"ghu_", "ghs_"},
Allowlists: githubAllowlist,
}
// validate
tps := utils.GenerateSampleSecrets("github", "ghs_"+secrets.NewSecret(utils.AlphaNumeric("36")))
tps = append(tps, utils.GenerateSampleSecrets("github", "ghu_"+secrets.NewSecret(utils.AlphaNumeric("36")))...)
fps := []string{
"ghu_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ghs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitHubRefresh() *config.Rule {
// define rule
r := config.Rule{
RuleID: "github-refresh-token",
Description: "Detected a GitHub Refresh Token, which could allow prolonged unauthorized access to GitHub services.",
Regex: regexp.MustCompile(`ghr_[0-9a-zA-Z]{36}`),
Entropy: 3,
Keywords: []string{"ghr_"},
}
// validate
tps := utils.GenerateSampleSecrets("github", "ghr_"+secrets.NewSecret(utils.AlphaNumeric("36")))
fps := []string{
"ghr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
+222
View File
@@ -0,0 +1,222 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
// overview with all GitLab tokens:
// https://docs.gitlab.com/ee/security/tokens/index.html#token-prefixes
func GitlabCiCdJobToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-cicd-job-token",
Description: "Identified a GitLab CI/CD Job Token, potential access to projects and some APIs on behalf of a user while the CI job is running.",
Regex: regexp.MustCompile(`glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}`),
Entropy: 3,
Keywords: []string{"glcbt-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glcbt-"+secrets.NewSecret(utils.AlphaNumeric("5"))+"_"+secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
func GitlabDeployToken() *config.Rule {
r := config.Rule{
Description: "Identified a GitLab Deploy Token, risking access to repositories, packages and containers with write access.",
RuleID: "gitlab-deploy-token",
Regex: regexp.MustCompile(`gldt-[0-9a-zA-Z_\-]{20}`),
Entropy: 3,
Keywords: []string{"gldt-"},
}
tps := []string{
utils.GenerateSampleSecret("gitlab", "gldt-"+secrets.NewSecret(utils.AlphaNumeric("20"))),
}
return utils.Validate(r, tps, nil)
}
func GitlabFeatureFlagClientToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-feature-flag-client-token",
Description: "Identified a GitLab feature flag client token, risks exposing user lists and features flags used by an application.",
Regex: regexp.MustCompile(`glffct-[0-9a-zA-Z_\-]{20}`),
Entropy: 3,
Keywords: []string{"glffct-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glffct-"+secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
func GitlabFeedToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-feed-token",
Description: "Identified a GitLab feed token, risking exposure of user data.",
Regex: regexp.MustCompile(`glft-[0-9a-zA-Z_\-]{20}`),
Entropy: 3,
Keywords: []string{"glft-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glft-"+secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
func GitlabIncomingMailToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-incoming-mail-token",
Description: "Identified a GitLab incoming mail token, risking manipulation of data sent by mail.",
Regex: regexp.MustCompile(`glimt-[0-9a-zA-Z_\-]{25}`),
Entropy: 3,
Keywords: []string{"glimt-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glimt-"+secrets.NewSecret(utils.AlphaNumeric("25")))
return utils.Validate(r, tps, nil)
}
func GitlabKubernetesAgentToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-kubernetes-agent-token",
Description: "Identified a GitLab Kubernetes Agent token, risking access to repos and registry of projects connected via agent.",
Regex: regexp.MustCompile(`glagent-[0-9a-zA-Z_\-]{50}`),
Entropy: 3,
Keywords: []string{"glagent-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glagent-"+secrets.NewSecret(utils.AlphaNumeric("50")))
return utils.Validate(r, tps, nil)
}
func GitlabOauthAppSecret() *config.Rule {
r := config.Rule{
RuleID: "gitlab-oauth-app-secret",
Description: "Identified a GitLab OIDC Application Secret, risking access to apps using GitLab as authentication provider.",
Regex: regexp.MustCompile(`gloas-[0-9a-zA-Z_\-]{64}`),
Entropy: 3,
Keywords: []string{"gloas-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "gloas-"+secrets.NewSecret(utils.AlphaNumeric("64")))
return utils.Validate(r, tps, nil)
}
func GitlabPat() *config.Rule {
r := config.Rule{
RuleID: "gitlab-pat",
Description: "Identified a GitLab Personal Access Token, risking unauthorized access to GitLab repositories and codebase exposure.",
Regex: regexp.MustCompile(`glpat-[\w-]{20}`),
Entropy: 3,
Keywords: []string{"glpat-"},
}
// validate
tps := utils.GenerateSampleSecrets("gitlab", "glpat-"+secrets.NewSecret(utils.AlphaNumeric("20")))
fps := []string{
"glpat-XXXXXXXXXXX-XXXXXXXX",
}
return utils.Validate(r, tps, fps)
}
func GitlabPatRoutable() *config.Rule {
r := config.Rule{
RuleID: "gitlab-pat-routable",
Description: "Identified a GitLab Personal Access Token (routable), risking unauthorized access to GitLab repositories and codebase exposure.",
Regex: regexp.MustCompile(`\bglpat-[0-9a-zA-Z_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b`),
Entropy: 4,
Keywords: []string{"glpat-"},
}
// validate
tps := utils.GenerateSampleSecrets("gitlab", "glpat-"+secrets.NewSecret(utils.AlphaNumeric("27"))+"."+secrets.NewSecret(utils.AlphaNumeric("2"))+secrets.NewSecret(utils.AlphaNumeric("7")))
fps := []string{
"glpat-xxxxxxxx-xxxxxxxxxxxxxxxxxx.xxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitlabPipelineTriggerToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-ptt",
Description: "Found a GitLab Pipeline Trigger Token, potentially compromising continuous integration workflows and project security.",
Regex: regexp.MustCompile(`glptt-[0-9a-f]{40}`),
Entropy: 3,
Keywords: []string{"glptt-"},
}
// validate
tps := utils.GenerateSampleSecrets("gitlab", "glptt-"+secrets.NewSecret(utils.Hex("40")))
fps := []string{
"glptt-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitlabRunnerRegistrationToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-rrt",
Description: "Discovered a GitLab Runner Registration Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",
Regex: regexp.MustCompile(`GR1348941[\w-]{20}`),
Entropy: 3,
Keywords: []string{"GR1348941"},
}
tps := utils.GenerateSampleSecrets("gitlab", "GR1348941"+secrets.NewSecret(utils.AlphaNumeric("20")))
fps := []string{
"GR134894112312312312312312312",
"GR1348941XXXXXXXXXXXXXXXXXXXX",
}
return utils.Validate(r, tps, fps)
}
func GitlabRunnerAuthenticationToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-runner-authentication-token",
Description: "Discovered a GitLab Runner Authentication Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",
Regex: regexp.MustCompile(`glrt-[0-9a-zA-Z_\-]{20}`),
Entropy: 3,
Keywords: []string{"glrt-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glrt-"+secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
func GitlabRunnerAuthenticationTokenRoutable() *config.Rule {
r := config.Rule{
RuleID: "gitlab-runner-authentication-token-routable",
Description: "Discovered a GitLab Runner Authentication Token (Routable), posing a risk to CI/CD pipeline integrity and unauthorized access.",
Regex: regexp.MustCompile(`\bglrt-t\d_[0-9a-zA-Z_\-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b`),
Entropy: 4,
Keywords: []string{"glrt-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glrt-t"+secrets.NewSecret(utils.Numeric("1"))+"_"+secrets.NewSecret(utils.AlphaNumeric("27"))+"."+secrets.NewSecret(utils.AlphaNumeric("2"))+secrets.NewSecret(utils.AlphaNumeric("7")))
fps := []string{
"glrt-tx_xxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxx",
}
return utils.Validate(r, tps, fps)
}
func GitlabScimToken() *config.Rule {
r := config.Rule{
RuleID: "gitlab-scim-token",
Description: "Discovered a GitLab SCIM Token, posing a risk to unauthorized access for a organization or instance.",
Regex: regexp.MustCompile(`glsoat-[0-9a-zA-Z_\-]{20}`),
Entropy: 3,
Keywords: []string{"glsoat-"},
}
tps := utils.GenerateSampleSecrets("gitlab", "glsoat-"+secrets.NewSecret(utils.AlphaNumeric("20")))
return utils.Validate(r, tps, nil)
}
func GitlabSessionCookie() *config.Rule {
r := config.Rule{
RuleID: "gitlab-session-cookie",
Description: "Discovered a GitLab Session Cookie, posing a risk to unauthorized access to a user account.",
Regex: regexp.MustCompile(`_gitlab_session=[0-9a-z]{32}`),
Entropy: 3,
Keywords: []string{"_gitlab_session="},
}
// validate
tps := utils.GenerateSampleSecrets("gitlab", "_gitlab_session="+secrets.NewSecret(utils.AlphaNumeric("32")))
return utils.Validate(r, tps, nil)
}
+25
View File
@@ -0,0 +1,25 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func GitterAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "gitter-access-token",
Description: "Uncovered a Gitter Access Token, which may lead to unauthorized access to chat and communication services.",
Regex: utils.GenerateSemiGenericRegex([]string{"gitter"},
utils.AlphaNumericExtendedShort("40"), true),
Keywords: []string{
"gitter",
},
}
// validate
tps := utils.GenerateSampleSecrets("gitter", secrets.NewSecret(utils.AlphaNumericExtendedShort("40")))
return utils.Validate(r, tps, nil)
}
+25
View File
@@ -0,0 +1,25 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func GoCardless() *config.Rule {
// define rule
r := config.Rule{
RuleID: "gocardless-api-token",
Description: "Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",
Regex: utils.GenerateSemiGenericRegex([]string{"gocardless"}, `live_(?i)[a-z0-9\-_=]{40}`, true),
Keywords: []string{
"live_",
"gocardless",
},
}
// validate
tps := utils.GenerateSampleSecrets("gocardless", "live_"+secrets.NewSecret(utils.AlphaNumericExtended("40")))
return utils.Validate(r, tps, nil)
}
+80
View File
@@ -0,0 +1,80 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func GrafanaApiKey() *config.Rule {
// define rule
r := config.Rule{
RuleID: "grafana-api-key",
Description: "Identified a Grafana API key, which could compromise monitoring dashboards and sensitive data analytics.",
Regex: utils.GenerateUniqueTokenRegex(`eyJrIjoi[A-Za-z0-9]{70,400}={0,3}`, true),
Entropy: 3,
Keywords: []string{"eyJrIjoi"},
}
// validate
tps := utils.GenerateSampleSecrets("grafana-api-key", "eyJrIjoi"+secrets.NewSecret(utils.AlphaNumeric("70")))
return utils.Validate(r, tps, nil)
}
func GrafanaCloudApiToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "grafana-cloud-api-token",
Description: "Found a Grafana cloud API token, risking unauthorized access to cloud-based monitoring services and data exposure.",
Regex: utils.GenerateUniqueTokenRegex(`glc_[A-Za-z0-9+/]{32,400}={0,3}`, true),
Entropy: 3,
Keywords: []string{"glc_"},
}
// validate
tps := utils.GenerateSampleSecrets("grafana-cloud-api-token", "glc_"+secrets.NewSecret(utils.AlphaNumeric("32")))
tps = append(tps,
utils.GenerateSampleSecret("grafana-cloud-api-token",
"glc_"+
secrets.NewSecret(utils.AlphaNumeric("32"))),
`loki_key: glc_eyJvIjoiNzQ0NTg3IiwibiI7InN0YWlrLTQ3NTgzMC1obC13cml0ZS1oYW5kc29uJG9raSIsImsiOiI4M2w3cmdYUlBoMTUyMW1lMU023nl5UDUiLCJtIjp7IOIiOiJ1cyJ9fQ==`,
// TODO:
//` loki:
//endpoint: https://322137:glc_eyJvIjoiNzQ0NTg3IiwibiI7InN0YWlrLTQ3NTgzMC1obC13cml0ZS1oYW5kc29uJG9raSIsImsiOiI4M2w3cmdYUlBoMTUyMW1lMU023nl5UDUiLCJtIjp7IOIiOiJ1cyJ9fQ==@logs-prod4.grafana.net/loki/api/v1/push`,
)
fps := []string{
// Low entropy.
`glc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,
` API_KEY="glc_111111111111111111111111111111111111111111="`,
// Invalid.
`static void GLC_CreateLightmapTextureArray(void);
static void GLC_CreateLightmapTexturesIndividual(void);
void GLC_UploadLightmap(int textureUnit, int lightmapnum);`,
`// Alias models
void GLC_StateBeginUnderwaterAliasModelCaustics(texture_ref base_texture, texture_ref caustics_texture)
{`,
}
return utils.Validate(r, tps, fps)
}
func GrafanaServiceAccountToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "grafana-service-account-token",
Description: "Discovered a Grafana service account token, posing a risk of compromised monitoring services and data integrity.",
Regex: utils.GenerateUniqueTokenRegex(`glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}`, true),
Entropy: 3,
Keywords: []string{"glsa_"},
}
// validate
tps := utils.GenerateSampleSecrets("grafana-service-account-token", "glsa_"+secrets.NewSecret(utils.AlphaNumeric("32"))+"_"+secrets.NewSecret(utils.Hex("8")))
tps = append(tps,
`'Authorization': 'Bearer glsa_pITqMOBIfNH2KL4PkXJqmTyQl0D9QGxF_486f63e1'`,
)
fps := []string{
"glsa_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_AAAAAAAA",
}
return utils.Validate(r, tps, fps)
}
+25
View File
@@ -0,0 +1,25 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func HarnessApiKey() *config.Rule {
// Define rule for Harness Personal Access Token (PAT) and Service Account Token (SAT)
r := config.Rule{
Description: "Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account.",
RuleID: "harness-api-key",
Regex: regexp.MustCompile(`(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}`),
Keywords: []string{"pat.", "sat."},
}
// Generate a sample secret for validation
tps := utils.GenerateSampleSecrets("harness", "pat."+secrets.NewSecret(utils.AlphaNumeric("22"))+"."+secrets.NewSecret(utils.AlphaNumeric("24"))+"."+secrets.NewSecret(utils.AlphaNumeric("20")))
tps = append(tps, utils.GenerateSampleSecrets("harness", "sat."+secrets.NewSecret(utils.AlphaNumeric("22"))+"."+secrets.NewSecret(utils.AlphaNumeric("24"))+"."+secrets.NewSecret(utils.AlphaNumeric("20")))...)
// validate the rule
return utils.Validate(r, tps, nil)
}
+58
View File
@@ -0,0 +1,58 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func HashiCorpTerraform() *config.Rule {
// define rule
r := config.Rule{
RuleID: "hashicorp-tf-api-token",
Description: "Uncovered a HashiCorp Terraform user/org API token, which may lead to unauthorized infrastructure management and security breaches.",
Regex: regexp.MustCompile(`(?i)[a-z0-9]{14}\.(?-i:atlasv1)\.[a-z0-9\-_=]{60,70}`),
Entropy: 3.5,
Keywords: []string{"atlasv1"},
}
// validate
tps := utils.GenerateSampleSecrets("hashicorpToken", secrets.NewSecret(utils.Hex("14"))+".atlasv1."+secrets.NewSecret(utils.AlphaNumericExtended("60,70")))
tps = append(tps,
`#token = "hE1hlYILrSqpqh.atlasv1.ARjZuyzl33F71WR55s6ln5GQ1HWIwTDDH3MiRjz7OnpCfaCb1RCF5zGaSncCWmJdcYA"`,
)
fps := []string{
`token = "xxxxxxxxxxxxxx.atlasv1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"`, // low entropy
}
return utils.Validate(r, tps, fps)
}
func HashicorpField() *config.Rule {
keywords := []string{"administrator_login_password", "password"}
// define rule
r := config.Rule{
RuleID: "hashicorp-tf-password",
Description: "Identified a HashiCorp Terraform password field, risking unauthorized infrastructure configuration and security breaches.",
Regex: utils.GenerateSemiGenericRegex(keywords, fmt.Sprintf(`"%s"`, utils.AlphaNumericExtended("8,20")), true),
Entropy: 2,
Path: regexp.MustCompile(`(?i)\.(?:tf|hcl)$`),
Keywords: keywords,
}
tps := map[string]string{
// Example from: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/sql_server.html
"file.tf": "administrator_login_password = " + `"thisIsDog11"`,
// https://registry.terraform.io/providers/petoju/mysql/latest/docs
"file.hcl": "password = " + `"rootpasswd"`,
}
fps := map[string]string{
"file.tf": "administrator_login_password = var.db_password",
"file.hcl": `password = "${aws_db_instance.default.password}"`,
"unrelated.js": "password = " + `"rootpasswd"`,
}
return utils.ValidateWithPaths(r, tps, fps)
}
@@ -0,0 +1,67 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func VaultServiceToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "vault-service-token",
Description: "Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.",
Regex: utils.GenerateUniqueTokenRegex(`(?:hvs\.[\w-]{90,120}|s\.(?i:[a-z0-9]{24}))`, false),
Entropy: 3.5,
Keywords: []string{"hvs.", "s."},
Allowlists: []*config.Allowlist{
{
Regexes: []*regexp.Regexp{
// https://github.com/gitleaks/gitleaks/issues/1490#issuecomment-2334166357
regexp.MustCompile(`s\.[A-Za-z]{24}`),
},
},
},
}
// validate
tps := []string{
// Old
utils.GenerateSampleSecret("vault", secrets.NewSecret(`s\.[0-9][a-zA-Z0-9]{23}`)),
`token: s.ZC9Ecf4M5g9o34Q6RkzGsj0z`,
// New
utils.GenerateSampleSecret("vault", secrets.NewSecret(`hvs\.[0-9][\w\-]{89}`)),
`-vaultToken hvs.CAESIP2jTxc9S2K7Z6CtcFWQv7-044m_oSsxnPE1H3nF89l3GiYKHGh2cy5sQmlIZVNyTWJNcDRsYWJpQjlhYjVlb1cQh6PL8wEYAg"`, // longer than 100 chars
}
fps := []string{
// Old
` credentials: new AWS.SharedIniFileCredentials({ profile: '<YOUR_PROFILE>' })`, // word boundary start
`INFO 4 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean`, // word boundary end
`s.xxxxxxxxxxxxxxxxxxxxxxxx`, // low entropy
`s.THISSTRINGISALLUPPERCASE`, // uppercase
`s.thisstringisalllowercase`, // lowercase
`s.AcceptanceTimeoutSeconds `, // pascal-case
`s.makeKubeConfigController = args`, // camel-case
// New
`hvs.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`, // low entropy
}
return utils.Validate(r, tps, fps)
}
func VaultBatchToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "vault-batch-token",
Description: "Detected a Vault Batch Token, risking unauthorized access to secret management services and sensitive data.",
Regex: utils.GenerateUniqueTokenRegex(`hvb\.[\w-]{138,300}`, false),
Entropy: 4,
Keywords: []string{"hvb."},
}
// validate
tps := utils.GenerateSampleSecrets("vault", "hvb."+secrets.NewSecret(utils.AlphaNumericExtendedShort("138")))
tps = append(tps, `hvb.AAAAAQJgxDgqsGNorpoOR7hPZ5SU-ynBvCl764jyRP_fnX7WvkdkDzGjbLNGdPdtlY33Als2P36yDZueqzfdGw9RsaTeaYXSH7E4RYSWuRoQ9YRKIw8o7mDDY2ZcT3KOB7RwtW1w1FN2eDqcy_sbCjXPaM1iBVH-mqMSYRmRd2nb5D1SJPeBzIYRqSglLc31wUGN7xEzyrKUczqOKsIcybQA`) // gitleaks:allow
return utils.Validate(r, tps, nil)
}
+45
View File
@@ -0,0 +1,45 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Heroku() *config.Rule {
// define rule
r := config.Rule{
Description: "Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",
RuleID: "heroku-api-key",
Regex: utils.GenerateSemiGenericRegex([]string{"heroku"}, utils.Hex8_4_4_4_12(), true),
Keywords: []string{"heroku"},
}
// validate
tps := utils.GenerateSampleSecrets("heroku", secrets.NewSecret(utils.Hex8_4_4_4_12()))
tps = append(tps,
`const HEROKU_KEY = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
`heroku_api_key = "832d2129-a846-4e27-99f4-7004b6ad53ef"`, // gitleaks:allow
)
return utils.Validate(r, tps, nil)
}
func HerokuV2() *config.Rule {
// define rule
r := config.Rule{
Description: "Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",
RuleID: "heroku-api-key-v2",
Regex: utils.GenerateUniqueTokenRegex(`(HRKU-AA[0-9a-zA-Z_-]{58})`, false),
Entropy: 4,
Keywords: []string{"HRKU-AA"},
}
// validate
tps := utils.GenerateSampleSecrets("heroku", secrets.NewSecret(`\b(HRKU-AA[0-9a-zA-Z_-]{58})\b`))
tps = append(tps,
`const KEY = "HRKU-AAlQ1aVoHDujJ9QsDHdHlHO0hbzhoERRSO45ZQusSYHg_____w4_hLrAym_u""`,
`API_Key = "HRKU-AAy9Ppr_HD2pPuTyIiTYInO0hbzhoERRSO93ZQusSYHgaD7_WQ07FnF7L9FX"`,
)
return utils.Validate(r, tps, nil)
}
+26
View File
@@ -0,0 +1,26 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func HubSpot() *config.Rule {
// define rule
r := config.Rule{
Description: "Found a HubSpot API Token, posing a risk to CRM data integrity and unauthorized marketing operations.",
RuleID: "hubspot-api-key",
Regex: utils.GenerateSemiGenericRegex([]string{"hubspot"},
`[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}`, true),
Keywords: []string{"hubspot"},
}
// validate
tps := utils.GenerateSampleSecrets("hubspot", secrets.NewSecret(utils.Hex8_4_4_4_12()))
tps = append(tps,
`const hubspotKey = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
)
return utils.Validate(r, tps, nil)
}
+116
View File
@@ -0,0 +1,116 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
// Reference: https://huggingface.co/docs/hub/security-tokens
//
// Old tokens have the prefix `api_`, however, I am not sure it's worth detecting them as that would be high noise.
// https://huggingface.co/docs/api-inference/quicktour
func HuggingFaceAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "huggingface-access-token",
Description: "Discovered a Hugging Face Access token, which could lead to unauthorized access to AI models and sensitive data.",
Regex: utils.GenerateUniqueTokenRegex("hf_(?i:[a-z]{34})", false),
Entropy: 2,
Keywords: []string{
"hf_",
},
}
// validate
tps := utils.GenerateSampleSecrets("huggingface", "hf_"+secrets.NewSecret("[a-zA-Z]{34}"))
tps = append(tps,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`huggingface-cli login --token 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`,
`-H "Authorization: Bearer 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"`,
`DEV=1 HF_TOKEN=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 poetry run python app.py`,
`use_auth_token='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')`,
`CI_HUB_USER_TOKEN = "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"`,
`- Change line 5 and add your Hugging Face token, that is, instead of 'hf_token = "ADD_YOUR_HUGGING_FACE_TOKEN_HERE"', you will need to change it to something like'hf_token = "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"'`,
//TODO: ` " hf_token = \"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\"\n",`,
`# Not critical, only usable on the sandboxed CI instance.
TOKEN = "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"`,
` parser.add_argument("--hf_token", type=str, default='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', help="Hugging Face Access Token to access PyAnnote gated models")`,
)
fps := []string{
`- (id)hf_requiredCharacteristicTypesForDisplayMetadata;`,
`amazon.de#@#div[data-cel-widget="desktop-rhf_SponsoredProductsRemoteRHFSearchEXPSubsK2ClickPagination"]`,
` _kHMSymptomhf_generatedByHomeAppForDebuggingPurposesKey,`,
` #define OSCHF_DebugGetExpectedAverageCrystalAmplitude NOROM_OSCHF_DebugGetExpectedAverageCrystalAmplitude`,
` M_UINT (ServingCellPriorityParametersDescription_t, H_PRIO, 2, &hf_servingcellpriorityparametersdescription_h_prio),`,
`+HWI-ST565_0092:4:1101:5508:5860#ACTTGA/1
bb_eeeeegfgffhiiiiiiiiiiihiiiiicgafhf_eefghihhiiiifhifhhdhifhiiiihifdgdhggf\bbceceedbcd
@HWI-ST565_0092:4:1101:7621:5770#ACTTGA/1`,
`y{}x|~|}{~}}~|~}||�~|�{��|{}{|~z{}{{|{||{|}|{}{~|y}vjoePbUBJ7&;"; <; :;?!!;<7%$IACa_ecghbfbaebejhahfbhf_ddbficghbgfbhhcghdghfhigiifhhehhdggcgfchf_fgcei^[[.40&54"5666 6`,
` change_dir(cwd)
subdirs = glob.glob('HF_CAASIMULIAComputeServicesBuildTime.HF*.Linux64')
if len(subdirs) == 1:`,
` os.environ.get("HF_AUTH_TOKEN",
"hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),`,
`# HuggingFace API Token https://huggingface.co/settings/tokens
HUGGINGFACE_API_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,`,
}
return utils.Validate(r, tps, fps)
}
// Will be deprecated Aug 1st, 2023.
func HuggingFaceOrganizationApiToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "huggingface-organization-api-token",
Description: "Uncovered a Hugging Face Organization API token, potentially compromising AI organization accounts and associated data.",
Regex: utils.GenerateUniqueTokenRegex("api_org_(?i:[a-z]{34})", false),
Entropy: 2,
Keywords: []string{
"api_org_",
},
}
// validate
tps := utils.GenerateSampleSecrets("huggingface", "api_org_"+secrets.NewSecret("[a-zA-Z]{34}"))
tps = append(tps,
`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`,
"`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`",
`\'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'\`,
//TODO: `\"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\"`,
//TODO: `,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,`,
//TODO: `(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)`,
//TODO: `<foo>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</foo>`,
`def test_private_space(self):
hf_token = "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" # Intentionally revealing this key for testing purposes
io = gr.load(`,
`hf_token = "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" # Intentionally revealing this key for testing purposes`,
`"news_train_dataset = datasets.load_dataset('nlpHakdang/aihub-news30k', data_files = \"train_news_text.csv\", use_auth_token='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')\n",`,
`os.environ['HUGGINGFACEHUB_API_TOKEN'] = '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'`,
fmt.Sprintf("api_org_%s", secrets.NewSecret(`[a-zA-Z]{34}`)),
)
fps := []string{
`public static final String API_ORG_EXIST = "APIOrganizationExist";`,
`const api_org_controller = require('../../controllers/api/index').organizations;`,
`API_ORG_CREATE("https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=ACCESS_TOKEN"),`,
`def test_internal_api_org_inclusion_with_href(api_name, href, expected, monkeypatch, called_with):
monkeypatch.setattr("requests.sessions.Session.request", called_with)`,
` def _api_org_96726c78_4ae3_402f_b08b_7a78c6903d2a(self, method, url, body, headers):
body = self.fixtures.load("api_org_96726c78_4ae3_402f_b08b_7a78c6903d2a.xml")
return httplib.OK, body, headers, httplib.responses[httplib.OK]`,
`<p>You should see a token <code>hf_xxxxx</code> (old tokens are <code>api_XXXXXXXX</code> or <code>api_org_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</code>).</p>`,
` From Hugging Face docs:
You should see a token hf_xxxxx (old tokens are api_XXXXXXXX or api_org_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).
If you do not submit your API token when sending requests to the API, you will not be able to run inference on your private models.`,
}
return utils.Validate(r, tps, fps)
}
+42
View File
@@ -0,0 +1,42 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func InfracostAPIToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "infracost-api-token",
Description: "Detected an Infracost API Token, risking unauthorized access to cloud cost estimation tools and financial data.",
Regex: utils.GenerateUniqueTokenRegex(`ico-[a-zA-Z0-9]{32}`, false),
Entropy: 3,
Keywords: []string{"ico-"},
}
// validate
tps := utils.GenerateSampleSecrets("ico", "ico-"+secrets.NewSecret("[A-Za-z0-9]{32}"))
tps = append(tps,
` variable {
name = "INFRACOST_API_KEY"
secret_value = "ico-mlCr1Mn3SRcRiZMObUZOTHLcgtH2Lpgt"
is_secret = true
}`,
// TODO: New format with longer keys?
// ` headers = {
//'X-Api-Key': 'ico-EeDdSfctrmjD14f45f45te5gJ7l6lw4o6M36sXT62a6',
//'Content-Type': 'application/json',
//}`,
)
fps := []string{
// Low entropy
`ico-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`,
// Invalid
`http://assets.r7.com/assets/media_box_tv_tres_colunas/video_box.ico-7a388b69018576d24b59331fd60aab0c.png`,
`https://explosivelab.notion.site/Pianificazione-Nerdz-Ng-pubblico-1bc826ecc0994dd8915be97fc3489cde?pvs=74`,
`http://ece252-2.uwaterloo.ca:2540/image?q=gAAAAABdHkoqb9ZaJ3q4dlzEvTgG9WYwKcD9Aw7OUXeFicO-5M5IdNDjHBpKw7KBK3nCVqtuga4yzUaFEpJn8BqA1LzZprIJBw==`,
}
return utils.Validate(r, tps, fps)
}
+22
View File
@@ -0,0 +1,22 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Intercom() *config.Rule {
// define rule
r := config.Rule{
Description: "Identified an Intercom API Token, which could compromise customer communication channels and data privacy.",
RuleID: "intercom-api-key",
Regex: utils.GenerateSemiGenericRegex([]string{"intercom"}, utils.AlphaNumericExtended("60"), true),
Keywords: []string{"intercom"},
}
// validate
tps := utils.GenerateSampleSecrets("intercom", secrets.NewSecret(utils.AlphaNumericExtended("60")))
return utils.Validate(r, tps, nil)
}
+31
View File
@@ -0,0 +1,31 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func Intra42ClientSecret() *config.Rule {
// define rule
r := config.Rule{
Description: "Found a Intra42 client secret, which could lead to unauthorized access to the 42School API and sensitive data.",
RuleID: "intra42-client-secret",
Regex: utils.GenerateUniqueTokenRegex(`s-s4t2(?:ud|af)-(?i)[abcdef0123456789]{64}`, false),
Entropy: 3,
Keywords: []string{
"intra",
"s-s4t2ud-",
"s-s4t2af-",
},
}
// validate
tps := []string{
"clientSecret := \"s-s4t2ud-" + secrets.NewSecret(utils.Hex("64")) + "\"",
"clientSecret := \"s-s4t2af-" + secrets.NewSecret(utils.Hex("64")) + "\"",
"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", // gitleaks:allow
"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", // gitleaks:allow
}
return utils.Validate(r, tps, nil)
}
+64
View File
@@ -0,0 +1,64 @@
package rules
import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func JFrogAPIKey() *config.Rule {
keywords := []string{"jfrog", "artifactory", "bintray", "xray"}
// Define Rule
r := config.Rule{
// Human readable description of the rule
Description: "Found a JFrog API Key, posing a risk of unauthorized access to software artifact repositories and build pipelines.",
// Unique ID for the rule
RuleID: "jfrog-api-key",
// Regex capture group for the actual secret
// Regex used for detecting secrets. See regex section below for more details
Regex: utils.GenerateSemiGenericRegex(keywords, utils.AlphaNumeric("73"), true),
// Keywords used for string matching on fragments (think of this as a prefilter)
Keywords: keywords,
}
// validate
tps := []string{
fmt.Sprintf("--set imagePullSecretJfrog.password=%s", secrets.NewSecret(utils.AlphaNumeric("73"))),
}
return utils.Validate(r, tps, nil)
}
func JFrogIdentityToken() *config.Rule {
keywords := []string{"jfrog", "artifactory", "bintray", "xray"}
// Define Rule
r := config.Rule{
// Human readable description of the rule
Description: "Discovered a JFrog Identity Token, potentially compromising access to JFrog services and sensitive software artifacts.",
// Unique ID for the rule
RuleID: "jfrog-identity-token",
// Regex capture group for the actual secret
// Regex used for detecting secrets. See regex section below for more details
Regex: utils.GenerateSemiGenericRegex(keywords, utils.AlphaNumeric("64"), true),
// Keywords used for string matching on fragments (think of this as a prefilter)
Keywords: keywords,
}
// validate
tps := utils.GenerateSampleSecrets("jfrog", secrets.NewSecret(utils.AlphaNumeric("64")))
tps = append(tps, utils.GenerateSampleSecrets("artifactory", secrets.NewSecret(utils.AlphaNumeric("64")))...)
tps = append(tps, utils.GenerateSampleSecrets("bintray", secrets.NewSecret(utils.AlphaNumeric("64")))...)
tps = append(tps, utils.GenerateSampleSecrets("xray", secrets.NewSecret(utils.AlphaNumeric("64")))...)
tps = append(tps, fmt.Sprintf("\"artifactory\", \"%s\"", secrets.NewSecret(utils.AlphaNumeric("64"))))
return utils.Validate(r, tps, nil)
}
Loaded 100 of 1327 files, more files were not shown because too many files have changed in this diff. Show more