A Bind provisioning plugin that uses netbox_dns for its data source
Project description
Netbox Bind Provisioner
The Netbox Bind Provisioner plugin implements a lightweight DNS server inside Netbox and builds a bridge for BIND and other DNS Servers implementing RFC9432 to retrieve DNS Zones directly from Netbox using DNS native mechanisms.
Plugin configuration
While providing Zone transfers via AXFR, the Server also exposes specialized catalog zones that BIND and other RFC9432 compliant DNS Servers use to automatically discover newly created zones and remove deleted ones. The plugin supports views and basic DNS security via TSIG.
The plugin exposes one catalog zone per view. Each catalog zone is made available under the special zone name "catz" and addtionally under "[viewname].catz" and may be queried through the built-in DNS server just like any other dns zone.
For proper operation, each view requires an installed TSIG key, and the
bind-transfer-endpoint must be running as a separate background service using
the manage.py command. Note that DNSSEC support will be added once BIND9
provides a mechanism to configure it through the Catalog Zones system.
To start the service in the foreground:
manage.py bind-transfer-endpoint --port 5354
This process needs to be scheduled as a background service for the built-in DNS Server to work correctly. For Linux users with Systemd (Ubuntu, etc), Matt Kollross provides a startup unit and instructions here.
Service parameters
| Parameter | Description |
|---|---|
| --port | Port to listen on for requests (defaults to 5354) |
| --address | IP of interface to bind to (defaults to 0.0.0.0) |
Plugin settings
| Setting | Description |
|---|---|
| tsig_keys | Maps a TSIG Key to be used for each view. |
Installation guide
This setup provisions a BIND9 server directly with DNS data from NetBox. BIND9 can optionally run on a separate server. If so, any reference to 127.0.0.1 in step 6 must be replaced with the IP address of the NetBox host. TCP and UDP traffic from the BIND9 server to the NetBox host must be allowed on port 5354 (or the port you have configured).
This guide assumes:
- Netbox has been installed under /opt/netbox
- Bind9 is installed on the same host as Netbox
- The Netbox DNS Plugin netbox-plugin-dns is installed
- The following dns views exist in Netbox DNS:
public(the default)private
-
Preliminaries
- Install Bind9 on the same host that netbox is on.
- Generate a TSIG Key for the
publicandprivatedns views respectively.
-
Adding required package
cd netbox echo netbox-plugin-bind-provisioner >> local_requirements.txt . venv/bin/activate pip install -r local_requirements.txt -
Updating netbox plugin configuration (configuration.py) Change following line from
PLUGINS = ['netbox_dns']to
PLUGINS = ['netbox_dns', 'netbox_plugin_bind_provisioner']Configure the Bind Exporter Plugin using the PLUGINS_CONFIG dictionary. Change
PLUGINS_CONFIG = {}to
PLUGINS_CONFIG = { "netbox_plugin_bind_provisioner": { "tsig_keys": { "public": { "keyname": "public_view_key", "algorithm": "hmac-sha256", "secret": "base64-encoded-secret" }, "private": { "keyname": "private_view_key", "algorithm": "hmac-sha256", "secret": "base64-encoded-secret" } } } }Note that the tsig-key attributes keyname, algorithm and secret form a dictionary in following python structure path:
PLUGINS_CONFIG.netbox_plugin_bind_provisioner.tsig_keys.<dns_view_name>This allows the plugin to map requests to the right dns view using the tsig signature from each request.
-
Run migrations
python3 netbox/manage.py migrate -
Start listener
This step runs the DNS endpoint used by bind to configure itself. You may want to write a service wrapper that runs this in the background. A guide for setting up a systemd service on Ubuntu is provided by Matt Kollross here. Dont forget to activate the venv if you do decide to run this service in the background.
Note that
--port 5354is optional. The listener will bind this port by default.python3 netbox/manage.py bind-transfer-endpoint --port 5354 -
Configuring a Bind9 to interact with Netbox via the bind-transfer-endpoint endpoint. Note that its not possible to give all the correct details of the
optionsblock as it is heavily dependent on the Operating System used. Please dont forget to adjust as required.########## OPTIONS ########## options { allow-update { none; }; allow-query { any; }; allow-recursion { none; }; notify yes; min-refresh-time 60; }; ########## ACLs ########## acl public { !10.0.0.0/8; !172.16.0.0/12; !192.168.0.0/16; any; }; acl private { 10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16; }; ########## ZONES ########## view "public" { key "public_view_key" { algorithm hmac-sha256; secret "base64-encoded-secret"; }; match-clients { public; }; catalog-zones { zone "catz" default-masters { 127.0.0.1 port 5354 key "public_view_key"; } zone-directory "/var/lib/bind/zones" min-update-interval 1; }; zone "catz" { type slave; file "/var/lib/bind/zones/catz_public"; masters { 127.0.0.1 port 5354 key "public_view_key"; }; notify no; }; }; view "private" { key "private_view_key" { algorithm hmac-sha256; secret "base64-encoded-secret"; }; match-clients { private; }; catalog-zones { zone "catz" default-masters { 127.0.0.1 port 5354 key "private_view_key"; } zone-directory "/var/lib/bind/zones" min-update-interval 1; }; zone "catz" { type slave; file "/var/lib/bind/zones/catz_private"; masters { 127.0.0.1 port 5354 key "private_view_key"; }; notify no; }; }; -
Restart bind - Done
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_plugin_bind_provisioner-1.0.5.tar.gz.
File metadata
- Download URL: netbox_plugin_bind_provisioner-1.0.5.tar.gz
- Upload date:
- Size: 23.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 |
1f63ebe30bf5d4b0efb15830ee5cc52c394ac47ac6b14a4aade218d7464b54d8
|
|
| MD5 |
c74732bf57d70a0920bccaa0fc00761a
|
|
| BLAKE2b-256 |
09dea7a4b0909edbff41f108a4095f593e4f9651df67f3a523d8d0629a3a3da3
|
Provenance
The following attestation bundles were made for netbox_plugin_bind_provisioner-1.0.5.tar.gz:
Publisher:
python-publish.yml on Suraxius/netbox-plugin-bind-provisioner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_plugin_bind_provisioner-1.0.5.tar.gz -
Subject digest:
1f63ebe30bf5d4b0efb15830ee5cc52c394ac47ac6b14a4aade218d7464b54d8 - Sigstore transparency entry: 810026733
- Sigstore integration time:
-
Permalink:
Suraxius/netbox-plugin-bind-provisioner@9a2b0a2c2b68dc1f9ac647a72baac25eb77ad946 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/Suraxius
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9a2b0a2c2b68dc1f9ac647a72baac25eb77ad946 -
Trigger Event:
release
-
Statement type:
File details
Details for the file netbox_plugin_bind_provisioner-1.0.5-py3-none-any.whl.
File metadata
- Download URL: netbox_plugin_bind_provisioner-1.0.5-py3-none-any.whl
- Upload date:
- Size: 23.6 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 |
88f39280a082c19aa7493117c721d5ec44b764ffdba0002bf59afce9ca3cac1d
|
|
| MD5 |
36deb825fbefaabf60eded70ff703731
|
|
| BLAKE2b-256 |
e2d5a1f6aac780b1d73dcdbd59d0051f8548f994dd0440b5bde305904c735097
|
Provenance
The following attestation bundles were made for netbox_plugin_bind_provisioner-1.0.5-py3-none-any.whl:
Publisher:
python-publish.yml on Suraxius/netbox-plugin-bind-provisioner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_plugin_bind_provisioner-1.0.5-py3-none-any.whl -
Subject digest:
88f39280a082c19aa7493117c721d5ec44b764ffdba0002bf59afce9ca3cac1d - Sigstore transparency entry: 810026768
- Sigstore integration time:
-
Permalink:
Suraxius/netbox-plugin-bind-provisioner@9a2b0a2c2b68dc1f9ac647a72baac25eb77ad946 -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/Suraxius
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9a2b0a2c2b68dc1f9ac647a72baac25eb77ad946 -
Trigger Event:
release
-
Statement type: