Skip to content

Commit

Permalink
Catches artifactory secrets after colon
Browse files Browse the repository at this point in the history
Follow up of #157. Adds feature to catch an artifactory secret after a colon, such as in a yaml file context.
  • Loading branch information
justineyster committed Apr 18, 2019
1 parent f2b06c3 commit 8713993
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detect_secrets/plugins/artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ArtifactoryDetector(RegexBasedDetector):

blacklist = [
# artifactory tokens begin with AKC
re.compile(r'(\s|=|"|^)AKC\w{10,}'), # api token
re.compile(r'(\s|=|:|"|^)AKC\w{10,}'), # api token
# artifactory encrypted passwords begin with AP6
re.compile(r'(\s|=|"|^)AP6\w{10,}'), # password
re.compile(r'(\s|=|:|"|^)AP6\w{10,}'), # password
]
2 changes: 2 additions & 0 deletions tests/plugins/artifactory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class TestArtifactoryDetector(object):
('=AKCxxxxxxxxxx', True),
('\"AP6xxxxxxxxxx\"', True),
('\"AKCxxxxxxxxxx\"', True),
('artif-key:AP6xxxxxxxxxx', True),
('artif-key:AKCxxxxxxxxxx', True),
('X-JFrog-Art-Api: AKCxxxxxxxxxx', True),
('X-JFrog-Art-Api: AP6xxxxxxxxxx', True),
('artifactoryx:_password=AKCxxxxxxxxxx', True),
Expand Down

0 comments on commit 8713993

Please sign in to comment.