You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rego has a set of built-in functions for operating on IP addresses and CIDRs. One operation that's missing is merging of IPs and subnets into the smallest possible set. This operation is useful when operating on large numbers of IP/CIDR values (e.g., in the context of firewall rules). An example implementation of this operation can be found in the netaddr Python module.
It should be easy enough to implement this function natively without relying on a thirdparty library.
The text was updated successfully, but these errors were encountered:
…t of CIDRs
This commit adds a new builtin to merge adjacent subnets and return the
smallest possible list of CIDRs.
To help with computing CIDR blocks between two
IP networks, an implemetation from https://github.com/cilium/cilium
is leveraged.
Fixes: open-policy-agent#2692
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
…t of CIDRs
This commit adds a new builtin to merge adjacent subnets and return the
smallest possible list of CIDRs.
To help with computing CIDR blocks between two
IP networks, an implemetation from https://github.com/cilium/cilium
is leveraged.
Fixes: #2692
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
Rego has a set of built-in functions for operating on IP addresses and CIDRs. One operation that's missing is merging of IPs and subnets into the smallest possible set. This operation is useful when operating on large numbers of IP/CIDR values (e.g., in the context of firewall rules). An example implementation of this operation can be found in the
netaddr
Python module.It should be easy enough to implement this function natively without relying on a thirdparty library.
The text was updated successfully, but these errors were encountered: