Security architecture, controls, threat model, and responsible disclosure for CLUESTREAM v1.0.0.
- Security Philosophy
- Security Controls
- Threat Model
- Live Mode Security
- Known Limitations
- Security Checklist
- Responsible Disclosure
- Security Audit
CLUESTREAM is designed with defense in depth and zero trust principles:
- Offline-first: Offline analysis makes no outbound network connections. The optional local dashboard binds to loopback. No telemetry, update checks, or automatic remote enrichment are performed.
- Memory-only credentials: Passwords are never written to disk. The per-startup credential exists only in process memory and is rotated on every startup.
- Evidence integrity: Every input file is SHA-256 hashed before parsing. Manifests provide byte-level integrity verification.
- Epistemic labeling: All analytical conclusions carry explicit status (OBSERVED/INFERRED/HYPOTHESIS/UNKNOWN) to prevent mistaking inference for observation.
- Zero stack traces: Standard operations never expose raw Python tracebacks to the operator.
- Least privilege: All mutating endpoints require authentication, CSRF tokens, and role-based access control.
| Control | Implementation |
|---|---|
| Password hashing | PBKDF2-SHA256, 240,000 rounds, random 16-byte salt |
| Credential storage | Memory-only; never written to disk; rotated per startup |
| Startup credential | Cryptographically random 256-bit password (secrets.token_urlsafe(32)) |
| Local user accounts | Salted PBKDF2 hashes in state directory (0o600 permissions) |
| Control | Implementation |
|---|---|
| Session tokens | secrets.token_urlsafe(32) (256 bits) |
| CSRF tokens | Per-session, validated on all mutating endpoints |
| Session timeout | 30-minute idle timeout (sliding) |
| Cookie attributes | HttpOnly, SameSite=Strict, Max-Age=1800 |
| Session fixation fix | Token regenerated on every login |
| Control | Implementation |
|---|---|
| File extensions | Allowlist (.evtx, .log, .txt, .csv, .json, .jsonl, .xml, .gz, .zip, .7z, .pcap, .pcapng) |
| Path traversal | Canonical path resolution + member validation for archives |
| Decompression bombs | MAX_INPUT_MB (256 MB), MAX_ZIP_RATIO (500:1), MAX_ZIP_MEMBERS (1000) |
| Line length | Capped at 8,192 characters |
| Request body | Capped at 64 MB |
| Filename validation | Rejects null bytes, control chars, traversal, reserved names |
| Control | Implementation |
|---|---|
| HTML escaping | escape_for_html() at API boundary |
| Security headers | CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Cache-Control: no-store, Permissions-Policy, Strict-Transport-Security |
| Network binding | Offline dashboard and live mode default to 127.0.0.1 loopback |
| Threat | Category | Offline Risk | Live Risk | Mitigation |
|---|---|---|---|---|
| Path traversal | Spoofing | Low | Critical | Canonical path resolution, extension allowlisting |
| Session fixation | Spoofing | Medium | High | Token regeneration on login |
| Unauthorized access | Tampering | N/A | Critical | RBAC, authentication, session management |
| Data exfiltration | Information Disclosure | None | High | Egress allowlisting, audit logging of all API calls |
| ReDoS | Denial of Service | Medium | High | Regex complexity caps, timeout on rule evaluation |
| SQL injection | Tampering | N/A | High | Parameterized queries (SQLite) |
| XSS | Tampering | Low | Medium | HTML escaping, CSP |
| CSRF | Tampering | N/A | High | Per-session CSRF tokens |
| Brute force | Denial of Service | Low | High | Rate limiting (5 failures/60s per IP) |
Live mode expands the attack surface. Additional controls are required:
- Transport: The built-in live API/dashboard serve HTTP, not HTTPS. Do not expose them directly to untrusted networks. For remote access, terminate TLS at a trusted reverse proxy and restrict the upstream to loopback/private interfaces.
- CORS: Restrict
live_cors_originsto trusted domains only - Bind address: Defaults to
127.0.0.1; do not bind to0.0.0.0unless protected by a firewall and TLS-terminating reverse proxy. - Rate limiting: Per-IP, per-endpoint sliding window
- Multi-user: Local user accounts with PBKDF2-SHA256 hashes
- RBAC: Four roles — Admin, Analyst Manager, Analyst, Auditor
- MFA: TOTP-based multi-factor authentication (RFC 6238)
- Session security: HttpOnly/SameSite cookies, 30-minute idle timeout
- Database: SQLite with 0o600 file permissions
- State directory: 0o700 permissions
- Audit log: Append-only JSONL with 0o600 permissions
- Evidence: SHA-256 hashes for all stored evidence files
| Limitation | Description | Mitigation |
|---|---|---|
| SHA-256 integrity | Proves byte-level integrity, not source authenticity | Document limitation; use secure boot/storage |
| No network in offline | Cannot receive threat intel feeds | By design; air-gapped operation |
| In-memory sessions | Sessions lost on restart | Acceptable for single-host deployment |
| SQLite single-writer | Concurrent writes may contend | Single-process deployment |
| Database not encrypted | Only optional alert evidence is sealed | Use filesystem/volume encryption for the live DB |
| Vault crypto is not AEAD | HMAC-SHA256 CTR + tag, stdlib only | Use disk encryption for high-value deployments |
| Collector is plain HTTP | Token protects access, not transport | TLS reverse proxy + firewall allow-list |
| No SSO/OIDC | Framework stub only | Future integration planned |
- The HTTP collector uses a
secrets.token_urlsafe(32)Bearer token stored0600, compared withhmac.compare_digest. Never paste the token into screenshots, issue reports or terminal transcripts. - Rotate with
cluestream collect-token rotate; the command prints only the path. Restartcluestream liveand update every forwarder afterwards. - Config validation refuses to start an enabled HTTP collector without a token file, and refuses to store normal raw events.
- Syslog and file-watcher sources are unauthenticated by design: bind them to loopback or a trusted management network and firewall the port.
- The optional raw-evidence vault uses HMAC-SHA256 counter-mode with an
authentication tag and SHA-256 hash, with a
0600key file. It is at-rest protection, not an audited AEAD cipher; use volume encryption for high-value evidence. Expired records are purged on an interval and each purge is recorded inretention_audit. - Offline mode never imports or starts any network component.
- Run as non-root user (dedicated
cluestreamuser) - Filesystem permissions: database 0o600, state dir 0o700
- Network: keep the service on loopback unless a secured reverse proxy is configured
- TLS: terminate HTTPS at a trusted reverse proxy before any remote access
- CORS: origins restricted to trusted domains
- Firewall: restrict API port (8080) to internal networks
- Logging: audit log enabled and monitored
- Strong passwords (min 10 characters) for all accounts
- MFA enabled for admin accounts
- Least privilege role assignment
- Regular access review
- Dependency vulnerability scanning (
pip-audit) - Security patch management
- Backup and recovery procedures
- Incident response plan
Security vulnerabilities should be reported privately to the project maintainer before public disclosure.
Contact: Shankar M. (ShankarSec) via GitHub
Please include:
- Description of the vulnerability
- Steps to reproduce
- Affected versions
- Potential impact
- Suggested remediation (if any)
We will acknowledge receipt within 7 business days and provide status updates as the issue is investigated and remediated.
The following controls were verified during development:
| Control | Status | Method |
|---|---|---|
| PBKDF2 password hashing | Verified | Unit tests |
| Session regeneration on login | Verified | Code review + tests |
| CSRF token validation | Verified | Code review |
| Input validation module | Verified | Unit tests (validation functions) |
| Rate limiting | Verified | Unit tests |
| Path traversal prevention | Verified | Unit tests (upload security) |
| Security headers | Verified | Code review |
| No hardcoded credentials | Verified | Secret scan: CLEAN |
| Offline mode zero network | Verified | Import test (no socket/http) |