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.1.tar.gz (68.1 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.1-py3-none-any.whl (82.2 kB view details)

Uploaded Python 3

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

Hashes for netbox_rir_manager-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c6878dd69a7fbe4650114382dfdfb125bb2cee7e3a99f777fe7478c1b42180f7
MD5 3f7d1b2dba0523ecb914bb8788636372
BLAKE2b-256 253a1ee2b02c52d6bb474adb362f04a253dd9fe0f21603318ac2f087c1449bf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_rir_manager-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_rir_manager-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab61bd8265d8845562c0c36d6d189b3a624f2e4c911ee45c57e6fc09c0edcb0c
MD5 e22f7f17b0cce8243e3556ddfb8bd10d
BLAKE2b-256 86271089d7810c27051bfb6f1918e201ec0451e19619a65e57a090e9c528c017

See more details on using hashes here.

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

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