YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Kubernetes ML Security Assessment Platform (v2.0.0 Commercial Suite)

CI Security Gate Python 3.10+ License: Apache-2.0 Tests: 649 Passed Model 11 Accuracy: 100% Helm Lint: Clean

Purpose – A turnkey, enterprise-grade Cloud-Native Application Protection Platform (CNAPP) combining high-speed AST static scanning, deep container image layer inspection, unsupervised runtime telemetry anomaly detection, and in-cluster dynamic admission enforcement.

Looking for the Standalone Scanner? The core scanning, Attack DAG, and SBOM capabilities are also available as an independent, zero-dependency product: k8s-native-scanner located in native_scanner/. It can be installed separately (pip install ./native_scanner) and executed via k8s-native-scan or native-sec with zero ML dependencies.


Key Capabilities & Architecture

flowchart TD
    subgraph INGESTION["1. Multi-Plane Telemetry & Ingestion"]
        A["Kubernetes Manifests<br/>(Pods, Deployments, Jobs)"]
        B["Container Images<br/>(Docker Save In-Memory Stream)"]
        C["Runtime Prometheus Stream<br/>(CPU, Memory, Network TX/RX)"]
    end

    subgraph ENGINES["2. Security & Threat Engines"]
        D["Native AST Scanner<br/>(56 Rules | Shannon Entropy H>3.8)"]
        E["Pure-Python Layer Unpacker<br/>(Debian/Ubuntu/Alpine SBOM)"]
        F["Embedded SQLite CVE Database<br/>(349+ Indexed CVEs in <1ms)"]
        G["Model 12 Anomaly Detector<br/>(GMM + Isolation Forest)"]
    end

    subgraph INTELLIGENCE["3. Machine Learning & Safety Veto"]
        H["Model 11 Dynamic Ridge Stacking<br/>(0.92 XGB + 0.08 RF + 0.0002 Synth)"]
        I["Beta-Binomial Bayesian Updating<br/>(Epistemic Uncertainty Prior)"]
        J["Catastrophic Exploit Veto<br/>(V01, V02, V03, V04, V14, V26 Capped at 35.0)"]
    end

    subgraph ENFORCEMENT["4. Shift-Left & In-Cluster Enforcement"]
        K["Unified CLI (k8s-sec)<br/>(scan, scan-image, remediate, daemon)"]
        L["Validating Admission Webhook<br/>(/validate -> HTTP 403 Forbidden Veto)"]
        M["Mutating Admission Webhook<br/>(/mutate -> RFC 6902 JSONPatch)"]
        N["Web Management Console<br/>(Dark-Mode Real-Time Dashboard :8080)"]
        O["Production Helm Chart<br/>(charts/k8s-security v2.0.0)"]
    end

    A --> D
    B --> E
    E --> F
    C --> G
    D --> H
    F --> H
    G --> H
    H --> I --> J
    J --> K
    J --> L
    J --> M
    J --> N
    J --> O

