Skip to main content

NetBox plugin for managing HTTP proxy configurations

Project description

netbox-proxy-plugin

CI License

A NetBox plugin for managing HTTP proxy configurations through the NetBox web interface and REST API.

This plugin integrates with NetBox's proxy routing system (PROXY_ROUTERS), allowing you to define and manage proxy configurations from the database instead of static configuration files.

Compatibility

NetBox Version Plugin Version
4.2+ 0.1.x

Features

  • Create, edit, and delete proxy configurations via the NetBox UI
  • Support for HTTP, HTTPS, SOCKS4, and SOCKS5 protocols
  • REST API for programmatic proxy management
  • Bulk import/edit/delete operations
  • Filtering and search
  • Optional proxy router that resolves proxies from the plugin database
  • Tags and custom fields support

Requirements

  • NetBox 4.2 or later
  • Python 3.10 or later

Installation

1. Install the package

pip install netbox-proxy-plugin

Or for development:

cd netbox-proxy-plugin
pip install -e .

2. Enable the plugin

Add to your NetBox configuration.py:

PLUGINS = [
    "netbox_proxy_plugin",
]

3. Run migrations

cd /opt/netbox/netbox
python manage.py migrate

4. Restart NetBox

sudo systemctl restart netbox netbox-rq

Configuration

Using the Plugin Proxy Router

To have NetBox resolve proxies from the plugin database, add the PluginProxyRouter to your PROXY_ROUTERS setting in configuration.py:

PROXY_ROUTERS = [
    "netbox_proxy_plugin.proxy_router.PluginProxyRouter",
    "utilities.proxy.DefaultProxyRouter",
]

The plugin router is listed first so it takes priority. If no matching proxy is found in the database, the default router falls back to the HTTP_PROXIES static configuration.

How Proxy Routing Works

NetBox's proxy routing system (introduced in PR #18681) calls resolve_proxies() whenever an outbound HTTP request needs proxy configuration. Each router in PROXY_ROUTERS is tried in order. The first router to return a non-empty result wins.

The PluginProxyRouter queries the plugin's Proxy model and returns matching entries as a dictionary:

{"http": "http://proxy.example.com:8080", "https": "https://proxy.example.com:8443"}

Usage

Web Interface

After installation, a Proxies menu appears in the NetBox navigation. From there you can:

  • List all configured proxies
  • Add a new proxy with protocol, server, port, and optional credentials
  • Edit or delete existing proxies
  • Bulk import proxies from CSV
  • Filter by protocol, server, or name

REST API

The plugin exposes a REST API at /api/plugins/proxies/proxies/.

List proxies:

curl -H "Authorization: Token <your-token>" \
  http://netbox.example.com/api/plugins/proxies/proxies/

Create a proxy:

curl -X POST \
  -H "Authorization: Token <your-token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "corp-proxy", "protocol": "http", "server": "proxy.corp.com", "port": 8080}' \
  http://netbox.example.com/api/plugins/proxies/proxies/

Model Reference

Proxy

Field Type Required Description
name string Yes Unique name for the proxy
protocol choice Yes http, https, socks4, socks5
server string Yes Proxy server address
port integer Yes Proxy server port
username string No Authentication username
password string No Authentication password
description string No Optional description

License

Apache License 2.0. See LICENSE.

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_proxy_plugin-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

netbox_proxy_plugin-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file netbox_proxy_plugin-0.1.0.tar.gz.

File metadata

  • Download URL: netbox_proxy_plugin-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netbox_proxy_plugin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3876e20a23c26d67e27f4dba1cf83d09d70ce7fc8a806bf9244f6a04031e6e1
MD5 4c08f934e8eb7ea2997c6455111eec82
BLAKE2b-256 c6cd21bdabca710590c1a6eda00e4c623def211b84972421700e4f2fe1a055ae

See more details on using hashes here.

File details

Details for the file netbox_proxy_plugin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: netbox_proxy_plugin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for netbox_proxy_plugin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f06abe553fe6858f96466b2ab4f62eec703b914cdbce5218a7b5ae7066f534
MD5 67768f74915c201b73e4af05e7512b20
BLAKE2b-256 92b8a8e70e960457dc2e6c50672c5789d9496892521186a09dcc74b4fec2489e

See more details on using hashes here.

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