Skip to main content

Creates and plots a dependency graph for XSOAR content packs.

Project description

XSOAR Dependency Graph

Python package

XSOAR Dependency Graph is a Python utility to create a dependency graph of either an entire content repository or a single content pack.

Requirements

In order to create a dependency graph for you content, you need the content to be in Content Packs Structure. It is highly recommended to use a content repository similar to content-ci-cd-template as you probably want to use demisto-sdk to interact with or create content at some point.

Usage

This package is not meant to be consumed directly. Its primay purpose is to support functionality in xsoar-cli

Installation

Install with uv or pip. TODO: add better installation docs here.

How is the content graph constructed

The content repository path given as a constructor argument is analyzed. For each content pack, the following items are evaluated (in order):

  1. The Content Pack itself is added as a graph node
  2. Playbooks are added as nodes. Playbooks are parsed and nodes and edges are added for any script or playbook reference found.
  3. Layouts are added as nodes. Layouts are parsed and nodes and edges are added when they are found for e.g dynamic sections or buttons.
  4. Incident Types are added as nodes. Layouts are parsed and nodes and edges are added for script or playbook references.
  5. Integrations are added as nodes. The integrations are parsed and every command defined in the integration is added as graph nodes. Integration code as such is not yet parsed.
  6. Scripts are added as nodes. If there is no path between Content Pack (1) and script then an edge is created from Content Pack node to script node. The scripts themselves are parsed as an Abstract Syntax Tree. When calls to execute_command or demisto.executeCommand are found, the scripts being called are added as graph nodesth an edge back to the calling script.

I can create a content graph with demisto-sdk, so how does this differ?

I have a slightly different opinion on how the content graph should be constructed. One example is I don't want all content items in a content pack to have an edge back to the content graph as such. I also want edges between scripts so that I can easily see exactly which other scripts a script is dependent upon and not only a dependency back to the content pack. Furthermore, demisto-sdk will do all sorts of validation of content which I don't care about. If you have weird docker image definitions in your content that's your business. I also prefer to plot my graphs with matplotlib initially. Unlike demisto-sdk, I don't care about visualizing the graphs in Neo4j. I would much rather export (this feature is not yet implemented) the finished graph to a format Neo4j can read, so that people can decide for themselves how they would like the graphs to be used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsoar_dependency_graph-0.4.0.tar.gz (59.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xsoar_dependency_graph-0.4.0-py2.py3-none-any.whl (18.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file xsoar_dependency_graph-0.4.0.tar.gz.

File metadata

  • Download URL: xsoar_dependency_graph-0.4.0.tar.gz
  • Upload date:
  • Size: 59.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xsoar_dependency_graph-0.4.0.tar.gz
Algorithm Hash digest
SHA256 88172b50131de0f0c5db4c38df6e1734794c20d07edf3a7cb0f7d080ef0884a7
MD5 0a112849d68f3f4161be18151aa31eb2
BLAKE2b-256 706140e69a6ae8be1011027aff780ebbebaacdd0f5987a8232ab7257b1dd3af0

See more details on using hashes here.

Provenance

The following attestation bundles were made for xsoar_dependency_graph-0.4.0.tar.gz:

Publisher: release.yaml on tlium/xsoar-dependency-graph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xsoar_dependency_graph-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for xsoar_dependency_graph-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6bbb380be20558dbbe72897994b92988450f64ff1e218af5b3291c806b599694
MD5 289f29309086813a1e19f39e30b1c3a0
BLAKE2b-256 3069b04a8c097c3442262e09c3df0de718e7f226341834a9811e39797a3fd4f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for xsoar_dependency_graph-0.4.0-py2.py3-none-any.whl:

Publisher: release.yaml on tlium/xsoar-dependency-graph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page