* gitlab pats may contain underscores as well as dashes
* include testdata index binary
Co-authored-by: Greg Johnson (codeEmitter) <gjohnson@gitlab.com>
Regexps for default Twitter rules ("Twitter Secret Key" and "Twitter Client
ID") have a small flaw that make the default configuration vulnerable to
some false-positives.
I believe these rules should detect the cases like (SOME_CLIENT_ID should
be longer):
```
"twitter_client_id": "SOME_CLIENT_ID"
```
However, currently the twitter rules also detect the false positives for the
cases like:
```
someObj := twitter.NewObjectWithALongName()
config.Twitter.DomainAccessToken
```
I'm trying to address this issue the similar way it's done for facebook client
ids and AWS secret keys, where the secret is expected to be quoted.
* Pass the entropy data back to the Leak struct
Do this to make it easier to tune entropy checks and make decisions in
systems consuming the output.
~ B'ezrat Hashem ~
* Return negative number when entropy not checked
That way you can tell the difference between not checking or an
actual entropy level of 0
~ B'ezrat Hashem ~
* Make sure to handle range checks properly
Make sure to show when something had an entropy returned but was outside
range, or didn't have a hit at all, etc...
~ B'zrat Hashem ~
* Add a few doc strings
Follow the project's conventiona add a comment above the methods
~ B'ezrat Hashem ~
* Update tests and get them to pass
~ B'ezrat Hashem ~
* Remove checked in `.got` files
~ B'ezrat Hashem ~
* Add `*.got` to the `.gitignore`
Make sure the test output files aren't checked-in
~ B'ezrat Hashem ~
Why:
* There are times where it would be nice to have a group from the regex
reported rather than the complete match.
This change addresses the need by:
* Add the reportGroup configuration option for a rule.
* Update scan.CheckRules to return the reportGroup if set.
Co-authored-by: Daniel Paul Searles <dsearles@gitlab.com>
* work in progress
* Update test configs
* adding test
* golint and change to allowlist
* fix race condition, this mistakenly got committed
* Updating tests and examples
* bump to v6 as this is a breaking change to the config
* More consistent variables
* Init refactor
* think i got it working
* we got em
* Updating tests
* fixing tests
* Better comments, more test fixing
* Bumping to v5
* Fixing golint messages
* Replacing usage of audit with scan in comments
* bumping go-git
* Updating to v5 in some other spots