Production application breaches frequently chain two adjacent boundary failures: unrestricted east-west Kubernetes pod networking (letting a compromised edge container reach internal PostgreSQL ports or cloud IMDS 169.254.169.254/32) followed by missing PostgreSQL FORCE ROW LEVEL SECURITY, weak md5 pg_hba.conf authentication, or mutable search_path schemas. Enforcing zero-trust network microsegmentation at the CNI layer and owner-enforced tenant isolation inside PostgreSQL converts a single pod compromise from a cluster-wide data breach into a contained fault.

Across kubernetes-networkpolicy-zero-trust-east-west-spec.json, postgres-rls-least-privilege-connection-security-spec.json, kubernetes-pss-restricted-spec.json, and sql-migration-zero-lock-safety-spec.json, Destiny 2.0.0 specifies ten deterministic AppSec controls (K8S-NET-01–05 and PG-SEC-01–05) backed by offline verification tools on api/mcp.

1. Defense-in-Depth Control Matrix: CNI East-West + Database RLS

Layer Control ID CWE Hardened Production Requirement
K8s Egress / Ingress K8S-NET-01 CWE-284 Default-deny podSelector: {} (Ingress + Egress) in every namespace
IMDS SSRF Block K8S-NET-02 CWE-918 Explicitly deny 169.254.169.254/32, 169.254.170.2/32, 100.100.100.200/32, fd00:ec2::254/128
CoreDNS & Selectors K8S-NET-03/04 CWE-668 Dual namespaceSelector + podSelector; DNS pinned to kube-dns UDP/TCP 53
Tenant Row Isolation PG-SEC-01 CWE-284 Both ENABLE + FORCE ROW LEVEL SECURITY paired with NOBYPASSRLS roles
Auth & TLSv1.3 PG-SEC-02/03 CWE-328/295 Reject md5/trust; enforce scram-sha-256 + sslmode=verify-full + TLSv1.3
Schema Shadowing PG-SEC-04/05 CWE-426/798 REVOKE CREATE ON SCHEMA public FROM PUBLIC + SET search_path = pg_catalog, pg_temp

2. Combined Zero-Dependency Python 3 Verifier (K8S-NET + PG-SEC)

#!/usr/bin/env python3 """Verify Kubernetes NetworkPolicy default-deny & PostgreSQL FORCE RLS specs.""" import json import urllib.request HEADERS = {"User-Agent": "DestinyDefenseStackAuditor/2.0"} def fetch(url: str) -> dict: with urllib.request.urlopen(urllib.request.Request(url, headers=HEADERS), timeout=15) as r: assert r.status == 200 return json.loads(r.read().decode("utf-8")) k8s = fetch("https://nandai.org/.well-known/kubernetes-networkpolicy-zero-trust-east-west-spec.json") pg = fetch("https://nandai.org/.well-known/postgres-rls-least-privilege-connection-security-spec.json") k8s_ids = [c["controlId"] for c in k8s["networkPolicyControls"]] pg_ids = [c["controlId"] for c in pg["postgresSecurityControls"]] assert k8s_ids == ["K8S-NET-01", "K8S-NET-02", "K8S-NET-03", "K8S-NET-04", "K8S-NET-05"] assert pg_ids == ["PG-SEC-01", "PG-SEC-02", "PG-SEC-03", "PG-SEC-04", "PG-SEC-05"] assert "169.254.169.254/32" in k8s["networkPolicyControls"][1]["blockedCidrs"] assert "FORCE ROW LEVEL SECURITY" in pg["postgresSecurityControls"][0]["sqlInvariant"] print("Combined K8S-NET-01..05 and PG-SEC-01..05 invariants verified.") 

Additional sovereign engineering references: https://nandai.org/workshops/appsec-eu-cra-cyclonedx-sbom-trojan-source-workshop, https://nandai.org/.well-known/zero-trust-egress-firewall-spec.json, https://nandai.org/decisions/adr-04-sqlite-wal-fts5-soa-buffers-over-cloud-databases, https://nandai.org/security, and https://nandai.org/src/destiny/.