Syntropy NAC
Syntropy Network As Code library and command line utility.
More information can be found at https://docs.syntropystack.com/docs/network-as-code
Requirements.
Python 3.6+
Installation & Usage
pip install
The latest package can be installed from PyPi:
pip install syntropynac
Command line tool usage
In order to be able to export or configure networks using YAML/JSON configuration files you can use syntropynac utility.
First you must set proper environment variables:
$ export SYNTROPY_API_SERVER={Syntropy Stack API URL}
$ export SYNTROPY_API_TOKEN={API authorization token}
In case you have a registered user on the platform you can retrieve the API token using this command(deprecated and requires syntropyctl to be installed using pip):
$ syntropyctl login {user name} {password}
{your API authorization token}
You can omit {password} on the command line, then the utility will ask you to type the password.
In case you are using SSO to login to the platform the API authorization token can be retrieved from the Platform itself.
Or you can set the SYNTROPY_API_TOKEN environment variable like this(Set SYNTROPY_API_SERVER to the server address and SYNTROPY_API_TOKEN to empty value before that):
export SYNTROPY_API_TOKEN=`syntropyctl login {user name} {password}`
You can learn about the types of actions this utility can perform by running:
$ syntropynac --help
Usage: syntropynac [OPTIONS] COMMAND [ARGS]...
Syntropy Network As Code cli tool
Options:
--help Show this message and exit.
Commands:
configure-networks Configure networks using a configuration YAML/JSON...
export-networks Exports existing networks to configuration YAML/JSON...
Exporting and configuring networks
It is possible to export existing networks using syntropynac export-networks command which will output existing networks configuration to stdout
in a YAML format.
This configuration can be passed to syntropynac configure-networks {infrastructure.yaml} to create networks and connections.
Note, however, that export-networks command will export connections(if any) as well as endpoints. The exported endpoints represent the endpoints without connections along with their services and tags. Those endpoints are ignored by the configure-networks command.
Below you can find a sample configuration file for different types of networks:
---
# Create point-to-point connections
name: interconnect
# Network topology is mandaroty. Values: P2P, P2M, MESH
topology: p2p
# Network state is mandatory. Values: present, absent
state: present
# Connections to create
connections:
# Endpoint can be refferred to by name and by id
endpoint-1:
# state is present by default
state: present
# type is endpoint by default. Values: endpoint, tag, id
type: endpoint
# services specifies what services to enable for given endpoint
services:
- nginx
# id has precedence before name when type is endpoint
id: 123
connect_to:
endpoint-2:
type: endpoint
services:
- postgre
3:
connect_to:
endpoint-4:
type: endpoint
state: present
type: id
endpoint-5:
connect_to:
6:
type: id
state: absent
type: endpoint
---
# Connect mqtt server with iot devices
name: iot-network
state: present
topology: p2m
connections:
mqtt-server-name.com:
type: endpoint
connect_to:
# Will connect mqtt server with all the endpoints tagged as "iot-devices"
iot-devices:
state: present
type: tag
---
# Create DNS servers mesh network
name: dns-mesh
state: present
topology: mesh
connections:
# Will create a mesh network using endpoints tagged as "dns-servers"
dns-servers:
state: present
type: tag
---
# Delete a network
name: old-iot-network
topology: mesh
state: absent
Metadata
Release files for syntropynac 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| syntropynac-0.3.0.tar.gz | 16.5 kB | Without provenance | Details for syntropynac-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| syntropynac-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for syntropynac-0.3.0-py3-none-any.whl |
Total release size: 35.0 kB
Release files / syntropynac-0.3.0.tar.gz
| Download URL | syntropynac-0.3.0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd2363b482264b0a500c2ed2e070f09f540da4aec5d9b56e5d247efc4b3778c4
|
|
BLAKE2b-256 checksum How to use checksums |
5f9a8656bfa9f490b0e859731d750d8713b1e40fc18628cc340240d338642679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
|
Release files / syntropynac-0.3.0-py3-none-any.whl
| Download URL | syntropynac-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7950a4649596a0b8dc31c1d3dddd48a48e159e5fa20cd30c14eaed9bccdba19
|
|
BLAKE2b-256 checksum How to use checksums |
85764286f044ca2a87211c33390e814a6b966a789dc488ee7596c66a5a530785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
|
Security for syntropynac 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.