mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 11:44:23 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6748a89bf4 | ||
|
|
6f6e057042 |
No files matched your search
@@ -369,8 +369,7 @@ class CustomClass:
|
||||
```
|
||||
|
||||
#### .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/zricethezav/gitleaks/blob/master/.gitleaksignore) for an example.
|
||||
|
||||
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/zricethezav/gitleaks/blob/master/.gitleaksignore) for an example. Note: this feature is expirmental and is subject to change in the future.
|
||||
|
||||
|
||||
## Secured by Jit
|
||||
|
||||
+16
-2
@@ -71,8 +71,7 @@ func runDetect(cmd *cobra.Command, args []string) {
|
||||
log.Fatal().Err(err)
|
||||
}
|
||||
|
||||
// check for a .gitleaksignore file
|
||||
if info, err := os.Stat(filepath.Join(source, ".gitleaksignore")); !os.IsNotExist(err) && !info.IsDir() {
|
||||
if fileExists(filepath.Join(source, ".gitleaksignore")) {
|
||||
detector.AddGitleaksIgnore(filepath.Join(source, ".gitleaksignore"))
|
||||
}
|
||||
|
||||
@@ -131,3 +130,18 @@ func runDetect(cmd *cobra.Command, args []string) {
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
}
|
||||
|
||||
func fileExists(fileName string) bool {
|
||||
// check for a .gitleaksignore file
|
||||
info, err := os.Stat(fileName)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
|
||||
if info != nil && err == nil {
|
||||
if !info.IsDir() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in new issue
Block a user