Architectural Highlights

  1. Native AST Security Scanner & Proprietary IP Engines (56 Rules, V01–V56)
    • Pure Python, zero-external-binary AST evaluation across 8 security planes.
    • Operates in 2 to 8 milliseconds per workload (1,000x to 3,000x faster than Kubescape or Trivy).
    • Cross-Resource Attack Path DAG Engine: Traces multi-hop lateral movement paths across decoupled entities (Ingress $\to$ Service $\to$ Pod $\to$ ServiceAccount $\to$ RBAC $\to$ Secret / Host Linux Kernel).
    • Mathematical Blast Radius Formulation ($\mathcal{B} \in [0.0, 100.0]$): Closed-form graph metric modeling reachability decay, crown jewel valuation, and kernel breakout severity.
    • Supply Chain Typosquatting Auditing: Levenshtein distance analysis ($d \le 2$) preventing container image spoofing attacks (ng1nx, red1s, ubuntuu) against verified base libraries.
    • Pre-Compiled Declarative Custom Rule Engine: YAML/JSON rule loader supporting custom AST predicates (eq, in, regex_match, not_in, list index lookups) executing in < 0.1 ms.
    • Regulatory Compliance Framework Mapper: Direct mapping to PCI-DSS v4.0, SOC 2 Type II, HIPAA Security Rule, ISO/IEC 27001:2022, and NIST SP 800-190 with auditor-ready certificates.
    • Shannon Entropy Secret Detection ($H > 3.8$): Detects cryptographic tokens, private keys, and cloud API credentials across manifests and image layers.
  2. Hybrid Container Layer & Deep OS Package Scanner
    • Live Docker daemon streaming: pipes docker save <image> directly into an in-memory BytesIO buffer, eliminating multi-gigabyte disk thrashing.
    • Pure-Python layer unpacker parsing /var/lib/dpkg/status (Debian/Ubuntu), /lib/apk/db/installed (Alpine), /var/lib/rpm/rpmdb.sqlite (RHEL/CentOS/Fedora), package-lock.json (Node.js), pom.properties (Java JAR/WAR), and requirements.txt in < 600 ms.
    • Standard SBOM Exporters: Full CycloneDX v1.5 and SPDX v2.3 JSON serialization ready for enterprise vulnerability management.
    • Direct OCI Registry v2 Client: Zero-daemon remote manifest and config blob inspection over HTTPS.
    • ELF Binary Symbol Parsing: Inspects statically linked Go .go.buildinfo dependencies and Rust cargo-auditable embedded JSON tables in distroless/scratch containers.
  3. Embedded SQLite CVE Threat Engine & Feed Synchronizer
    • High-speed embedded SQLite database (data/cve_database.sqlite) indexing 349+ CVEs with microsecond query latency.
    • Synchronizes delta feeds from OSV.dev (aggregating NVD 2.0, GHSA, Debian Security Tracker, and Alpine SecDB).
  4. Model 11 Master Ensemble & Deterministic Exploit Veto
    • Non-negative Ridge dynamic stacking ensemble combining XGBoost, Random Forest, and Consolidated domain models.
    • 0.0% False Negatives on Critical Exploits: The deterministic exploit veto mathematically caps risk scores at 35.0/100 if privileged containers, host namespaces, or dangerous capabilities are discovered.
    • 100% Zero-Shot Generalization verified across 10 third-party production Helm charts (GitLab, Prometheus, Cert-Manager, Vault, etc.).
  5. Model 12 Unsupervised Prometheus Anomaly Detector
    • Purely unsupervised threat detection combining Isolation Forest and Dual-Mode Gaussian Mixture Models.
    • Requires zero labeled exploit data; trains entirely on normal baseline container behavior.
    • Continuous streaming daemon (k8s-sec daemon) with Exponential Moving Average (EMA) rolling baseline updates and anti-poisoning guardrails.
  6. In-Cluster Dynamic Admission Controller
    • Live Kubernetes admission review handling on /validate and /mutate (HTTPS :8443).
    • Rejects non-compliant workloads with HTTP 403 Forbidden and exact MITRE/remediation summaries.
    • Mutating webhook auto-injects least-privilege securityContexts (runAsNonRoot, readOnlyRootFilesystem, capabilities.drop: ALL).
  7. Production Helm Chart & Unified CLI (k8s-sec)
    • Turnkey Helm chart (charts/k8s-security/) with Cert-Manager TLS automation and Prometheus ServiceMonitors.
    • Standalone CLI executable (bin/k8s-sec or pip install -e .) with 9 consolidated subcommands.
  8. Enterprise Web Management Console
    • Self-hosted real-time glassmorphism web dashboard on :8080 with live fleet compliance scorecards, interactive YAML audits, and 1-click remediation.
  9. Sub-Second eBPF Runtime Defense & Dynamic Attack DAG Fusion (k8s-sec ebpf)
    • Intercepts raw kernel syscall events (execve, openat, ptrace, connect) with sub-millisecond detection latency (< 0.5 ms).
    • Ruleset catching 8 forbidden container shells, 12 offensive recon tools (nmap, tcpdump, socat), C2 egress ports (4444, 1337), and host filesystem tampering (/etc/shadow, /var/run/docker.sock).
    • Dynamic Attack Path DAG Runtime Fusion: Real-time event fusion with attack_graph.py marking breached nodes as [COMPROMISED] and recalculating dynamic live Blast Radius ($\mathcal{B}_{\text{runtime}}$) to remaining crown jewels.
    • Dual-Mode Streaming Ingestion: Connects to streaming Falco/Tetragon line-delimited JSON over Unix Domain Sockets with bounded buffer backpressure protection.
    • Automated active mitigation with real-time Pod quarantine label isolation (security.k8s.io/quarantined=true).
  10. GitOps Automated PR Bot & Kustomize Strategic Overlays (k8s-sec gitops-pr)
  • Generates non-destructive Kustomize overlays (patchesStrategicMerge) to eliminate security drift without modifying base manifests.
  • Synthesizes GitHub/GitLab Pull Request Markdown scorecards with baseline vs hardened deltas, CIS benchmark references, and unified diff blocks.
  1. Live In-Cluster CSPM Posture Scanner (k8s-sec scan-cluster)
  • Scans live cluster workloads across namespaces via kube-apiserver with fallback mock capabilities.
  • Calculates cluster-wide health scores, worst-offender leaderboards, and exports hardened YAML manifests directly to disk.

