Syncing permissions on IP Addresses with those from their corresponding Prefix in NetBox
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
netbox-ip-permissions-synchronization
Overview
This plugin allows you to compare and synchronize IP address permissions (tenant assignments and custom permission fields) with their parent prefix in NetBox. It's useful for ensuring consistent permission and tenant assignments across all IP addresses within a prefix.
Features
- Compare IP address permissions against their parent prefix
- View tenant and permission field assignments at a glance
- Synchronize all IP addresses with prefix permissions
- Automatic detection of mismatched permissions
- User-friendly interface with color-coded status indicators
Compatibility
Tested with NetBox versions 4.3.7.
Installation
If your NetBox installation uses virtualenv, activate it like this:
source /opt/netbox/venv/bin/activate
Install the plugin from PyPI:
pip install netbox-ip-permissions-synchronization
Or clone this repository, then go to the folder with it and install the plugin:
pip install .
To enable the plugin, add the plugin's name to the PLUGINS list in configuration.py (it's usually located in /opt/netbox/netbox/netbox/) like so:
PLUGINS = [
'netbox_ip_permissions_synchronization'
]
Don't forget to restart NetBox:
sudo systemctl restart netbox netbox-rq
Usage
Navigate to any Prefix in NetBox and look for the "Sync IP Permissions" button at the top of the page:
The synchronization page will show:
- Prefix information including tenant and permission assignments
- IP addresses that need synchronization (highlighted in yellow)
- IP addresses that are already synchronized (highlighted in green)
Select the IP addresses you want to synchronize using the checkboxes, then click:
- "Sync All IPs" - Synchronize all IP addresses in the prefix
Custom Fields Required
This plugin requires the following custom fields to be created in NetBox:
- tenant_permissions - Multiple objects (Tenant) field to store read-write permission assignments
- tenant_permissions_ro - Multiple objects (Tenant) field to store read-only permission assignments
These fields should be applied to both:
- IPAM > Prefix
- IPAM > IP Address
How It Works
- When you access the sync page for a prefix, the plugin fetches all IP addresses within that prefix
- It compares each IP address's tenant and permission fields with the parent prefix
- IP addresses with mismatched values are marked for synchronization
- You can selectively sync individual IPs or all IPs at once
- The sync operation updates:
- Tenant assignment (if the prefix has a tenant set)
tenant_permissionscustom fieldtenant_permissions_rocustom field
Plugin Settings
If you want to override the default values, configure the PLUGINS_CONFIG in your configuration.py:
PLUGINS_CONFIG = {
'netbox_ip_permissions_synchronization': {
# Add any future configuration options here
}
}
Currently, there are no required configuration options. All settings are managed through the NetBox UI.
Permissions Required
To use this plugin, users need the following permissions:
ipam.view_ipaddress- View IP addressesipam.change_ipaddress- Modify IP addressesipam.view_prefix- View prefixes
Troubleshooting
Custom fields not syncing
- Ensure that the
tenant_permissionsandtenant_permissions_rocustom fields exist in NetBox - Verify that these custom fields are assigned to both Prefix and IP Address models
- Check that the field names match exactly (case-sensitive)
No IP addresses found
- Make sure the prefix status is not "container" (container prefixes are skipped)
- Verify that IP addresses exist within the prefix range
- Check that you have permission to view the IP addresses
Permission denied errors
- Ensure your user account has the required permissions listed above
- Contact your NetBox administrator if you lack necessary permissions
Support
For issues, feature requests, or contributions, please visit the project repository.
License
GNU General Public License v3.0 - See LICENSE file for details.
Acknowledgements
This project was inspired in part by the work done in the netbox-interface-synchronization plugin by NetTech2001.
Their approach to interface synchronization in NetBox provided valuable guidance when designing the permission-sync logic for IP addresses.
A big thanks to them for sharing their project with the community!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netbox_ip_permissions_synchronization-0.0.6.tar.gz.
File metadata
- Download URL: netbox_ip_permissions_synchronization-0.0.6.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a662f15c4f66d972a88c5134ad36e9a069c77a1c1cb23c0a1f687a5b45a8696
|
|
| MD5 |
4b93918acb1fb59a194e2a885e1617bf
|
|
| BLAKE2b-256 |
cdc320eec28cb014e43f8146197a80c5ef3b3fd882240e6b9614d8298443828b
|
Provenance
The following attestation bundles were made for netbox_ip_permissions_synchronization-0.0.6.tar.gz:
Publisher:
publish.yml on LoH-lu/netbox_ip_permissions_synchronization
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_ip_permissions_synchronization-0.0.6.tar.gz -
Subject digest:
7a662f15c4f66d972a88c5134ad36e9a069c77a1c1cb23c0a1f687a5b45a8696 - Sigstore transparency entry: 760863853
- Sigstore integration time:
-
Permalink:
LoH-lu/netbox_ip_permissions_synchronization@66b0c58a271d7ffb2fe52cc4c117e6d9a291d7c3 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/LoH-lu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@66b0c58a271d7ffb2fe52cc4c117e6d9a291d7c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file netbox_ip_permissions_synchronization-0.0.6-py3-none-any.whl.
File metadata
- Download URL: netbox_ip_permissions_synchronization-0.0.6-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d709d396c22067c9294f808d26387ab494de5af565db1679ba1ca04edbeb87f0
|
|
| MD5 |
9963f76d66be810608abb98681e64a20
|
|
| BLAKE2b-256 |
92bec458c7ddfe772fe7034f7acc7b0718846e8b03cbf0534371710130bf1b83
|
Provenance
The following attestation bundles were made for netbox_ip_permissions_synchronization-0.0.6-py3-none-any.whl:
Publisher:
publish.yml on LoH-lu/netbox_ip_permissions_synchronization
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_ip_permissions_synchronization-0.0.6-py3-none-any.whl -
Subject digest:
d709d396c22067c9294f808d26387ab494de5af565db1679ba1ca04edbeb87f0 - Sigstore transparency entry: 760863855
- Sigstore integration time:
-
Permalink:
LoH-lu/netbox_ip_permissions_synchronization@66b0c58a271d7ffb2fe52cc4c117e6d9a291d7c3 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/LoH-lu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@66b0c58a271d7ffb2fe52cc4c117e6d9a291d7c3 -
Trigger Event:
push
-
Statement type: