[Low] ate-api-server accepts client certificates chained to system roots when --pod-identity-ca-certs is unset
Maintainer thường phản hồi trong vòng 1 ngày
@abhisheksharma2411 đang làm issue này rồi.
Từ ngày 20/10/2026.
- #3023 của @abhisheksharma2411 — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Bắt đầu tại cmd/ateapi/main.go, ở buildServerTLSConfig (các dòng 631–643), và kiểm tra nhánh có caCertsPath trống cấu hình chứng chỉ máy khách như thế nào. Đọc hành vi xác thực máy khách TLS của Go được mô tả trong issue, sau đó chạy các bài kiểm thử ate-api-server liên quan. Hoàn thành khi cấu hình với đường dẫn trống không xác thực chứng chỉ máy khách thông qua các root của hệ thống và các bài kiểm thử bao quát hành vi đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When --pod-identity-ca-certs is omitted (empty caCertsPath), cmd/ateapi/main.go:buildServerTLSConfig returns a tls.Config with ClientAuth: tls.VerifyClientCertIfGiven and ClientCAs: nil. Under Go's crypto/tls implementation, a nil ClientCAs causes client certificate verification to fall back to the host system root CAs, allowing any client certificate trusted by a system root containing a SPIFFE URI SAN to authenticate as an mTLS principal.
Details
In cmd/ateapi/main.go:631-643:
func buildServerTLSConfig(ctx context.Context, credBundlePath, caCertsPath string) (*tls.Config, error) {
serverCert := credbundle.Loader(credBundlePath)
const clientAuth = tls.VerifyClientCertIfGiven
if caCertsPath == "" {
return &tls.Config{
GetCertificate: serverCert,
ClientAuth: clientAuth,
}, nil
}
When caCertsPath == "", ClientCAs is left nil. In Go's crypto/tls/handshake_server.go:
opts := x509.VerifyOptions{
Roots: c.config.ClientCAs,
CurrentTime: c.config.time(),
Intermediates: x509.NewCertPool(),
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
}
When opts.Roots is nil, x509.Certificate.Verify defaults to the host's system root CAs. If a client certificate verified by any system CA includes a URI SAN, apiauthn.UnaryServerInterceptor extracts the URI SAN via mtlsPeerIdentity and treats the caller as an authenticated mTLS principal without inspecting or requiring bearer token authentication.
Impact
Low: in standard deployments (manifests/ate-install/ate-api-server.yaml:180), --pod-identity-ca-certs is always provided. The fallback occurs only when --pod-identity-ca-certs is omitted. In standard deployments (manifests/ate-install/ate-api-server.yaml:180), --pod-identity-ca-certs is always provided, pointing to /run/podidentity.podcert.ate.dev/trust-bundle.pem. The fallback occurs only in non-standard or standalone deployments where --pod-identity-ca-certs is deliberately omitted. Furthermore, obtaining a publicly-trusted certificate containing a URI SAN (e.g., spiffe://...) with the clientAuth EKU is non-trivial under standard Web PKI CA baseline requirements. NetworkPolicies on ate-api-server also restrict ingress on port 443 to control plane pods or namespaces labeled ate.dev/api-access=true.
Suggested fix
When caCertsPath == "", explicitly disable client certificate verification by setting ClientAuth: tls.NoClientCert in the returned tls.Config:
if caCertsPath == "" {
return &tls.Config{
GetCertificate: serverCert,
ClientAuth: tls.NoClientCert,
}, nil
}
Related
No existing duplicate issues or PRs found.
- Ngôn ngữ chính
- Go
- Star
- 5.7k
- Fork
- 612
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 566
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của agent-substrate/substrate
-
[Low] CSI plugin builds staging directories from storage_volume_id without a containment checkĐang mởarea/security kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
agent-substrate/substrate#2935 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Low] CleanupSandboxState joins an unchecked id into paths it RemoveAll()sCó thể đã có người làm @ericcurtin đã nhận hôm nay. Đang mởarea/security kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agent-substrate/substrate#2932 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Low] guestVolumeSource can map host paths containing ".." outside the microVM guest shareCó thể đã có người làm @jiayimeow đã nhận 3 ngày trước. Đang mởarea/security kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
agent-substrate/substrate#2920 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Low] setupImageVolumes builds host mount paths from vol.Name without a containment checkCó thể đã có người làm @abhisheksharma2411 đã nhận 2 ngày trước. Đang mởarea/security kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
agent-substrate/substrate#2919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cloud SQL backend: document (and optionally provision) Private Service Connect for ATE_API_POSTGRES_CLOUDSQL_IP_TYPE=pscCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea/dev-infra kind/docs kind/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
agent-substrate/substrate#2875 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của agent-substrate/substrate
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
FiloSottile/age#758 ·
-
nginx configĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày