Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 2.53 KB

File metadata and controls

61 lines (46 loc) · 2.53 KB

Get started with signals using Python

In this tutorial for signals development using Python3 you'll create a sample signals and submit them to SAFE.

This tutorial will show you how to:

  1. Run sample application that generates signals and submits to SAFE.
  2. Check the results in SAFE.
  3. Create your own signal.

Pre-Requisites

  • Python3 and PIP3
  • Safe Url
  • REST API creds to access SAFE API's

How to run sample application

  1. Check out the signals repository to your machine from Github.
  2. Navigate to signal/python folder.
  3. Fill following properties in the config file
    1. SafeUrl-(Required) Base Url of the Safe Server.
    2. ApiUsername and ApiPassword (Required)- REST api credentials to access SAFE API's.
  4. Run pip3 install -r requirements.txt which will install the required dependencies.
  5. Run python3 app/main.py to run the program which will submit sample signals to Safe.

Check results on SAFE

  1. Login to SAFE and click on Technology->Assets from left navigation view.
  2. Search for asset MyVirtualMachine.acme.com and click on the asset.
  3. Scroll down to see list of controls that were sent using signal.

Create your own signal

See Signal specification

  1. Follow Signal specification to add new signal jsons in the directory.

  2. Run python3 app/main.py to submit the signals to Safe.

  3. Safe supports signals zip upload. Zip file can contain signal jsons and a config file named config.json.

  4. Create config.json with following settings -

    {
      "assetMatchingCriteria": [
        "fqdn",
        "assetName",
        "ipAddress"
      ],
      "shouldImportAssets": true,
      "fullAssessmentForTypes": [
        "va"
      ]
    }

    Only the above mentioned properties are accepted in SAFE from config.json

    Description about the properties

    • assetMatchingCriteria- Is used to match existing asset in SAFE based on the priority fqdn, assetName, ipAddress.
    • shouldImportAssets- will inform SAFE whether to import this asset on SAFE portal.
    • fullAssessmentForTypes- this will upload new set of security findings for a particular type of security context for an asset and old findings if present are discarded. It accepts array of strings containing SecurityType as mentioned in Enums