瀏覽代碼

adding some more defaults

zach rice 7 年之前
父節點
當前提交
9554258d02
共有 2 個文件被更改,包括 25 次插入21 次删除
  1. 1 5
      github.go
  2. 24 16
      main.go

+ 1 - 5
github.go

@@ -143,12 +143,8 @@ func auditGithubRepos() ([]Leak, error) {
 			}
 		}
 	}
-	if err != nil {
-		return nil, err
-	}
 	if opts.Disk {
-		ownerDir, err = ioutil.TempDir(dir, opts.GithubUser)
-		os.RemoveAll(ownerDir)
+		ownerDir, _ = ioutil.TempDir(dir, opts.GithubUser)
 	}
 	for _, githubRepo := range githubRepos {
 		repo, err := cloneGithubRepo(githubRepo)

+ 24 - 16
main.go

@@ -145,53 +145,61 @@ const defaultConfig = `
 # is set, gitleaks will load configurations from that path. If option --config-path is set, gitleaks will load
 # configurations from that path. Gitleaks does not whitelist anything by default.
 
-
 title = "gitleaks config"
 # add regexes to the regex table
 [[regexes]]
 description = "AWS"
 regex = '''AKIA[0-9A-Z]{16}'''
 [[regexes]]
-description = "RKCS8"
+description = "PKCS8"
 regex = '''-----BEGIN PRIVATE KEY-----'''
 [[regexes]]
 description = "RSA"
 regex = '''-----BEGIN RSA PRIVATE KEY-----'''
 [[regexes]]
-description = "Github"
-regex = '''(?i)github.*['\"][0-9a-zA-Z]{35,40}['\"]'''
-[[regexes]]
 description = "SSH"
 regex = '''-----BEGIN OPENSSH PRIVATE KEY-----'''
 [[regexes]]
+description = "PGP"
+regex = '''-----BEGIN PGP PRIVATE KEY BLOCK-----'''
+[[regexes]]
 description = "Facebook"
 regex = '''(?i)facebook.*['\"][0-9a-f]{32}['\"]'''
 [[regexes]]
 description = "Twitter"
 regex = '''(?i)twitter.*['\"][0-9a-zA-Z]{35,44}['\"]'''
+[[regexes]]
+description = "Github"
+regex = '''(?i)github.*['\"][0-9a-zA-Z]{35,40}['\"]'''
+[[regexes]]
+description = "Slack"
+regex = '''xoxo[bapr]-.*'''
+[[regexes]]
+description = "Telegram"
+regex = '''\d{5,}:A[a-zA-Z0-9_\-]{34,34}'''
 
 [whitelist]
-#regexes = [
-#  "AKAIMYFAKEAWKKEY",
-#]
-
-#files = [
-#  "(.*?)(jpg|gif|doc|pdf|bin)$"
-#]
-
+regexes = [
+  '''(?i)github.*ref.*['\"][0-9a-fA-F]{35,40}['\"]''',
+  '''(?i)shasum.*['\"][0-9a-fA-F]{40}['\"]''',
+  '''(?i)githead.*['\"][0-9a-fA-F]{40}['\"]''',
+  '''(?i)email_hash.*['\"][0-9a-fA-F]{40}['\"]''',
+  '''(?i)email_hash.*['\"][0-9a-fA-F]{32}['\"]''',
+  '''(?i)rev.*:.*['\"][0-9a-fA-F]{40}['\"]''',
+]
+files = [
+  "(.*?)(jpg|gif|doc|pdf|bin)$"
+]
 #commits = [
 #  "BADHA5H1",
 #  "BADHA5H2",
 #]
-
 #branches = [
 #	"dev/goodrepo"
 #]
-
 #repos = [
 #	"mygoodrepo"
 #]
-
 [misc]
 #entropy = [
 #	"3.3-4.30"