Opt-in discovery of infrastructure tools from Deployment container images in a Kubernetes cluster. Used by GET /api/v1/discovery/kubernetes (API v1).
K8S_DISCOVERY_ENABLED=true
# Optional: restrict namespaces (comma-separated). Omit for all namespaces.
# K8S_DISCOVERY_NAMESPACES=production,staging
# Optional: kubeconfig path (default: in-cluster SA or ~/.kube/config)
# K8S_KUBECONFIG=/path/to/kubeconfigRequires API_SECRET (or equivalent auth) in production — discovery is not exposed anonymously. RBAC roles: admin, scanner.
When disabled, the endpoint returns 503 { "code": "K8S_DISCOVERY_DISABLED" }. Capabilities expose features.k8sDiscovery: true|false.
{
"enabled": true,
"images": ["haproxy", "nginx", "redis"],
"tools": ["HAProxy", "Nginx", "Redis"],
"unmapped": ["my-sidecar"]
}images— deduplicated image base names (registry/tag/digest stripped)tools— mapped to preset names inserver/lib/presets.ts(aligned with UIINFRA_PRESETS)unmapped— bases with no preset mapping (add manually in Stack tab)
Minimal ClusterRole for listing Deployments:
apiVersion: v1
kind: ServiceAccount
metadata:
name: cve-radar-discovery
namespace: cve-radar
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cve-radar-discovery
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["list", "get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cve-radar-discovery
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cve-radar-discovery
subjects:
- kind: ServiceAccount
name: cve-radar-discovery
namespace: cve-radarMount the ServiceAccount token in the CVE Radar pod (default in-cluster config). For namespace-scoped access, use a Role + RoleBinding per namespace and set K8S_DISCOVERY_NAMESPACES.
When features.k8sDiscovery is true, the Stack tab can call GET /api/v1/discovery/kubernetes and merge returned tools into the active stack (Import from cluster).
- Discovery is read-only — no cluster mutations.
- Do not grant
secrets,pods/exec, or write verbs to the discovery SA. - Run CVE Radar behind network policy; combine with tenant isolation (
docs/self-hosted/TENANTS.md) on shared installs.