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

Create mssql.go #1394

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

Create mssql.go #1394

wants to merge 4 commits into from

Conversation

fhverga
Copy link

@fhverga fhverga commented Apr 18, 2024

Explanation:

MSSQLDatabaseCredentials() is a function that generates the rule for detecting exposure of MSSQL database credentials. The Rule struct contains fields such as Description, RuleID, Regex, and Keywords, which define the rule. The Regex field contains the regular expression used for detecting secrets. In this case, it's looking for occurrences of Password= followed by any characters except ;. The Keywords field is used for string matching on fragments as a pre-filter. validate() function is used to validate the rule against example secrets (tps). You can provide example secrets that match the rule for testing purposes. The validate() function should return the validated rule.

Description:

Explain the purpose of the PR.

Checklist:

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

Explanation:

MSSQLDatabaseCredentials() is a function that generates the rule for detecting exposure of MSSQL database credentials.
The Rule struct contains fields such as Description, RuleID, Regex, and Keywords, which define the rule.
The Regex field contains the regular expression used for detecting secrets. In this case, it's looking for occurrences of Password= followed by any characters except ;.
The Keywords field is used for string matching on fragments as a pre-filter.
validate() function is used to validate the rule against example secrets (tps). You can provide example secrets that match the rule for testing purposes.
The validate() function should return the validated rule.
@fhverga
Copy link
Author

fhverga commented Apr 18, 2024

Hello, I had created a local .yml rule to identify these types of mssql "connection" password exposure. Because originally running gitleaks on pip it was not identified. And when manually reviewing via code-review I caught this type of scenario. With that I made the regex to automate and try to contribute so that if this type of exposure comes again, gitleaks will be able to catch it and alert me.

Below is an example of the manual test.

image

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