@@ -11,11 +11,11 @@ import (
11
11
// https://curl.se/docs/manpage.html#-u
12
12
func CurlBasicAuth () * config.Rule {
13
13
r := config.Rule {
14
- RuleID : "curl-auth-user" ,
15
- // TODO: Description: "",
16
- Regex : regexp .MustCompile (`\bcurl\b(?:.*|.*(?:[\r\n]{1,2}.*){1,5})[ \t\n\r](?:-u|--user)(?:=|[ \t]{0,5})(?:"([^:"]{3,}:[^"]{3,})"|'([^:']{3,}:[^']{3,})'|((?:"[^"]{3,}"|'[^']{3,}'|[\w$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[\w${}@.-]+)))(?:\s|\z)` ),
17
- Keywords : []string {"curl" },
18
- Entropy : 2 ,
14
+ RuleID : "curl-auth-user" ,
15
+ Description : "Discovered a potential basic authorization token provided in a curl command, which could compromise the curl accessed resource. " ,
16
+ Regex : regexp .MustCompile (`\bcurl\b(?:.*|.*(?:[\r\n]{1,2}.*){1,5})[ \t\n\r](?:-u|--user)(?:=|[ \t]{0,5})(?:"([^:"]{3,}:[^"]{3,})"|'([^:']{3,}:[^']{3,})'|((?:"[^"]{3,}"|'[^']{3,}'|[\w$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[\w${}@.-]+)))(?:\s|\z)` ),
17
+ Keywords : []string {"curl" },
18
+ Entropy : 2 ,
19
19
Allowlists : []config.Allowlist {
20
20
{
21
21
Regexes : []* regexp.Regexp {
@@ -99,8 +99,8 @@ func CurlHeaderAuth() *config.Rule {
99
99
// language=regexp
100
100
authPat := `(?i)(?:Authorization:[ \t]{0,5}(?:Basic[ \t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \t]([\w=~@.+/-]{8,})|([\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \t]{0,5}([\w=~@.+/-]{8,}))`
101
101
r := config.Rule {
102
- RuleID : "curl-auth-header" ,
103
- // TODO: Description: "",
102
+ RuleID : "curl-auth-header" ,
103
+ Description : "Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource. " ,
104
104
Regex : regexp .MustCompile (
105
105
// language=regexp
106
106
fmt .Sprintf (`\bcurl\b(?:.*?|.*?(?:[\r\n]{1,2}.*?){1,5})[ \t\n\r](?:-H|--header)(?:=|[ \t]{0,5})(?:"%s"|'%s')(?:\B|\s|\z)` , authPat , authPat )),
0 commit comments