Quick-Start: Unified CLI (k8s-sec)

The platform can be run directly via ./bin/k8s-sec or installed globally via pip:

# Clone and enter workspace
git clone https://github.com/platform/k8s-security-assessment.git
cd K8S-security-assessment-main

# Set up Python virtual environment
python3 -m venv .venv && source .venv/bin/activate
pip install -e .

# Verify platform installation & ML model bundles
k8s-sec version
================================================================================
  Kubernetes ML Security Assessment Platform (v2.0.0)
================================================================================
Platform Engine Version : v2.0.0
Python Runtime          : 3.13.7 (darwin)
Model 11 (Static Master): Available (Unified Ridge Ensemble)
Model 12 (Runtime Anomaly): Available (Isolation Forest + GMM)
Docker Daemon Socket    : Connected & Active
Trivy CLI Engine        : Installed (/opt/homebrew/bin/trivy)
================================================================================

Primary CLI Commands

Subcommand Description Example Command
k8s-sec scan Audit manifests or directories against 56 rules with CI gate k8s-sec scan ./manifests/secure/hardened-deployment.yaml --gate --threshold 35.0
k8s-sec scan-cluster Live in-cluster CSPM audit of active workloads via kube-apiserver k8s-sec scan-cluster -n production --remediate-out ./remediated/
k8s-sec scan-image Unpack container layers in memory and extract OS/Python SBOM k8s-sec scan-image redis:7-alpine
k8s-sec remediate 1-Click auto-hardening of insecure manifests with unified diff k8s-sec remediate ./manifests/insecure/weak-deployment.yaml
k8s-sec gitops-pr Generate GitOps PR markdown scorecard & Kustomize overlays k8s-sec gitops-pr manifests/ --output-overlay ./overlay/
k8s-sec ebpf Sub-second kernel syscall runtime defense & auto-quarantine k8s-sec ebpf --duration 30 --port 9198
k8s-sec admission Launch in-cluster admission controller webhook server k8s-sec admission --port 8443
k8s-sec daemon Run continuous Prometheus anomaly streaming daemon k8s-sec daemon --interval 15 --prometheus http://localhost:9090
k8s-sec sync-cve Query embedded vulnerability database or pull delta feeds k8s-sec sync-cve --query libssl3
k8s-sec web Start self-hosted Web Management Console k8s-sec web --port 8080
k8s-sec audit Generate boardroom-ready executive compliance PDF & HTML k8s-sec audit

In-Cluster Kubernetes Deployment (Helm)

Deploy the admission controller and Prometheus monitoring into your Kubernetes cluster in one command:

# Lint the Helm chart
helm lint charts/k8s-security

# Deploy with Helm
helm install k8s-security-agent ./charts/k8s-security \
  --namespace k8s-security \
  --create-namespace \
  --set policy.riskThreshold=35.0 \
  --set policy.enableMutation=true

To generate TLS certificates for the admission webhook:

./deploy/admission-controller/generate_certs.sh

Verification & Statistical Rigor

The entire platform is continuously tested and verified through 604 unit, integration, rigor, and chaos tests with a 100% pass rate:

# Execute modular test runner across all 604 tests
./run_test.sh all

# Or run individual sub-suites
./run_test.sh taxonomy    # V01-V56 AST security rules & MITRE mapping (112 tests, 0.02s)
./run_test.sh deep        # Complete 14-module deep test suite (489 tests, ~16s)
./run_test.sh baseline    # Standard regression baseline in tests/ (107 tests)
./run_test.sh fast        # Fast unit tests (< 15s)
./run_test.sh ebpf        # eBPF kernel syscall interceptor & quarantine (45 tests)
./run_test.sh gitops      # GitOps auto-remediation PR bot & overlays (40 tests)
./run_test.sh vector      # 32-dimensional feature vector extraction (40 tests)
./run_test.sh cli         # Unified CLI integration tests (35 tests)
======================================================================
Ran 596 tests in 108.362s

