Skip to content

Commit

Permalink
softreset
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek committed Jun 28, 2024
1 parent aa2888f commit ce67e8b
Show file tree
Hide file tree
Showing 28 changed files with 951 additions and 161 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
- name: Checkout CredData
uses: actions/checkout@v4
with:
repository: Samsung/CredData
repository: babenek/CredData
ref: auxiliary

- name: Markup hashing
run: |
Expand Down Expand Up @@ -72,7 +73,8 @@ jobs:
- name: Checkout CredData
uses: actions/checkout@v4
with:
repository: Samsung/CredData
repository: babenek/CredData
ref: auxiliary

- name: Markup hashing
run: |
Expand Down Expand Up @@ -174,7 +176,8 @@ jobs:
- name: Checkout CredData
uses: actions/checkout@v4
with:
repository: Samsung/CredData
repository: babenek/CredData
ref: auxiliary

- name: Markup hashing
run: |
Expand Down Expand Up @@ -355,7 +358,8 @@ jobs:
- name: Checkout CredData
uses: actions/checkout@v4
with:
repository: Samsung/CredData
repository: babenek/CredData
ref: auxiliary

- name: Markup hashing
run: |
Expand Down
8 changes: 4 additions & 4 deletions credsweeper/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class KeywordPattern:
# Authentication scheme ( oauth | basic | bearer | apikey ) precedes to credential
separator = r"\s*\]?\s*" \
r"(?P<separator>:( [a-z]{3,9}[?]? )?=" \
r"|:( oauth | basic | bearer | apikey | accesskey )?" \
r"|=>|!=|===|==|=)" \
r"|:|=>|!=|===|==|=)" \
r"([ \"']{1,8}(oauth|basic|bearer|apikey|accesskey) )?" \
r"((?!\s*ENC(\(|\[))(\s|\w)*\((\s|\w|=|\()*|\s*)"
value = r"(?P<value_leftquote>((b|r|br|rb|u|f|rf|fr|\\)?[`'\"])+)?" \
value = r"(?P<value_leftquote>((b|r|br|rb|u|f|rf|fr|\\{0,8})?[`'\"]){1,3})?" \
r"(?P<value>(?:\{[^}]{3,8000}\})|(?:<[^>]{3,8000}>)|" \
r"(?(value_leftquote)(?:\\[tnrux0-7][0-9a-f]*|[^`'\"\\])|(?:\\n|\\r|\\?[^\s`'\"\\])){3,8000})" \
r"(?P<value_rightquote>(\\?[`'\"])+)?"
r"(?(value_leftquote)(?P<value_rightquote>(\\{0,8}[`'\"]){1,3})?)"

@classmethod
def get_keyword_pattern(cls, keyword: str) -> re.Pattern:
Expand Down
16 changes: 9 additions & 7 deletions credsweeper/common/keyword_checklist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from functools import cached_property
from typing import Set
from typing import Set, List

from credsweeper.app import APP_PATH

Expand All @@ -13,21 +13,23 @@ class KeywordChecklist:

def __init__(self) -> None:
# used suggested text read style. split() is preferred because it strips 0x0A on end the file
self.__keyword_list = self.KEYWORD_PATH.read_text().split()
self.__keyword_list.sort(key=lambda x: len(x), reverse=True)
self.__keyword_set = set(self.KEYWORD_PATH.read_text().split())
# The list of morphemes can be combined to form words.
# The value is considered a variable if at least two exist.
self.__morpheme_set = set(self.MORPHEME_PATH.read_text().split())

@cached_property
def keyword_set(self) -> Set[str]:
"""Get set with keywords.
Return:
Set of strings
"""
"""Get set with keywords"""
return self.__keyword_set

@cached_property
def keyword_list(self) -> List[str]:
"""Get list with keywords in descended order of length"""
return self.__keyword_list

@cached_property
def keyword_len(self) -> int:
"""Length of keyword_set"""
Expand Down
22 changes: 20 additions & 2 deletions credsweeper/common/keyword_checklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ animation
another
anony
apache
api
appearance
apple
application
Expand Down Expand Up @@ -102,6 +103,7 @@ border
bottle
bottom
bound
brain
branch
brand
break
Expand Down Expand Up @@ -200,6 +202,7 @@ continue
control
convenience
convert
copy
cookie
coordinator
corner
Expand Down Expand Up @@ -285,6 +288,7 @@ editing
editor
effect
either
elastic
element
email
empty
Expand All @@ -297,7 +301,7 @@ ensure
entity
entries
entry
environ
environment
equal
equals
erase
Expand Down Expand Up @@ -331,6 +335,7 @@ feedback
fetch
field
figure
file
files
filename
filter
Expand Down Expand Up @@ -533,6 +538,7 @@ notice
notification
null
number
oauth
object
oblique
observe
Expand Down Expand Up @@ -581,6 +587,7 @@ patch
paths
pattern
pause
peer
payload
payment
pending
Expand All @@ -602,6 +609,7 @@ plain
platform
player
point
pool
policy
portal
portfolio
Expand Down Expand Up @@ -754,6 +762,11 @@ session
setting
setter
setup
sha256
sha1
sha2
sha224
sha512
shadow
shallow
shape
Expand All @@ -765,6 +778,7 @@ showing
shown
shutdown
sidebar
signature
sign
similar
simple
Expand All @@ -786,6 +800,7 @@ solid
sorted
source
space
spaces
spacing
spark
speak
Expand Down Expand Up @@ -845,7 +860,7 @@ tablet
target
tasks
teacher
teams
team
temp
terms
test
Expand Down Expand Up @@ -932,13 +947,15 @@ warning
watch
waves
weight
whatever
where
whether
which
while
white
width
window
with
within
without
world
Expand All @@ -949,6 +966,7 @@ written
xxxxx
yellow
yield
your
zeros
.json
.xml
Loading

0 comments on commit ce67e8b

Please sign in to comment.