mirror of
https://github.com/openziti/ziti.git
synced 2026-09-11 21:38:58 +00:00
9e3aff2bab
- adds HardenedJwksResolver, a jwks.Resolver that fetches an external jwt signer's jwksEndpoint with an http/https-only scheme check, a total timeout and a redirect cap - adds JwksFetchPolicy, gating a fetch on both the URL hostname and the address being connected to, applied to the first request and to every redirect hop - hostname gate: deniedHostnames blocks, allowedHostnames is exclusive when set; entries are an exact hostname or a '*.suffix' wildcard that matches subdomains at any depth but never the suffix itself, normalized to lower case punycode without a trailing dot - address gate: built-in blocked (metadata, link-local, link-local multicast, unspecified), then deniedIPs, then allowedIPs, then blockPrivateAddresses, first-match-wins with deny over allow - keeps the gates independent, so neither can authorize what the other refuses; the address check runs in the dialer against the resolved address, so a hostname that resolves to a blocked address is refused - adds the [edge.externalJwtSigners.jwksFetch] config section with compatible defaults: empty hostname lists, blockPrivateAddresses false, timeout 5s, maxRedirects 5 - takes IP lists as a flat address or a CIDR block, hostname lists as names only, and rejects an entry belonging to the other list at startup - shares the resolver from AuthModuleExtJwt, which is where this line constructs the per-signer jwks resolver, and reports an existing signer whose endpoint the configuration now refuses as its signers are loaded - rejects a jwksEndpoint the policy refuses when an external jwt signer is created or updated, surfaced as a field error on jwksEndpoint - adds CreateExtJwtSigner and GetExtJwtSigner management test helpers, which this line did not yet have - documents both gates, their deny-wins precedence, the accepted entry forms and the wildcard matching rules in etc/ctrl.with.edge.yml and CHANGELOG.md