Edge Defense Manager Client
This simple client allows you to use Edge Defense Manager’s public API.
Requirements
Python (tested on Python 2.7 and Python 3.6.5)
Requests
Installation:
sudo pip install edm-client
Source code is available on GitHub.
Generating an API Token From Edge Defense Manager
Access to the Edge Defense Manager API requires an API token for authentication. You generate the token in the EDM command line interface (CLI).
The API token is associated with the user account under which it is generated. Any user can generate an EDM API token, except for the root user.
To generate an EDM API token:
Establish an SSH connection to EDM.
Log in to the operating system CLI with your EDM credentials.
To create the token, enter edm_apitoken_gen.
The system responds with the new API token, for example:
{ "admin": "LMttPZ45FXnJT6IokVh6Px-otiKGDMkUdyQmJMWmWGz" }For later use, copy the token and then paste it to a text file.
To log out of the CLI, enter exit
To View or delete a token, use one of the following commands.
edm_apitoken_show
edm_apitoken_delete
Using the Client
Import the package:
from edmclient.edm import EdgeDefenseManager
dev = EdgeDefenseManager(<host>, <apitoken>, api_version=<api_version, eg. 'v1'>, raise_on_error=<True|False>)
Managing Devices
Add a device:
dev.devices.add(host='aed_1.example.com',
apiToken='WWPi7_',
name='AED_1')
View devices:
dev.devices.show()
dev.devices.show(id=1)
Remove devices:
dev.devices.remove(id=1)
Update a device:
dev.devices.update(id=1,
host='aed_1.example.com',
apiToken='WWPi7_',
name='AED_1')
Partially update a device:
dev.devices.update(id=1, name='NEW_AED_1')
dev.devices.update(id=1, apiToken='sdf79_kjI')
Viewing Alerts
View threats:
dev.alerts.threats.show(start='2018-09-08T00:00:00Z')
View DDoS alerts:
dev.alerts.ddos.show(start='2018-09-08T00:00:00Z')
View DDoS counts:
dev.alerts.ddos.count.show(start='2018-09-08T00:00:00Z')
Viewing Traffic
View traffic:
dev.traffic.edge.show(start='2018-09-08T00:00:00Z')
Viewing Contextual Threat Intelligence (CTI)
View CTI data:
dev.cti.insights.show(indicatorValue='1.2.3.4')
Configuring CTI
View the CTI configuration:
dev.configuration.cti.show()
Add or Update the CTI configuration:
dev.configuration.cti.update(cti_token='ajfdgFJGFGmh27hnbv')
Running Unit Tests
If nose is not installed, then run:
pip3 install nose
Run the following command from the package directory:
nosetests
Metadata
Release files for edm-client 1.1.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 |
|---|---|---|---|---|
| edm-client-1.1.0.tar.gz | 6.2 kB | Without provenance | Details for edm-client-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| edm_client-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for edm_client-1.1.0-py3-none-any.whl |
Total release size: 15.8 kB
Release files / edm-client-1.1.0.tar.gz
| Download URL | edm-client-1.1.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43e69994fb01cd893e8a260115437d037e4bf994897639f7eee85048b969b55b
|
|
BLAKE2b-256 checksum How to use checksums |
f5e2d4dc97f833cdde9bc366a30bdc076f1a91217ab95be5070f27022732cbc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Release files / edm_client-1.1.0-py3-none-any.whl
| Download URL | edm_client-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
732894be3a66db3b032977d2551143433d688b2815eb4cea1bd9f36b7248ebb4
|
|
BLAKE2b-256 checksum How to use checksums |
7f58722912fd797e98bb72d00ed8ea5ce861bad6b28435264357868b0c6a6a8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Security for edm-client 1.1.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.