This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
wes edited this page May 2, 2020
·
5 revisions
The CIF Software Development Kit (SDK) for Python contains library code and examples designed to enable developers to build applications using CIF.
from pprint import pprint
from cifsdk import search, submit
for i in search({'indicator': 'example.com'}):
pprint(i)
rv = submit({'indicator': 'example.com', 'tags': 'phishing', 'group': 'everyone'})
$ sudo apt-get install -y python-dev python-pip
$ pip install 'cifsdk>=5.0b1,<6.0'
These plugins are minimal and run out of the box
$ export CIF_REMOTE=http://localhost:5000
$ cif -q example.com
$ cif --itype ipv4 --tags scanner --format csv
$ cif -q example.com --format table
$ cif -q example.com --format json
The [/~https://github.com/csirtgadgets/cif-v5/wiki/REST-API](REST API) doc is now available via your local CIF instance using Swagger. Simply navigate to http://localhost:5000 using your browser to begin.
import logging
from cifsdk.client.http import HTTP as Client
from pprint import pprint
cli = Client()
ret = cli.indicators_search('example.com')
filters = {
"indicator": "example.com",
"confidence": 4,
"limit": 50
}
ret = cli.indicators_search(filters=filters)
pprint(ret)
import logging
import json
from cifsdk.client.http import HTTP as Client
data = '{"indicator":"example4.com","tlp":"amber","confidence":"4","tags":"malware","provider":"example.com","group":"everyone"}'
data = json.loads(data)
cli = Client()
ret = cli.indicators_create(data)
print("submission id: {0}".format(ret))