Skip to main content

help interacting with nftables

Project description

NftTools

Help interacting with nftables

NftTools provides helpers to work with nftables from Python. It builds on python-nftables which itself uses libnftables. Note that the API is not yet stable and can change from one version to the next.


Features

  • Convert an nftables rule into its JSON representation.
  • Validate an nftables rule by temporary applying it in a helper chain.
  • Convert simple rules into a dictionary representation.
  • Convert that dictionary representation into an nftables rule.
  • Supports IPv4 and IPv6.
  • Provides limited support for sets.

Installation

Install using PyPi:

pip3 install nfttools

Note: The tool uses python3-nftables as dependency. If you don't use Debian's operating system package (or Alpine's py3-nftables) but attempt to install pip-nftables instead, the latter might complain on missing "schema.json". Workaround: Use the operating system package or copy it's "schema.json" to the place pip-nftables is looking for that file.


Reporting bugs

In case you encounter any bugs, please report the expected behavior and the actual behavior so that the issue can be reproduced and fixed.


Developers

Clone repository

Clone this repo to your local machine using https://github.com/towalink/nfttools.git

Install the module temporarily to make it available in your Python installation:

pip3 install -e <path to root of "src" directory>

License

License

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

nfttools-0.1.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

nfttools-0.1.0-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

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