Netify Python Binding Extension Plugin

Introduction

Netify Python plugin allows an integrator to work with events and data objects in the Python scripting language.

License

Netify Python Binding Extension Plugin is a proprietary plugin requiring a license. Please contact us for details.

Installation

Netify plugins are packaged in the same workflow as the agent and can usually be installed using a similar syntax that was implemented during the installation of the Netify agent. Exceptions to this rule occur when the plugin requires a Software License Agreement or if an upgrade or downgrade to a different version of the plugin is required.

Plugins are compiled against specific Netify agent versions and require ABI compatibility. Click here for more information.
Download URLs in the commands below for example only and version specific. Use a browser to navigate to the repository to find and copy the package you wish to install.

Alma Linux

Alma Linux 9

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/almalinux/9/stable/x86_64/netify-python_1.0.22-1.os9.x86_64.rpm
apt install ./netify-python_1.0.22-1.os9.x86_64.rpm
Alma Linux 8

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/almalinux/8/stable/x86_64/netify-python_1.0.22-1.os8.x86_64.rpm
yum install ./netify-python_1.0.22-1.os8.x86_64.rpm

Debian

Debian 13 (Bookworm)

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/debian/10/amd64/netify-python_1.0.22-1_amd64.deb
apt install ./netify-python_1.0.22-1_amd64.deb
Debian 11 (Bullseye)

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/debian/10/amd64/netify-python_1.0.22-1_amd64.deb
apt install ./netify-python_1.0.22-1_amd64.deb
Debian 10 (Buster)

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/debian/10/amd64/netify-python_1.0.22-1_amd64.deb
apt install ./netify-python_1.0.22-1_amd64.deb

OpenWRT

OpenWRT 23.05

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/openwrt/23.05/amd64/netify-python_1.0.22-1_x86_64.ipk
OpenWRT 22.03

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/openwrt/22.03/amd64/netify-python_1.0.22-1_x86_64.ipk
OpenWRT 21.02

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/openwrt/21.02/amd64/netify-python_1.0.22-1_x86_64.ipk
OpenWRT 19.07

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/openwrt/19.07/amd64/netify-python_1.0.22-1_x86_64.ipk

OPNsense

OPNsense 24.1 - Savvy Shark

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/freebsd/13.2/amd64/netify-python_1.0.22,1.pkg
OPNsense 23.7 - Restless Roadrunner

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/freebsd/13.2/amd64/netify-python_1.0.22,1.pkg

pfSense

pfSense Plus 23.x

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/freebsd/14.0/amd64/netify-python_1.0.22,1.pkg
pfSense CE 2.7.x

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

pkg add https://client:secret@download.netify.ai/5/freebsd/13.2/amd64/netify-python_1.0.22,1.pkg

Rocky Linux

Rocky Linux 9

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/rockylinux/9/stable/x86_64/netify-python_1.0.22-1.os9.x86_64.rpm
apt install ./netify-python_1.0.22-1.os9.x86_64.rpm
Rocky Linux 8

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/rockylinux/8/stable/x86_64/netify-python_1.0.22-1.os8.x86_64.rpm
yum install ./netify-python_1.0.22-1.os8.x86_64.rpm

openSUSE Linux

openSUSE Leap 15.5

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/opensuse/15.5/stable/x86_64/netify-python_1.0.22-1.os15.5.x86_64.rpm
zypper install ./netify-python_1.0.22-1.os15.5.x86_64.rpm

Ubuntu

Ubuntu 24.04 - Noble

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/ubuntu/noble/binary-amd64/netify-python_1.0.22-1_amd64.deb
apt install ./netify-python_1.0.22-1_amd64.deb
Ubuntu 22.04 - Jammy

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/ubuntu/jammy/binary-amd64/netify-python_1.0.22-1_amd64.deb
apt install ./netify-python_1.0.22-1_amd64.deb
Ubuntu 20.04 - Focal

The Netify Python Binding Extension plugin is a licensed (proprietary) plugin. Instructions to access this plugin will have been provided to you by a Netify representative. Typically, the package will be available via a web link with Basic authentication protection. Example:

cd /tmp/
wget https://client:secret@download.netify.ai/5/ubuntu/focal/binary-amd64/netify-python_1.0.22-1_amd64.deb
apt install ./netify-python_1.0.22-1_amd64.deb

Configuration

Plugin Loader Configuration

All plugins are disabled by default, and the Netify Python Binding Extension Processor plugin is no different. To enable:

netifyd --enable-plugin proc-python
A plugin can also be disabled in this way by substituting --disable-plugin.

Alternatively, you can edit /etc/netifyd/plugins.d/10-netify-proc-python.conf and set enable to yes.

# Netify Python Binding Extension Processor Plugin Loader
# Copyright (C) 2024 eGloo Incorporated
#
##############################################################################

[proc-python]
enable = yes
plugin_library = /usr/lib64/libnetify-proc-python.so.0.0.0
conf_filename = ${path_state_persistent}/netify-proc-python.json

# vim: set ft=dosini :

Plugin Configuration

Once the plugin has been enabled, it can be configured using the JSON configuration file specified in the plugin loader configuration. Let's look at a configuration sample to review the syntax and parts of the file.

{
    "debug": false,
    "script": "${path_state_persistent}/netify-proc-python/netify-proc-python.python"
}
Property debug
Description Debug enable/disable.
Type boolean
Property script
Description The location of the Python script.
Type string

Examples

Python Sample Code

Send device discovery data to the Sink Socket plugin to a channel name devices.

{
    "script": "${path_state_persistent}/netify-proc-python.python"
}
python-proc-python.python
import sys
import npp
import json
import time
import math

def ProcessFlowEvent(event, flow):
    if event == 4:
        # Filter on DNS
        if flow["detected_protocol_name"] != "DNS":
            return

        fields = []

        # Application
        field = {}
        field["application"] = flow["detected_application_name"]
        field["protocol"] = flow["detected_protocol_name"]
        field["hostname"] = flow["host_server_name"]

        # Local Address
        if flow["origin"] == 1:
            addr = flow["lower_addr"] + ":" + str(flow["lower_port"])
        else:
            addr = flow["upper_addr"] + ":" + str(flow["upper_port"])

        field["local_address"] = addr

        # Remote Address
        if flow["origin"] == 1:
            addr = flow["upper_addr"] + ":" + str(flow["upper_port"])
        else:
            addr = flow["lower_addr"] + ":" + str(flow["lower_port"])

        field["remote_address"] = addr

        field["last_seen"] = flow["last_seen_at"]

        fields.append(field)

        npp.dispatch("sink-log", [ "dns" ],
            json.dumps(fields), 1, 0)
Requires the Python interpreter to be installed on the host or container.

Technical Support

Haven't found the answers you're looking for?

Contact Us