Skip to content
pavann19Public

About

Kubernetes validating admission webhook in Go that enforces signed container images and checks model artifacts.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ModelGate

Documentation index | Verified baseline and remaining limits

ModelGate is a Go Kubernetes validating admission webhook. It checks Pod CREATE/UPDATE and UPDATE of pods/ephemeralcontainers against a namespace-scoped ModelGatePolicy. This release candidate is under security review; it is not production-certified.

The platform case study examines admission under concurrent load, signing-key rotation, verification saturation and webhook outage/recovery. Three local runs retained 1,840 API-level measurements with real registry traffic and cosign verification. All 60 intentional-outage requests failed closed; admission resumed 6.05–9.21 seconds after scale-up. These are single-node kind observations, with raw samples and contention limits published alongside the results; they are not production capacity or availability guarantees.

Current security demonstration documents bounded-v1 compatibility, local test evidence and remaining deployment gates. No production readiness claim is made.

The historical matched latency comparison records 4.203 s → 600.8 ms p95 (85.7% reduction) for eight same-image containers and four concurrent workers in local kind trials, with all 800 samples and a recomputation script. This workload-specific October result is not a benchmark of current main or a production SLO.

The matching October trust/outage record documents 420/420 repeated negative-signature controls denied, 120/120 selected positive controls admitted, and 60/60 injected webhook-outage requests blocked, with observed local recovery of 2.97–6.04 s. This is a separate dataset from the case study's 6.05–9.21 s run.

Architecture

An admission request reaches the webhook, which consults namespace policy and verification checks before its decision.

flowchart LR
    A["Kubernetes API server"]
    W["Validating webhook"]
    P["Namespace policy source"]
    S["Image signature verification"]
    O["Optional model-artifact check"]
    Y["Allow admission"]
    N["Deny / fail closed"]
    Q["Proposal-only analysis worker"]
    A --> W
    W --> P
    W --> S
    W --> O
    W --> Y
    W --> N
    A --> N
    W -.-> Q
Loading

Simplified view; see admission lifecycle for details.

Enforcement

  • The production verifier requires repository@sha256:<64 lowercase hex characters> and verifies its cosign signature against the policy's public key. Mutable tags are denied.
  • All regular, init and ephemeral container images are checked.
  • hostPID, hostIPC, hostNetwork, hostPath and privileged containers are denied.
  • An optional modelgate.dev/model-artifact annotation selects a policy-allow-listed local file in the webhook filesystem. Its SHA-256 and JSON-object safetensors framing are checked, and recognized pickle/PyTorch archives are rejected. This is not full tensor-schema validation.
  • Missing, ambiguous or unreadable policies fail closed. Explicit policy exemptions bypass every check and require a reason. The installation excludes kube-system and the webhook namespace.

The artifact annotation is optional. ModelGate does not discover unannotated models, bind a webhook-local file to workload mounts, enforce provenance/SBOMs, or monitor running containers. Provenance, keyless identity, transparency-log, expiry and revocation checks are unsupported; the operator-managed public key is the trust root.

Read and run

Build with Go 1.27.4: go build ./cmd/webhook. The runtime uses bounded-v1 Go cryptography without an external verification executable. Only PKIX PEM ECDSA P-256 keys and SHA-256/ASN.1 DER signatures are supported. See the verification contract. Run dependency-free unit suites with go test ./internal/... ./api/... ./cmd/.... go test ./... additionally requires envtest assets, Docker and cosign; it is not a unit-only command. See the testing guide for prerequisite setup and the distinction between mocks and real infrastructure.

TLS provisioning, registry destination policy and ModelGatePolicy management are operator responsibilities. Registry security describes required host/CIDR trust and private registry configuration. The Helm chart requires a CA bundle; raw Kustomize manifests require CA injection before use. Keep failurePolicy: Fail. A webhook outage blocks protected Pod admissions.

Metrics and structured decisions are available on port 8080 and container logs. Metrics are unauthenticated; restrict access at the cluster network boundary. No managed production deployment, real verification latency, throughput or scale claim is made.

The hosted CI and worker checks passed for runtime revision e9af94f on 1 November 2026, including Linux FIFO, race, real-signature, API-server, Helm and kind integration checks. Each later PR must pass its own checks before promotion. The retained local observation stopped at 15 hours and does not satisfy the original 24-hour gate; a distinct-image control regressed. See the lifecycle guide for the remaining limits.

License

Original project code is licensed under Apache-2.0. Dependency licenses and distribution obligations are retained in third-party notices.

Contributing and maintenance

See contributing, maintenance rules and security reporting. Changes reach main through reviewed PRs and required checks.

About

Kubernetes validating admission webhook in Go that enforces signed container images and checks model artifacts.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages