forked from mirrors/kingfisher
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
rules:
|
|
- name: Linode Personal Access Token
|
|
id: kingfisher.linode.1
|
|
pattern: |
|
|
(?xi)
|
|
\b
|
|
(?:
|
|
linode(?:[_\s-]*api)?(?:[_\s-]*(?:token|key|access))
|
|
|
|
|
linode(?:[_\s-]*personal)?(?:[_\s-]*access)?(?:[_\s-]*token)
|
|
)
|
|
\b
|
|
(?:.|[\n\r]){0,24}?
|
|
(?:
|
|
[=:]
|
|
|
|
|
["']\s*:\s*["']
|
|
)
|
|
\s*
|
|
["']?
|
|
(
|
|
[a-f0-9]{64}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 4
|
|
min_entropy: 3.8
|
|
confidence: medium
|
|
examples:
|
|
- linode_api_token = "3f87c1b4e9a26d70f4c1b9658e2a3d7992b4f1c8a6d03e57f19b48c2d6a7e1f4"
|
|
- 'LINODE_PERSONAL_ACCESS_TOKEN: "6b2e04f19ca378d5e16ab0c4f278e35d94bc7a6e183f0d57a2c6e419fd38ab51"'
|
|
references:
|
|
- https://techdocs.akamai.com/linode-api/reference/get-profile
|
|
- https://techdocs.akamai.com/linode-api/reference/delete-personal-access-token
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: https://api.linode.com/v4/profile
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|
|
- type: JsonValid
|
|
- type: WordMatch
|
|
words:
|
|
- '"username"'
|
|
revocation:
|
|
type: HttpMultiStep
|
|
content:
|
|
steps:
|
|
- name: lookup_token_id
|
|
request:
|
|
method: GET
|
|
url: https://api.linode.com/v4/profile/tokens
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- type: StatusMatch
|
|
status: [200]
|
|
extract:
|
|
LINODE_TOKEN_ID:
|
|
type: JsonPath
|
|
path: "$.data[0].id"
|
|
- name: delete_token
|
|
request:
|
|
method: DELETE
|
|
url: "https://api.linode.com/v4/profile/tokens/{{ LINODE_TOKEN_ID }}"
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|