/viperclaw:viper-logging-pii-compliancefrom viperclaw
Audits application logging for PII redaction, log injection defenses (CWE-117, CWE-532), and security event coverage per OWASP Logging Cheat Sheet and ASVS V7. Provides grep commands and an 8-point checklist for secret scrubbing and audit trail completeness.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-logging-pii-compliance)viper_taint_scan, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.dbflowchart LR
Event["Security / App Event"] --> Scrub["PII & Secret Redaction Filter"] --> JSON["Structured JSON Formatter (No CRLF)"] --> SIEM[("Immutable Audit Log Sink")]
Applications either log too much (dumping full req.headers or req.body containing plaintext passwords, Bearer JWTs, session cookies, and credit card numbers into Datadog/CloudWatch) or log too little (failing to record failed logins, privilege escalations, and cross-tenant 403 denials, or allowing log injection).
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(logger\.(info|debug|error|warning)|console\.(log|error))\(.*(password|token|secret|authorization|cookie|ssn|card)" -i
rg -n "(print\(request\.|console\.log\(req\.(headers|body))"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
LOG-01 | Automatic Credential & Token Redaction | Structured log processors scrub password, secret, token, authorization, cookie, api_key, cvv, and ssn keys at the root logger level. | logger.debug(f"Login body: {request.json}") writes plaintext passwords to log storage. |
LOG-02 | Log Injection & CRLF Neutralization (CWE-117) | Logs are emitted as single-line structured JSON (structlog / pino / zap) or strip \r, \n, and ANSI escape sequences (\x1b[) from user strings. | Plaintext log logger.info(f"User {username} logged in") allows forging fake log lines via username="guest\n2026-11-18 INFO Admin privilege granted". |
LOG-03 | Mandatory Security Event Coverage (CWE-778) | Auth failures, password/MFA resets, role changes, API key creations, and 403 Forbidden authorization failures emit structured audit events. | Administrative role elevation or repeated BOLA probes leave zero audit trail. |
LOG-04 | Correlation / Request ID Propagation | Every incoming HTTP request generates or validates a UUID X-Request-ID propagated across all downstream logs and error responses. | Impossible to trace a security incident across microservices. |
LOG-05 | Exception Handler Secret Scrubbing | Crash reporters (Sentry, Rollbar, Bugsnag) enable send_default_pii=False and scrub local stack variables containing secrets. | Unhandled exception dumps local environment variables and DB connection strings to external crash tracker. |
LOG-06 | HTTP Access Log Query-String Hygiene | Sensitive values are never placed in URL query strings, and access logs redact ?token= / ?code= parameters. | OAuth code or password-reset token logged in plaintext Nginx/ALB access logs. |
LOG-07 | Tamper-Evident Append-Only Audit Storage | Compliance audit trails (audit_logs table / S3 Object Lock) disallow UPDATE and DELETE by the application DB role. | Compromised application role can DELETE FROM audit_logs to erase evidence. |
LOG-08 | Log Level Hygiene in Production | Production environments run at INFO or WARN level, never DEBUG or TRACE. | LOG_LEVEL=DEBUG in production dumps full SQL query parameters and HTTP bodies. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N | Plaintext passwords, active session JWTs, or payment card data written to shared log management systems. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N | Unescaped CRLF / ANSI log injection allowing audit log forgery or terminal escape injection. |
| LOW (3.3) | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N | Missing security audit events on privilege changes or failed authentication attempts. |
# ❌ VULNERABLE: Logs raw headers/body (leaking Authorization & password) with newline injection risk
logger.info(f"Auth attempt for {request.form.get('username')} with headers {dict(request.headers)}")
# ✅ HARDENED: Structured JSON logging with automatic sensitive-key redaction & CRLF stripping
REDACTED_KEYS = {"authorization", "cookie", "password", "token", "secret", "api_key"}
def redact_dict(d: dict) -> dict:
return {k: ("[REDACTED]" if k.lower() in REDACTED_KEYS else v) for k, v in d.items()}
safe_user = str(request.form.get("username", "")).replace("\r", "").replace("\n", "")[:64]
logger.info("auth_attempt", extra={"username": safe_user, "headers": redact_dict(dict(request.headers))})
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pii-redaction, log-injection, audit-trail, security-logging, owasp-asvs
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job