Ausfuehrbares Pruefpaket fuer Payment-Terminal-Systeme: 1. Semgrep-Regeln (25 Regeln in 5 Dateien): - Logging: Sensitive Daten, Tokens, Debug-Flags - Crypto: MD5/SHA1/DES/ECB, Hardcoded Secrets, Weak Random, TLS - API: Debug-Routes, Exception Leaks, IDOR, Input Validation - Config: Test-Endpoints, CORS, Cookies, Retry - Data: Telemetrie, Cache, Export, Queue, Testdaten 2. CodeQL Query-Specs (5 Briefings): - Sensitive Data → Logs - Sensitive Data → HTTP Response - Tenant Context Loss - Sensitive Data → Telemetry - Cache/Export Leak 3. State-Machine-Tests (10 Testfaelle): - 11 Zustaende, 15 Events, 8 Invarianten - Duplicate Response, Timeout+Late Success, Decline - Invalid Reversal, Cancel, Backend Timeout - Parallel Reversal, Unknown Response, Reconnect - Late Response after Cancel 4. Finding Schema (JSON Schema): - Einheitliches Format fuer alle Engines - control_id, engine, status, confidence, evidence, verdict_text Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
rules:
|
|
- id: payment-prod-config-test-endpoint
|
|
message: Test- oder Sandbox-Endpunkt in produktionsnaher Konfiguration erkannt.
|
|
severity: ERROR
|
|
languages: [yaml, json]
|
|
pattern-regex: (?i)(sandbox|test-endpoint|mock-terminal|dummy-acquirer)
|
|
|
|
- id: payment-prod-debug-flag
|
|
message: Unsicherer Debug-Flag in Konfiguration erkannt.
|
|
severity: WARNING
|
|
languages: [yaml, json]
|
|
pattern-regex: (?i)(debug:\s*true|"debug"\s*:\s*true)
|
|
|
|
- id: payment-open-cors
|
|
message: Offene CORS-Freigabe pruefen.
|
|
severity: WARNING
|
|
languages: [yaml, json, javascript, typescript]
|
|
pattern-regex: (?i)(Access-Control-Allow-Origin.*\*|origin:\s*["']\*["'])
|
|
|
|
- id: payment-insecure-session-cookie
|
|
message: Unsicher gesetzte Session-Cookies pruefen.
|
|
severity: ERROR
|
|
languages: [javascript, typescript, python]
|
|
pattern-regex: (?i)(httpOnly\s*:\s*false|secure\s*:\s*false|sameSite\s*:\s*["']none["'])
|
|
|
|
- id: payment-unbounded-retry
|
|
message: Retry-Konfiguration scheint unbegrenzt oder zu hoch.
|
|
severity: WARNING
|
|
languages: [yaml, json]
|
|
pattern-regex: (?i)(retry.*(9999|infinite|unbounded))
|