Connectors and functions

To build integrations for the SOAR application with little or no coding required, you can import connector functions from OpenAPI spec 3.0 files.

Connector functions come from an imported OpenAPI spec of a vendor. App functions come from the installation of a SOAR app from the IBM AppExchange. You can access both connector and App functions from the playbook function library menu.

Connector functions run as serverless functions (also known as Function-as-a-Service) and require no additional runtime configuration in the SOAR environment. To run the App functions, you need to deploy the Edge Gateway.

A function is an object that sends data to a remote function processor through a message destination or REST API endpoint via HTTP(s) request. The AppExchange invokes remote code, which performs an activity and then returns the results to the playbook. Connector functions invoke the OpenAPI / REST API endpoint via HTTP(s) request and return the results to the playbook.

Importing connector functions for playbooks

You can use connectors to build integrations for the SOAR application, with little or no coding required. A connector is a collection of functions that are imported from the OpenAPI specification into the SOAR application.

Before you begin

You must have an OpenAPI Spec 3.0 .yaml or .json file available on the system that contains the functions that you want to import.

About this task

Connectors provide a simple way to add functions in SOAR. Using connectors, you can quickly build integrations, with little or minimal coding effort.

From the Connectors tab, you can import Open API Spec files, parse the data, and then create connector functions to use in your playbooks. You must configure security credentials for the function to authenticate against the REST API endpoints.

Note: For importing connector functions, only OpenAPI Spec 3.0 files are supported currently.

Procedure

  1. From the Playbook canvas window, click the Functions icon () in the playbook library.
  2. From the Connectors tab, click Add connector functions and then Import connector APIs to start adding a connector.
  3. From the Import connector page, click in the Upload file area.
  4. Search for and select a .yaml or .json file that contains the functions.
  5. Click Upload and then Next.
    The system parses the data in the file and renders the data onscreen.
  6. From the Connector Details page, enter a folder name for the data in the file and enter a description.
  7. From the Functions section, select the functions that you want to import. By default, all of the functions are selected. To omit any function, deselect it.
  8. From the authentication section, click Configure to create a security profile for the function to authenticate against the REST API endpoints. If you do not configure a security profile, a half blue circle icon is displayed for the connector. Complete the following steps to configure authentication:
    1. From the Security scheme drop-down menu, select an authentication scheme. The supported authentication schemes are API Key, Bearer, Basic authentication, and None. Depending on the Security scheme you select, other configuration fields are displayed.
    2. Complete any fields that appear for the security scheme that you selected. All fields displayed are required fields.
    3. From the Server URL drop-down menu, select the URL for which the function needs to authenticate.
    4. Enter your key or username and password for authentication.
    5. Save your changes.
    A green icon is shown for the connector to indicate that it is correctly configured.
    Note: If you subsequently change the security configuration, values you entered for the username and password do not persist, so you must reenter them.
  9. Click Save to save and return to the Connectors tab, where the functions you imported are shown in the list under the folder name that you provided.
  10. To view information about the function, select the function from the list.
  11. Click the edit icon to edit the function.
    From the Edit Function page, edit the function details, request parameters, and response data as required.
  12. To add a function to the playbook, drag it to the canvas, or click the + icon.
  13. From the canvas, click the function to open the function configuration window.

Editing a connector

You can edit a connector that you previously imported.

About this task

When you edit a connector, you cannot import new functions, but you can select functions not previously selected and you can remove functions.

Procedure

  1. From the Playbook canvas window, click the Functions icon () in the playbook library.
  2. From the Connectors tab, click the blue or green icon (depending on whether the connector is fully configured) beside the connector to open the connector details.
  3. Click the edit icon to edit the connector.
  4. From the Edit connector page, you can make the following changes:
    Connector details and description
    You can change the connector folder name where the imported function is stored and you can change the description.
    Authentication section
    You configure or change the security profile.
    Functions
    You can add any functions that you imported previously that are not currently selected, and you can remove functions. You cannot import new functions.
  5. Save your changes.

Adding functions to playbooks

You can access functions in the library from the Functions > Connectors or Functions > AppExchange tab on the Playbook canvas window.

About this task

If you are adding a connector function that you imported, go the Connectors tab, and search for and select the function.

If you are adding a function from an app or a function that you created, go to the AppExchange tab, where the library categorizes the functions by the app that installed them. Functions that are not associated with an app are grouped in the Other category. If you need to install a new app, click Install new app to open the Apps tab on the Administrator settings page. For more information, see Apps.

To add a function to a playbook, complete the following steps.

Procedure

  1. In the Playbook canvas window, click the Functions icon () in the playbook library.
  2. Complete one of the following, depending on whether you want to add a connector function or a function from an app or other function:
    • To add a connector function, from the Connector tab, search for and select the function.
    • To add a function from an app or a function that you created, click the AppExchange tab and expand the app name to see its functions. To see functions that are not associated with an app, expand the Other category.
    Tip: Click the Open filters icon to filter the list of functions.
  3. To view information about the function, select the function from the list.
  4. To add a function to the playbook, drag it to the canvas, or click the + icon.
  5. On the canvas, select the function to open the function configuration window.
  6. Under Function output, type a name in the Output name field.

    You can use to this name to make the function output available to scripts that start later in the playbook.

  7. For the functions inputs, determine the method for delivering inputs:
    For connector functions, to define inputs, expand the Request parameters section, and select the Form or Raw tab. Use the Raw tab to use a script to enter function inputs using playbook data.
    • If you select the Form tab, enter values for each field. To select the input field directly from the playbook schema, click the Choose from schema icon ( ), and browse through the list to find the object that you want to use. Click the + icon to add the path to the input field. The object or property type must match the input field type. If it does not, a validation message appears under the input field.

    • Use the Raw tab to set a JSON payload as function Request body.
    For non-connector functions:
    • To manually define the inputs, click the Fields tab and type a value in each input field.

      To select the input field directly from the playbook schema, click the Choose from schema icon ( ), and browse through the list to find the object that you want to use. Click the + icon to add the path to the input field.

      The object or property type must match the input field type. If it does not, a validation message appears under the input field.

    • To use a script to programmatically define the inputs, click the Script tab.

      If a script is present, click Edit script to update it.

      To add objects directly from the playbook schema, click the View playbook schema icon ( ), and browse through the list to find the object that you want to use. Click the + icon to add the path to the script builder.

      For information about building scripts, see Function input script.

  8. To duplicate or remove the function, on the playbook canvas, right-click on the function and select Duplicate mode or Remove.