Failure to access a ZooKeeper cluster via IP address with TLS
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java, kubernetes
- Lĩnh vực
- networking, security
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với lệnh zkCli.sh và thao tác tra cứu trạng thái listener bằng kubectl được mô tả trong issue. Đọc cấu hình client ZooKeeper liên quan đến việc xác minh hostname TLS và so sánh tùy chọn canonicalization được tài liệu hóa với hành vi reverse-DNS quan sát được. Công việc được xem là hoàn tất khi có một giới hạn được tài liệu hóa đối với các địa chỉ listener dựa trên IP hoặc có một bản sửa client upstream đã được thống nhất; issue hiện chưa chọn giữa hai phương án này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is actually a problem caused by ZooKeeper client (ie: what is called via zkCli.sh)
Problem
Accessing a cluster with valid SAN entry:
openssl s_client -connect 172.18.0.2:30504 | openssl x509 -noout -text
...
X509v3 Subject Alternative Name: critical
IP Address:172.18.0.2
using the Zookeeper Client:
/stackable/zookeeper/bin/zkCli.sh -server 172.18.0.2:30504 ls /
results in a connection failure:
Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching 172-18-0-2.kubernetes.default.svc.cluster.local found.
Steps to reproduce
Deploy a ZookeeperCluster with a listenerClass of external-unstable on a KinD cluster and with TLS enabled:
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: test-zk
spec:
clusterConfig:
authentication:
- authenticationClass: zk-client-auth-tls
tls:
quorumSecretClass: tls
serverSecretClass: zk-client-secret
image:
productVersion: 3.9.3
servers:
config:
resources:
cpu:
max: 500m
min: 250m
memory:
limit: 512Mi
storage:
data:
capacity: 1Gi
roleConfig:
# 👇 see here
listenerClass: external-unstable
roleGroups:
primary:
replicas: 3
[!NOTE]
todo: add complete minimal example.FWIW, I launched this with:
scripts/run-tests --test smoke_zookeeper-3.9.3_use-server-tls-true_use-client-auth-tls-true_openshift-false --parallel 1 --skip-deleteAnd then manually updated the
listenerClasson theZookeeperCluster.
Get the node hostname (in this case, IP) and node port:
kubectl -n kuttl-test-musical-stork get listener test-zk-server -o 'jsonpath={.status.ingressAddresses[0].address}:{.status.nodePorts.zk}'
Shell into the first replica, and run:
export CLIENT_STORE_SECRET="$(< /stackable/rwconfig/zoo.cfg grep "ssl.keyStore.password" | cut -d "=" -f2)"
export CLIENT_JVMFLAGS="
-Dzookeeper.authProvider.x509=org.apache.zookeeper.server.auth.X509AuthenticationProvider
-Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty
-Dzookeeper.client.secure=true
-Dzookeeper.ssl.keyStore.location=/stackable/server_tls/keystore.p12
-Dzookeeper.ssl.keyStore.password=${CLIENT_STORE_SECRET}
-Dzookeeper.ssl.trustStore.location=/stackable/server_tls/truststore.p12
-Dzookeeper.ssl.trustStore.password=${CLIENT_STORE_SECRET}"
and then
# replace the IP and port with what was returned in the earlier kubectl command
/stackable/zookeeper/bin/zkCli.sh -server 172.18.0.2:30504 ls /
The client will fail to connect due to an invalid name.
Explanation
The ZooKeeper client is doing a reverse DNS lookup on the IP provided in the command line, and then using that to connect to ZooKeeper. But the reverse DNS record is not in the SAN entries (this is expected).
@nightkr: in this case it seems to come up because it's running on the same control plane node as the apiserver, but pretty sure any hostNetworking pod that uses a service in the same way would trigger the same bug.
Considerations:
- Document that ZK cannot be exposed when the Listener reports back an IP address instead of hostname.
- Fix the ZK Client upstream.
- I have tried with
-Dzookeeper.sasl.client.canonicalize.hostname=falseto no avail.
- I have tried with
Add Reverse DNS entries to TLS certificate SANs.The reverse DNS record is not a reliable identifier to base trust on.
- Ngôn ngữ chính
- Rust
- Star
- 37
- Fork
- 11
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 stackabletech/zookeeper-operator
-
ZooKeeper znode controller: release finalizer without connecting when the parent is deleting Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
stackabletech/zookeeper-operator#1049 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
type/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
type/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Tất cả issue của stackabletech/zookeeper-operator
Issue tương tự
-
bug github_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
registrystack/registry-stack#1393 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
rocky-data/rocky#2181 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Đang mởbot:ai-assisted component:indexer QA-roadmap status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
midnightntwrk/midnight-indexer#1557 ·