forked from mirrors/kingfisher
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
rules:
|
|
- name: Vultr API Key
|
|
id: kingfisher.vultr.1
|
|
pattern: |
|
|
(?xi)
|
|
\b
|
|
vultr
|
|
(?:.|[\n\r]){0,24}?
|
|
(?:api[_\s-]*key|token|authorization|key)
|
|
(?:.|[\n\r]){0,16}?
|
|
(
|
|
[a-f0-9]{36}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 3
|
|
min_entropy: 3.4
|
|
confidence: medium
|
|
examples:
|
|
- VULTR_API_KEY="7a1c3e5f7092ab4cd6ef80123456789abcde"
|
|
- 'export VULTR_TOKEN=0123456789abcdef0123456789abcedf1234 # vultr'
|
|
references:
|
|
- https://docs.vultr.com/platform/other/api/current-user/list-api-key
|
|
- https://docs.vultr.com/platform/other/api/current-user/delete-api-key
|
|
- https://www.vultr.com/api/
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: https://api.vultr.com/v2/apikeys
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|
|
- type: JsonValid
|
|
- type: WordMatch
|
|
words:
|
|
- '"apikeys"'
|
|
revocation:
|
|
type: HttpMultiStep
|
|
content:
|
|
steps:
|
|
- name: list_api_keys
|
|
request:
|
|
method: GET
|
|
url: https://api.vultr.com/v2/apikeys
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- type: StatusMatch
|
|
status: [200]
|
|
- type: JsonValid
|
|
extract:
|
|
APIKEY_ID:
|
|
type: Regex
|
|
pattern: '"id"\\s*:\\s*"([^"]+)"'
|
|
- name: delete_api_key
|
|
request:
|
|
method: DELETE
|
|
url: https://api.vultr.com/v2/apikeys/{{ APIKEY_ID }}
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [204]
|