Skip to main content

Edge Defense Manager Client

Project description

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:

  1. Establish an SSH connection to EDM.

  2. Log in to the operating system CLI with your EDM credentials.

  3. To create the token, enter edm_apitoken_gen.

    The system responds with the new API token, for example:

    { "admin": "LMttPZ45FXnJT6IokVh6Px-otiKGDMkUdyQmJMWmWGz" }
  4. For later use, copy the token and then paste it to a text file.

  5. 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

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

edm-client-1.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

edm_client-1.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file edm-client-1.1.0.tar.gz.

File metadata

  • Download URL: edm-client-1.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for edm-client-1.1.0.tar.gz
Algorithm Hash digest
SHA256 43e69994fb01cd893e8a260115437d037e4bf994897639f7eee85048b969b55b
MD5 268715d2df5bcbc00491a29a54983df8
BLAKE2b-256 f5e2d4dc97f833cdde9bc366a30bdc076f1a91217ab95be5070f27022732cbc5

See more details on using hashes here.

File details

Details for the file edm_client-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: edm_client-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for edm_client-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 732894be3a66db3b032977d2551143433d688b2815eb4cea1bd9f36b7248ebb4
MD5 45c73b20ed38c0cff43968cd9e1d80fb
BLAKE2b-256 7f58722912fd797e98bb72d00ed8ea5ce861bad6b28435264357868b0c6a6a8d

See more details on using hashes here.

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