added more rules

This commit is contained in:
Mick Grove 2026-03-29 00:03:58 -07:00
commit a28250be19
8 changed files with 462 additions and 0 deletions

35
NOTICE
View file

@ -78,3 +78,38 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--------------------------------------------------------------------
Certain detection rules:
* crates/kingfisher-rules/data/rules/octopusdeploy.yml
* crates/kingfisher-rules/data/rules/openshift.yml
* crates/kingfisher-rules/data/rules/polymarket.yml
* crates/kingfisher-rules/data/rules/privateai.yml
* crates/kingfisher-rules/data/rules/settlemint.yml
* crates/kingfisher-rules/data/rules/sidekiq.yml
are derived in part from Betterleaks
(https://github.com/betterleaks/betterleaks), which is licensed under the MIT
License.
Betterleaks
Copyright (c) 2026 Zachary Rice
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,66 @@
rules:
- name: Octopus Deploy Server URL
id: kingfisher.octopusdeploy.1
pattern: |
(?xi)
(?:
\boctopus(?:[_\s.-]?deploy)?(?:[_\s.-]?(?:url|server|host))?\b
(?:.|[\n\r]){0,32}?
[:=]
|
\boctopus(?:url|server|host)\b
\s*[:=]
)
\s*["']?
(
https://
[A-Za-z0-9.-]+
(?::\d{2,5})?
)
["']?
min_entropy: 2.3
confidence: medium
visible: false
examples:
- OCTOPUS_URL=https://deploy.acme.example
- 'octopus_server: "https://octopus.internal.example:8443"'
references:
- https://octopus.com/docs/octopus-rest-api/getting-started
- name: Octopus Deploy API Key
id: kingfisher.octopusdeploy.2
pattern: |
(?x)
\b
(
API-[A-Z0-9]{26}
)
\b
pattern_requirements:
min_digits: 4
min_uppercase: 4
min_entropy: 3.4
confidence: medium
examples:
- OCTOPUS_API_KEY=API-ZNRMR7SL6L3ATMOIK7GKJDKLPY
- 'set apikey="API-A1B2C3D4E5F6G7H8J9K0LMNOPQ"'
references:
- https://octopus.com/docs/octopus-rest-api/getting-started
- https://octopus.com/docs/octopus-rest-api/how-to-create-an-api-key
depends_on_rule:
- rule_id: kingfisher.octopusdeploy.1
variable: OCTOPUS_URL
validation:
type: Http
content:
request:
method: GET
url: '{{ OCTOPUS_URL }}/api'
headers:
X-Octopus-ApiKey: '{{ TOKEN }}'
Accept: application/json
response_matcher:
- report_response: true
- type: StatusMatch
status: [200]
- type: JsonValid

View file

@ -0,0 +1,78 @@
rules:
- name: OpenShift API Server URL
id: kingfisher.openshift.1
pattern: |
(?xi)
(?:
\boc\s+login\b
(?:.|[\n\r]){0,128}?
--server=
|
\bopenshift\b
(?:.|[\n\r]){0,32}?
\b(?:server|api(?:[_-]?server)?|cluster(?:[_-]?url)?)\b
\s*[:=]\s*
)
["']?
(
https://
(?:
\[[0-9a-f:.]+\]
|
[a-z0-9]
[a-z0-9.-]{1,253}
)
(?::\d{2,5})?
)
["']?
min_entropy: 2.0
confidence: medium
visible: false
examples:
- oc login --token=sha256~kV46hPnEYhCWFnB85r5NrprAxggzgb6GOeLbgcKNsH0 --server=https://api.cluster.example.com:6443
- OPENSHIFT_SERVER=https://api.dev-cluster.example.net:6443
references:
- https://docs.redhat.com/en/documentation/openshift_container_platform/4.9/html-single/authentication_and_authorization/index
- https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/user_and_group_apis/user-user-openshift-io-v1
- name: OpenShift OAuth Access Token
id: kingfisher.openshift.2
pattern: |
(?x)
\b
(
sha256~[A-Za-z0-9_-]{43}
)
\b
pattern_requirements:
min_digits: 3
min_uppercase: 1
min_lowercase: 3
ignore_if_contains:
- put_your_token_here
- xxxxxx
min_entropy: 3.8
confidence: medium
examples:
- 'Authorization: Bearer sha256~kV46hPnEYhCWFnB85r5NrprAxggzgb6GOeLbgcKNsH0'
- oc login --token=sha256~ZBMKw9VAayhdnyANaHvjJeXDiGwA7Fsr5gtLKj3-eh- --server=https://api.cluster.example.com:6443
references:
- https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/oauth_apis/oauthaccesstoken-oauth-openshift-io-v1
- https://docs.redhat.com/en/documentation/openshift_container_platform/4.9/html-single/authentication_and_authorization/index
depends_on_rule:
- rule_id: kingfisher.openshift.1
variable: OPENSHIFT_API_SERVER
validation:
type: Http
content:
request:
method: GET
url: '{{ OPENSHIFT_API_SERVER }}/apis/user.openshift.io/v1/users'
headers:
Authorization: 'Bearer {{ TOKEN }}'
Accept: application/json
response_matcher:
- report_response: true
- type: StatusMatch
status: [200, 403]
- type: JsonValid

View file

@ -0,0 +1,85 @@
rules:
- name: Polymarket Builder Secret
id: kingfisher.polymarket.1
pattern: |
(?xi)
\b
poly(?:market)?
(?:.|[\n\r]){0,32}?
(?:builder|api)?
(?:.|[\n\r]){0,16}?
secret
(?:.|[\n\r]){0,12}?
(
[A-Za-z0-9+/]{40,88}={0,2}
)
\b
pattern_requirements:
min_digits: 2
min_uppercase: 1
min_lowercase: 8
min_entropy: 3.6
confidence: medium
visible: false
examples:
- POLY_BUILDER_SECRET=QmFzZTY0U2VjcmV0VGVzdEtleTEyMzQ1Njc4OTBBQkNERUY=
- 'polymarket_builder_secret: Q29tcGxleFNlY3JldE1hdGVyaWFsMTIzNDU2Nzg5MDEyMzQ='
references:
- https://docs.polymarket.com/trading/orders/attribution
- name: Polymarket Builder Passphrase
id: kingfisher.polymarket.2
pattern: |
(?xi)
\b
poly(?:market)?
(?:.|[\n\r]){0,32}?
(?:builder|api)?
(?:.|[\n\r]){0,16}?
passphrase
(?:.|[\n\r]){0,12}?
(
[A-Za-z0-9_]{8,128}
)
\b
pattern_requirements:
min_digits: 1
min_uppercase: 1
min_lowercase: 4
ignore_if_contains:
- example
- placeholder
min_entropy: 3.0
confidence: medium
visible: false
examples:
- POLY_BUILDER_PASSPHRASE=BuilderPass_2026
- 'polymarket_passphrase: AlphaPass_7788'
references:
- https://docs.polymarket.com/trading/orders/attribution
- name: Polymarket Builder API Key
id: kingfisher.polymarket.3
pattern: |
(?xi)
\b
poly(?:market)?
(?:.|[\n\r]){0,32}?
(?:builder|api)?
(?:.|[\n\r]){0,16}?
key
(?:.|[\n\r]){0,12}?
(
[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
)
\b
pattern_requirements:
min_digits: 6
min_lowercase: 8
min_entropy: 3.2
confidence: medium
examples:
- POLY_BUILDER_API_KEY=12345678-abcd-1234-efab-1234567890ab
- 'polymarket_api_key: a1b2c3d4-e5f6-789a-bcde-f0123456789a'
references:
- https://docs.polymarket.com/trading/orders/attribution

View file

@ -0,0 +1,58 @@
rules:
- name: Private AI API Key
id: kingfisher.privateai.1
pattern: |
(?xi)
\b
(?:
private[_-]?ai
|
limina
)
(?:.|[\n\r]){0,32}?
(?:
api[_-]?key
|
x-api-key
|
token
)
(?:.|[\n\r]){0,12}?
(
[a-z0-9]{32}
)
\b
pattern_requirements:
min_digits: 4
min_lowercase: 8
ignore_if_contains:
- example
- placeholder
- insert
- your
min_entropy: 3.5
confidence: medium
examples:
- PRIVATEAI_API_KEY=4fa2d7c81be9063d4ea8bc1f6d2a7e9c
- 'x-api-key: 2ab4d6e8f0c1a3b5d7e9f1a2b4c6d8e0'
references:
- https://docs.private-ai.com/fundamentals/getting-started
- https://docs.private-ai.com/reference/4.0.0/operation/ner_text_ner_text_post/
validation:
type: Http
content:
request:
method: POST
url: https://api.private-ai.com/community/v4/process/text
headers:
Content-Type: application/json
x-api-key: '{{ TOKEN }}'
body: '{"text":["Hello Jane Doe"]}'
response_matcher:
- report_response: true
- type: StatusMatch
status: [200]
- type: JsonValid
- type: WordMatch
words:
- '"processed_text"'

View file

@ -108,3 +108,22 @@ rules:
-----END ENCRYPTED PRIVATE KEY BLOCK-----
references:
- https://www.rfc-editor.org/rfc/rfc7468
- name: PKCS#12 File Path
id: kingfisher.privkey.3
pattern: |
(?xi)
(?:
^|["'\s(=/]
)
(
(?:[^"' \t\r\n/]+/)*[^"' \t\r\n/]+\.(?:p12|pfx)
)
(?:
$|["'\s),]
)
min_entropy: 2.0
confidence: medium
examples:
- security/es_certificates/opensearch/es_kibana_client.p12
- ToDo/ToDo.UWP/ToDo.UWP_TemporaryKey.pfx

View file

@ -0,0 +1,63 @@
rules:
- name: SettleMint Personal Access Token
id: kingfisher.settlemint.1
pattern: |
(?x)
\b
(
sm_pat_[A-Za-z0-9]{16}
)
\b
pattern_requirements:
min_digits: 2
min_uppercase: 1
min_lowercase: 4
min_entropy: 3.2
confidence: medium
examples:
- SETTLEMINT_ACCESS_TOKEN=sm_pat_A1b2C3d4E5f6G7h8
- settlemint connect --pat=sm_pat_Z9y8X7w6V5u4T3s2
references:
- https://console.settlemint.com/documentation/blockchain-platform/platform-components/security-and-authentication/personal-access-tokens
- name: SettleMint Application Access Token
id: kingfisher.settlemint.2
pattern: |
(?x)
\b
(
sm_aat_[A-Za-z0-9]{16}
)
\b
pattern_requirements:
min_digits: 2
min_uppercase: 1
min_lowercase: 4
min_entropy: 3.2
confidence: medium
examples:
- BLOCKSCOUT_SETTLEMINT_APPLICATION_ACCESS_TOKEN=sm_aat_A1b2C3d4E5f6G7h8
- 'x-auth-token: sm_aat_Z9y8X7w6V5u4T3s2'
references:
- https://console.settlemint.com/documentation/blockchain-platform/platform-components/security-and-authentication/application-access-tokens
- name: SettleMint Service Access Token
id: kingfisher.settlemint.3
pattern: |
(?x)
\b
(
sm_sat_[A-Za-z0-9]{16}
)
\b
pattern_requirements:
min_digits: 2
min_uppercase: 1
min_lowercase: 4
min_entropy: 3.2
confidence: medium
examples:
- SETTLEMINT_SERVICE_TOKEN=sm_sat_A1b2C3d4E5f6G7h8
- 'Authorization: Bearer sm_sat_Z9y8X7w6V5u4T3s2'
references:
- https://console.settlemint.com/documentation

View file

@ -0,0 +1,58 @@
rules:
- name: Sidekiq Enterprise Credential
id: kingfisher.sidekiq.1
pattern: |
(?xi)
\b
(?:
BUNDLE_ENTERPRISE__CONTRIBSYS__COM
|
BUNDLE_GEMS__CONTRIBSYS__COM
)
\s*[:=]\s*
["']?
(
[a-f0-9]{8}:[a-f0-9]{8}
)
["']?
\b
pattern_requirements:
min_digits: 4
min_lowercase: 4
min_entropy: 2.8
confidence: medium
examples:
- BUNDLE_ENTERPRISE__CONTRIBSYS__COM=cafebabe:deadbeef
- 'export BUNDLE_GEMS__CONTRIBSYS__COM="cafeb4b3:d3adb33f"'
- name: Sidekiq Sensitive URL
id: kingfisher.sidekiq.2
pattern: |
(?xi)
(
https?://
[a-f0-9]{8}:[a-f0-9]{8}
@
(?:
gems\.contribsys\.com
|
enterprise\.contribsys\.com
)
(?:
/[^ \t\r\n"'<>]*
|
\?[^ \t\r\n"'<>]*
|
\#[^ \t\r\n"'<>]*
|
:[0-9]{1,5}(?:/[^ \t\r\n"'<>]*)?
)?
)
pattern_requirements:
min_digits: 4
min_lowercase: 4
min_entropy: 2.8
confidence: medium
examples:
- https://cafebabe:deadbeef@gems.contribsys.com/
- http://cafeb4b3:d3adb33f@enterprise.contribsys.com:80/path?param1=true