Skip to content

Commit 41cd15c

Browse files
committed
Updated test cases for new vendor patterns
1 parent 58f9111 commit 41cd15c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

vendors/patterns.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,10 @@ patterns:
788788
(?i)(Ocp-Apim-Subscription-Key: |Ocp-Apim-Subscription-Key=|OcpApimSubscriptionKey=|Subscription-Key=)
789789
end: |
790790
\z|[^A-Za-z0-9/+=]
791+
test:
792+
data: |
793+
Ocp-Apim-Subscription-Key=0123456789abcdef0123456789abcdef
794+
start_offset: 26
791795
comments:
792796
- "This is an imprecise detection for Azure keys that does not identify which Azure service the key is for."
793797
- "The key lacks internal identifiable features, which are used in modern keys issued by these Azure services."
@@ -797,16 +801,15 @@ patterns:
797801
description: AWS Bedrock API Key - automatic username
798802
regex:
799803
pattern: |
800-
ABSKQmVkcm9ja0FQSUtleS[A-Za-z0-9+/]{2}([A-Za-z0-9+/]{4})+([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)
804+
ABSKQmVkcm9ja0FQSUtleS[A-Za-z0-9+/]{2}([A-Za-z0-9+/]{4})+([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?
801805
start: |
802806
\A|[^A-Za-z0-9/+]
803807
end: |
804808
\z|[^A-Za-z0-9/+=]
805809
test:
806810
data: |
807-
BedrockApiKey=ABSKQmVkcm9ja0FQSUtleSabcdEFGHijklMNOPqrstUVWXyz0123456789ABCD
811+
BedrockApiKey=ABSKQmVkcm9ja0FQSUtleSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
808812
start_offset: 14
809-
end_offset: 76
810813
comments:
811814
- "AWS Bedrock API Keys start with the prefix 'ABSKQmVkcm9ja0FQSUtleS' followed by a base64-encoded string."
812815
- "Matches AWS Bedrock keys that have an auto-generated 'BedrockAPIKey-' username."
@@ -816,7 +819,7 @@ patterns:
816819
description: AWS Bedrock API Key - manual username
817820
regex:
818821
pattern: |
819-
ABSK([A-Za-z0-9+/]{4}){26,}([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)
822+
ABSK([A-Za-z0-9+/]{4}){26,}([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?
820823
start: |
821824
\A|[^A-Za-z0-9/+]
822825
end: |
@@ -825,9 +828,8 @@ patterns:
825828
- ^ABSKQmVkcm9ja0FQSUtleS
826829
test:
827830
data: |
828-
bedrock_api_key = "ABSKQmVkcm9ja0FQSUtleSabcdEFGHijklMNOPqrstUVWXyz0123456789ABCD"
829-
start_offset: 19
830-
end_offset: 81
831+
bedrock_api_key: ABSKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
832+
start_offset: 17
831833
comments:
832834
- "AWS Bedrock API Keys start with the prefix 'ABSK' followed by a base64-encoded string."
833835
- "This rule matches an alternative format of AWS Bedrock API Keys that do not have the auto-generated 'BedrockAPIKey-' username."

0 commit comments

Comments
 (0)