kingfisher/crates/kingfisher-rules/data/rules/cypress.yml
2026-03-03 16:47:59 -08:00

61 lines
1.8 KiB
YAML

rules:
- name: Cypress Record Key
id: kingfisher.cypress.1
pattern: |
(?xi)
(?:cypress|CYPRESS_RECORD_KEY|record_key|recordKey|--record\s+--key)
(?:.|[\n\r]){0,16}?
\b
(
[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
)
\b
pattern_requirements:
ignore_if_contains:
- "00000000-0000-0000-0000-000000000000"
confidence: medium
min_entropy: 3.0
examples:
- "CYPRESS_RECORD_KEY=a1b2c3d4-e5f6-7890-abcd-ef1234567890"
- 'cypress_record_key: "f8e7d6c5-b4a3-2190-fedc-ba0987654321"'
- "--record --key a9b8c7d6-e5f4-3210-abcd-ef9876543210"
references:
- https://docs.cypress.io/guides/guides/command-line#cypress-run
- https://docs.cypress.io/guides/cloud/account-management/projects#Record-key
depends_on_rule:
- rule_id: kingfisher.cypress.2
variable: CYPRESS_PROJECT_ID
validation:
type: Http
content:
request:
method: POST
url: "https://api.cypress.io/runs"
headers:
Content-Type: "application/json"
x-route-version: "4"
x-os-name: "darwin"
x-cypress-version: "5.5.0"
body: '{"projectId":"{{ CYPRESS_PROJECT_ID }}","recordKey":"{{ TOKEN }}","specs":["test.js"],"platform":{"osName":"linux"},"ci":{"buildNumber":"1"}}'
response_matcher:
- report_response: true
- type: StatusMatch
status: [200]
- name: Cypress Project ID
id: kingfisher.cypress.2
visible: false
pattern: |
(?xi)
\b
(?:CYPRESS_PROJECT_ID|projectId|project_id)
\s* [=:] \s* ["']?
(
[a-z0-9]{6,8}
)
["']?
confidence: medium
min_entropy: 1.0
examples:
- 'CYPRESS_PROJECT_ID=a7bq2k'
- 'projectId: "abc123"'