feat(rules): support CIDR ranges in admin-ips - #108
Open
selfuryon wants to merge 3 commits into
Open
Conversation
Voluntary exit authorization via server.rules.admin-ips previously required an exact IP match, which is unusable for ephemeral workloads (e.g. Kubernetes pods) whose addresses change on every reschedule. Admin-ips entries may now be individual IP addresses or CIDR ranges; a plain IP is treated as a CIDR covering that address alone. Invalid entries are now rejected at startup instead of silently never matching.
This was referenced Aug 3, 2026
AntiD2ta
requested changes
Aug 5, 2026
AntiD2ta
left a comment
Contributor
There was a problem hiding this comment.
Happy to see this progressing.
Apart from the other comments, could we add test cases (on both rules_tests.go and sign_test.go) for a (non-CIDR) IPv6 address?
Address review feedback on attestantio#108: - Invalid admin-ips entries are now logged and skipped instead of failing New(), since a misconfigured entry can only narrow the set of addresses trusted for voluntary exits, never widen it, so it's not worth blocking Dirk's startup over. - A CIDR entry with non-zero host bits (e.g. "10.1.2.3/24" instead of the network address "10.1.2.0/24") is now also treated as invalid and skipped, rather than net.ParseCIDR silently widening it to the whole network. - Add test coverage for plain IPv6 addresses and for CIDR entries with non-zero host bits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now admin-ips entries may now be individual IP addresses or CIDR ranges; a plain IP is treated as a CIDR covering that address alone. Invalid entries are now rejected at startup instead of silently never matching.