Cortex XSOAR VSCode Plugin
Work with Visual Studio Code to edit, validate and format your Cortex XSOAR integrations and automations.
To start using the extension, first of all, install demisto-sdk.
You can also use the XSOAR: Install/Update Demisto-SDK command.
Local Environment (LINUX or MacOS)
Execute the command XSOAR: Install XSOAR local development environment. This will install local development environment with demisto-sdk and will configure the demisto-sdk with XSOAR. If Homebrew is available, you can choose to install any of python, poetry, node, docker or pyenv.
Remote Environment (All OS)
Or you can follow this guide to configure a fully configured remote development environnement, with
The default behavior of the extension when running a demisto-sdk command is to run
The Cortex XSOAR extension will automatically use the demisto-sdk to lint (code files) and validate (.yml files) your packs.
To turn on auto-linters in your workspace, set the
The linters will write its data to the path configured in
If you wish to see the process running (or check why it's failing or not working), change
By default, the extension will automatically save changes made to the integration/automation file made in the webview (opened with XSOAR: Load Integration/Script).
to disable it, change
Configure Demisto-SDK for XSOAR
This will configure
Configure XSOAR unit tests
The extension supports configuring the integration/script unit tests.
When working on an integration or a script, you can right click on it, and click on Configure XSOAR unit tests. This will configure the XSOAR unit-tests to run and debug them in the _test.py to run from the test file or from the
If you there is a Pytest discovery error, there is a probably missing dependencies. Either install the missing dependencies, or use python virtual environnement instead.
Python Virtual Environment
The extension supports opening an integration or a script in their python virtual environnement.
When working on an integration or a script, you can right click on it, and click on Open integration/script in virtual environment. This will open the integration or the script in a new folder, with configured
This is the recommended way to develop and debug your integration.
Dev Containers (Advanced)
The extension supports opening an integration or a script in a dev container.
This opens a new folder inside a container that is based upon the integration or script docker image (which is specified in their YAML file). This workspace is fully configured with
Windows: Docker Desktop 2.0+ on Windows 10 Pro/Enterprise. Windows 10 Home (2004+) requires Docker Desktop 2.3+ and the WSL 2 back-end. macOS: Docker Desktop 2.0+. Linux: Docker CE/EE 18.06+ and Docker Compose 1.21+
Follow the VSCode instructions for the installation process.
When working on an integration or a script, you can right click on it, and click on Open integration/script in virtual environment. This will open the integration or the script in a new folder, exactly the same environment of the
This is mainly used to debug your integration.
Dev Container Notes
Python 2.* Support
Using a Python 2.* virtual environnement or container, mypy will not be able to be installed.
For debugging the tests, it is necessary to install The VSCode Python extension version
Contributions are welcome and appreciated. To contribute follow the instructions below and submit a PR.
Before merging any PRs, we need all contributors to sign a contributor license agreement. By signing a contributor license agreement, we ensure that the community is free to use your contributions.
When you open a new pull request, a bot will evaluate whether you have signed the CLA. If required, the bot will comment on the pull request, including a link to accept the agreement. The CLA document is also available for review as a PDF.
Dev Setup Environment