NetBox plugin for managing RIR (ARIN, RIPE, etc.) resources
Project description
NetBox RIR Manager
A NetBox plugin for managing Regional Internet Registry (RIR) resources directly from within NetBox.
Features
- Sync RIR resources — Import organizations, contacts (POCs), networks, and ASNs from your RIR into NetBox
- Auto-link to IPAM — Automatically link synced networks to existing NetBox Aggregates, Prefixes, and ASNs
- Write operations — Reassign, reallocate, remove, and delete networks directly through the plugin
- Ticket tracking — Monitor RIR tickets (reassignments, reallocations, deletions) and their status
- Per-user API keys — Each user stores their own RIR API key with encryption at rest
- Scheduled sync — Daily background jobs keep your RIR data up to date
- Pluggable backend architecture — Abstract backend system designed to support multiple RIRs (ARIN supported today; PRs welcome for RIPE, APNIC, etc.)
- Full REST API — All resources and actions are available through NetBox's REST API
- Sync logging — Full audit trail of every sync operation with status and details
Requirements
| Dependency | Version |
|---|---|
| Python | 3.12+ |
| NetBox | 4.5+ |
| pyregrws | 0.2.0+ |
Installation
1. Install the plugin
pip install netbox-rir-manager
Or if installing from source:
pip install git+https://github.com/jsenecal/netbox-rir-manager.git
2. Enable the plugin
Add the plugin to your NetBox configuration.py:
PLUGINS = [
"netbox_rir_manager",
]
3. Configure the plugin (optional)
Add any configuration overrides to PLUGINS_CONFIG in configuration.py:
PLUGINS_CONFIG = {
"netbox_rir_manager": {
"top_level_menu": True,
"sync_interval_hours": 24,
"auto_link_networks": True,
"enabled_backends": ["ARIN"],
"encryption_key": "", # defaults to NetBox SECRET_KEY
"api_retry_count": 3,
"api_retry_backoff": 2,
},
}
4. Run database migrations
cd /opt/netbox/netbox
python manage.py migrate
5. Restart NetBox
Restart both the NetBox WSGI service and the RQ worker. The exact command depends on your deployment method (systemd, Docker Compose, etc.). Refer to the NetBox documentation for your specific setup.
Configuration
| Setting | Default | Description |
|---|---|---|
top_level_menu |
True |
Display RIR Manager as a top-level menu item in the NetBox navigation |
sync_interval_hours |
24 |
Interval in hours between scheduled background syncs |
auto_link_networks |
True |
Automatically link synced RIR networks to matching NetBox Aggregates and Prefixes |
enabled_backends |
["ARIN"] |
List of enabled RIR backends |
encryption_key |
"" |
Key used to encrypt API keys at rest. Falls back to NetBox's SECRET_KEY when empty |
api_retry_count |
3 |
Number of retries for failed RIR API calls |
api_retry_backoff |
2 |
Exponential backoff multiplier between API retries (in seconds) |
Warning: The
encryption_key(or NetBox'sSECRET_KEYif left empty) is used to encrypt stored API keys. Changing or losing this key will make all previously encrypted API keys unrecoverable. Store it securely and back it up alongside your database.
Usage
Setting up an RIR Config
- Navigate to RIR Manager > Configs and create a new RIR Config
- Select the RIR backend (e.g. ARIN) and provide the organization handle for your account
Adding a User API Key
- Navigate to RIR Manager > User Keys and add a new key
- Select the RIR Config and enter your ARIN Online API key
- The key is encrypted at rest using the configured
encryption_key
Syncing resources
- Manual sync: Trigger a sync from the RIR Config detail view
- Scheduled sync: A background job runs automatically based on
sync_interval_hours
Synced resources (organizations, contacts, networks) appear under RIR Manager > Resources and are automatically linked to matching NetBox IPAM objects when auto_link_networks is enabled.
Write operations
From a network's detail view, you can perform write operations against the RIR:
- Reassign — Reassign a subnet from a parent network
- Reallocate — Reallocate a subnet from a parent network
- Remove — Remove a reassigned/reallocated network
- Delete — Submit a deletion request to the RIR
Write operations that require RIR approval will create a ticket that can be tracked under RIR Manager > Tickets.
REST API
All models and actions are exposed through NetBox's REST API under /api/plugins/rir-manager/. Available endpoints:
/api/plugins/rir-manager/configs/— RIR configurations/api/plugins/rir-manager/user-keys/— Per-user API keys/api/plugins/rir-manager/organizations/— RIR organizations/api/plugins/rir-manager/contacts/— RIR contacts (POCs)/api/plugins/rir-manager/networks/— RIR networks/api/plugins/rir-manager/sync-logs/— Sync operation logs/api/plugins/rir-manager/tickets/— RIR tickets
Development
Setup
git clone https://github.com/jsenecal/netbox-rir-manager.git
cd netbox-rir-manager
pip install -e ".[dev]"
Linting
ruff check netbox_rir_manager/ tests/
ruff format --check netbox_rir_manager/ tests/
Running tests
pytest
Tests require a running NetBox environment with PostgreSQL and Redis. See the CI workflow for the full setup.
Contributing
Contributions are welcome! In particular, PRs adding support for additional RIR backends (RIPE, APNIC, LACNIC, AFRINIC) are encouraged. The plugin uses a pluggable backend architecture — see netbox_rir_manager/backends/base.py for the abstract RIRBackend class to implement.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Project details
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_rir_manager-0.3.1.tar.gz.
File metadata
- Download URL: netbox_rir_manager-0.3.1.tar.gz
- Upload date:
- Size: 68.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6878dd69a7fbe4650114382dfdfb125bb2cee7e3a99f777fe7478c1b42180f7
|
|
| MD5 |
3f7d1b2dba0523ecb914bb8788636372
|
|
| BLAKE2b-256 |
253a1ee2b02c52d6bb474adb362f04a253dd9fe0f21603318ac2f087c1449bf1
|
Provenance
The following attestation bundles were made for netbox_rir_manager-0.3.1.tar.gz:
Publisher:
publish.yml on jsenecal/netbox-rir-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_rir_manager-0.3.1.tar.gz -
Subject digest:
c6878dd69a7fbe4650114382dfdfb125bb2cee7e3a99f777fe7478c1b42180f7 - Sigstore transparency entry: 963075057
- Sigstore integration time:
-
Permalink:
jsenecal/netbox-rir-manager@39cc138c5e8ac6b3511963cbeeea5c881c1e2b20 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/jsenecal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@39cc138c5e8ac6b3511963cbeeea5c881c1e2b20 -
Trigger Event:
release
-
Statement type:
File details
Details for the file netbox_rir_manager-0.3.1-py3-none-any.whl.
File metadata
- Download URL: netbox_rir_manager-0.3.1-py3-none-any.whl
- Upload date:
- Size: 82.2 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 |
ab61bd8265d8845562c0c36d6d189b3a624f2e4c911ee45c57e6fc09c0edcb0c
|
|
| MD5 |
e22f7f17b0cce8243e3556ddfb8bd10d
|
|
| BLAKE2b-256 |
86271089d7810c27051bfb6f1918e201ec0451e19619a65e57a090e9c528c017
|
Provenance
The following attestation bundles were made for netbox_rir_manager-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on jsenecal/netbox-rir-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_rir_manager-0.3.1-py3-none-any.whl -
Subject digest:
ab61bd8265d8845562c0c36d6d189b3a624f2e4c911ee45c57e6fc09c0edcb0c - Sigstore transparency entry: 963075060
- Sigstore integration time:
-
Permalink:
jsenecal/netbox-rir-manager@39cc138c5e8ac6b3511963cbeeea5c881c1e2b20 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/jsenecal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@39cc138c5e8ac6b3511963cbeeea5c881c1e2b20 -
Trigger Event:
release
-
Statement type: