Permission constraints for public IP addresses #11484
Replies: 1 comment 6 replies
-
Here is my attempt at something which could help you get started (corrections/improvements very welcome):
The above constraint JSON should make an object permission apply to the following ranges:
..all of which are examples of public Class-A IPv4 ranges. Append as desired. Considering that the above ranges span way larger networks, /24 may seem a rather odd prefix. However, as of Netbox 3.4.2 with my limited testing so far, this seems to work fine. I cannot quite seem to get the desired result if I change e.g. the first range to /8 on both ends. One caveat is that, if you apply this to a read-only permission, and an applicable user tries (on the /ipam/ip-addresses/ page) to edit an IP address which is outside the constrained range(s), Netbox will say "The requested page does not exist." instead of notifying the user that they lack permission. Or so it seems. I might report it as a bug after some further testing and verification. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am in the process of defining a permission based on the IP class. So RFC1918, Class A, B, C and public IP addresses.
The plan is to create a permission for public IPs. I have already tried a regex but unfortunately the netbox reports that json is invalid after a certain complexity.
Does anyone have an idea how to map this?
Beta Was this translation helpful? Give feedback.
All reactions