NC-AUTH-003

No tokens in OpenClaw log files

🟠 High ⚗️ Experimental ⚗️ Experimental not scored

What this checks

Scans OpenClaw log files for accidentally logged credentials.

Why it matters

Tokens in log files persist on disk and may be exposed through log aggregation or shared access.

How to fix it

Step 1 Find out which log files contain credentials. Check the finding detail:

openclaw security audit --json | jq '.findings[] | select(.checkId=="security.secrets.tokens_in_logs") | .detail'

Step 2 Enable log redaction. Add the following to your OpenClaw config to redact sensitive fields before they are written to log files:

logging:
  redact:
    enabled: true
    fields:
      - authorization
      - x-api-key
      - token
      - password
      - secret

Step 3 Rotate exposed credentials. Any token that appeared in log files should be treated as potentially compromised. Revoke and reissue it in the relevant service dashboard.

Step 4 Clear old log files that contain the exposed values:

# Find log location
openclaw config path
# Then truncate or remove the logs directory (OpenClaw will recreate it)
rm ~/.openclaw/logs/*.log

Step 5 Restart and verify: openclaw gateway restart, then re-run the audit to confirm the finding is gone.

Technical details

FieldValue
Control IDNC-AUTH-003
DomainAUTH
SeverityHigh
StatusExperimental
Data sourcelog_scan
Source typederived
ModeMode 1 (OpenClaw native)
Introduced inLibrary v0.1.0
OWASP LLM 2025LLM02: Sensitive Information Disclosure

False positive notes

May match non-token strings in logs. Higher false-positive risk than authoritative checks.

Suppress this finding

If this finding is intentional or not applicable to your setup, you can exclude it:

clawvitals exclude NC-AUTH-003 reason "your reason here"

Exclusions are auditable and expire automatically. See the exclusions guide.