Skip to content

Generic-b64-additions #98

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions generic/auth-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-ssh-auth
type: kubernetes.io/ssh-auth
data:
# the data is abbreviated in this example
ssh-privatekey: |
UG91cmluZzYlRW1vdGljb24lU2N1YmE=
---
apiVersion: v1
kind: Secret
metadata:
name: sample-secret
labels:
findme: "yea"
type: Opaque
data:
# base64 encoded: my super cool \n multiline \ secret
secret.world: bXkgc3VwZXIgY29vbAptdWx0aWxpbmUKc2VjcmV0
9 changes: 8 additions & 1 deletion generic/patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ patterns:
pattern: |
(([A-Za-z0-9+/]){4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)
start: |
(?:\A|[^a-zA-Z0-9])(?i)[a-z0-9._-]*(?:api|auth[a-z]+|jwt|mysql|db)?[_.-]?(?:pass?(?:wo?r?d|code|phrase)|secret|key|token)([_-][a-z0-9]+){0,3}([ \t]+As[ \t]+String)?[\t ]*(={1,3}|:)[\t ]*(?:["']|b["'])?
(?:\A|[^a-zA-Z0-9])(?i)[a-z0-9._-]*(?:api|auth[a-z]+|jwt|mysql|db)?[_.-]?(?:pass?(?:wo?r?d|code|phrase)|secret|key|token)([_\s-.][a-z0-9]+){0,3}([\s]+As[\s]+String)?[\s]*(={1,3}|:)[\s]*\|?[\s]*(?:["']|b["'])?
end: |
(\z|[\r\n'"])
additional_match:
Expand All @@ -119,6 +119,13 @@ patterns:
data: password="AAAAAAAAAAAa00=="
start_offset: 10
end_offset: 26
expected:
- name: auth-secret.yaml
start_offset: 159
end_offset: 160
- name: auth-secret.yaml
start_offset: 381
end_offset: 421
comments:
- "The Base64 must contain numbers, upper case and lower case and be at least 12 characters long"
- "`password`, `secret`, `key`, or password like prefix (fuzzy)"
Expand Down
Loading