{"repo": "betterleaks/betterleaks", "files": {"cmd/generate/config/rules/deepseek.go": {"e8c8ab9e72e96086ae77a2155a60145dd1153d30": {"t": 1785747461.6100295, "n": 1248, "h": "be48db10da6cae4f", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tValidateExpr: `let r = http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + finding[\"secret\"],\n \"Accept\": \"application/json\"\n }); r.status == 200 && (r.body contains '\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : validate.unknown(r)`,\n\t\tFilter: `entropy(finding[\"secret\"]) <= 3.5`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecretWithEntropy(utils.Hex(\"32\"), 3.5))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "6475f3fe49bf893d7713cd501131176a051f8d10": {"t": 1785773427.700759, "n": 1248, "h": "be48db10da6cae4f", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tValidateExpr: `let r = http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + finding[\"secret\"],\n \"Accept\": \"application/json\"\n }); r.status == 200 && (r.body contains '\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : validate.unknown(r)`,\n\t\tFilter: `entropy(finding[\"secret\"]) <= 3.5`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecretWithEntropy(utils.Hex(\"32\"), 3.5))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "e2ae8d541f505d0de045db55b5bc198b0418810e": {"t": 1785773429.17036, "n": 1256, "h": "e99409d20f946981", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tValidateCEL: `cel.bind(r,\n http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + finding[\"secret\"],\n \"Accept\": \"application/json\"\n }),\n r.status == 200 && r.body.contains('\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : validate.unknown(r)\n)`,\n\t\tFilter: `entropy(finding[\"secret\"]) <= 3.5`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecretWithEntropy(utils.Hex(\"32\"), 3.5))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "92cea1164d1cc551ead2402b1257055dd0080016": {"t": 1785773430.3302207, "n": 1247, "h": "79cccfafb2731dea", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tValidateCEL: `cel.bind(r,\n http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + finding[\"secret\"],\n \"Accept\": \"application/json\"\n }),\n r.status == 200 && r.body.contains('\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : unknown(r)\n)`,\n\t\tFilter: `entropy(finding[\"secret\"]) <= 3.5`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecretWithEntropy(utils.Hex(\"32\"), 3.5))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "6506694931741fef3758ec3c2a4822cfc2691c58": {"t": 1785773431.5481184, "n": 1220, "h": "87678225b8e556db", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.5,\n\t\tValidateCEL: `cel.bind(r,\n http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + finding[\"secret\"],\n \"Accept\": \"application/json\"\n }),\n r.status == 200 && r.body.contains('\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : unknown(r)\n)`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecretWithEntropy(utils.Hex(\"32\"), 3.5))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "f12b1475d73691e11444b90ffdb83924d6e4ba51": {"t": 1785773432.7212434, "n": 1209, "h": "c6e3e4832e25926f", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.5,\n\t\tValidateCEL: `cel.bind(r,\n http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + secret,\n \"Accept\": \"application/json\"\n }),\n r.status == 200 && r.body.contains('\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : unknown(r)\n)`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecretWithEntropy(utils.Hex(\"32\"), 3.5))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "eed2e4af8befde2f87cd2aa08cd52da40850f0b6": {"t": 1785773434.7854106, "n": 1193, "h": "181677f9add07889", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.5,\n\t\tValidateCEL: `cel.bind(r,\n http.get(\"https://api.deepseek.com/models\", {\n \"Authorization\": \"Bearer \" + secret,\n \"Accept\": \"application/json\"\n }),\n r.status == 200 && r.body.contains('\"data\"') ? {\n \"result\": \"valid\"\n } : r.status in [401, 403] ? {\n \"result\": \"invalid\",\n \"reason\": \"Unauthorized\"\n } : unknown(r)\n)`,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecret(utils.Hex(\"32\")))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "6b4d1d7367a7cad327ea41de31be85736dd97d8b": {"t": 1785773435.9381068, "n": 1355, "h": "2c69b94e69fd0307", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc deepseekValidation() *config.Validation {\n\treturn &config.Validation{\n\t\tType: config.ValidationTypeHTTP,\n\t\tMethod: \"GET\",\n\t\tURL: \"https://api.deepseek.com/models\",\n\t\tHeaders: map[string]string{\n\t\t\t\"Authorization\": \"Bearer {{ secret }}\",\n\t\t\t\"Accept\": \"application/json\",\n\t\t},\n\t\tMatch: []config.MatchClause{\n\t\t\t{StatusCodes: []int{200}, Words: []string{`\"data\"`}, Result: \"valid\"},\n\t\t\t{StatusCodes: []int{401, 403}, Result: \"invalid\"},\n\t\t},\n\t}\n}\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.5,\n\t\tValidation: deepseekValidation(),\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecret(utils.Hex(\"32\")))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "d03d8730d22e79cb4e374cd6f43e6bc3b9212c91": {"t": 1785773438.321081, "n": 1383, "h": "5d96f4666738c6ab", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc deepseekValidation() *config.Validation {\n\treturn &config.Validation{\n\t\tType: config.ValidationTypeHTTP,\n\t\tMethod: \"GET\",\n\t\tURL: \"https://api.deepseek.com/models\",\n\t\tHeaders: map[string]string{\n\t\t\t\"Authorization\": \"Bearer {{ secret }}\",\n\t\t\t\"Accept\": \"application/json\",\n\t\t},\n\t\tMatch: []config.MatchClause{\n\t\t\t{StatusCodes: []int{200}, Words: []string{`\"data\"`}, Result: \"confirmed\"},\n\t\t\t{StatusCodes: []int{401, 403}, Result: \"invalid\"},\n\t\t\t{Result: \"unknown\"},\n\t\t},\n\t}\n}\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.5,\n\t\tValidation: deepseekValidation(),\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecret(utils.Hex(\"32\")))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "d4bced5855abff5a501170df7bdc3b4c0ee228e0": {"t": 1785773440.5646596, "n": 856, "h": "0677ce7ad794eea8", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.5,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecret(utils.Hex(\"32\")))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}, "9c2864dc41aaa8f35cc8146583fe42f406144cde": {"t": 1785773442.7856991, "n": 856, "h": "fe5d6ca79b9202a3", "c": "package rules\n\nimport (\n\t\"github.com/betterleaks/betterleaks/cmd/generate/config/utils\"\n\t\"github.com/betterleaks/betterleaks/cmd/generate/secrets\"\n\t\"github.com/betterleaks/betterleaks/config\"\n)\n\nfunc DeepSeek() *config.Rule {\n\tr := config.Rule{\n\t\tRuleID: \"deepseek-api-key\",\n\t\tDescription: \"Detected a DeepSeek API Key, which may expose AI model access and associated usage to unauthorized parties.\",\n\t\tRegex: utils.GenerateSemiGenericRegex([]string{\"deepseek\"}, `sk-[a-f0-9]{32}`, true),\n\t\tKeywords: []string{\"deepseek\"},\n\t\tEntropy: 3.7,\n\t}\n\n\ttps := utils.GenerateSampleSecrets(\"deepseek\", \"sk-\"+secrets.NewSecret(utils.Hex(\"32\")))\n\tfps := []string{\n\t\t// Too short\n\t\t`deepseek_key = sk-ba588036180d4d1d9cebbf`,\n\t\t// All zeros (low entropy)\n\t\t`deepseek_key = sk-00000000000000000000000000000000`,\n\t}\n\treturn utils.Validate(r, tps, fps)\n}\n"}}}}