Skip to main content

Nautobot Chatops plugin for Panorama

Project description

Nautobot Panorama ChatOps

This is a plugin for Nautobot that extends ChatOps support to Palo Alto Panorama systems. The plugin adds some useful commands into your ChatOps environment that enhance an administrator's and end user's day to day using of Panorama. This framework allows for the quick extension of new ChatOps commands for Panorama.

Note: While this plugin requires Nautobot and the base Nautobot ChatOps plugin, it does not require the Panorama or Palo Alto inventory to be in Nautobot. It is effectively Nautobot-independent, except for using it as a backend to run the chat bot itself.

Usage

The supported commands are listed below. We welcome any new command or feature requests by submitting an issue or PR.

/panorama Command Description
capture-traffic Run a packet capture on PANOS Device for specified IP traffic.
export-device-rules Generate a downloadable list of firewall rules with details in CSV format.
get-device-rules Return a list of all firewall rules on a given device with details.
get-version Obtain software version information for Panorama.
install-software Install software to specified Palo Alto device.
upload-software Upload software to specified Palo Alto device.
validate-rule-exists Verify that a specific ACL rule exists within a device, via Panorama.

Prerequisites

This plugin requires the Nautobot ChatOps Plugin to be installed and configured before using. You can find detailed setup and configuration instructions here.

Installation

The plugin is available as a Python package in pypi and can be installed with pip:

pip install nautobot-plugin-chatops-panorama

The plugin is compatible with Nautobot 1.1.0 and higher

To ensure Nautobot Panorama ChatOps is automatically re-installed during future upgrades, create a file named local_requirements.txt (if not already existing) in the Nautobot root directory (alongside requirements.txt) and list the nautobot-plugin-chatops-panorama package:

# echo nautobot-plugin-chatops-panorama >> local_requirements.txt

Once installed, the plugin needs to be enabled in your nautobot_config.py

# In your configuration.py
PLUGINS = ["nautobot_chatops", "nautobot_plugin_chatops_panorama"]

In addition, add/update the below PLUGINS_CONFIG section to nautobot_config.py.

It is only necessary to add the sections from the below snippet for the chat platform you will be using (Slack, Webex, etc.).

# Also in nautobot_config.py
PLUGINS_CONFIG = {
    "nautobot_chatops": {
        # Slack
        "enable_slack": os.environ.get("ENABLE_SLACK", False),
        "slack_api_token": os.environ.get("SLACK_API_TOKEN"),
        "slack_signing_secret": os.environ.get("SLACK_SIGNING_SECRET"),
        "slack_slash_command_prefix": os.environ.get("SLACK_SLASH_COMMAND_PREFIX", "/"),
        # Webex
        "enable_webex": os.environ.get("ENABLE_WEBEX", False),
        "webex_token": os.environ.get("WEBEX_TOKEN"),
        "webex_signing_secret": os.environ.get("WEBEX_SIGNING_SECRET"),
        # Mattermost
        "enable_mattermost": os.environ.get("ENABLE_MATTERMOST", False),
        "mattermost_api_token": os.environ.get("MATTERMOST_API_TOKEN"),
        "mattermost_url": os.environ.get("MATTERMOST_URL"),
        # MS Teams
        "enable_ms_teams": os.environ.get("ENABLE_MS_TEAMS", False),
        "microsoft_app_id": os.environ.get("MICROSOFT_APP_ID"),
        "microsoft_app_password": os.environ.get("MICROSOFT_APP_PASSWORD"),
    },
    "nautobot_plugin_chatops_panorama": {
        "panorama_host": os.environ.get("PANORAMA_HOST"),
        "panorama_user": os.environ.get("PANORAMA_USER"),
        "panorama_password": os.environ.get("PANORAMA_PASSWORD"),
    },
}

Environment Variables

You will need to set the following environment variables for your Nautobot instance, then restart the services for them to take effect.

  • PANORAMA_HOST - This is the management DNS/IP address used to reach your Panorama instance.
  • PANORAMA_USER - A user account with API access to Panorama.
  • PANORAMA_PASSWORD - The password that goes with the above user account.
export PANORAMA_HOST="{{ Panorama DNS/URL }}"
export PANORAMA_USER="{{ Panorama account username }}"
export PANORAMA_PASSWORD="{{ Panorama account password }}"

If the base Nautobot Chatops plugin is not already installed, the following environment variables are required for the chat platform in use. The Platform-specific Setup document describes how to retrieve the tokens and secrets for each chat platform that will need to be used in the environment variables.

It is only necessary to create the environment variables shown below for the chat platform you will be using. To make the environment variables persistent, add them to the ~/.bash_profile for the user running Nautobot.

# Slack
export ENABLE_SLACK="true"
export SLACK_API_TOKEN="foobar"
export SLACK_SIGNING_SECRET="foobar"
# Webex
export ENABLE_WEBEX="true"
export WEBEX_TOKEN="foobar"
export WEBEX_SIGNING_SECRET="foobar"
# Mattermost
export ENABLE_MATTERMOST="false"
export MATTERMOST_API_TOKEN="foobar"
export MATTERMOST_URL="foobar"
# Microsoft Teams
export ENABLE_MS_TEAMS="false"
export MICROSOFT_APP_ID="foobar"
export MICROSOFT_APP_PASSWORD="foobar"

When deploying as Docker containers, all of the above environment variables should be defined in the file development/creds.env. An example credentials file creds.env.example is available in the development folder.

Access Control

Just like with the regular /nautobot command from the base Nautobot ChatOps plugin, the /panorama command supports access control through the Access Grants menu in Nautobot. See section Grant Access to the Chatbot in the installation guide for the base Nautobot ChatOps plugin for setting this up.

Questions

For any questions or comments, please check the FAQ first and feel free to swing by the Network to Code slack channel (channel #networktocode). Sign up here

Screenshots

Help

Validate Rule Exists Success

Validate Rule Exists Failure

Upload Software

Capture Traffic Filter

Capture Traffic

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

nautobot-plugin-chatops-panorama-1.1.0.tar.gz (105.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nautobot-plugin-chatops-panorama-1.1.0.tar.gz.

File metadata

  • Download URL: nautobot-plugin-chatops-panorama-1.1.0.tar.gz
  • Upload date:
  • Size: 105.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for nautobot-plugin-chatops-panorama-1.1.0.tar.gz
Algorithm Hash digest
SHA256 38ac74aa4643e2a09c79ee826e15ecb5b98a58d95f4a7f7521d81fa446bd51af
MD5 3d1cc0ea0fcfe743c79c86ca5f415627
BLAKE2b-256 457ab6e5193c153b364f2198582482da32a0fc1e5c09559fb36e3dc4315284f7

See more details on using hashes here.

File details

Details for the file nautobot_plugin_chatops_panorama-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: nautobot_plugin_chatops_panorama-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 107.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for nautobot_plugin_chatops_panorama-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60bcc57fa5485a741e884e4bc34464a48f3b54c9330c1aa3a5277b55ed842dee
MD5 6200a7bce0250979da9c9a55036eb7ab
BLAKE2b-256 4fc914d09d88d1e6dc007dc746a95faad3698e6de25b40664bea62fe192e2b1f

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