You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Cluster Type Detection to Prevent Dev Mode on Non-Minikube Clusters #323
Priority: 🟡 MAJOR Effort: 30 minutes Related PR:#246 Related Issue:#322 Mentioned in: 4/6 code reviews
Add detection to verify dev mode only activates on actual Minikube clusters.
Problem
Dev mode can currently activate on ANY Kubernetes cluster if:
DISABLE_AUTH=true
ENVIRONMENT=local
Namespace in allow-list
Risk Scenario:
Someone accidentally deploys minikube manifests to a real cluster and dev mode activates.
Solution
Add cluster type detection by checking for Minikube-specific nodes:
funcisMinikubeCluster() bool {
// Check for minikube node by namenode, err:=server.K8sClient.CoreV1().Nodes().Get(
context.Background(),
"minikube",
v1.GetOptions{},
)
iferr==nil&&node!=nil {
returntrue
}
// Check for minikube node labelsnodes, err:=server.K8sClient.CoreV1().Nodes().List(
context.Background(),
v1.ListOptions{
LabelSelector: "minikube.k8s.io/name=minikube",
},
)
returnerr==nil&&len(nodes.Items) >0
}
funcisLocalDevEnvironment() bool {
// ... existing checks ...// NEW: Require actual minikube clusterif!isMinikubeCluster() {
log.Printf("Refusing dev mode: not running in minikube cluster")
returnfalse
}
returntrue
}
Acceptance Criteria
isMinikubeCluster() function implemented
Integrated into isLocalDevEnvironment() check
Dev mode only activates on actual Minikube
Error logging explains why dev mode refused
Unit tests for cluster detection logic
Integration test verifies rejection on non-Minikube
Testing
# Positive test (on minikube)
make local-up
# Should work# Negative test (simulate non-minikube)# Mock K8s cluster without minikube labels# Should refuse dev mode
The components/backend/handlers/middleware.go file now contains (lines 367-375):
// SECURITY: Removed the previous local-dev authentication bypass helpers.// The removed implementation relied on environment variables (test/dev flags)// which could be accidentally set in production, creating an authentication bypass risk.//// Production code must NEVER bypass authentication based on environment variables.// All requests require valid user tokens. No exceptions.
Conclusion:
There is no longer any dev mode to accidentally activate, so Minikube detection is unnecessary. All requests now require valid user tokens with no environment-based bypasses.
Activity
jeremyeder commentedon Jan 29, 2026
This issue is no longer valid and can be closed.
Why This Issue is Obsolete
The security risk this issue was designed to prevent has been completely eliminated by removing the dev mode authentication bypass entirely.
Timeline:
isLocalDevEnvironment()withDISABLE_AUTHbypass (the risk this issue warned about)Current State:
The
components/backend/handlers/middleware.gofile now contains (lines 367-375):Conclusion:
There is no longer any dev mode to accidentally activate, so Minikube detection is unnecessary. All requests now require valid user tokens with no environment-based bypasses.
Closing as obsolete. ✅