Zero-Trust Cyber-Resilience & Telemetry Defense Engine
nkryptd is a hardened, self-contained ingestion and cryptographic ledger engine built for high-assurance environments. It inspects untrusted HTTP and WebSocket traffic through multi-pass canonicalization, strict AST structural validation, constant-time token authentication, CPython heap zeroing, and AES-256-GCM storage—wrapped in rootless, AppArmor-confined Docker containers.
[Client TLS 1.3 / WSS]
│
▼
┌──────────────────────────────────────────────────────────┐
│ Nginx Edge Proxy (nginx.conf) │
│ • TLS 1.3 Only • Rate & Conn Limits • 512KB Body Cap │
└──────────────┬───────────────────────────┬───────────────┘
│ (Internal Bridge) │ (Internal Bridge)
▼ ▼
┌────────────────────────────┐ ┌──────────────────────────┐
│ Core HTTP Monolith (:8080) │ │ WebSocket Gateway (:19999)│
│ headless_defense_monolith │ │ kryptic_websocket_gateway │
└──────────────┬─────────────┘ └────────────┬─────────────┘
└──────────────┬──────────────┘
▼
1. Constant-Time Token Auth (hmac.compare_digest)
2. Iterative URL / HTML Canonicalization
3. Strict AST Literal Moat & Regex Allergy Filter
4. Runtime SHA-256 Integrity Check & Hot Key Rotation
5. AES-256-GCM Ledger Seal + libc.memset Heap Zeroing
- Multi-Pass Canonicalization & Strict AST Moat (
HardenedASTPayloadMoat): Unescapes nested URL and HTML encodings prior to screening, enforces an8 KBpayload ceiling, and restrictsast.parse(..., mode="eval")to safe literal nodes (depth <= 30) to neutralize SQLi, XSS, and Python code injection. - Constant-Time Authentication (
hmac.compare_digest): Enforces timing-safe token validation across both HTTP (NKRYPTD_API_TOKEN) and WebSocket (NKRYPTD_GATEWAY_TOKEN) ingestion endpoints. - AES-256-GCM Sealed Ledger & Heap Zeroing (
AESEncryptedNarrativeLedger): Encrypts persisted records with 256-bit keys stored with0o600permissions and zeroes rawbytearrayplaintext buffers in CPython memory viactypes+libc.memset. - Self-Healing Tamper Guard (
AutonomousShieldSentinel): Continuously verifies active code hashes against a signed manifest and rotates encryption keys immediately if source variance is detected. - Defense-in-Depth Container Isolation: Runs as unprivileged user
nkryptd(uid=999) withread_only: true,no-new-privileges:true,cap_drop: [ALL], PID/memory quotas, and a custom AppArmor profile (docker-nkryptd-policy).
pip install -r requirements.txt bandit
bandit -r . -lll
python3 test_moat_validation.py
python3 test_gateway_traffic.pycp .env.example .env
# Edit .env and set strong 32-byte hex values for NKRYPTD_API_TOKEN and NKRYPTD_GATEWAY_TOKEN
./generate_certs.sh
docker compose -f docker-compose.yml -f docker-compose.security.yml up -d --build| File | Role |
|---|---|
headless_defense_monolith.py |
Core HTTP server, AST moat, CPython wiper, AES-256-GCM ledger, and AutonomousShieldSentinel |
kryptic_websocket_gateway.py |
Async WebSocket gateway with constant-time token verification |
kryptic_9999_actuator.py |
Multi-threaded integrity verification and payload routing pool |
nginx.conf |
TLS 1.3 edge reverse proxy with rate limiting and security headers |
prometheus.yml |
Hardened Prometheus scraper polling /metrics on the internal bridge |
grafana/dashboards/nkryptd-soc-dashboard.json |
Auto-provisioned 6-panel Grafana SOC telemetry dashboard |
Dockerfile.nkryptd |
Multi-stage Alpine build running as unprivileged user nkryptd (uid=999) |
docker-compose.yml |
Isolated internal bridge network with read-only rootfs and resource limits |
docker-nkryptd-policy |
Custom AppArmor kernel confinement profile |
VERIFIED_PROOF_OF_EXECUTION.md |
Verified test results, SAST audit summary, and defense benchmark |
Proprietary. All rights reserved by Krypticsoundz LLC.