No project description provided
Project description
xsoar-cli
This tool is made to help provide a smoother workflow for developers, but also for power users to get useful information out of XSOAR from the terminal. Merge requests are very welcome and appreciated!
IMPORTANT NOTE This CLI tools is made to be run from the root of a content repository. Some commands depends on files located in your content repository or expects a certain directory structure to be available from your currently working directory.
Installation
pip install xsoar-cli
Upgrading
pip install --upgrade xsoar-cli
Configuration
The xsoar-cli config file is located in ~/.config/xsoar-cli/config.json. To create a configuration file from template, please run
xsoar-cli config create
Open up the newly created configuration file and add values that correspond with your environment.
IMPORTANT NOTE: the configuration key "custom_pack_authors": ["SOMEONE"] is needed in order for xsoar-cli to be able to
determine which content packs are your own custom content packs and which are supplied from Palo Alto upstream. Use whateve values you may have set in
pack_metadata.json in the content packs in your content repository.
Usage
xsoar-cli <command> <sub-command> <args>
For information about available commands, run xsoar-cli without arguments.
For more information on a specific command execute xsoar-cli <command> --help.
Commands
Plugin System
xsoar-cli supports a plugin system that allows you to extend the CLI with custom commands. Plugins are Python files that you place in ~/.local/xsoar-cli/plugins/ and they're automatically discovered and loaded.
Quick Start with Plugins
-
Create an example plugin:
xsoar-cli plugins create-example
-
List available plugins:
xsoar-cli plugins list
-
Test the example plugin:
xsoar-cli example hello --name "World"
Plugin Management Commands
xsoar-cli plugins list- List all pluginsxsoar-cli plugins info <plugin>- Show plugin informationxsoar-cli plugins validate- Validate all pluginsxsoar-cli plugins reload <plugin>- Reload a specific pluginxsoar-cli plugins create-example- Create an example pluginxsoar-cli plugins open- Open the plugins directory
Creating Your Own Plugins
Create a Python file in ~/.local/xsoar-cli/plugins/ that inherits from XSOARPlugin:
import click
from xsoar_cli.plugins import XSOARPlugin
class MyPlugin(XSOARPlugin):
@property
def name(self) -> str:
return "myplugin"
@property
def version(self) -> str:
return "1.0.0"
def get_command(self) -> click.Command:
@click.command(help="My custom command")
def mycommand():
click.echo("Hello from my plugin!")
return mycommand
For detailed documentation, see Plugin System Documentation.
License
xsoar-cli is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xsoar_cli-0.0.3.tar.gz.
File metadata
- Download URL: xsoar_cli-0.0.3.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdd451139054ef40cf21e4e6265a88285955912db251128156c8b3250802177a
|
|
| MD5 |
6e3e2154b64029a05cee95b83ab5789f
|
|
| BLAKE2b-256 |
5a526ab83bc89b8abe00620d5be7ce88ee12990ca0bd1622ec2ab9ffeb8c1326
|
Provenance
The following attestation bundles were made for xsoar_cli-0.0.3.tar.gz:
Publisher:
release.yml on tlium/xsoar-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xsoar_cli-0.0.3.tar.gz -
Subject digest:
bdd451139054ef40cf21e4e6265a88285955912db251128156c8b3250802177a - Sigstore transparency entry: 406217205
- Sigstore integration time:
-
Permalink:
tlium/xsoar-cli@d1e9ce4b2c7766b2fe295e2ddab15cdeafc8f64e -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/tlium
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d1e9ce4b2c7766b2fe295e2ddab15cdeafc8f64e -
Trigger Event:
push
-
Statement type:
File details
Details for the file xsoar_cli-0.0.3-py3-none-any.whl.
File metadata
- Download URL: xsoar_cli-0.0.3-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ffd5afd532f0cde277c606dd60177f93ddc67738bdc4a1348b95d4a89821af0
|
|
| MD5 |
1f7aa357de6452f40327c0b17054c20f
|
|
| BLAKE2b-256 |
04ac03fc3da7a8d4e2e646acb6c1c10d0298391d9277bb9c74eaa3758ad972de
|
Provenance
The following attestation bundles were made for xsoar_cli-0.0.3-py3-none-any.whl:
Publisher:
release.yml on tlium/xsoar-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xsoar_cli-0.0.3-py3-none-any.whl -
Subject digest:
3ffd5afd532f0cde277c606dd60177f93ddc67738bdc4a1348b95d4a89821af0 - Sigstore transparency entry: 406217215
- Sigstore integration time:
-
Permalink:
tlium/xsoar-cli@d1e9ce4b2c7766b2fe295e2ddab15cdeafc8f64e -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/tlium
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d1e9ce4b2c7766b2fe295e2ddab15cdeafc8f64e -
Trigger Event:
push
-
Statement type: