mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 06:47:41 -05:00
* feat(route53resolver): apply resolver rules to DNS resolution Resolver rules were stored and ignored. The embedded DNS server now consults them before resolving a name itself, via two CDI SPIs so core.common.dns imports neither Route 53 Resolver nor EKS: DnsForwardingRuleSource supplies the rules associated with one VPC, DnsClientVpcSource maps a query's source address to the VPC it came from. FORWARD rules forward the raw query to their TargetIps, each on its own port, in a random order with the next target tried when one does not answer. SYSTEM and RECURSIVE rules carry no targets and hand the query back to Floci, so a SYSTEM rule carves a subdomain out of a broader FORWARD. Matching is exact-or-subdomain on label boundaries and the most specific matching rule wins. A rule takes precedence over a private hosted zone matching the same name, as AWS documents. Floci's own suffixes and ec2.internal names resolve locally whatever the rules say, as AWS autodefines system rules for its internal domains. A rule whose targets are all unreachable answers SERVFAIL for that query only. Route53ResolverDnsForwardingRules reads the rule and association stores through Route53ResolverService across account partitions, since the packet path has no caller. EksClusterManager claims its cluster node container addresses for the cluster's resourcesVpcConfig.vpcId. * fix(route53resolver): scope rule DNS lookups to the querying account AssociateResolverRule stores whatever VPCId the caller names without proving ownership of it, so joining associations across account partitions by VPC id let one account redirect another account's cluster DNS by naming its VPC. The DNS client VPC now carries the account alongside the VPC id, and the rule source reads only that account's associations. Rules are fetched by id instead of scanned for, so a query reads only the rules an association named rather than the whole rule store, and registration warns when a running cluster's container addresses cannot be determined instead of leaving its rules silently inert. Also stop setting the authoritative bit on the SERVFAIL answer for a forwarded query: Floci is not the authority for a name a rule sends elsewhere. * style(route53resolver): import Optional instead of qualifying it inline * fix(route53resolver): scope rule DNS lookups to the querying region Route 53 Resolver is regional, so a rule created in one region governs nothing in another, but the DNS path matched on account and VPC alone. A rule created in eu-west-1 therefore steered a query from a VPC in us-east-1. The DNS client origin now carries the region, and a rule is only applied when its own region matches. The stores carry no region in their keys, so a rule's region is read back from the ARN the service minted for it rather than reshaping the stores. A stored rule with no parseable ARN has no region to claim and is treated as belonging to the region asking, which no create path can produce. Associations are now read as rule ids rather than as nodes, so a query no longer deep-copies a record per association when all it needs is which rules to look at. * test(eks): pin the warning when a cluster's addresses cannot be determined Inspecting the node container can fail, and when it does the cluster gets no VPC mapping and its queries quietly ignore every associated resolver rule. Nothing fails, so the warning is the only way a reader finds out, which makes it worth a test rather than leaving it to inspection. Levels are compared by severity rather than identity because JBoss LogManager has its own Level constants, so its WARN is not java.util.logging's WARNING.