Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generic support special character #1371

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

baruchiro
Copy link
Contributor

@baruchiro baruchiro commented Mar 13, 2024

Description:

I added examples of generic tokens that include @![].

Generic API Key supports any non-space character.

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

@baruchiro baruchiro changed the title fix: generic support at character fix: generic support special character Mar 13, 2024
Baruch Odem and others added 19 commits March 28, 2024 15:55
### Description:
- Added generic API key inside an XML element:
`<password>edf8f16608465858a6c9e3cccb97d3c2</password>`
- Added True-Positives and False-Positives to the Generic API Key rule

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1265
### Description:
> since this part is enclosed in `[]`, the pipes aren't necessary.

_Originally posted by @rgmz in
gitleaks#1265 (comment)

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1266
### Description:
I have a code sample when someone writting a hard-coded JSON as string,
and it looks like this:
```java
var json = "{ \"access-key\": \"access key here\" }"
```

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1267
I found some rules that returns the value ended with `"`. This happened
because missing `secretGroup` value.

It is an _hot fix_.

For the future, I think we need:
1. Refactor the `validate` function or create another suite of tests
with declaration of the expected found secret.
1. Fix the suffix regex to not include the `"`, because even with my
change, it only fixes the `Secret` but not the `Match`

Original: gitleaks#1350
### Description:
Sometimes the tp of Scalingo is failing during the Github Actions
workflow and after re-triggering it passed. I think the problem was when
the generated example secret was ended with `-`, and combined with the
`Regex` that expect for a word boundary `\b`, it was failed.

I think in any way it is better to use the common
`generateUniqueTokenRegex` instead of wrapping the regex with `\b`.

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1359
### Description:
I fixes few issues (gitleaks#1049, gitleaks#1324, gitleaks#1337) and added a rule for AWS Secret
Key.

I renamed the `AWS()` function name to `AWSAccessKey()`, and changed the
`RuleID` too, which may lead to breaking changes ⚠️.

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1356
### Description:
[PuTTY](https://www.putty.org/) is a common SSH and telnet client for
Windows. It installed with a "PuTTY Key Generator, which is generating a
regular private/public keys, but saves them in a different format.

To support this, I added support for apply the `AllowList.Regexes` on
the `fragment.Raw` content.

I also added a `validateFragment` to validate a rule that accept the
`Path` field.

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1373
### Description:
I just generated keys from Stripe and adjusted the rule.

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1375
### Description:
Added rules for real (revoked) cloudflare secrets

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1374
### Description:
To add this rule I took examples from the official Hashicorp
documentation, but now I used this rule and it find too generic cases
such as `const TagPassword = "password"`.

Using the `Entropy` field is a balance between true/false positives,
since with `3.5` it will ignore almost all passwords less then 10
characters length.

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1358
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant