Failure to access a ZooKeeper cluster via IP address with TLS
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- java, kubernetes
- Área
- networking, security
Línea de trabajo
Empieza reproduciendo el fallo con el comando zkCli.sh y la consulta del estado del listener con kubectl descritos en la issue. Lee la configuración del cliente de ZooKeeper implicada en la verificación del nombre de host mediante TLS y compara la opción de canonicalización documentada con el comportamiento de DNS inverso observado. Se considerará terminado si se documenta una limitación para direcciones de listener basadas en IP o si se acuerda una corrección upstream del cliente; la issue todavía no se decide entre ambas opciones.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 37
- Forks
- 11
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 10
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stackabletech/zookeeper-operator
-
ZooKeeper znode controller: release finalizer without connecting when the parent is deleting Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
stackabletech/zookeeper-operator#1049 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
type/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
-
type/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Todos los issues de stackabletech/zookeeper-operator
Issues similares
-
risk:low runtime status:in-progress type:test
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
bevyengine/bevy#25861 ·