implement new openai regex pattern (#1780)

* implement new openai regex pattern

* implement key in config generation

* support admin keys, support 58 char length keys

* add examples to tp slice
This commit is contained in:
Tomás Ralph authored and GitHub committed 2025-03-27 17:48:57 -05:00
1 parent 9708e65c25
commit ddcc75371f
2 files changed
+16 -3

No files matched your search

+1 -1
View File
@@ -2626,7 +2626,7 @@ keywords = ["okta"]
[[rules]]
id = "openai-api-key"
description = "Found an OpenAI API Key, posing a risk of unauthorized access to AI services and data manipulation."
regex = '''\b(sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\x60'"\s;]|\\[nr]|$)'''
regex = '''\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\x60'"\s;]|\\[nr]|$)'''
entropy = 3
keywords = ["t3blbkfj"]