@@ -7,54 +7,6 @@ import (
77 "github.com/zricethezav/gitleaks/v8/config"
88)
99
10- func GitHubPat () * config.Rule {
11- // define rule
12- r := config.Rule {
13- Description : "Uncovered a GitHub Personal Access Token, potentially leading to unauthorized repository access and sensitive content exposure." ,
14- RuleID : "github-pat" ,
15- Regex : regexp .MustCompile (`ghp_[0-9a-zA-Z]{36}` ),
16- Keywords : []string {"ghp_" },
17- }
18-
19- // validate
20- tps := []string {
21- generateSampleSecret ("github" , "ghp_" + secrets .NewSecret (alphaNumeric ("36" ))),
22- }
23- return validate (r , tps , nil )
24- }
25-
26- func GitHubFineGrainedPat () * config.Rule {
27- // define rule
28- r := config.Rule {
29- Description : "Found a GitHub Fine-Grained Personal Access Token, risking unauthorized repository access and code manipulation." ,
30- RuleID : "github-fine-grained-pat" ,
31- Regex : regexp .MustCompile (`github_pat_[0-9a-zA-Z_]{82}` ),
32- Keywords : []string {"github_pat_" },
33- }
34-
35- // validate
36- tps := []string {
37- generateSampleSecret ("github" , "github_pat_" + secrets .NewSecret (alphaNumeric ("82" ))),
38- }
39- return validate (r , tps , nil )
40- }
41-
42- func GitHubOauth () * config.Rule {
43- // define rule
44- r := config.Rule {
45- Description : "Discovered a GitHub OAuth Access Token, posing a risk of compromised GitHub account integrations and data leaks." ,
46- RuleID : "github-oauth" ,
47- Regex : regexp .MustCompile (`gho_[0-9a-zA-Z]{36}` ),
48- Keywords : []string {"gho_" },
49- }
50-
51- // validate
52- tps := []string {
53- generateSampleSecret ("github" , "gho_" + secrets .NewSecret (alphaNumeric ("36" ))),
54- }
55- return validate (r , tps , nil )
56- }
57-
5810func GitHubApp () * config.Rule {
5911 // define rule
6012 r := config.Rule {
@@ -71,19 +23,3 @@ func GitHubApp() *config.Rule {
7123 }
7224 return validate (r , tps , nil )
7325}
74-
75- func GitHubRefresh () * config.Rule {
76- // define rule
77- r := config.Rule {
78- Description : "Detected a GitHub Refresh Token, which could allow prolonged unauthorized access to GitHub services." ,
79- RuleID : "github-refresh-token" ,
80- Regex : regexp .MustCompile (`ghr_[0-9a-zA-Z]{36}` ),
81- Keywords : []string {"ghr_" },
82- }
83-
84- // validate
85- tps := []string {
86- generateSampleSecret ("github" , "ghr_" + secrets .NewSecret (alphaNumeric ("36" ))),
87- }
88- return validate (r , tps , nil )
89- }
0 commit comments