The Python SDK for AlienVault OTX
Go to file
2019-03-29 16:26:03 -05:00
examples Add Domains to Pulse Example 2019-01-15 09:29:36 +00:00
tests Fix dateutil -> python-dateutil in setup.py 2019-03-29 16:26:03 -05:00
.gitignore update .gitignore for python and intelliJ. 2016-05-01 07:09:12 -07:00
.travis.yml Add pytz to requirements 2019-03-28 19:12:19 -05:00
howto_use_python_otx_api.ipynb Added PatchPulse object 2017-05-04 12:01:10 +01:00
IndicatorTypes.py Fix filenames 2017-05-04 14:27:53 +01:00
LICENSE Added Apache License 2015-08-26 09:01:58 -07:00
OTXv2.py Added OTXv2Cached class, for cached access to pulses. Also added subscribe_to_user and unsubscribe_from_user to SDK. Added tests for both 2019-03-28 18:49:34 -05:00
patch_pulse.py Fix filenames 2017-05-04 14:29:21 +01:00
README.md Update README.md 2019-01-15 10:45:36 +00:00
setup.cfg add setup.cfg (defines readme file for pypi), setup.py (added 'download_url' for pypi configuration). 2016-05-03 09:25:24 -07:00
setup.py Fix dateutil -> python-dateutil in setup.py 2019-03-29 16:26:03 -05:00

Build Status

About

Open Threat Exchange is an open community that allows participants to learn about the latest threats, research indicators of compromise observed in their environments, share threats they have identified, and automatically update their security infrastructure with the latest indicators to defend their environment.

OTX Direct Connect agents provide a way to automatically update your security infrastructure with pulses you have subscribed to from with Open Threat Exchange. By using Direct Connect, the indicators contained within the pulses you have subscribed to can be downloaded and made locally available for other applications such as Intrusion Detection Systems, Firewalls, and other security-focused applications.

OTX Direct Connect provides a mechanism to automatically pull indicators of compromise from the Open Threat Exchange portal into your environment. The DirectConnect API provides access to all Pulses that you have subscribed to in Open Threat Exchange (https://otx.alienvault.com).

Installation

You can install with pip install OTXv2 or alternatively:

  1. Clone this repo
  2. Run (from the root directory) pip install . or python setup.py install
  3. Integrate into your codebase (see Python Notebook example below)

For more information about the particular API calls see https://otx.alienvault.com/api (Endpoint details on 'docs' tab)

Installation with Python Notebook

  1. Clone this repo
  2. Install pandas

pip install pandas

  1. Install python notebook (http://jupyter.readthedocs.org/en/latest/install.html)

pip install jupyter

  1. Run notebook

jupyter notebook howto_use_python_otx_api.ipynb

Example

Reading contents from OTX:

from OTXv2 import OTXv2
from OTXv2 import IndicatorTypes
otx = OTXv2("API_KEY")
# Get all the indicators associated with a pulse
indicators = otx.get_pulse_indicators("pulse_id")
for indicator in indicators:
    print indicator["indicator"] + indicator["type"]
# Get everything OTX knows about google.com
otx.get_indicator_details_full(IndicatorTypes.DOMAIN, "google.com")

Adding content to OTX:

from OTXv2 import OTXv2
otx = OTXv2("API_KEY")
name = 'Test Pulse'
indicators = [
    {'indicator': '69.73.130.198', 'type': 'IPv4'},
    {'indicator': 'aoldaily.com', 'type': 'Domain'}
]
response = otx.create_pulse(name=name ,public=True ,indicators=indicators ,tags=[] , references=[])
print str(response)

Additional Examples:

More examples are at https://otx.alienvault.com/api/