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
Implement vSphere cluster name lookup and exact service account name construction
Rewrite validation to get actual vSphere cluster names from supervisor and
construct expected service account names using exact pattern matching.
Implementation follows the reference pattern exactly:
1. Get vSphere cluster using cluster API
2. Construct service account name: fmt.Sprintf("%s-%s", vsphereCluster.Name, "pvcsi")
3. Do exact string matching instead of regex patterns
Key improvements:
- Query actual CAPI clusters from Kubernetes API
- Construct expected names using real cluster names
- Single-cluster optimization for guest cluster scenarios
- Multi-cluster validation for supervisor scenarios
- Graceful fallback when cluster API unavailable
- Exact string matching eliminates all regex bypass vulnerabilities
Security benefits:
- Impossible to bypass with crafted names - must match real cluster
- Validates against actual cluster existence in the system
- Prevents attacks with non-existent cluster names
- Maintains namespace isolation
- No regex patterns that can be exploited
Reference implementation:
https://github-vcf.devops.broadcom.net/vcf/kubernetes-service/blob/0319c5f7c9a4300b0a97296e2b3ad6283fc6bae0/addons/controllers/csi/vspherecsiconfig_controller.go#L322-L331
Author: ab002488
Fixes: Bug 3687875
Vulnerability-ID: SUP-VULN-0009
0 commit comments