Skip to main content

NetBox plugin to hide form fields per user group from the UI

Project description

NetBox HideBox Plugin

NetBox HideBox is a powerful utility for NetBox administrators to clean up and customize the user interface. It allows you to dynamically hide specific form fields on a per-model basis, filtered by User Groups.

Whether you want to hide internal metadata from specific teams or simplify complex forms for non-technical users, HideBox provides a managed, UI-driven way to do it.

Features

  • UI-Driven Configuration: No need to edit Python files to hide fields; manage everything through the "Field Hide Rules" menu.
  • Dynamic Field Discovery: Automatically inspects NetBox forms to list available fields for any selected Content Type (Device, IP Address, Virtual Machine, etc.).
  • Group-Based Visibility:
    • Hide fields for all users.
    • Hide fields only for specific User Groups.
  • Safe Integration: Uses safe monkey-patching on the base NetBoxModelForm to ensure compatibility across the entire NetBox ecosystem.
  • Toggleable Rules: Easily enable or disable rules without deleting them.

Compatibility

NetBox Version Plugin Version
4.3.0+ 1.3.0

Installation

1. Install via Pip

pip install netbox-hidebox

(Alternatively, if installing from source: pip install . from the root of the repository)

2. Enable in NetBox

Add the plugin to your configuration.py:

PLUGINS = [ 'netbox_hidebox', ]

3. Run Migrations

python3 manage.py migrate netbox_hidebox

4. Restart NetBox

sudo systemctl restart netbox netbox-rq

How It Works

  1. Middleware: The plugin includes a lightweight middleware that tracks the current user in the request thread.
  2. Form Patching: Upon startup, the plugin patches the __init__ method of the core NetBoxModelForm.
  3. Dynamic Logic: Every time a form is initialized, the plugin checks the database for active rules matching that model. If the current user falls under the rule, the specified fields are programmatically converted to HiddenInput widgets.

Usage

Creating a Rule

  1. Navigate to Plugins > HideBox > Field Hide Rules.
  2. Click Add.
  3. Name: A descriptive name (e.g., "Hide VM Sensitive Tags").
  4. Content Type: Select the model you want to target (e.g., virtualization | virtual machine).
  5. Fields to Hide: Once the Content Type is selected, the plugin will load all available form fields. Check the boxes for fields you want to disappear.
  6. Hide for Groups:
    • The fields are hidden only for members of the groups you select here.
    • If left empty, the fields are hidden for everyone.
  7. Enabled: Keep checked to activate the rule.

Security Note

HideBox is a UI/UX enhancement tool.

Hiding a field prevents it from appearing in the browser-based forms. However, this plugin does not modify API permissions or database-level constraints. A user with API access and the correct NetBox permissions could still theoretically modify hidden fields via the REST API or custom scripts. For strict security enforcement, always use NetBox's built-in Permissions and Constraints system.

Configuration

The plugin uses the following defaults:

  • Base URL: hidebox
  • Min NetBox Version: 4.3.0

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_hidebox-2.0.1b1.tar.gz (28.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_hidebox-2.0.1b1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file netbox_hidebox-2.0.1b1.tar.gz.

File metadata

  • Download URL: netbox_hidebox-2.0.1b1.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for netbox_hidebox-2.0.1b1.tar.gz
Algorithm Hash digest
SHA256 e863572b4c66f73c64c010efa9883b2b298071cfe5b6d7415f7724f94c15ad46
MD5 5d017ac5fd6cc3d96c8c7fa18a337b9a
BLAKE2b-256 4302d059da6a7a3c9fd993f702f35335b246944cd9c6e24d3c85bb0d9b4cda1d

See more details on using hashes here.

File details

Details for the file netbox_hidebox-2.0.1b1-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_hidebox-2.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 1615d54c5b7e8a758507b44b15f1be711abf488fee3ca6a88fd83036abaada78
MD5 159addf65bd34b71be28193b560db846
BLAKE2b-256 2f1b47aed9fec984d32bd8c834a65152f56f0906a2e60eee295cd7bc405cbb2a

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