Skip to main content

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 Repository#

Fork 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 Python#

You 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:

pyenv install 3.10.5
pyenv global 3.10.5

Install Poetry#

We recommend using poetry to create an isolated virtual python development environment. To install poetry, follow the instructions in this installation guide .

Install Docker#

Demisto-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 Node#

To install the nvm package manager, follow the instructions in this nvm guide.

After installing, run:

nvm install node

Install pipx#

Pipx is a package that enables you to install and run the Python application globally in an isolated Python environment.

Installation:

pip install --user pipx
pipx ensurepath

Install demisto-sdk#

This 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

pipx install demisto-sdk --force

To check the you have the latest version of the SDK, run:

demisto-sdk --version

Bootstrap#

Run 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:

.hooks/bootstrap

After the script completes, you can activate the newly created virtual environment by running:

poetry shell

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.

IDE#

Cortex XSOAR offers two IDEs for developing:

You can also use your IDE of choice along with demisto-sdk, for example, Visual Studio Code.

Last updated on