forked from gitleaks/gitleaks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from AikidoSec/feat/add-settlemint-token-identi…
…fiers add settlemint identifiers
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package rules | ||
|
||
import ( | ||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets" | ||
"github.com/zricethezav/gitleaks/v8/config" | ||
) | ||
|
||
func SettlemintPersonalAccessToken() *config.Rule { | ||
// define rule | ||
r := config.Rule{ | ||
Description: "Found a Settlemint Personal Access Token.", | ||
RuleID: "settlemint-personal-access-token", | ||
Regex: generateUniqueTokenRegex(`(sm_pat_)[a-zA-Z0-9]+`, false), | ||
Keywords: []string{ | ||
"sm_pat", | ||
}, | ||
} | ||
|
||
// validate | ||
tps := []string{ | ||
generateSampleSecret("settlemintToken", "sm_pat_"+secrets.NewSecret(alphaNumeric("16"))), | ||
} | ||
fps := []string{"nonMatchingToken := \"" + secrets.NewSecret(alphaNumeric("16")) + "\""} | ||
return validate(r, tps, fps) | ||
} | ||
|
||
func SettlemintApplicationAccessToken() *config.Rule { | ||
// define rule | ||
r := config.Rule{ | ||
Description: "Found a Settlemint Application Access Token.", | ||
RuleID: "settlemint-application-access-token", | ||
Regex: generateUniqueTokenRegex(`(sm_aat_)[a-zA-Z0-9]+`, false), | ||
Keywords: []string{ | ||
"sm_aat", | ||
}, | ||
} | ||
|
||
// validate | ||
tps := []string{ | ||
generateSampleSecret("settlemintToken", "sm_aat_"+secrets.NewSecret(alphaNumeric("16"))), | ||
} | ||
fps := []string{"nonMatchingToken := \"" + secrets.NewSecret(alphaNumeric("16")) + "\""} | ||
return validate(r, tps, fps) | ||
} | ||
|
||
func SettlemintServiceAccessToken() *config.Rule { | ||
// define rule | ||
r := config.Rule{ | ||
Description: "Found a Settlemint Service Access Token.", | ||
RuleID: "settlemint-service-access-token", | ||
Regex: generateUniqueTokenRegex(`(sm_sat_)[a-zA-Z0-9]+`, false), | ||
Keywords: []string{ | ||
"sm_sat", | ||
}, | ||
} | ||
|
||
// validate | ||
tps := []string{ | ||
generateSampleSecret("settlemintToken", "sm_sat_"+secrets.NewSecret(alphaNumeric("16"))), | ||
} | ||
fps := []string{"nonMatchingToken := \"" + secrets.NewSecret(alphaNumeric("16")) + "\""} | ||
return validate(r, tps, fps) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters