Skip to content

Conversation

StephenHogg
Copy link

@StephenHogg StephenHogg commented Nov 16, 2023

Description:

Closes #539 - adds Azure rules

Checklist:

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

Comment on lines +39 to +57
func AzureStorageCredential86char() *config.Rule {
// define rule
r := config.Rule{
Description: "CSCAN0030, CSCAN0090, CSCAN0150 - Found Azure storage credential in source code file.",
RuleID: "azure-storage-credential-86char",
SecretGroup: 1,
Regex: generateUniqueTokenRegex(`[ \t]{0,10}[a-zA-Z0-9/+]{86}==`, true),
Keywords: []string{"=="},
}

// validate
tps := []string{
generateSampleSecret("azure-storage-credential-86char",
secrets.NewSecret(alphaNumeric("86")+"==")),
}
return validate(r, tps, nil)
}

func AzureStorageCredential43char() *config.Rule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested both these out and they're far too noisy as-is. I'm not sure how they can be improved beyond adding a prefix for "accountkey", though that may overlap with an existing pattern.

@StephenHogg
Copy link
Author

StephenHogg commented Nov 17, 2023 via email

@baruchiro baruchiro mentioned this pull request Feb 28, 2024
3 tasks
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.

Gitleaks misses quite a few Azure rules.
2 participants