Simplify TLS verifier, skip DNSName checking#255
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCentral CRS HTTP client TLS handling now uses unified certificate-chain verification. Hostname-based checks, connection-type branching, service certificate fallback logic, related constants, and endpoint parsing have been removed. ChangesCentral CRS TLS verification
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
vladbologa
left a comment
There was a problem hiding this comment.
LGTM. I also think that chain-only verification is safe here.
The trust pool is narrow (StackRox CA + optional default TLS certs), and modifying either requires cluster access, at which point hostname checking adds no value.
Simplify TLS verifier: skip DNSName checking
centralVerifyFunc, keeping chain-only verificationisACentralCert,isLoopback, thecentral.stackroxfallback, and theServiceCACommonName/CentralCommonNameconstantsMotivation
The latest roxie fails in CI on GKE clusters when Central uses custom TLS certificates:
The custom cert has DNS SANs but no IP SANs, and the GKE LoadBalancer exposes only an IP address — so hostname verification always fails.
roxctlsidesteps this entirely because CI invokes it with--insecure-skip-tls-verify --insecure --ca "", bypassing all TLS validation.Why this is safe
The custom verifier only runs when a CA cert file is available, in which case the trust pool is a narrow, cluster-scoped
x509.NewCertPool()— not the system root CAs. It contains only the StackRox internal CA (fromcentral-tls) and, when configured, certs from the customdefaultTLSSecret. Forging a certificate trusted by this pool requires the CA private key, which is stored in thecentral-tlssecret on the cluster. Reading that secret requires kubectl access — at which point the attacker can read the admin password directly.Without a CA cert file, roxie falls back to Go's default TLS verification with system root CAs and full hostname checking.
Summary by CodeRabbit