Development Setup
Important Note
This article is focused on setting up a development environment to create and contribute supported new content. If you are not planning to contribute or your contribution will be only community supported, the content in this article is not required. For more details, refer to the Getting Started Guide.
For details, the Setup Tutorial summarizes the end-to-end steps that are required.
Before you read the following information, make sure you read the Getting Started Guide and the Contribution Requirements documentation.
#
Setting Up a Development RepositoryFork the Cortex XSOAR Content repository and create a branch for your contribution. Do not work on the master
or main
branch.
#
Set up environment#
Option 1: Use remote development environment (Any operating system)Follow this guide to set up a fully configured remote development environment.
#
Option 2: Let VSCode extension set up a local environment (Linux, MacOS, WSL2)Follow this guide to set up a fully configured local environment.
#
Option 3: Manual setup#
Install PythonYou will need python3
installed on your system. We recommend using pyenv
. At the time of this writing, the latest version of Python 3.10 is 3.10.5.
Make sure pyenv
is installed first and that the eval "$(pyenv init -)"
expression is placed in your shell configuration (~/.bashrc
or ~/.zshrc
). For additional information see this guide.
After installing pyenv
, you can install Python
:
#
Install PoetryWe recommend using poetry to create an isolated virtual python development environment. To install poetry, follow the instructions in this installation guide .
#
Install DockerDemisto-sdk uses Docker to run certain commands. Follow the instructions in the Docker Getting Started guide to install Docker in your host.
Note: If you are using Windows with WSL2, you can still use Docker Desktop from WSL. Follow the instructions in this tutorial for details.
#
Install NodeTo install the nvm
package manager, follow the instructions in this nvm guide.
After installing, run:
#
Install pipxPipx
is a package that enables you to install and run the Python application globally in an isolated Python environment.
Installation:
#
Install demisto-sdkThis is our help tool that will ease the contribution process. It will help you to generate a Pack, maintain your files, and validate them before committing to the branch.
To install demisto-sdk using pipx
To check the you have the latest version of the SDK, run:
#
BootstrapRun the bootstrap
script. The script will set up a pre-commit hook that will validate your modified files before committing. It will also set up a python virtual environment for development with the package requirements for Python3. Run the script from the root directory of the source tree:
After the script completes, you can activate the newly created virtual environment by running:
Congratulations! You now have a fully configured virtual environment, where you can run our different validation and utility scripts.
For more details, refer to the end-to-end Tutorial.
#
IDECortex XSOAR offers two IDEs for developing:
- Built-in Platform Cortex XSOAR IDE (not recommended for complex/advanced use cases. More details here.)
- Visual Studio Code Extension
You can also use your IDE of choice along with demisto-sdk
, for example, Visual Studio Code.