Skip to main content

NetBox plugin that provides permissions on object fields.

Project description

netbox-field-permissions

Limit the ability for user/groups to change certain fields on NetBox objects.

By default, NetBox only allows you to restrict access an individual object, with this plugin you can restrict access on a field of an object.

A common use case for this is compliance where certain information is not allowed to be altered or simply prevent accidental changes.

Compatibility

NetBox Version Plugin Version
4.0, 4.1 0.1.X

Installing

For adding to a NetBox Docker setup see the general instructions for using netbox-docker with plugins.

Install

pip install netbox-field-permissions

or by adding to your local_requirements.txt or plugin_requirements.txt (netbox-docker):

netbox-field-permissions

Development Install

If you would like to install a version not yet published to pypi.

pip install git+https://github.com/TheDJVG/netbox-field-permissions

or by adding to your local_requirements.txt or plugin_requirements.txt (netbox-docker):

git+https://github.com/TheDJVG/netbox-field-permissions

NetBox Configuration

Enable the plugin in /opt/netbox/netbox/netbox/configuration.py, or if you use netbox-docker, your /configuration/plugins.py file :

PLUGINS = [
    'netbox_field_permissions'
]

Validator installation

By default, the migration will install the validator for all models. If you're using a statically configured NetBox instance you can use this CUSTOM_VALIDATORS block to install it for all models:

Show configuration snippet
CUSTOM_VALIDATORS = {
    "circuits.circuit": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "circuits.circuittermination": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "circuits.circuittype": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "circuits.provider": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "circuits.provideraccount": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "circuits.providernetwork": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.cable": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.cablepath": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.cabletermination": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.consoleport": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.consoleporttemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.consoleserverport": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.consoleserverporttemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.device": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.devicebay": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.devicebaytemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.devicerole": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.devicetype": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.frontport": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.frontporttemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.interface": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.interfacetemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.inventoryitem": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.inventoryitemrole": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.inventoryitemtemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.location": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.manufacturer": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.module": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.modulebay": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.modulebaytemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.moduletype": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.platform": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.powerfeed": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.poweroutlet": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.poweroutlettemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.powerpanel": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.powerport": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.powerporttemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.rack": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.rackreservation": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.rackrole": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.rearport": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.rearporttemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.region": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.site": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.sitegroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.virtualchassis": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "dcim.virtualdevicecontext": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.bookmark": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.branch": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.cachedvalue": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.configcontext": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.configtemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.customfield": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.customfieldchoiceset": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.customlink": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.dashboard": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.eventrule": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.exporttemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.imageattachment": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.journalentry": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.objectchange": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.reportmodule": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.savedfilter": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.script": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.scriptmodule": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.stagedchange": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.tag": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.taggeditem": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "extras.webhook": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.aggregate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.asn": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.asnrange": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.fhrpgroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.fhrpgroupassignment": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.ipaddress": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.iprange": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.prefix": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.rir": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.role": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.routetarget": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.service": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.servicetemplate": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.vlan": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.vlangroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "ipam.vrf": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "tenancy.contact": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "tenancy.contactassignment": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "tenancy.contactgroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "tenancy.contactrole": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "tenancy.tenant": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "tenancy.tenantgroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "virtualization.cluster": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "virtualization.clustergroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "virtualization.clustertype": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "virtualization.virtualdisk": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "virtualization.virtualmachine": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "virtualization.vminterface": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.ikepolicy": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.ikeproposal": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.ipsecpolicy": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.ipsecprofile": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.ipsecproposal": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.l2vpn": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.l2vpntermination": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.tunnel": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.tunnelgroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "vpn.tunneltermination": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "wireless.wirelesslan": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "wireless.wirelesslangroup": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ],
    "wireless.wirelesslink": [
        "netbox_field_permissions.validators.FieldPermissionValidator"
    ]
}

You can also view updated configuration on the Plugins -> Field Permissions -> Manage Validator page.

Features

Disallow changes to any user accessible field

When someone tries to alter a field they don't have access to an error will be emitted. Example permission denied

Easily verify validator install

Dynamic configurations can benefit from automatic (un)install of validator for every model. Config validation

Pending features

  • Better selection of fields (some of the fields are for users but are currently shown).
  • Better field names that match the other NetBox forms.

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_field_permissions-0.1.0rc2.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file netbox_field_permissions-0.1.0rc2.tar.gz.

File metadata

  • Download URL: netbox_field_permissions-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.11.1-arch1-1

File hashes

Hashes for netbox_field_permissions-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 9920b2bf5bfab9b6f03faedb6808b182f7ea4208575dd967fe56d3d41a6f7186
MD5 0187c176011fb26a236f1476c7f624e5
BLAKE2b-256 8c5a7d93bcdcc8c20401df56c4f23a718679b802d109fa007e360a420f7e79f7

See more details on using hashes here.

File details

Details for the file netbox_field_permissions-0.1.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_field_permissions-0.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b4b9b3aff64c3483b99f45f6583b60a319b78fdf8520dc0d48ac6e76ea4fd65
MD5 432838cbb7d3c81bf67ea0553a643730
BLAKE2b-256 655dd3ace8778023f25a0059a61207554ab8eaafca150d5d9cefdaeab1ed9a17

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page