Skip to content

Creating A Feed

Luke Lyon edited this page May 9, 2020 · 11 revisions

How to Create a Feed

With CBAPI Example Script

CBAPI-Python includes an example to create a feed through the command line.

user@machine:~$ python cbapi-python/examples/threathunter/create_feed.py --name="Binary Analysis Feed" --owner="Developer Relations" --url="https://www.carbonblack.com/" --summary="Binary Analysis YARA Results" --category="Analysis"

> Feed object, bound to https://defense-<environment>.conferdeploy.net.
-------------------------------------------------------------------------------

                  access: private
                category: Analysis
                      id: jVxpUZ32SGKidfTNNDFuVr
                    name: Binary Analysis Feed
                   owner: ABCDEFGH
            provider_url: https://www.carbonblack.com/
            source_label: None
                 summary: Binary Analysis YARA Results

The id is listed as output of the example script. Copy this value into feed_id in your configuration file.

With API Requests

Postman is a useful tool for sending API requests through a GUI. You can import this ThreatHunter Feed Operations Collection via url.

Importing a Collection into Postman

In Postman, use the "Create new private feed" request to make a new feed. Be sure to update the X-Auth-Token header to use your API token, and the Body of the request with details you want.

With cURL

user@machine:~$ curl --location --request POST 'https://defense-<environment>.conferdeploy.net/threathunter/feedmgr/v2/orgs/MYORGID/feeds' \
--header 'X-Auth-Token: MYAPISECRETKEY/MYAPIKEYID' \
--header 'Content-type: application/json' \
--header 'Content-Type: text/plain' \
--data-raw '{"feedinfo": {"name": "Binary Analysis Feed", "owner": "Developer Relations", "provider_url": "https://www.carbonblack.com", "summary": "Binary Analysis YARA Results", "category": "Analysis"},
 "reports": []}
'

> Feed object, bound to https://defense-<environment>.conferdeploy.net.
-------------------------------------------------------------------------------

                  access: private
                category: Analysis
                      id: jVxpUZ32SGKidfTNNDFuVr
                    name: Binary Analysis Feed
                   owner: ABCDEFGH
            provider_url: https://www.carbonblack.com/
            source_label: None
                 summary: Binary Analysis YARA Results