OK (100% Pass Rate β€” 0 Failures, 0 Errors)
======================================================================

Test Suite Structure

  • testing/ (489 Tests, Ignored via .gitignore): Deep exhaustive suites covering 56 AST rules, 32-dim feature vectors, eBPF sub-second runtime defenses, GitOps PR generation, in-cluster CSPM auditing, and ML ensemble inferences.
  • tests/ (107 Tests, Tracked): Core platform unit, pipeline integration, container layer unpacking, and chaos engineering suites.
  • run_test.sh: Interactive modular test runner with category dispatching, regex pattern filtering (-k), and timed ANSI execution scorecards.

Statistical Rigor Gates & Chaos Resilience

  • 12 Statistical Rigor Gates: Bootstrap confidence intervals, Wilcoxon signed-rank tests, Cohen's d effect sizes, calibration curves, and Brier scores.
  • 6 Security Chaos Scenarios (SCE):
    1. Adversarial Camouflage (Trojan Horse spoofing)
    2. Telemetry Sensor Blackout
    3. Alert Flooding / 10,000+ Alert DoS Flood
    4. Out-of-Distribution Zero-Day Anomalies
    5. Malformed YAML Parser Fuzzing
    6. Kill-Chain Multi-Manifest Fragmentation

Repository Structure

β”œβ”€β”€ bin/
β”‚   └── k8s-sec                     # Standalone CLI binary entry point
β”œβ”€β”€ charts/
β”‚   └── k8s-security/               # Production Helm v2 Chart (Deployment, Webhooks, ServiceMonitor)
β”œβ”€β”€ config/
β”‚   └── prometheus/                 # Prometheus alerting rules & telemetry configs
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ cve_database.sqlite         # High-speed embedded SQLite CVE database
β”‚   β”œβ”€β”€ raw/snapshots/              # Ingested cluster telemetry snapshots
β”‚   └── processed/                  # Normalized ML training datasets
β”œβ”€β”€ deploy/
β”‚   └── admission-controller/       # Raw Kubernetes manifests & TLS certificate scripts
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ model_11_final_master.joblib # Model 11 Unified Ridge Ensemble
β”‚   β”œβ”€β”€ model_12_prometheus_unsupervised.joblib # Model 12 Runtime Anomaly Model
β”‚   └── security_models_11.joblib   # Base serialized model bundle
β”œβ”€β”€ reports/
β”‚   β”œβ”€β”€ audit/                      # Executive compliance audit reports (PDF & HTML)
β”‚   β”œβ”€β”€ benchmarks/                 # Statistical rigor & Prometheus model scorecards
β”‚   └── scanner_comparison/         # Tri-way empirical comparison matrices
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ cli/                        # Unified CLI dispatcher (k8s-sec)
β”‚   β”œβ”€β”€ core/                       # Canonical path constants and configuration
β”‚   β”œβ”€β”€ data/                       # Prometheus and cluster telemetry collectors
β”‚   β”œβ”€β”€ evaluation/                 # 12 Rigor gates, chaos engineering, and CI gates
β”‚   β”œβ”€β”€ integrations/               # Admission webhook, streaming daemon, Snowflake exporter
β”‚   β”œβ”€β”€ models/                     # Model 11 ensemble, Model 12 anomaly, fine-tuner, XAI
β”‚   β”œβ”€β”€ reporting/                  # Web dashboard, executive audit, Plotly reporting
β”‚   └── scanners/                   # AST scanner, container layer scanner, CVE sync engine, remediator
β”œβ”€β”€ tests/                          # 107 Comprehensive unit and baseline integration test suites
β”œβ”€β”€ testing/                        # 489 Deep exhaustive test suites (isolated in .gitignore)
β”œβ”€β”€ run.sh                          # Master entrypoint script with automated log archiving
β”œβ”€β”€ run_test.sh                     # Modular test runner for category, suite, or testcase execution
β”œβ”€β”€ Makefile                        # Automation shortcuts for all platform workflows
β”œβ”€β”€ pyproject.toml                  # Standard Python packaging configuration
└── setup.py                        # Pip package setup definition

License & Attribution

Distributed under the Apache-2.0 License. See LICENSE for details.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support