Testing and Validation

Intelligence card extension testing and validation occurs in two steps:  

First, the developer can locally test their python code to ensure it works as expected and returns a json response aligned to expectations. 

Second, the entire extension package (including the source python code, logo, extension.json and metadata.json files) can be bundled as a .tgz file and sent to Recorded Future for final testing and validation in an internal staging environment.  Within a reasonable time period (typically within 1 business day), the developer can expect feedback, including any errors seen, and screenshots from the final integration.

Once the extension is validated by Recorded Future, it will be made publicly available and announced on the Recorded Future Product Updates.  Other Go-To-Market activities (e.g., webinars, datasheets, announcements) will be coordinated through the marketing team.

Below are further details on the two testing steps:

[1a] Testing the extension standalone from the command line

To test the python source code part of an extension from the command line, you will need the extension_util.py library; it is attached to this support page.  Also, you will need to include a main function to the extension source code, as in the following example:

if __name__ == "__main__":
    from recordedfuture_extension_util.extension_util import make_request
    print "response:", make_request(request)

Run your request function by providing the request dictionary and the authentication dictionary.


python farsight.py '{"entity":{"name":"recordedfuture.com","type":"InternetDomainName"}}' '{"api_key":"xxx"}' 

To maintain the correct (expected) filepath for the recordedfuture_extension_util, we recommend having the util directory one level up and using PYTHONPATH to specify that the file search path should include one level up, e.g.:

PYTHONPATH=../ python farsight.py '{"entity":{"name":"recordedfuture.com","type":"InternetDomainName"}}' '{"api_key":"xxx"}'

[1b] Testing the extension standalone from the python interpreter

To test the python source code part of an extension from the python interpreter, launch python and import your extension. This example assumes that your filesystem looks like this: .

/extensions
./extensions/recordedfuture_extension_util
./extensions/recordedfuture_extension_util/extension_util.py
./extensions/myExtension
./extensions/myExtension/myExtension.py

In this example, we use IDLE (a lightweight python IDE.)

PYTHONPATH=../ idle
import myExtension

Define the request and authentication inputs as JSON objects:

request = {"entity":{"name":"213.115.47.82","type":"IpAddress"}}
auth = {"api_key":""}

Run your extension and parse the response

stringResponse = myExtension.request(request,auth)
import json
jsonResponse = json.loads(stringResponse)
import pprint
pprint.pprint(jsonResponse)

 

[2] Submitting an Intelligence Card Extension for Recorded Future Testing

All extension files should be bundled as a .tgz file.  An example of how to package this together at the command line is shown below:

tar zcvf my_new_extension.tgz my_new_extension.py my_new_extension_small-logo.png my_new_extension_large-logo.png metadata.json extension.json

To have Recorded Future test and validate the extension, send the following information to partners@recordedfuture.com:

  • List of Intelligence card types the extension should appear on (e.g., IP , domain, URL)
  • Brief description of what the extension does, including anticipated use cases 
  • Credentials that Recorded Future can use for testing
  • .tgz file (as generated above)
  • for each intelligence card type this extension should work on, provide at least one test entity that should generate a representative response so we can evaluate the output format

 

This content is confidential. Do not distribute or download content in a manner that violates your Recorded Future license agreement. Sharing this content outside of licensed Recorded Future users constitutes a breach of the terms and/or agreement and shall be considered a breach by your organization.
Was this article helpful?
0 out of 0 found this helpful

Articles in this section