Skip to content

Add rule for microsoft teams webhooks#918

Closed
maltemorgenstern wants to merge 19 commits intogitleaks:masterfrom
maltemorgenstern:add-microsoft-teams-webhook-rule
Closed

Add rule for microsoft teams webhooks#918
maltemorgenstern wants to merge 19 commits intogitleaks:masterfrom
maltemorgenstern:add-microsoft-teams-webhook-rule

Conversation

@maltemorgenstern
Copy link
Contributor

@maltemorgenstern maltemorgenstern commented Jul 16, 2022

Description:

This MR adds a new rule for Microsoft Teams Webhooks.

The regex is based on the one suggested in #626. The only other information about the URL format I was able to find is from this stackoverflow article.

I confirmed the format locally in our Teams instance and tested the new rule:
$ gitleaks detect --config gitleaks.toml --no-git

Log
{
        "Description": "Microsoft Teams Webhook",
        "StartLine": 2,
        "EndLine": 2,
        "StartColumn": 12,
        "EndColumn": 223,
        "Match": "https://[redacted].webhook.office.com/webhookb2/50koqw9j-e63t-pbul-7rtz-r7hd8jwzhc2l@yj49lqsq-ydkp-xwwv-v0et-6jmvc301riid/IncomingWebhook/aruuzufctr6c5m27tg5ramvhw8jkisdn/v9azwg44-z1m5-9zfl-00rf-1h260d1wnre2",
        "Secret": "https://[redacted].webhook.office.com/webhookb2/50koqw9j-e63t-pbul-7rtz-r7hd8jwzhc2l@yj49lqsq-ydkp-xwwv-v0et-6jmvc301riid/IncomingWebhook/aruuzufctr6c5m27tg5ramvhw8jkisdn/v9azwg44-z1m5-9zfl-00rf-1h260d1wnre2",
        "File": "README.txt",
        "Commit": "",
        "Entropy": 4.68221,
        "Author": "",
        "Email": "",
        "Date": "",
        "Message": "",
        "Tags": [],
        "RuleID": "microsoft-teams-webhook"
}
scan completed in 11.5429ms
leaks found: 1

This closes #626

Checklist:

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

@jit-ci
Copy link

jit-ci bot commented Jul 16, 2022

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

All security workflows are defined in a centralized repository named .jit.
In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@maltemorgenstern
Copy link
Contributor Author

I don't know why the Jit Security checks failed - can you retry them?

@maltemorgenstern
Copy link
Contributor Author

Hey @zricethezav, could you give this PR a review?
Same issue here - the gitleaks (pull_request) job fails. If I should add a gitleaks:allow for this line please let me know 😃

weineran and others added 17 commits August 3, 2022 07:31
* Add sidekiq rules

* Added two new rules for sidekiq
* Other: Add keywords to square rules per Zach's instructions

* Validate now works, but test suite is failing

* Tests are now passing

* Add Sidekiq Rules: Ran go fmt

* * After resolving conflicts, had to rerun the rule generator to add back the semicolon char
* After running tests, had to fix one line in testdata/expected/report/sarif_simple.sarif

* * Added keywords to simple.toml for sidekiq-sensitive-url so that the rule matches what is in gitleaks.toml

Co-authored-by: Andrew Weiner <aweiner@frontrush.com>
* add new rules for vault tokens

* Configure max length for vault rules
* gitleaks allow docs

* reorder
* add jwt support

* ignore sample secrets
* no-git support fingerprint support

* updating gitleaksignore w/ no-git false positives

* fix test
…#954)

* bump gitdiff, add git.Err state, better log messages

* remove cmd.Start

* forgot to start...
* Add grafana tokens rules

* Adding upper bound limits to Grafana tokens
Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

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

❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed below as a comment.
It’s highly recommended that you fix this security issue before merge.

secretPrefixUnique = `\b(`
secretPrefix = `(?:'|\"|\s|=|\x60){0,5}(`
secretSuffix = `)(?:['|\"|\n|\r|\s|\x60]|$)`
secretSuffix = `)(?:['|\"|\n|\r|\s|\x60|;]|$)`
Copy link

Choose a reason for hiding this comment

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

Security control: Static Code Analysis Go

Type: Potential Hardcoded Credentials

Description: Potential hardcoded credentials

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_finding Ignore this specific single instance of finding
  • #jit_undo_ignore Undo ignore command

@maltemorgenstern
Copy link
Contributor Author

Closing this in favour of #970 - the pipeline in this PR does not pass.

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.

Support for Microsoft Webhooks

4 participants