Repository navigation
Conversation
…est to check external path
…y write that rule for the JN
|
Nightly tests: |
NickLarsenNZ
left a comment
There was a problem hiding this comment.
Partial review. need to close all of the github tabs because it is unusable.
| if cluster.has_kerberos_enabled() { | ||
| volume_mounts.push( | ||
| VolumeMountBuilder::new(&*SPNEGO_KEYTAB_VOLUME_NAME, SPNEGO_KEYTAB_DIR) | ||
| .build(), | ||
| ); | ||
| } |
There was a problem hiding this comment.
If I understand correctly, volumes (further above) are always set, but the mounts are only set if cluster.has_kerberos_enabled().
Do we want to also make volumes conditional?
| /// with Kerby, which cannot parse the keytab as the secret-operator writes it, but parses | ||
| /// the same entries written by `ktutil`. `wkt` appends to an existing file, so any existing | ||
| /// file is removed first. `ktutil` exits with 0 even when a command fails, so success is | ||
| /// judged by the written file. |
There was a problem hiding this comment.
Does secret-operator do something wrong?
Can you give an example of the differences in the keytab secret-operator produces and the one Kerby expects?
There was a problem hiding this comment.
Yes, there is an issue here: stackabletech/secret-operator#785
| /// HDFS superuser, and likewise for `dn` and `jn`. So only the principals the daemons log in as | ||
| /// keep these short names. Any other principal with these service names is left unchanged, and | ||
| /// Hadoop rejects the non-simple result, so it cannot authenticate. `DEFAULT` maps all other | ||
| /// principals. |
There was a problem hiding this comment.
Is that to say:
nn/host1->nndn/host1->dnjn/host1->jnfoo/host1->foo/host1
There was a problem hiding this comment.
I think a test for auth_to_local_rules would help.
Apologies if there already is one, the Github review page is almost unusable for me and I can't easily find things anymore.
Description
Part of https://github.com/stackabletech/internal-issues/issues/191
Read this and the following comments: https://github.com/stackabletech/internal-issues/issues/191#issuecomment-7136264854
With Kerberos enabled, the HTTP endpoints of name, data and journal nodes enforce SPNEGO, with /prom as the only exception, as Prometheus cannot authenticate via SPNEGO. SPNEGO works both via the pod FQDNs and via the listener addresses published in the discovery ConfigMap.
core-site.xml:hadoop.http.authentication.type=kerberos, anonymous access off,/promwhitelisted. Data nodes additionally getAuthenticationFilterInitializerinhadoop.http.filter.initializers, asDatanodeHttpServerdoes not useDFSUtil.getHttpServerTemplate.HTTP/principal in the keytab (hadoop.http.authentication.kerberos.principal=*). The keytab volume gets the pod scope (pod FQDNs, used by/imagetransferand/getJournal) and, for name and data nodes, the listener scope, so SPNEGO also works via the addresses published in the discovery ConfigMap, including NodePort IPs.*, Hadoop reads the keytab with Kerby, which cannot parse the keytab as the secret-operator writes it (the entry it adds and removes leaves a hole). The main container rewrites the keytab withktutilto/stackable/config/spnego.keytab, which the HTTP servers use. That directory is a memory-backedemptyDir, so the copy stays off the node's disk, like the secret-operator's tmpfs original.GetJournalEditServlet.isValidRequestoronly accepts requesters with the journal node's own short name, so journal nodes map the name node principal tojnviahadoop.security.auth_to_local. The rule is set on journal nodes only; no principal is mapped tonn.BREAKING: a
configOverridesentry forhadoop.security.auth_to_localon journal nodes replacesthe operator's rule and must include it, otherwise name nodes cannot fetch edits and fail to start.
Tested
kerberos, new step 33: without a ticket 401, with SPNEGO 200, via pod FQDNs and via the name node addresses from the discovery ConfigMap;/promstays open. The test now uses theexternal-unstablelistener class, so the discovered addresses are NodePort IPs.cluster-internal), including the chaos monkey step (name node restarts reading edits via/getJournal).curl --negotiatevia a name node's NodePort address returns 401 without and 200 with a ticket.Manual testing
Testing SPNEGO from outside the cluster
With a Kerberos-enabled cluster whose name nodes use
external-unstable(e.g. thekerberoskuttl test with
--skip-delete), in its namespace:Get a name node HTTPS address from the discovery ConfigMap:
Create a test principal on the KDC:
In a second terminal, forward the KDC (TCP only):
kubectl -n $NS port-forward svc/krb5-kdc 18888:88Save as
/tmp/krb5.conf, with<REALM>replaced by the test's realm:Without a ticket, expect 401:
With a ticket (password
tester), expect 200:klistshows a ticket forHTTP/<address without port>@<REALM>.-kskips certificate verification to keep the steps short.rdns/dns_canonicalize_hostnamemake the client request a ticket for the address exactly as given, including an IP.
Follow-ups
ktutilrewrite unnecessary.Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker