@@ -60,35 +60,35 @@ func NewRuleFilter(action bool, ruleIDs ...string) RuleFilter {
60
60
func Generate (filters ... RuleFilter ) RuleList {
61
61
rules := map [string ]RuleDefinition {
62
62
// misc
63
- "G101" : RuleDefinition {"Look for hardcoded credentials" , NewHardcodedCredentials },
64
- "G102" : RuleDefinition {"Bind to all interfaces" , NewBindsToAllNetworkInterfaces },
65
- "G103" : RuleDefinition {"Audit the use of unsafe block" , NewUsingUnsafe },
66
- "G104" : RuleDefinition {"Audit errors not checked" , NewNoErrorCheck },
67
- "G105" : RuleDefinition {"Audit the use of big.Exp function" , NewUsingBigExp },
68
- "G106" : RuleDefinition {"Audit the use of ssh.InsecureIgnoreHostKey function" , NewSSHHostKey },
63
+ "G101" : {"Look for hardcoded credentials" , NewHardcodedCredentials },
64
+ "G102" : {"Bind to all interfaces" , NewBindsToAllNetworkInterfaces },
65
+ "G103" : {"Audit the use of unsafe block" , NewUsingUnsafe },
66
+ "G104" : {"Audit errors not checked" , NewNoErrorCheck },
67
+ "G105" : {"Audit the use of big.Exp function" , NewUsingBigExp },
68
+ "G106" : {"Audit the use of ssh.InsecureIgnoreHostKey function" , NewSSHHostKey },
69
69
70
70
// injection
71
- "G201" : RuleDefinition {"SQL query construction using format string" , NewSQLStrFormat },
72
- "G202" : RuleDefinition {"SQL query construction using string concatenation" , NewSQLStrConcat },
73
- "G203" : RuleDefinition {"Use of unescaped data in HTML templates" , NewTemplateCheck },
74
- "G204" : RuleDefinition {"Audit use of command execution" , NewSubproc },
71
+ "G201" : {"SQL query construction using format string" , NewSQLStrFormat },
72
+ "G202" : {"SQL query construction using string concatenation" , NewSQLStrConcat },
73
+ "G203" : {"Use of unescaped data in HTML templates" , NewTemplateCheck },
74
+ "G204" : {"Audit use of command execution" , NewSubproc },
75
75
76
76
// filesystem
77
- "G301" : RuleDefinition {"Poor file permissions used when creating a directory" , NewMkdirPerms },
78
- "G302" : RuleDefinition {"Poor file permisions used when creation file or using chmod" , NewFilePerms },
79
- "G303" : RuleDefinition {"Creating tempfile using a predictable path" , NewBadTempFile },
77
+ "G301" : {"Poor file permissions used when creating a directory" , NewMkdirPerms },
78
+ "G302" : {"Poor file permisions used when creation file or using chmod" , NewFilePerms },
79
+ "G303" : {"Creating tempfile using a predictable path" , NewBadTempFile },
80
80
81
81
// crypto
82
- "G401" : RuleDefinition {"Detect the usage of DES, RC4, or MD5" , NewUsesWeakCryptography },
83
- "G402" : RuleDefinition {"Look for bad TLS connection settings" , NewIntermediateTLSCheck },
84
- "G403" : RuleDefinition {"Ensure minimum RSA key length of 2048 bits" , NewWeakKeyStrength },
85
- "G404" : RuleDefinition {"Insecure random number source (rand)" , NewWeakRandCheck },
82
+ "G401" : {"Detect the usage of DES, RC4, or MD5" , NewUsesWeakCryptography },
83
+ "G402" : {"Look for bad TLS connection settings" , NewIntermediateTLSCheck },
84
+ "G403" : {"Ensure minimum RSA key length of 2048 bits" , NewWeakKeyStrength },
85
+ "G404" : {"Insecure random number source (rand)" , NewWeakRandCheck },
86
86
87
87
// blacklist
88
- "G501" : RuleDefinition {"Import blacklist: crypto/md5" , NewBlacklistedImportMD5 },
89
- "G502" : RuleDefinition {"Import blacklist: crypto/des" , NewBlacklistedImportDES },
90
- "G503" : RuleDefinition {"Import blacklist: crypto/rc4" , NewBlacklistedImportRC4 },
91
- "G504" : RuleDefinition {"Import blacklist: net/http/cgi" , NewBlacklistedImportCGI },
88
+ "G501" : {"Import blacklist: crypto/md5" , NewBlacklistedImportMD5 },
89
+ "G502" : {"Import blacklist: crypto/des" , NewBlacklistedImportDES },
90
+ "G503" : {"Import blacklist: crypto/rc4" , NewBlacklistedImportRC4 },
91
+ "G504" : {"Import blacklist: net/http/cgi" , NewBlacklistedImportCGI },
92
92
}
93
93
94
94
for rule := range rules {
0 commit comments