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 datesSoftwareVersion(per Platform)SoftwareImageFileDeviceSoftware— software actually running on a DeviceValidatedSoftware— approval rulesContractProviderCVEVulnerability
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
-
Copy
netbox_dlm/onto your NetBox host inside the same Python environment as NetBox, or install it editable via the includedpyproject.toml:pip install -e /path/to/netbox_dlm
-
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, }, }
-
Apply migrations:
cd /opt/netbox/netbox # your NetBox root python3 manage.py migrate
The shipped
0001_initialmigration was generated against NetBox v4.6.4. If your host runs a different NetBox version, runpython3 manage.py makemigrations netbox_dlmfirst 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. -
Restart NetBox (
systemctl restart netbox netbox-rqor your equivalent). You should see "Device Lifecycle" in the left nav, and Scripts under Operations > Scripts grouped by this plugin. -
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.devicesM2M). - Hardware Notices — one row per
DeviceTypeorModuleType(not both — enforced inclean()), with EoS/EoL/EoSecurity/EoSW dates. - Software Versions / Images — per
Platform.DeviceSoftwareis a 1:1 toDevicerecording what's actually running (populate this from your existing sync tooling — e.g. alongsideaci_netbox_syncruns, or a Golden Config compliance pass). - Validated Software — approval rules scoped by
device_types,device_roles, and/or specificdevices(M2M). A rule with no scope at all applies to any device running that software version.preferred=Truemarks the target version for a given scope;covers_device()andvalid_nowdo the compliance-check heavy lifting. - CVE / Vulnerability —
CVE.affected_softwareM2M links a CVE to one or moreSoftwareVersions;Vulnerabilitynarrows that down to (optionally) a specificDevice, with its ownstatusworkflow (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-validValidatedSoftwarerule, 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 toservices.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
NetBoxModelif 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 legacyInventoryItemmodel for non-modular gear, that's a straightforward additional FK to add toHardwareNotice. - VM software tracking —
DeviceSoftwareonly coversDevice, notVirtualMachine. Trivial to mirror if needed. - Automated CVE ingestion —
SyncCVEsis 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
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_dlm-0.3.1.tar.gz.
File metadata
- Download URL: netbox_dlm-0.3.1.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0175ee9f6f04f0b15c4d0896597ef7d529a6463671202ac2c5cd34955ed688e
|
|
| MD5 |
40495c4ba87eb195807469626729649e
|
|
| BLAKE2b-256 |
7a4c24837a0d10b26a1606c407bead9d9a48255a56766c8f09807698a185b36f
|
Provenance
The following attestation bundles were made for netbox_dlm-0.3.1.tar.gz:
Publisher:
release.yml on droolingtaz/netbox-dlm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_dlm-0.3.1.tar.gz -
Subject digest:
b0175ee9f6f04f0b15c4d0896597ef7d529a6463671202ac2c5cd34955ed688e - Sigstore transparency entry: 2164428317
- Sigstore integration time:
-
Permalink:
droolingtaz/netbox-dlm@a5882f1138b529f1c6ec28c447affaa39cfa8300 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/droolingtaz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a5882f1138b529f1c6ec28c447affaa39cfa8300 -
Trigger Event:
push
-
Statement type:
File details
Details for the file netbox_dlm-0.3.1-py3-none-any.whl.
File metadata
- Download URL: netbox_dlm-0.3.1-py3-none-any.whl
- Upload date:
- Size: 37.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0728a56019e51adb470c43c7ed9192f1af6f19876218d20e738da13dc12360f7
|
|
| MD5 |
990d14262ddd5a2b23cca443155739cd
|
|
| BLAKE2b-256 |
c0ab04b42bafaf58b2ae9491aef7bbddf2e80ac18402b38d214d1f9457a71623
|
Provenance
The following attestation bundles were made for netbox_dlm-0.3.1-py3-none-any.whl:
Publisher:
release.yml on droolingtaz/netbox-dlm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_dlm-0.3.1-py3-none-any.whl -
Subject digest:
0728a56019e51adb470c43c7ed9192f1af6f19876218d20e738da13dc12360f7 - Sigstore transparency entry: 2164428327
- Sigstore integration time:
-
Permalink:
droolingtaz/netbox-dlm@a5882f1138b529f1c6ec28c447affaa39cfa8300 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/droolingtaz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a5882f1138b529f1c6ec28c447affaa39cfa8300 -
Trigger Event:
push
-
Statement type: