Skip to main content

Opinionated RBAC for NetBox

Project description


This package is an opinionated implementation of role based access control for NetBox.

It completely replaces the default authentication backend, using Active Directory for authentication and determining group membership. A user's roles are updated only on login, and are stored in the database.

Once installed, a user may view their roles.


$ pip3 install netbox-rbac


Add the following to





	'loggers': {
		'netbox_rbac': {
			'handlers': ['console'],
			'level':     'INFO',

RBAC = {
	'AUTH': {
		'LDAP': {
			'domain': 'COMPANY.COM',
			'server': 'ldap://',
			'search': {
				'group': {
					'base':   'OU=Groups,DC=company,DC=com',
					'filter': '(&(sAMAccountName=%s)(objectClass=group))',
				'member': {
					'base':   'OU=Accounts,DC=company,DC=com',
					'filter': '(&(sAMAccountName=%s)(memberOf:1.2.840.113556.1.4.1941:=%s))',
				'user': {
					'base':   'OU=Accounts,DC=company,DC=com',
					'filter': '(&(sAMAccountName=%s)(objectClass=user))',
	'RULE': [

Add the following to

_patterns += [
	path('', include('netbox_rbac.urls') ),


Generate and apply RBAC model migrations.

$ ./ makemigrations netbox_rbac
$ ./ showmigrations
$ ./ migrate


See the example rules, and documentation. The rule paths can be local files or URLs, and the backend will try each path in turn until it succeeds.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for netbox-rbac, version 1.0.6
Filename, size File type Python version Upload date Hashes
Filename, size netbox_rbac-1.0.6-py3-none-any.whl (15.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size netbox-rbac-1.0.6.tar.gz (11.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page