Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Slack token detector#122

Merged
KevinHock merged 2 commits into
Yelp:masterfrom
killuazhu:slack
Feb 1, 2019
Merged

Add Slack token detector#122
KevinHock merged 2 commits into
Yelp:masterfrom
killuazhu:slack

Conversation

@killuazhu
Copy link
Copy Markdown
Contributor

@killuazhu killuazhu commented Feb 1, 2019

Add Slack token detector.

CC @jribm

Add Slack token detector
Copy link
Copy Markdown
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

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

Awesome stuff! 🚢

class SlackDetector(RegexBasedDetector):
secret_type = 'Slack Token'
blacklist = (
re.compile(r'xox(?:a|b|p|o|s|r)-(?:\d+-)+[a-z0-9]+', flags=re.IGNORECASE),
Copy link
Copy Markdown
Collaborator

@KevinHock KevinHock Feb 1, 2019

Choose a reason for hiding this comment

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

Super nit: We could add length ranges but I couldn't find out how much they vary, e.g. the last field might not be more than 32 chars. I rather we lean towards false-positives and iterate though, i.e. ship as-is 👍 (not that I think there will be any false-positives, since xox is sort of rare)

cc @dxa4481, in case you want to compare with your truffleHogRegex

Comment thread detect_secrets/core/usage.py Outdated
PluginDescriptor(
classname='SlackDetector',
disable_flag_text='--no-slack-scan',
disable_help_text='Disables scanning for secret slack.',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: Maybe Disables scanning for Slack tokens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in the latest commit 2dd3ef8

@KevinHock KevinHock merged commit 4a05700 into Yelp:master Feb 1, 2019
KevinHock added a commit that referenced this pull request Feb 1, 2019
jfagoagas pushed a commit to jfagoagas/detect-secrets that referenced this pull request Mar 14, 2026
Sign container images with cosign
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.

3 participants