Skip to main content

Armorblox SDK for Python

Project description

Armorblox logo

Armorblox Python SDK (Alpha)

PyPI version Apache-2 License

This is an alpha version of the SDK with limited documentation and no support.

Requirements

Python 3.5+

Installation

pip install armorblox-sdk

Usage

from armorblox import client

# Create an API client for your tenant
c = client.Client(api_key='your-api-key-here', instance_name='yourtenantname')

# Fetch information about an incident's analysis data
incident_analysis = c.incidents.analysis(78143)

# Fetch information about an incident's sender data
incident_senders = c.incidents.senders(78143)

# Fetch information about an object associated with an incident (usually mail). 
# Get the object ID from Get Incident by Id's response, under .events[].object_id
incident_object = c.incidents.mail('d72c07bc789c30cb4d63d78ee2861f94add695f9c812e30cfb081b20d3e7e5e7')

# Updates the action to be taken for an incident's objects
update_details = c.incidents.update(78143, body = {
                  "policyActionType": "DELETE",
                  "addSenderToException": False,
                  "actionProfileId": ""
                })


# Fetch a list of threats
threat_incidents, next_page_token, total_incident_count = c.threats.list()

# Fetch a specific threat
incident = c.threats.get(44006)


# Fetch a list of abuse incidents
abuse_incidents, next_page_token, total_incident_count = c.abuse_incidents.list()

# Fetch a specific abuse incident
abuse_incident = c.abuse_incidents.get(44200)


# Fetch a list of DLP incidents
dlp_incidents, next_page_token, total_incident_count = c.dlp_incidents.list()

# Fetch a specific DLP incident
dlp_incident = c.dlp_incidents.get(44010)


# Example to fetch all threats using next_page_token
c = client.Client(api_key='your-api-key-here', instance_name='yourtenantname')
next_page_token = None
incidents = []
while True:
    threats, next_page_token, total_incident_count = client.threats.list(page_token=next_page_token)
    incidents.extend(threats)
    if not next_page_token:
        break

Contributing

  • Install Poetry
  • Clone the SDK repo & cd into it
git clone https://github.com/armorblox/armorblox-python-sdk
cd armorblox-python-sdk
  • Run poetry install to install the dependencies
  • Run tox to run the tests

Publishing

TestPyPI

One-time setup

poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi <your-TestPyPI-token>

Publishing

poetry publish --build -r test-pypi

Use

pip install --index-url https://test.pypi.org/simple/ --no-deps armorblox-sdk

to make sure the installation works correctly.

PyPI

One-time setup

poetry config pypi-token.pypi <your-PyPI-token>

Publishing

poetry publish --build

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

armorblox-sdk-0.1.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

armorblox_sdk-0.1.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file armorblox-sdk-0.1.3.tar.gz.

File metadata

  • Download URL: armorblox-sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.5 Darwin/21.6.0

File hashes

Hashes for armorblox-sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3012ce0ed7318c94e9ee1e96167e8d3b7b8babd482df6d2bcac4456fb501f44c
MD5 6ee29a3be761d48e52595c8bdfd7b991
BLAKE2b-256 81ab09493df551854e4f9f87f67032cf95383905052d4041c0ca7fb58b5962ff

See more details on using hashes here.

File details

Details for the file armorblox_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: armorblox_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.5 Darwin/21.6.0

File hashes

Hashes for armorblox_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e56cba71bc336727fb69989452b9add006d9314806b87232f15f1a68341c53
MD5 330096cd03192b860097820d99c6048c
BLAKE2b-256 b3c2e06ebdaa99a799e7074bc8ee7b96527532faa08ebabddba732548339c6b5

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