Packaging your app

When you have finished development, package your app for testing or repackage to finalize.

When you package the app, you are creating:
  • The app.zip file, which contains the playbook components and a reference on how to access the container's image.
  • The container's image which, when installed, is hosted in a repository.
To package your app, perform the following:
  1. If necessary, refresh your package with the latest changes, including exported functions, workflows and rules.
    resilient-sdk codegen --reload

    This command creates the Dockerfile, apikey_permissions.txt and entrypoint.sh files. The apikeys_permissions.txt file is used with other key files, such as setup.py to capture metadata about your application. Dockerfile and entrypoint.sh are essential for containerizing your app.

    NOTE: If running the codegen --reload command on packages created with the SOAR SDK prior to version 39.0.0, ensure the MANIFEST.in file includes the line: recursive-include <package_name>/util

  2. If your app needs more than read_data and read_function permissions, edit the apikey_permissions.txt file and uncomment those permissions you need.
  3. Update the two template icon files, app_logo.png and company_logo.pg, in the icons folder with your company’s app and company logo. By default, these icons are the standard IBM® Shield logos.
  4. Package the app as follows:
    resilient-sdk package -p /path/to/your/app

    The path to your app is where the setup.py file exists. If the file is in your local directory, you can use: resilient-sdk package -p . (The dot is part of the command.)

    The resulting zip file is placed in the app's /dist folder. Within this file are:
    • app_name.tar.gz file, which is the app in the extension format.
    • app.json file containing the app metadata and list of permissions used to create API key account. The information displays in the Apps Details tab in the SOAR Platform is obtained from this file .
    • export.res file containing the playbook components, which you use to import these components when using the app as an extension.
  5. Optionally, edit Dockerfile if you have non-Python dependencies. Most apps do not need the dockerfile edited.
    • Change <app_name> in ARG APPLICATION=<app_name> to the name of your app. It should match the name= parameter in your setup.py file.
    • Change the version number in ARG RES_CIRCUITS_VERSION=xx.x to match the latest version of Resilient® Circuits found on PyPI.
    • In advanced cases where you need to install additional operating system level packages, edit the following section:
      # uncomment and replicate if additional os libraries are needed 
      #RUN yum -y update && yum clean all
      #RUN yum -y install <package>
    • In advanced cases where you need to install additional Python packages, edit the following section:
      # uncomment and replicate if additional pypi packages are needed
      #RUN pip3 install <package>
      
      # uncomment and replicate if additional local packages are needed 
      #COPY /path/to/extra_package /tmp/packages/.
      #RUN pip3 install /tmp/packages/<extra_package>*.tar.gz
    • In advanced cases where you need to expose one or more ports for your app, edit the following section:
      # uncomment to expose port only if a custom threat feed
      #EXPOSE 9000
    • Save the dockerfile.
  6. Use your container tool to build a container image. For example, the following Docker command assumes the Dockerfile is in the current directory and assigns a tags with a version number of 1.0.0. The container version must match the version specific in your setup.py file.
    docker build  -t your_repository/your_custom_app:1.0.0 <path_to_dockerfile>

You deploy the zip file to a SOAR Platform, as described in the Install an app topic of the System administrator Guide.

If you wish to use your app with releases of the SOAR Platform earlier than V37.1, deploy the app_name.tar.gz file using the Integration Server, as described in the Installing an app package on the SOAR Platform topic of the Integration Server Guide.