Skip to content
KrypticKode007Public

About

Enterprise-grade, zero-trust cyber-resilience engine. Combines strict AST payload validation, multi-pass canonicalization, constant-time token auth, CPython heap zeroing (libc.memset), AES-256-GCM sealed ledgers, and rootless AppArmor Docker isolation to neutralize SQLi, XSS, RCE, and tampering in real time.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

90 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nkryptd

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.


Architecture & Defense Pipeline

[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

Core Security Controls

  • Multi-Pass Canonicalization & Strict AST Moat (HardenedASTPayloadMoat): Unescapes nested URL and HTML encodings prior to screening, enforces an 8 KB payload ceiling, and restricts ast.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 with 0o600 permissions and zeroes raw bytearray plaintext buffers in CPython memory via ctypes + 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) with read_only: true, no-new-privileges:true, cap_drop: [ALL], PID/memory quotas, and a custom AppArmor profile (docker-nkryptd-policy).

Quick Start & Verification

1. Local Setup & Automated Test Suites

pip install -r requirements.txt bandit
bandit -r . -lll
python3 test_moat_validation.py
python3 test_gateway_traffic.py

2. Production Container Deployment

cp .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

Repository Map

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

License

Proprietary. All rights reserved by Krypticsoundz LLC.

About

Enterprise-grade, zero-trust cyber-resilience engine. Combines strict AST payload validation, multi-pass canonicalization, constant-time token auth, CPython heap zeroing (libc.memset), AES-256-GCM sealed ledgers, and rootless AppArmor Docker isolation to neutralize SQLi, XSS, RCE, and tampering in real time.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages