Skip to main content

Python based API to Forcepoint NGFW Management Center

Project description

Python version

smc-python

Python based library to provide the ability to interact with the Forcepoint NGFW Management Center API. Provides automation capabilities for any environment that interact with the SMC remotely.

Some of the functionality you get with the SMC Python API:

  • Create any engine types; single firewall, cluster firewalls, ips engines, layer 2 firewalls, master engine and virtual engines.

  • Engine operations such as enabling/disabling AV, GTI, default NAT, Contact Addresses, etc

  • Interface configurations

  • Routing configurations (OSPF, BGP, Static, Antispoofing)

  • Engine level commands such as rebooting, going offline, policy push, enable/disable SSH, etc.

  • Create and modify all network element objects such as Host, Network, Address Ranges, Domain Names, etc.

  • Policy control (create rules, delete rules) for layer 3 firewall policies

  • VPN Policy control and creation

  • Management / Log Server settings configuration

  • Admin User creation and modification

  • System level controls; update system packages, update engines, global blacklisting, etc

  • Tasks

  • Search operations for any object type by name, href and by filter

  • Collections interface to view all objects by type

  • Monitoring by polling

  • High-Availability management

Requirements

Python >= 3.9

Requests >= 2.32.0 websocket-client >= 1.8.0

Security Management Center version >= 6.10

Getting Started

Installing package

From git:

pip install git+https://github.com/Forcepoint/fp-NGFW-SMC-python.git

Or after cloning:

python setup.py install

Examples

Included are a variety of test example scripts that leverage the API to do various tasks in smc/examples directory

Basics

Before any commands are run, you must obtain a login session. Once commands are complete, call session.logout() to remove the active session. To obtain the api_key, log in to the Forcepoint NGFW Management Center and create an API client with the proper privileges.

from smc import session

session.login(url='http://1.1.1.1:8082', api_key='xxxxxxxxxxxxx')
....do stuff....
session.logout()

Or log in to a specific Admin Domain and use a specific version of the API:

session.login(url='http://1.1.1.1:8082', api_key='xxxxxxxxxxxxx',
              domain=mydomain, api_version=6.2)
....do stuff....
session.logout()

Once a valid session is obtained, it will be re-used for each operation for the duration of the sessions validity, or until the program is exited.

Extensions

Extensions are available to smc-python that provide additional functionality besides what is provided in the base library. Extensions are kept separate as they may require additional package requirements and simplify packaging.

Available extensions:

  • smc-python-monitoring: Monitoring for SMC connections, blacklists, users, VPNs, alerts, etc. In addition this package provides the ability to ‘subscribe’ to administrative event modifications.

Extensions are found in the base smc-python repository as namespace packages and each is housed in it’s own sub-directory of this base package.

Pull Requests

Pull requests are welcome and appreciated, but they cannot be merged as-is. We use an internal repository to validate and integrate these changes. However, they may be released later according to our roadmap. You can use ‘Issues’ to suggest changes to us.

Documentation

View Documentation on Read The Docs

Release History

Release notes on GitHub

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

fp_ngfw_smc_python-1.0.34.tar.gz (643.2 kB view details)

Uploaded Source

Built Distribution

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

fp_ngfw_smc_python-1.0.34-py3-none-any.whl (761.1 kB view details)

Uploaded Python 3

File details

Details for the file fp_ngfw_smc_python-1.0.34.tar.gz.

File metadata

  • Download URL: fp_ngfw_smc_python-1.0.34.tar.gz
  • Upload date:
  • Size: 643.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fp_ngfw_smc_python-1.0.34.tar.gz
Algorithm Hash digest
SHA256 927845ca55e6f42d62c0e71f76617e955d9fae203e40c9dd2d49ae99bb7dfa81
MD5 b1c5d81c8d84a9b4df66eef4ac8a7572
BLAKE2b-256 e95bc8974cfad024c9b677a928a19d571b9df0aa5d7e4cabec7e44c2e17093fa

See more details on using hashes here.

File details

Details for the file fp_ngfw_smc_python-1.0.34-py3-none-any.whl.

File metadata

File hashes

Hashes for fp_ngfw_smc_python-1.0.34-py3-none-any.whl
Algorithm Hash digest
SHA256 4cc8ef5b187079d3910663dea06e60c1299294a754baa9ffafb161bacd615d9e
MD5 ed996b1f43b7ad7abdf0365f7562ceae
BLAKE2b-256 a2d22583f6409008f5a5e6f599a1aa58a3b10b1d7a2fa9b6a0927e3a13fddc9b

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