rjgoyln opened a new pull request, #11272:
URL: https://github.com/apache/ozone/pull/11272

   ## What changes were proposed in this pull request?
   
   A wildcard, link-local, or scoped address binds fine but names no endpoint a 
peer can reach, and a zone identifier cannot go into an X.509 certificate at 
all. Nothing rejected such a value where it is read as an *advertised* address, 
so the misconfiguration turned up later as a peer that could not connect, or a 
certificate it could not use. `MiniOzoneClusterImpl` already pins the SCM bind 
hosts to `127.0.0.1` to keep `0.0.0.0` out of `ozone.scm.names` — the same 
leak, now caught where the value is read.
   
   The configured text is a second gap. `ozone.om.address = 2001:db8::1:9862` 
reads either as host `2001:db8::1` on port 9862, or as the whole literal on the 
property's default port; both are valid IPv6 literals, and since #11130 the 
second reading is taken silently instead of failing.
   
   - Reject a wildcard, link-local, or scoped host configured as an advertised 
address, naming the property and the value.
   - Reject an unbracketed IPv6 literal in `getPortNumberFromConfigKeys`, the 
one helper only ever given a property a port may follow.
   - Render the four remaining advertised peer identities through 
`HddsUtils.getHostPortString`, the part #11130 deferred here.
   
   The advertised set is `ozone.scm.names`, the SCM and OM per-node address 
properties, the four SCM client-facing `*.address` properties, 
`ozone.recon.address` and `hdds.datanode.hostname`. Every `*.bind.host` is 
excluded, and so is the unsuffixed `ozone.om.address`: it ships as 
`0.0.0.0:9862` and a non-HA OM binds to it.
   
   Loopback stays accepted, which is why `isValidInetForCsr` is not reused — 
excluding loopback is right for a certificate SAN and wrong for a single-host 
deployment. `ServerUtils.updateListenAddress` writes a server's bind host back 
into its own address property, but nothing inside a non-HA SCM reads those 
properties again after the servers bind, so the check does not trip on that 
write-back. Each converted identity site passes `getHostName()` and `getPort()` 
rather than a new `InetSocketAddress` overload, as #11130's review asked.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16308
   
   ## How was this patch tested?
   
   Unit tests across the six affected helpers cover the accepted set (DNS 
names, IPv4 and global IPv6 literals, loopback, bracketed authorities) and the 
rejected set (wildcard, link-local, scoped and prefixed literals, bracketed 
wildcards, unbracketed authorities). Each rejection test was confirmed to fail 
without the production change.
   
   Guards pin the cases where over-rejection is the greater risk: a bare `::` 
bind host, the shipped `ozone.om.address` wildcard default, and a bare IPv6 
literal in the host-only per-node SCM address property.
   
   ## Behavior change
   
   An IPv6 literal now needs brackets wherever a port may follow, so 
`ozone.scm.client.address = 2001:db8::1` becomes `[2001:db8::1]`, and a 
wildcard HTTP listener is configured through `*.http-bind-host`. This reverses 
the two bare-literal cases HDDS-15773 added, whose tests now assert the 
rejection.
   
   Generated-by: Claude Code (Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to