Skip to main content

Tools for working with PAN-OS Skillets in Python 3

Project description

Skilletlib

Base Classes and Utilities for working with Skillets. Skilletlib encapsulates all the logic necessary to execute a skillet in your app or tooling.

See here for information about Skillets and what skillets may be available. A list of example skillets may be found here as well.

About Skillets

Skillets are designed to be sharable units of configuration or validation data. They are perfectly suited for 'Compliance as Code' or 'Infrastructure as Code' type environments. All the 'knowledge' of doing a thing is encapsulated in the skillet. Skillets strive to be tooling agnostic. A subject matter expert should not have to define best practices in multiple domain specific languages. Ideally, this should be expressed once, and executed in a variety of tools. Skilletlib makes it easy to allow Skillets to be executed in your tooling, or tooling of choice.

Skillets are meant to be stored and shared via source control repositories along with the rest of your infrastructure. This allows complex NGFW configurations and use case specific compliance checks to be executed as part of your deployment pipeline.

Installation

Skilletlib is distributed as a python shared library on pypi.org.

pip install skilletlib

Basic Example

from skilletlib import SkilletLoader

# init SkilletLoader Class
sl = SkilletLoader()

# Load the skillet found in the current directory
skillet = sl.load_skillet_from_path('.')

# Every skillet requires a context, which is a dict containing
# any user-input or other variables to allow customization.
context = dict()

# In this example, our skillet needs a configuration.xml file to be loaded into a variable
# called 'config'
with open('config.xml', 'r') as config:
    context['config'] = config.read()

# execute the skillet and return the results
out = skillet.execute(context)

# Do something interesting with the results, like print it out :-)
print(out)
print('all done')

Loading Skillets from a Git repository

from skilletlib import SkilletLoader
repo_url = 'https://github.com/nembery/Skillets'
repo_branch = 'develop'
directory = '/var/tmp/skillets'
repo_name = 'example skillets'

sl = SkilletLoader()
skillets = sl.load_from_git(repo_url, repo_name, repo_branch, local_dir=directory)

for s in skillets:
    print(s.name)

Other projects that use Skilletlib

Here are a couple of examples of other projects that use skilletlib

  • Panhandler Panhandler is a tool to manage collections of Skillets and their respective git repositories
  • SkilletLoader SkilletLoader is a tool to load and test skillets in a CI/CD pipeline via Docker
  • Ansible Skillets Ansible roles and libraries for loading PAN-OS and related skillets via Ansible playbooks
  • Demisto XSOAR Integration Experimental in development Demisto XSOAR integration

Other utilities in Skilletlib

Skilletlib includes all the necessary libraries and code to work directly with PAN-OS and Panorama devices. A call called 'Panoply' is included which includes many often needed methods when working with emphemeral PAN-OS devices, such as in a CI/CD pipeline.

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

skilletlib-0.1.3.6.tar.gz (47.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skilletlib-0.1.3.6-py3-none-any.whl (73.6 kB view details)

Uploaded Python 3

File details

Details for the file skilletlib-0.1.3.6.tar.gz.

File metadata

  • Download URL: skilletlib-0.1.3.6.tar.gz
  • Upload date:
  • Size: 47.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

File hashes

Hashes for skilletlib-0.1.3.6.tar.gz
Algorithm Hash digest
SHA256 bb8c5bbf10b5c705b04e747e18380ea7cff64592cdd7f64fadd38360a9e2629e
MD5 759ef2a446f891009816888f7407f035
BLAKE2b-256 a09fc80b5c4aad9e196b536d316a3501592c260062f8b911cc8f8907f6cc5578

See more details on using hashes here.

File details

Details for the file skilletlib-0.1.3.6-py3-none-any.whl.

File metadata

  • Download URL: skilletlib-0.1.3.6-py3-none-any.whl
  • Upload date:
  • Size: 73.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

File hashes

Hashes for skilletlib-0.1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c99504838780541e4f3861801e79db9b74b9dbd6437c99a494e65976a12be81e
MD5 14902cbd6c1de965c7dcebe7b519ca0e
BLAKE2b-256 32ed8bff3a025a92f6eccda92c46367b6f35ea9a72a0ec9c3fc449a1fbb403a8

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