forked from mirrors/kingfisher
86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
rules:
|
|
- name: Docker Registry Credentials (auths JSON)
|
|
id: kingfisher.docker.1
|
|
pattern: |
|
|
(?xis)
|
|
"auths"\s*:\s*\{
|
|
[^}]*?
|
|
" (?P<REG> (?:https?:\/\/)? [a-z0-9.\-:+/]+ ) "\s*:\s*\{
|
|
[^}]*?
|
|
"auth"\s*:\s*"(?P<B64> [A-Za-z0-9+/=]{16,} )"
|
|
[^}]*?
|
|
\}
|
|
[^}]*?
|
|
\}
|
|
min_entropy: 2.0
|
|
confidence: medium
|
|
examples:
|
|
- |
|
|
{
|
|
"auths": {
|
|
"quay.io": {
|
|
"auth": "dXNlcjEyOnRva2VuMzQ1Njc4OTA="
|
|
}
|
|
}
|
|
}
|
|
- |
|
|
{"auths":{"index.docker.io/v1/":{"auth":"dXNlcjEyOnRva2VuMzQ1Njc4OTA="}}}
|
|
references:
|
|
- https://distribution.github.io/distribution/spec/api/
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: >
|
|
{%- assign r = REG -%}
|
|
{%- if r contains "://" -%}
|
|
{{ r | replace: "/$", "" }}/v2/auth
|
|
{%- else -%}
|
|
https://{{ r }}/v2/auth
|
|
{%- endif -%}
|
|
headers:
|
|
Authorization: "Basic {{ B64 }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|
|
|
|
- name: Docker Swarm Join Token
|
|
id: kingfisher.docker.2
|
|
pattern: |
|
|
(?x)
|
|
\b
|
|
(
|
|
SWMTKN-1-[a-z0-9]{50,60}-[a-z0-9]{24,30}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 4
|
|
min_entropy: 3.5
|
|
confidence: high
|
|
categories: [api, key]
|
|
examples:
|
|
- 'docker swarm join --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx 192.168.99.100:2377'
|
|
references:
|
|
- https://docs.docker.com/engine/swarm/join-nodes/
|
|
|
|
- name: Docker Swarm Unlock Key
|
|
id: kingfisher.docker.3
|
|
pattern: |
|
|
(?x)
|
|
\b
|
|
(
|
|
SWMKEY-1-[A-Za-z0-9+/]{40,50}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 2
|
|
min_entropy: 3.5
|
|
confidence: high
|
|
categories: [api, key]
|
|
examples:
|
|
- 'docker swarm unlock --key SWMKEY-1-AbCdEfGhIjKlMnOpQrStUvWxYz1234567890ABCDEFG'
|
|
references:
|
|
- https://docs.docker.com/engine/swarm/swarm_manager_locking/
|