Splunk® SOAR (Cloud)

Develop Apps for Splunk SOAR (Cloud)

Acrobat logo Download manual as PDF

Acrobat logo Download topic as PDF

Frequently asked questions

How do I handle Python module dependencies for my app?

You can manage dependencies on Python modules by packaging the required modules with the app, or by adding PIP dependencies in the app JSON.

When an action is executed, the platform adds the following directories to the PYTHONPATH environment:

  • /opt/phantom/lib
  • /opt/phantom/www
  • /opt/phantom/apps/[app_install_directory]
  • /opt/phantom/apps/[app_install_directory]/dependencies

Package required modules with the app

Place all required modules as part of the app TAR file. You can do this in the following ways:

  • Install the modules into a sub directory of the app. PIP supports the --target command line switch that allows the modules to be installed at a specific location. Use this switch to install the modules into the app's subdirectory called dependencies. When the app TAR file is installed on the platform the modules will be part of the app code.
  • Distribute the complete module, including the source and license file, in a sub directory of the app. In this case the app will need to append any folders in the PYTHONPATH it self.

The platform will install all the files present in the app TAR file in the app install directory. Be careful while packaging modules this way. Many Python modules are released under various licenses. Make sure the license allows for such redistribution. Packaging modules this way makes the app self-sufficient.

Add PIP dependencies in the app JSON

Specify app dependencies in the app JSON so that the platform tries to install the dependencies with the app. See Specifying pip dependencies for more information.

Last modified on 06 September, 2023
Tutorial: Use the app wizard to develop an app framework
Table Template

This documentation applies to the following versions of Splunk® SOAR (Cloud): current

Was this documentation topic helpful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters