forked from mirrors/kingfisher
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
rules:
|
|
- name: Samsara API Token (prefixed)
|
|
id: kingfisher.samsara.1
|
|
pattern: |
|
|
(?x)
|
|
\b
|
|
(
|
|
samsara_api_
|
|
[A-Za-z0-9]{26,32}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 2
|
|
min_uppercase: 1
|
|
min_lowercase: 4
|
|
min_entropy: 3.0
|
|
confidence: high
|
|
examples:
|
|
- "access_token = \"samsara_api_8ZWXxCINWCRGi9qRl9JEz90x5lxAHU\""
|
|
- "SAMSARA_TOKEN=samsara_api_AbCdEfGhIjKlMnOpQrStUvWxYz0123"
|
|
references:
|
|
- https://developers.samsara.com/reference
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: https://api.samsara.com/fleet/vehicles
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|
|
- type: StatusMatch
|
|
status: [401, 403]
|
|
negative: true
|
|
|
|
- name: Samsara API Token (contextual)
|
|
id: kingfisher.samsara.2
|
|
pattern: |
|
|
(?xi)
|
|
\b
|
|
samsara
|
|
(?:.|[\n\r]){0,32}?
|
|
\b(?:access[_-]?token|api[_-]?token|token)\b
|
|
(?:.|[\n\r]){0,16}?
|
|
[=:"'\s]
|
|
\b
|
|
(
|
|
[A-Za-z0-9]{28,32}
|
|
)
|
|
\b
|
|
pattern_requirements:
|
|
min_digits: 2
|
|
min_uppercase: 2
|
|
min_lowercase: 4
|
|
min_entropy: 3.0
|
|
confidence: low
|
|
examples:
|
|
- "samsara context\naccess_token = \"8ZWXxCINWCRGi9qRl9JEz90x5lxAHUbc\""
|
|
- "SAMSARA_API_TOKEN=AbCdEfGhIjKlMnOpQrStUvWxYz012345"
|
|
references:
|
|
- https://developers.samsara.com/reference
|
|
validation:
|
|
type: Http
|
|
content:
|
|
request:
|
|
method: GET
|
|
url: https://api.samsara.com/fleet/vehicles
|
|
headers:
|
|
Authorization: "Bearer {{ TOKEN }}"
|
|
Accept: application/json
|
|
response_matcher:
|
|
- report_response: true
|
|
- type: StatusMatch
|
|
status: [200]
|
|
- type: StatusMatch
|
|
status: [401, 403]
|
|
negative: true
|