Skip to main content

django-auth-tacacs

A django authentication backend that uses Tacacs+ for authentication. This can also be used with Nautobot or Netbox.

Description

This backend authenticates users via Tacacs+. Only authentication is implemented, authorization is expected to be managed within the application itself, depending on the user groups.

Users that don't exist yet may be added automatically by enabling the option TACACSPLUS_AUTOCREATE_USERS. Newly created users will be added with the standard django parameters is_admin=False and is_staff=False.

If you have customized User tables then this package may not work as expected.

Installation

Install the package with pip:

pip3 install django-auth-tacacs

This package requires tacacs-plus to be installed.

Depending on the usage, it also requires one of the following packages:

  • django
  • nautobot
  • netbox

Usage

To use this package, you'll need to add the TACACSPlusAuthenticationBackend library to the AUTHENTICATION_BACKENDS configuration parameter. The order is important, if you have multiple authentication backends then you must configure them in the correct order.

You also need to add the TACACS_PLUS configuration parameters:

TACACSPLUS_HOST = 'localhost'
TACACSPLUS_PORT = 49
TACACSPLUS_SECRET = 'super-secret'
TACACSPLUS_SESSION_TIMEOUT = 5
TACACSPLUS_AUTH_PROTOCOL = 'ascii'
TACACSPLUS_AUTOCREATE_USERS = True

Django example

This example will use the Tacacs+ authentication backend and fallback to the internal django DB user authentication: Add the following to settings.py

AUTHENTICATION_BACKENDS = [
    'django_auth_tacacs.django.TACACSPlusAuthenticationBackend',
    'django.contrib.auth.backends.ModelBackend',
]
TACACSPLUS_HOST = 'localhost'
TACACSPLUS_PORT = 49
TACACSPLUS_SECRET = 'super-secret'
TACACSPLUS_SESSION_TIMEOUT = 5
TACACSPLUS_AUTH_PROTOCOL = 'ascii'
TACACSPLUS_AUTOCREATE_USERS = True 

Nautobot example

This example will use the Tacacs+ authentication backend and fallback to the internal nautobot DB user authentication.
Add the following to nautobot_config.py

AUTHENTICATION_BACKENDS = [
     'django_auth_tacacs.nautobot.TACACSPlusAuthenticationBackend',
     'nautobot.core.authentication.ObjectPermissionBackend',
]
TACACSPLUS_HOST = 'localhost'
TACACSPLUS_PORT = 49
TACACSPLUS_SECRET = 'super-secret'
TACACSPLUS_SESSION_TIMEOUT = 5
TACACSPLUS_AUTH_PROTOCOL = 'ascii'
TACACSPLUS_AUTOCREATE_USERS = True 

Netbox example

This example will use the Tacacs+ authentication backend and fallback to the internal netbox DB user authentication.
Add the following to configuration.py

REMOTE_AUTH_BACKEND = 'django_auth_tacacs.nautobot.TACACSPlusAuthenticationBackend'

TACACSPLUS_HOST = 'localhost'
TACACSPLUS_PORT = 49
TACACSPLUS_SECRET = 'super-secret'
TACACSPLUS_SESSION_TIMEOUT = 5
TACACSPLUS_AUTH_PROTOCOL = 'ascii'
TACACSPLUS_AUTOCREATE_USERS = True 

Metadata

Release files for django-auth-tacacs 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-auth-tacacs 0.0.1
File Size Uploaded
django_auth_tacacs-0.0.1.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-auth-tacacs 0.0.1
File Interpreter ABI Platform
django_auth_tacacs-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / django_auth_tacacs-0.0.1.tar.gz

Download URL django_auth_tacacs-0.0.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8a4f2a86ad1f245b9f522e8c745cefbde230d930793005e5e63813b4369c2305
BLAKE2b-256 checksum
How to use checksums
d1095ddc5a49a57d7633bbf477131e91a2f554ae064a0a026151b9f06d1fa9df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.9.16 Linux/4.15.0-200-generic

Release files / django_auth_tacacs-0.0.1-py3-none-any.whl

Download URL django_auth_tacacs-0.0.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b265b000d485e65f72494bb336518cde9f23d391b0c17cba567336287d3593cb
BLAKE2b-256 checksum
How to use checksums
b1f0da65cf1f70905837649664feb49e4109237972ea1ab324e46f4571a668f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.9.16 Linux/4.15.0-200-generic

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page