Skip to main content

Device/software/hardware lifecycle management plugin for NetBox

Project description

netbox-dlm

A NetBox plugin for hardware/software lifecycle management — built as a real NetBox plugin (Django models, not Custom Objects), since this needs background scripts, custom filtersets/API viewsets, and many-to-many scoping that Custom Objects doesn't support well.

What it models

  • HardwareNotice (DeviceType or ModuleType) — EoS/EoL/EoSecurity/EoSW dates
  • SoftwareVersion (per Platform)
  • SoftwareImageFile
  • DeviceSoftware — software actually running on a Device
  • ValidatedSoftware — approval rules
  • Contract
  • Provider
  • CVE
  • Vulnerability

NetBox doesn't have native SoftwareVersion/Contact core models for this, so those are built from scratch here rather than reused.

Reports are handled as on-demand Scripts (scripts.py) rather than stored "*Result" models — CheckHardwareNotices and RunSoftwareValidation compute compliance live against current data. This is a deliberate scope simplification; add stored result models later as ordinary NetBoxModels if you want historical trending of compliance over time.

Package layout

netbox_dlm/
├── __init__.py                          # PluginConfig
├── models.py                            # Provider, Contract, HardwareNotice, SoftwareVersion,
│                                        # SoftwareImageFile, DeviceSoftware, ValidatedSoftware,
│                                        # CVE, Vulnerability
├── choices.py                           # ChoiceSets
├── admin.py                             # Django admin registrations
├── forms.py                             # NetBoxModelForm / FilterSetForm classes
├── tables.py                            # NetBoxTable classes
├── filtersets.py                        # NetBoxModelFilterSet classes
├── views.py                             # Generic CRUD views
├── urls.py                              # UI URL routing
├── navigation.py                        # Nav menu ("Device Lifecycle")
├── template_content.py                  # Panels injected onto Device/DeviceType pages
├── scripts.py                           # CheckHardwareNotices, RunSoftwareValidation, SyncCVEs
├── templates/netbox_dlm/
│   ├── device_lifecycle_panel.html
│   └── devicetype_lifecycle_panel.html
├── api/
│   ├── serializers.py
│   ├── views.py
│   └── urls.py
└── migrations/
    ├── __init__.py
    └── 0001_initial.py                   # generated against NetBox v4.6.4 (see below)

Installation

  1. Copy netbox_dlm/ onto your NetBox host inside the same Python environment as NetBox, or install it editable via the included pyproject.toml:

    pip install -e /path/to/netbox_dlm
    
  2. Add to configuration.py:

    PLUGINS = [
        "netbox_dlm",
        # ... your other plugins
    ]
    
    PLUGINS_CONFIG = {
        "netbox_dlm": {
            "nist_api_key": None,       # optional, raises NVD API rate limits
            "eos_warning_days": 180,
        },
    }
    
  3. Apply migrations:

    cd /opt/netbox/netbox   # your NetBox root
    python3 manage.py migrate
    

    The shipped 0001_initial migration was generated against NetBox v4.6.4. If your host runs a different NetBox version, run python3 manage.py makemigrations netbox_dlm first and check the output for unexpected diffs before migrating — field/constraint behavior on NetBox's core models (dcim.Device, dcim.Platform, etc.) can shift between versions.

  4. Restart NetBox (systemctl restart netbox netbox-rq or your equivalent). You should see "Device Lifecycle" in the left nav, and Scripts under Operations > Scripts grouped by this plugin.

  5. If you're serving static files separately behind a reverse proxy, run python manage.py collectstatic --no-input.

Using it

  • Providers / Contracts — track who supports what, and which devices a contract covers (Contract.devices M2M).
  • Hardware Notices — one row per DeviceType or ModuleType (not both — enforced in clean()), with EoS/EoL/EoSecurity/EoSW dates.
  • Software Versions / Images — per Platform. DeviceSoftware is a 1:1 to Device recording what's actually running (populate this from your existing sync tooling — e.g. alongside aci_netbox_sync runs, or a Golden Config compliance pass).
  • Validated Software — approval rules scoped by device_types, device_roles, and/or specific devices (M2M). A rule with no scope at all applies to any device running that software version. preferred=True marks the target version for a given scope; covers_device() and valid_now do the compliance-check heavy lifting.
  • CVE / VulnerabilityCVE.affected_software M2M links a CVE to one or more SoftwareVersions; Vulnerability narrows that down to (optionally) a specific Device, with its own status workflow (open → mitigated/resolved).
  • Scripts (Operations > Scripts > Device Lifecycle Management):
    • Check Hardware Notices — flags past-due and upcoming EoS.
    • Run Software Validation — flags devices whose recorded software has no currently-valid ValidatedSoftware rule, or isn't the preferred version.
    • Sync CVEs from NIST NVD — placeholder; wire up the actual NVD API 2.0 HTTP calls once your NetBox host has outbound access to services.nvd.nist.gov.

Device and DeviceType pages get a right-hand panel (via template_content.py) summarizing running software, compliance status, hardware notice, and open vulnerabilities at a glance.

Testing

./scripts/test-templates.sh

First run clones netbox-community/netbox (pinned to the version this plugin targets) and builds a venv under .dev/ (gitignored, ~150MB); subsequent runs reuse it. It compiles every template in netbox_dlm/templates/netbox_dlm/ through NetBox's real template engine — no database or Redis needed, since template compilation never touches the ORM. This catches TemplateSyntaxError/TemplateDoesNotExist (bad {% load %}, filters used where a tag was needed, missing includes) before they reach a deployed host. It won't catch bugs that only manifest at render time against real data (e.g. a table column referencing a model attribute that silently resolves to nothing) — there's no substitute for exercising the view against a real NetBox + Postgres instance for that.

What I didn't build (scope cuts, worth knowing about)

  • Stored compliance-result models / history — this plugin computes compliance live via scripts rather than persisting result rows. Straightforward to add later as another NetBoxModel if you want a graphable history.
  • Inventory item lifecycle — hardware notices are scoped to Module/ModuleType (NetBox's modern equivalent); if you're still using NetBox's legacy InventoryItem model for non-modular gear, that's a straightforward additional FK to add to HardwareNotice.
  • VM software trackingDeviceSoftware only covers Device, not VirtualMachine. Trivial to mirror if needed.
  • Automated CVE ingestionSyncCVEs is a stub; NVD API 2.0 request/response handling needs to be written against whatever auth/rate-limit setup you use.

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_dlm-0.4.1.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

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

netbox_dlm-0.4.1-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file netbox_dlm-0.4.1.tar.gz.

File metadata

  • Download URL: netbox_dlm-0.4.1.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for netbox_dlm-0.4.1.tar.gz
Algorithm Hash digest
SHA256 691b1412ddeebe0535d639b3e120ae29e1e245b22a444a928132e267cc557ab6
MD5 e37aea1de16a85fd8a56b7c1d6b615af
BLAKE2b-256 d48e3fdce56a62c932b5dfc6f7b5c1531014b70b38115cda8783871baea06c15

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_dlm-0.4.1.tar.gz:

Publisher: release.yml on droolingtaz/netbox-dlm

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_dlm-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: netbox_dlm-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for netbox_dlm-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ec3339057bfa222f8f41323c482783e16a2fb46888fc4f7b780c04a78226a8a
MD5 c05f38a1fd1e3b49b9fc92816244fbf9
BLAKE2b-256 8a97f5ef326cad765c159dcad09d103c327faff7e920619c10e9d36f7a290dc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_dlm-0.4.1-py3-none-any.whl:

Publisher: release.yml on droolingtaz/netbox-dlm

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