forked from csirtgadgets/cifsdk-py-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
wes edited this page Aug 21, 2018
·
11 revisions
The CIF Software Development Kit (SDK) for Python contains library code and examples designed to enable developers to build applications using CIF.
$ pip install 'cifsdk>=3.0.0,<4.0'
# ~/.cif.yml
remote: https://localhost
token: 1234
These plugins are minimal and run out of the box
$ cif --token 1234 --remote 'https://localhost' -q example.com
$ cif --token 1234 --remote 'https://localhost' -q example.com --format csv
$ cif --token 1234 --remote 'https://localhost' -q example.com --format table
$ cif --token 1234 --remote 'https://localhost' -q example.com --format json
import logging
from cifsdk.client.http import HTTP as Client
from pprint import pprint
cli = Client(token='1234',
remote='https://localhost',
verify_ssl=False)
ret = cli.indicators_search('example.com')
filters = {
"indicator": "example.com",
"confidence": 6,
}
ret = cli.indicators_search(filters=filters)
pprint(ret)
import logging
from cifsdk.client.http import HTTP as Client
data = '{"indicator":"example4.com","tlp":"amber","confidence":"8","tags":"malware","provider":"example.com","group":"everyone"}'
cli = Client(token='1234',
remote='https://localhost',
verify_ssl=False)
ret = cli.indicators_create(data)
print("submission id: {0}".format(ret))
from cifsdk.client.http import HTTP as Client
...
ret = cli.ping()
print("roundtrip: %s ms" % ret)