mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
Add pre-commit support (#552)
* Add pre-commit support * Update README.md
This commit is contained in:
1 parent
12d276acd7
commit
e7553b0168
2 files changed
+18
-1
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
- id: gitleaks
|
||||||
|
name: Detect hardcoded secrets
|
||||||
|
description: Detect hardcoded secrets using Gitleaks
|
||||||
|
entry: gitleaks
|
||||||
|
language: golang
|
||||||
@@ -24,7 +24,7 @@ Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys
|
|||||||
|
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases).
|
Gitleaks can be installed using Homebrew, Docker, or Go. Gitleaks is also available in binary form for many popular platforms and OS types on the [releases page](https://github.com/zricethezav/gitleaks/releases). In addition, Gitleaks can be implemented as a pre-commit hook directly in your repo.
|
||||||
|
|
||||||
##### MacOS
|
##### MacOS
|
||||||
|
|
||||||
@@ -42,6 +42,18 @@ docker pull zricethezav/gitleaks
|
|||||||
```bash
|
```bash
|
||||||
GO111MODULE=on go get github.com/zricethezav/gitleaks/v7
|
GO111MODULE=on go get github.com/zricethezav/gitleaks/v7
|
||||||
```
|
```
|
||||||
|
##### As a pre-commit hook
|
||||||
|
|
||||||
|
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions.
|
||||||
|
|
||||||
|
Sample `.pre-commit-config.yaml`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- repo: https://github.com/zricethezav/gitleaks
|
||||||
|
rev: v7.4.0
|
||||||
|
hooks:
|
||||||
|
- id: gitleaks
|
||||||
|
```
|
||||||
|
|
||||||
### Usage and Options
|
### Usage and Options
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in new issue
Block a user