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