Skip to main content

A NetBox plugin for documenting network security policy: rulebooks, zones, and NSM object links

Project description

netbox-nsm

NetBox plugin for security policy documentation (zones, rulebooks, object links).
No firewall push — inventory and policy only.

⚠️ Work in progress — Not recommended for production use yet. Breaking changes possible (e.g. 0.4.5 permission migration).

Status: NetBox: 4.5–4.6 · Plugin: 0.4.11 · Requires: netbox-custom-objects

Features

  • Security Panel on prefix, IP, device, VM, custom objects — + Assign for zones, addresses, …
  • Bundles — deploy NSM schema and demo data from JSON bundles (Security → Configuration → Bundles)
  • Type Metadata — per-COT settings (nsm_config in type comments): role, display template, sort order
  • Rulebooks with flexible columns (zones, addresses, labels, …)
  • Rules — table, row grouping, grouped columns, zone matrix; Export JSON (bundle-compatible, re-import via Bundles)
  • IP Analyzer — address resolution via the IP Analyzer applet on rule pages (loupe icon)
  • Object Analyzer — graph from any NetBox object
  • Object Report — daily background audit of NSM addresses/groups; TOML export

Navigation

Group Items
Configuration Bundles, Type Metadata, Object Report
Rulebooks Rulebooks (+ Add)
Analysis Object Analyzer

Screenshots

Bundles — apply nsm_schema first, then optional demo bundles:

Bundles

Type Metadatansm_config per COT type (role, display template, sort order):

Type Metadata

Object Report — daily address/group audit with TOML export:

Object Report

Rulebooks — list and detail (fields, enforcement targets):

Rulebooks

Rulebook detail

Rules — row grouping, grouped columns, Export JSON:

Rules by zone

Zone matrix — permit/deny between zones:

Zone matrix

IP Analyzer — destination tree with merge/diff:

IP Analyzer

Installation

pip install netbox-nsm
PLUGINS = ["netbox_custom_objects", "netbox_nsm"]

PLUGINS_CONFIG = {
    "netbox_nsm": {
        "menu_label": "Security",
        "panel_label": "Security",
        "top_level_menu": True,
        "bundles_menu": True,  # False hides Configuration → Bundles
        "setup_allow_destructive_actions": True,  # destructive preview/apply + demos; disable in prod
        "bundle_paths": [],
        "builtin_bundles": True,
        # Optional Jinja2 address naming — see docs/address_name_templates.md
        # "address_name_templates": [
        #     {"template": "h-{ipam>ip}", "match": "host"},
        # ],
    },
}
./manage.py migrate netbox_custom_objects --no-input
./manage.py migrate netbox_nsm --no-input

First run

  1. Security → Configuration → BundlesApply nsm_schema (required; imports built-in nsm_* COT types and writes nsm_config into each type's comments).
  2. Optional demo bundles: RB Demo Zone Matrix, RB Demo Zone/Address (Preview → Apply).
  3. Open a prefix → Security tab → + Assign → zone.
  4. Rulebooks under Security → Rulebooks.

Details: docs/using_netbox_nsm.md

Rules export / import

On a rulebook Rules tab, Export JSON downloads all rules matching the current filters (not just the visible page) as a bundle-compatible JSON document (objects[].records[] with portable refs like nsm_zone/zone_01). Import the file via Security → Configuration → Bundles (objects seeding).

API

/api/plugins/netbox-nsm/ — Type Metadata via nsm-configs/<slug>/, plus object-links/, ip-analyzer/
Rules and policy objects: netbox-custom-objects API.

Demos

Demo Where Notes
NSM Schema Bundles → nsm_schema Required base import (types, choice sets, seed objects, metadata)
RB Demo Zone Matrix Bundles → nsm_demo_zone_matrix 30×30 zone matrix, 900 rules
RB Demo Zone/Address Bundles → nsm_demo_zone_address_adressgroup Zones, addresses, groups, 500 rules

Documentation

File Topic
docs/using_netbox_nsm.md Operations
docs/DATABASE.md PostgreSQL tables
docs/RULE_DATA_STORAGE.md UI vs DB data model
docs/object_report.md Daily object report: job, checks, scaling
ARCHITECTURE.md Code (developers)
CHANGELOG.md Versions

License

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_nsm-0.4.11.tar.gz (550.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_nsm-0.4.11-py3-none-any.whl (711.0 kB view details)

Uploaded Python 3

File details

Details for the file netbox_nsm-0.4.11.tar.gz.

File metadata

  • Download URL: netbox_nsm-0.4.11.tar.gz
  • Upload date:
  • Size: 550.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netbox_nsm-0.4.11.tar.gz
Algorithm Hash digest
SHA256 ebc4e5c30761e2a4842a251e48f1685d24c3aa3a249d8fbdf78109c36ea0bc26
MD5 bc054f2c24575d1e180341e65859692c
BLAKE2b-256 7a2521accd82ec1c21aec22bfb4427461694ac919f2bcedeb0be4874461c167f

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_nsm-0.4.11.tar.gz:

Publisher: publish.yml on christianbur/netbox-nsm

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_nsm-0.4.11-py3-none-any.whl.

File metadata

  • Download URL: netbox_nsm-0.4.11-py3-none-any.whl
  • Upload date:
  • Size: 711.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netbox_nsm-0.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b64bf66e2daae9c7c73e3c16be56a0d7f6245dca7fe6b8c8f37ce07e193f25
MD5 effd568e5da72076f86f98be02b687ec
BLAKE2b-256 e13d95a8fc1dac5307d7b07ca78b01fda0350f98c14c6ab5784ab2892c9a0467

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_nsm-0.4.11-py3-none-any.whl:

Publisher: publish.yml on christianbur/netbox-nsm

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