Skip to main content

NetBox plugin for managing RIR (ARIN, RIPE, etc.) resources

Project description

NetBox RIR Manager

PyPI version License CI codecov NetBox

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's SECRET_KEY if 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

  1. Navigate to RIR Manager > Configs and create a new RIR Config
  2. Select the RIR backend (e.g. ARIN) and provide the organization handle for your account

Adding a User API Key

  1. Navigate to RIR Manager > User Keys and add a new key
  2. Select the RIR Config and enter your ARIN Online API key
  3. 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

netbox_rir_manager-0.3.0.tar.gz (68.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_rir_manager-0.3.0-py3-none-any.whl (82.1 kB view details)

Uploaded Python 3

File details

Details for the file netbox_rir_manager-0.3.0.tar.gz.

File metadata

  • Download URL: netbox_rir_manager-0.3.0.tar.gz
  • Upload date:
  • Size: 68.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for netbox_rir_manager-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c334bcdec335eb3151392ab2f5457a1fc0f4b47d22bfd73488d1c519d7b34363
MD5 9592f3a0588bac3a24fdaa39febdd908
BLAKE2b-256 dd5f03ff223724cccd28e05d0379a7dbb4e84259830256d3a1fedd1cf2971ff6

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_rir_manager-0.3.0.tar.gz:

Publisher: publish.yml on jsenecal/netbox-rir-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbox_rir_manager-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_rir_manager-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71402b040ad233db926ef92431e0d28a59e8c9ee870e51e08c2498fe23fc3951
MD5 1b28c036427551214879b8dfd6e2cea6
BLAKE2b-256 1eed6372dbc060f958a4697093f2f70118a6a7585d927e3e703b5d58fd6b16d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_rir_manager-0.3.0-py3-none-any.whl:

Publisher: publish.yml on jsenecal/netbox-rir-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page