Giter VIP home page Giter VIP logo

otx-python-sdk's Introduction

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/

otx-python-sdk's People

Contributors

chrisdoman avatar jaimeblasco avatar rspitler-alien avatar rustybrooks avatar bsmartt13 avatar earada avatar neo23x0 avatar debugger22 avatar deadbits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.