xsoar-cli 1.0.4__tar.gz → 1.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xsoar-cli might be problematic. Click here for more details.

Files changed (98) hide show
  1. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/.github/workflows/pull-request-open.yml +6 -3
  2. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/.gitignore +1 -0
  3. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/PKG-INFO +7 -5
  4. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/README.md +3 -3
  5. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/pyproject.toml +3 -1
  6. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/__about__.py +1 -1
  7. xsoar_cli-1.0.6/src/xsoar_cli/case/README.md +57 -0
  8. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/case/commands.py +46 -6
  9. xsoar_cli-1.0.6/src/xsoar_cli/config/README.md +64 -0
  10. xsoar_cli-1.0.6/src/xsoar_cli/manifest/README.md +122 -0
  11. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/manifest/commands.py +44 -9
  12. xsoar_cli-1.0.6/src/xsoar_cli/pack/README.md +36 -0
  13. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/pack/commands.py +8 -4
  14. xsoar_cli-1.0.6/src/xsoar_cli/playbook/README.md +43 -0
  15. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/playbook/commands.py +4 -3
  16. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/plugins/README.md +1 -1
  17. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/utilities.py +15 -1
  18. xsoar_cli-1.0.4/src/xsoar_cli/case/README.md +0 -31
  19. xsoar_cli-1.0.4/src/xsoar_cli/config/README.md +0 -12
  20. xsoar_cli-1.0.4/src/xsoar_cli/manifest/README.md +0 -269
  21. xsoar_cli-1.0.4/src/xsoar_cli/pack/README.md +0 -7
  22. xsoar_cli-1.0.4/src/xsoar_cli/playbook/README.md +0 -19
  23. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/.github/workflows/release.yml +0 -0
  24. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/CONTRIBUTING.md +0 -0
  25. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/LICENSE.txt +0 -0
  26. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/examples/README.md +0 -0
  27. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/examples/advanced_plugin.py +0 -0
  28. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/requirements.txt +0 -0
  29. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/requirements_dev.txt +0 -0
  30. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/__init__.py +0 -0
  31. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/case/__init__.py +0 -0
  32. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/cli.py +0 -0
  33. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/config/__init__.py +0 -0
  34. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/config/commands.py +0 -0
  35. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/graph/README.md +0 -0
  36. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/graph/__init__.py +0 -0
  37. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/graph/commands.py +0 -0
  38. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/manifest/__init__.py +0 -0
  39. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/pack/__init__.py +0 -0
  40. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/playbook/__init__.py +0 -0
  41. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/plugins/__init__.py +0 -0
  42. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/plugins/commands.py +0 -0
  43. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/src/xsoar_cli/plugins/manager.py +0 -0
  44. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/__init__.py +0 -0
  45. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/conftest.py +0 -0
  46. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_base.py +0 -0
  47. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_case.py +0 -0
  48. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_config.py +0 -0
  49. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Download/playbook-empty.yml +0 -0
  50. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonPlaybooks/.pack-ignore +0 -0
  51. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonPlaybooks/.secrets-ignore +0 -0
  52. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonPlaybooks/Author_image.png +0 -0
  53. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonPlaybooks/Playbooks/GenericPlaybook.yml +0 -0
  54. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonPlaybooks/README.md +0 -0
  55. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonPlaybooks/pack_metadata.json +0 -0
  56. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/.pack-ignore +0 -0
  57. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/.secrets-ignore +0 -0
  58. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/Author_image.png +0 -0
  59. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/README.md +0 -0
  60. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/Scripts/GenericScript/GenericScript.py +0 -0
  61. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/Scripts/GenericScript/GenericScript.yml +0 -0
  62. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/Scripts/GenericScript/README.md +0 -0
  63. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_CommonScripts/pack_metadata.json +0 -0
  64. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/.pack-ignore +0 -0
  65. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/.secrets-ignore +0 -0
  66. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Author_image.png +0 -0
  67. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Playbooks/EDR_InitialTriage.yml +0 -0
  68. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/README.md +0 -0
  69. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/EDR_FetchFile.py +0 -0
  70. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/EDR_FetchFile.yml +0 -0
  71. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/README.md +0 -0
  72. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_Triage/EDR_Triage.py +0 -0
  73. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_Triage/EDR_Triage.yml +0 -0
  74. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_Triage/README.md +0 -0
  75. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/LegacyItem.py +0 -0
  76. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/LegacyItem.yml +0 -0
  77. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/README.md +0 -0
  78. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/test_data/basescript-dummy.json +0 -0
  79. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_EDR/pack_metadata.json +0 -0
  80. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_Layouts/.pack-ignore +0 -0
  81. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_Layouts/.secrets-ignore +0 -0
  82. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_Layouts/Author_image.png +0 -0
  83. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_Layouts/Layouts/layoutscontainer-GenericLayout.json +0 -0
  84. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_Layouts/README.md +0 -0
  85. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/MyOrg_Layouts/pack_metadata.json +0 -0
  86. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/Packs/Not_applicable/Playbooks/Empty.yml +0 -0
  87. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/manifest_base.json +0 -0
  88. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/manifest_invalid.json +0 -0
  89. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/manifest_with_pack_not_on_server.json +0 -0
  90. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/server_base_response.json +0 -0
  91. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/server_base_response_missing_one_pack.json +0 -0
  92. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/server_base_response_with_updates.json +0 -0
  93. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_data/server_base_response_with_updates_and_one_extra.json +0 -0
  94. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_graph.py +0 -0
  95. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_manifest.py +0 -0
  96. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_pack.py +0 -0
  97. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_playbook.py +0 -0
  98. {xsoar_cli-1.0.4 → xsoar_cli-1.0.6}/tests/test_plugins.py +0 -0
@@ -5,14 +5,18 @@ on:
5
5
  jobs:
6
6
  test:
7
7
  runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.10", "3.11", "3.12"]
8
11
  steps:
9
12
  - name: Checkout code
10
13
  uses: actions/checkout@v4
11
14
 
12
- - name: Setup Python 3.12
15
+ - name: Set up Python ${{ matrix.python-version }}
13
16
  uses: actions/setup-python@v5
14
17
  with:
15
- python-version: "3.12"
18
+ python-version: ${{ matrix.python-version }}
19
+ cache: "pip"
16
20
 
17
21
  - name: Create and activate virtual environment
18
22
  run: |
@@ -21,7 +25,6 @@ jobs:
21
25
 
22
26
  - name: Install requirements
23
27
  run: |
24
- pip install -r requirements.txt
25
28
  pip install -r requirements_dev.txt
26
29
 
27
30
  - name: Install xsoar-cli
@@ -1,4 +1,5 @@
1
1
  **/__pycache__
2
+ **/.DS_Store
2
3
  dist
3
4
  build
4
5
  venv
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xsoar-cli
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Project-URL: Documentation, https://github.com/tlium/xsoar-cli#readme
5
5
  Project-URL: Issues, https://github.com/tlium/xsoar-cli/issues
6
6
  Project-URL: Source, https://github.com/tlium/xsoar-cli
@@ -9,10 +9,12 @@ License-Expression: MIT
9
9
  License-File: LICENSE.txt
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
12
14
  Classifier: Programming Language :: Python :: 3.12
13
15
  Classifier: Programming Language :: Python :: Implementation :: CPython
14
16
  Classifier: Programming Language :: Python :: Implementation :: PyPy
15
- Requires-Python: >=3.12
17
+ Requires-Python: <3.13,>=3.10
16
18
  Requires-Dist: click==8.1.8
17
19
  Requires-Dist: pyyaml>=6.0.2
18
20
  Requires-Dist: xsoar-client>=1.0.0
@@ -21,13 +23,13 @@ Description-Content-Type: text/markdown
21
23
 
22
24
  # xsoar-cli
23
25
 
24
- [![PyPI version](https://badge.fury.io/py/xsoar-cli.svg)](https://badge.fury.io/py/xsoar-cli) [![Python](https://img.shields.io/pypi/pyversions/xsoar-cli.svg)](https://pypi.org/project/xsoar-cli/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
26
+ ![PyPI - Version](https://img.shields.io/pypi/v/xsoar-cli) [![Python](https://img.shields.io/pypi/pyversions/xsoar-cli.svg)](https://pypi.org/project/xsoar-cli/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
25
27
 
26
28
  A command-line interface for managing Palo Alto Networks XSOAR (Cortex XSOAR) that streamlines content development and deployment workflows.
27
29
 
28
30
  **Key Features:**
29
31
  - **Content Management**: Validate and deploy content packs with declarative manifests
30
- - **Case Operations**: Retrieve case details and clone cases between environments
32
+ - **Case Operations**: Retrieve case details and clone cases between environments
31
33
  - **Playbook Development**: Download playbooks for local editing and testing
32
34
  - **Dependency Analysis**: Generate visual graphs of content pack dependencies
33
35
  - **Plugin System**: Extend functionality with custom commands
@@ -163,7 +165,7 @@ For more information on a specific command execute `xsoar-cli <command> --help`.
163
165
  ### Commands
164
166
 
165
167
  - **[case](src/xsoar_cli/case/README.md)** - Retrieve case details and clone cases between environments
166
- - **[config](src/xsoar_cli/config/README.md)** - Create, validate, and manage CLI configuration files
168
+ - **[config](src/xsoar_cli/config/README.md)** - Create, validate, and manage CLI configuration files
167
169
  - **[graph](src/xsoar_cli/graph/README.md)** - Generate visual dependency graphs for content packs
168
170
  - **[manifest](src/xsoar_cli/manifest/README.md)** - Validate and deploy content using declarative manifests
169
171
  - **[pack](src/xsoar_cli/pack/README.md)** - Manage content pack operations and information
@@ -1,12 +1,12 @@
1
1
  # xsoar-cli
2
2
 
3
- [![PyPI version](https://badge.fury.io/py/xsoar-cli.svg)](https://badge.fury.io/py/xsoar-cli) [![Python](https://img.shields.io/pypi/pyversions/xsoar-cli.svg)](https://pypi.org/project/xsoar-cli/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ ![PyPI - Version](https://img.shields.io/pypi/v/xsoar-cli) [![Python](https://img.shields.io/pypi/pyversions/xsoar-cli.svg)](https://pypi.org/project/xsoar-cli/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
 
5
5
  A command-line interface for managing Palo Alto Networks XSOAR (Cortex XSOAR) that streamlines content development and deployment workflows.
6
6
 
7
7
  **Key Features:**
8
8
  - **Content Management**: Validate and deploy content packs with declarative manifests
9
- - **Case Operations**: Retrieve case details and clone cases between environments
9
+ - **Case Operations**: Retrieve case details and clone cases between environments
10
10
  - **Playbook Development**: Download playbooks for local editing and testing
11
11
  - **Dependency Analysis**: Generate visual graphs of content pack dependencies
12
12
  - **Plugin System**: Extend functionality with custom commands
@@ -142,7 +142,7 @@ For more information on a specific command execute `xsoar-cli <command> --help`.
142
142
  ### Commands
143
143
 
144
144
  - **[case](src/xsoar_cli/case/README.md)** - Retrieve case details and clone cases between environments
145
- - **[config](src/xsoar_cli/config/README.md)** - Create, validate, and manage CLI configuration files
145
+ - **[config](src/xsoar_cli/config/README.md)** - Create, validate, and manage CLI configuration files
146
146
  - **[graph](src/xsoar_cli/graph/README.md)** - Generate visual dependency graphs for content packs
147
147
  - **[manifest](src/xsoar_cli/manifest/README.md)** - Validate and deploy content using declarative manifests
148
148
  - **[pack](src/xsoar_cli/pack/README.md)** - Manage content pack operations and information
@@ -7,13 +7,15 @@ name = "xsoar-cli"
7
7
  dynamic = ["version"]
8
8
  description = ''
9
9
  readme = "README.md"
10
- requires-python = ">=3.12"
10
+ requires-python = ">=3.10, <3.13"
11
11
  license = "MIT"
12
12
  keywords = []
13
13
  authors = [{ name = "Torbjørn Lium", email = "torben@lium.org" }]
14
14
  classifiers = [
15
15
  "Development Status :: 4 - Beta",
16
16
  "Programming Language :: Python",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
17
19
  "Programming Language :: Python :: 3.12",
18
20
  "Programming Language :: Python :: Implementation :: CPython",
19
21
  "Programming Language :: Python :: Implementation :: PyPy",
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Torbjørn Lium <torben@lium.org>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "1.0.4"
4
+ __version__ = "1.0.6"
@@ -0,0 +1,57 @@
1
+ # Case
2
+
3
+ Various case/incident related commands for XSOAR.
4
+
5
+ ## Get
6
+
7
+ Retrieve basic information about a single case. Returns raw JSON formatted with 4-space indentation.
8
+
9
+ **Syntax:** `xsoar-cli case get [OPTIONS] CASENUMBER`
10
+
11
+ **Options:**
12
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
13
+
14
+ **Examples:**
15
+ ```
16
+ xsoar-cli case get 312412
17
+ xsoar-cli case get --environment prod 312412
18
+ ```
19
+
20
+ ## Clone
21
+
22
+ Clone a case from one environment to another. Useful for copying production cases to development environment for testing.
23
+
24
+ **Syntax:** `xsoar-cli case clone [OPTIONS] CASENUMBER`
25
+
26
+ **Options:**
27
+ - `--source TEXT` - Source environment (default: prod)
28
+ - `--dest TEXT` - Destination environment (default: dev)
29
+
30
+ **Examples:**
31
+ ```
32
+ xsoar-cli case clone 312412 # Clone from prod to dev (defaults)
33
+ xsoar-cli case clone --source dev --dest prod 312412 # Clone from dev to prod
34
+ ```
35
+
36
+ ## Create
37
+
38
+ Create a new case in XSOAR with optional custom fields and case type.
39
+
40
+ **Syntax:** `xsoar-cli case create [OPTIONS] [NAME] [DETAILS]`
41
+
42
+ **Options:**
43
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
44
+ - `--casetype TEXT` - Case type (default: uses default case type from config)
45
+ - `--custom-fields TEXT` - Additional fields in format "field1=value1,field2=value2" (useful when XSOAR has mandatory custom case fields configured)
46
+ - `--custom-fields-delimiter TEXT` - Delimiter for custom fields (default: ",")
47
+
48
+ **Arguments:**
49
+ - `NAME` - Case title (default: "Test case created from xsoar-cli")
50
+ - `DETAILS` - Case description (default: "Placeholder case details")
51
+
52
+ **Examples:**
53
+ ```
54
+ xsoar-cli case create
55
+ xsoar-cli case create "Security Incident" "Suspicious network activity detected"
56
+ xsoar-cli case create --casetype "Phishing" --custom-fields "severity=High,source=Email" "Phishing Email" "Suspicious email received"
57
+ ```
@@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
3
3
 
4
4
  import click
5
5
 
6
- from xsoar_cli.utilities import load_config, validate_environments
6
+ from xsoar_cli.utilities import load_config, parse_string_to_dict, validate_environments
7
7
 
8
8
  if TYPE_CHECKING:
9
9
  from xsoar_client.xsoar_client import Client
@@ -15,11 +15,13 @@ def case() -> None:
15
15
 
16
16
 
17
17
  @click.argument("casenumber", type=int)
18
- @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
18
+ @click.option("--environment", default=None, help="Default environment set in config file.")
19
19
  @click.command(help="Get basic information about a single case in XSOAR")
20
20
  @click.pass_context
21
21
  @load_config
22
- def get(ctx: click.Context, casenumber: int, environment: str) -> None:
22
+ def get(ctx: click.Context, casenumber: int, environment: str | None) -> None:
23
+ if not environment:
24
+ environment = ctx.obj["default_environment"]
23
25
  xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
24
26
  response = xsoar_client.get_case(casenumber)
25
27
  if response["total"] == 0 and not response["data"]:
@@ -31,15 +33,31 @@ def get(ctx: click.Context, casenumber: int, environment: str) -> None:
31
33
  @click.argument("casenumber", type=int)
32
34
  @click.option("--source", default="prod", show_default=True, help="Source environment")
33
35
  @click.option("--dest", default="dev", show_default=True, help="Destination environment")
36
+ @click.option(
37
+ "--custom-fields",
38
+ default=None,
39
+ help='Additional fields on the form "myfield=my_value,anotherfield=another value". Use machine name for field names, e.g mycustomfieldname.',
40
+ )
41
+ @click.option("--custom-fields-delimiter", default=",", help='Delimiter when specifying additional fields. Default is ","')
34
42
  @click.command()
35
43
  @click.pass_context
36
44
  @load_config
37
- def clone(ctx: click.Context, casenumber: int, source: str, dest: str) -> None:
45
+ def clone( # noqa: PLR0913
46
+ ctx: click.Context,
47
+ casenumber: int,
48
+ source: str,
49
+ dest: str,
50
+ custom_fields: str | None,
51
+ custom_fields_delimiter: str,
52
+ ) -> None:
38
53
  """Clones a case from source to destination environment."""
39
54
  valid_envs = validate_environments(source, dest, ctx=ctx)
40
55
  if not valid_envs:
41
56
  click.echo(f"Error: cannot find environments {source} and/or {dest} in config")
42
57
  ctx.exit(1)
58
+ if custom_fields and "=" not in custom_fields:
59
+ click.echo('Malformed custom fields. Must be on the form "myfield=myvalue"')
60
+ ctx.exit(1)
43
61
  xsoar_source_client: Client = ctx.obj["server_envs"][source]["xsoar_client"]
44
62
  results = xsoar_source_client.get_case(casenumber)
45
63
  data = results["data"][0]
@@ -56,21 +74,42 @@ def clone(ctx: click.Context, casenumber: int, source: str, dest: str) -> None:
56
74
  data.pop("modified")
57
75
  # Ensure that playbooks run immediately when the case is created
58
76
  data["createInvestigation"] = True
77
+ if "CustomFields" in data:
78
+ data["CustomFields"] = data["CustomFields"] | parse_string_to_dict(custom_fields, custom_fields_delimiter)
59
79
 
60
80
  xsoar_dest_client: Client = ctx.obj["server_envs"][dest]["xsoar_client"]
61
81
  case_data = xsoar_dest_client.create_case(data=data)
62
82
  click.echo(json.dumps(case_data, indent=4))
63
83
 
64
84
 
65
- @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
85
+ @click.option("--environment", default=None, help="Default environment set in config file.")
66
86
  @click.option("--casetype", default="", show_default=True, help="Create case of specified type. Default type set in config file.")
87
+ @click.option(
88
+ "--custom-fields",
89
+ default=None,
90
+ help='Additional fields on the form "myfield=my_value,anotherfield=another value". Use machine name for field names, e.g mycustomfieldname.',
91
+ )
92
+ @click.option("--custom-fields-delimiter", default=",", help='Delimiter when specifying additional fields. Default is ","')
67
93
  @click.argument("details", type=str, default="Placeholder case details")
68
94
  @click.argument("name", type=str, default="Test case created from xsoar-cli")
69
95
  @click.command()
70
96
  @click.pass_context
71
97
  @load_config
72
- def create(ctx: click.Context, environment: str, casetype: str, name: str, details: str) -> None:
98
+ def create( # noqa: PLR0913
99
+ ctx: click.Context,
100
+ environment: str | None,
101
+ casetype: str,
102
+ name: str,
103
+ custom_fields: str | None,
104
+ custom_fields_delimiter: str,
105
+ details: str,
106
+ ) -> None:
73
107
  """Creates a new case in XSOAR. If invalid case type is specified as a command option, XSOAR will default to using Unclassified."""
108
+ if custom_fields and "=" not in custom_fields:
109
+ click.echo('Malformed custom fields. Must be on the form "myfield=myvalue"')
110
+ ctx.exit(1)
111
+ if not environment:
112
+ environment = ctx.obj["default_environment"]
74
113
  xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
75
114
  if not casetype:
76
115
  casetype = ctx.obj["default_new_case_type"]
@@ -79,6 +118,7 @@ def create(ctx: click.Context, environment: str, casetype: str, name: str, detai
79
118
  "name": name,
80
119
  "type": casetype,
81
120
  "details": details,
121
+ "CustomFields": parse_string_to_dict(custom_fields, custom_fields_delimiter),
82
122
  }
83
123
  case_data = xsoar_client.create_case(data=data)
84
124
  case_id = case_data["id"]
@@ -0,0 +1,64 @@
1
+ # Config
2
+
3
+ Configuration management commands for XSOAR CLI.
4
+
5
+ ## Create
6
+
7
+ Create a new configuration file based on a template. If the configuration file already exists, prompts for confirmation to overwrite.
8
+
9
+ **Syntax:** `xsoar-cli config create`
10
+
11
+ **Examples:**
12
+ ```
13
+ xsoar-cli config create
14
+ ```
15
+
16
+ ## Show
17
+
18
+ Display the current configuration file contents as formatted JSON. API keys are masked by default for security.
19
+
20
+ **Syntax:** `xsoar-cli config show [OPTIONS]`
21
+
22
+ **Options:**
23
+ - `--unmask` - Show unmasked API keys in output
24
+
25
+ **Examples:**
26
+ ```
27
+ xsoar-cli config show
28
+ xsoar-cli config show --unmask
29
+ ```
30
+
31
+ ## Validate
32
+
33
+ Validate that the configuration file is properly formatted JSON and test connectivity to each XSOAR environment defined in the configuration.
34
+
35
+ **Syntax:** `xsoar-cli config validate [OPTIONS]`
36
+
37
+ **Options:**
38
+ - `--only-test-environment TEXT` - Test connectivity for only the specified environment
39
+
40
+ **Examples:**
41
+ ```
42
+ xsoar-cli config validate
43
+ xsoar-cli config validate --only-test-environment prod
44
+ ```
45
+
46
+ ## Set Credentials
47
+
48
+ Update API credentials for a specific environment in the configuration file. Automatically sets server version based on whether a key ID is provided.
49
+
50
+ **Syntax:** `xsoar-cli config set-credentials [OPTIONS] APITOKEN`
51
+
52
+ **Options:**
53
+ - `--environment TEXT` - Target environment (default: dev)
54
+ - `--key_id INTEGER` - API key ID for XSOAR 8 (sets server_version to 8, omit for XSOAR 6)
55
+
56
+ **Arguments:**
57
+ - `APITOKEN` - The API token to set for the environment
58
+
59
+ **Examples:**
60
+ ```
61
+ xsoar-cli config set-credentials your-api-token-here
62
+ xsoar-cli config set-credentials --environment prod your-api-token-here
63
+ xsoar-cli config set-credentials --environment prod --key_id 123 your-api-token-here
64
+ ```
@@ -0,0 +1,122 @@
1
+ # Manifest
2
+
3
+ Content pack deployment management commands using a declarative configuration file (`xsoar_config.json`).
4
+
5
+ ## Generate
6
+
7
+ Generate a new manifest file from currently installed content packs. Assumes all packs are marketplace packs (no custom packs).
8
+
9
+ **Syntax:** `xsoar-cli manifest generate [OPTIONS] MANIFEST_PATH`
10
+
11
+ **Options:**
12
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
13
+
14
+ **Arguments:**
15
+ - `MANIFEST_PATH` - Path where the new manifest file will be created
16
+
17
+ **Examples:**
18
+ ```
19
+ xsoar-cli manifest generate ./xsoar_config.json
20
+ xsoar-cli manifest generate --environment prod ./xsoar_config.json
21
+ ```
22
+
23
+ ## Validate
24
+
25
+ Validate manifest JSON syntax and verify all specified content packs are available. Tests connectivity to pack sources and checks local pack metadata for development packs.
26
+
27
+ **Syntax:** `xsoar-cli manifest validate [OPTIONS] MANIFEST_PATH`
28
+
29
+ **Options:**
30
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
31
+
32
+ **Arguments:**
33
+ - `MANIFEST_PATH` - Path to the manifest file to validate
34
+
35
+ **Examples:**
36
+ ```
37
+ xsoar-cli manifest validate ./xsoar_config.json
38
+ xsoar-cli manifest validate --environment staging ./xsoar_config.json
39
+ ```
40
+
41
+ ## Update
42
+
43
+ Compare installed packs against available versions and update the manifest file with latest versions. Prompts for confirmation on each upgrade.
44
+
45
+ **Syntax:** `xsoar-cli manifest update [OPTIONS] MANIFEST_PATH`
46
+
47
+ **Options:**
48
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
49
+
50
+ **Arguments:**
51
+ - `MANIFEST_PATH` - Path to the manifest file to update
52
+
53
+ **Examples:**
54
+ ```
55
+ xsoar-cli manifest update ./xsoar_config.json
56
+ xsoar-cli manifest update --environment dev ./xsoar_config.json
57
+ ```
58
+
59
+ ## Diff
60
+
61
+ Compare the manifest definition against what is actually installed on the XSOAR server. Shows packs that are missing or have version mismatches.
62
+
63
+ **Syntax:** `xsoar-cli manifest diff [OPTIONS] MANIFEST_PATH`
64
+
65
+ **Options:**
66
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
67
+
68
+ **Arguments:**
69
+ - `MANIFEST_PATH` - Path to the manifest file to compare
70
+
71
+ **Examples:**
72
+ ```
73
+ xsoar-cli manifest diff ./xsoar_config.json
74
+ xsoar-cli manifest diff --environment prod ./xsoar_config.json
75
+ ```
76
+
77
+ ## Deploy
78
+
79
+ Install or update content packs on the XSOAR server according to the manifest. Only deploys packs that differ from current installation.
80
+
81
+ **Syntax:** `xsoar-cli manifest deploy [OPTIONS] MANIFEST_PATH`
82
+
83
+ **Options:**
84
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
85
+ - `--verbose` - Show detailed information about skipped packs
86
+ - `--yes` - Skip confirmation prompt
87
+
88
+ **Arguments:**
89
+ - `MANIFEST_PATH` - Path to the manifest file to deploy
90
+
91
+ **Examples:**
92
+ ```
93
+ xsoar-cli manifest deploy ./xsoar_config.json
94
+ xsoar-cli manifest deploy --environment prod --yes ./xsoar_config.json
95
+ xsoar-cli manifest deploy --verbose ./xsoar_config.json
96
+ ```
97
+
98
+ ## Manifest File Structure
99
+
100
+ The `xsoar_config.json` file defines content packs to be installed:
101
+
102
+ ```json
103
+ {
104
+ "custom_packs": [
105
+ {
106
+ "id": "MyCustomPack",
107
+ "version": "1.0.0",
108
+ "_comment": "Optional documentation comment"
109
+ }
110
+ ],
111
+ "marketplace_packs": [
112
+ {
113
+ "id": "CommonScripts",
114
+ "version": "1.20.0"
115
+ }
116
+ ]
117
+ }
118
+ ```
119
+
120
+ - **custom_packs**: Organization-developed packs stored in artifact repositories
121
+ - **marketplace_packs**: Official Palo Alto Networks content packs
122
+ - **_comment**: Optional field for documentation (preserved during updates)
@@ -39,13 +39,42 @@ def manifest() -> None:
39
39
  """Various commands to interact/update/deploy content packs defined in the xsoar_config.json manifest."""
40
40
 
41
41
 
42
- @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
42
+ @click.option("--environment", default=None, help="Default environment set in config file.")
43
+ @click.argument("manifest_path", type=str)
44
+ @click.command()
45
+ @click.pass_context
46
+ @load_config
47
+ def generate(ctx: click.Context, environment: str | None, manifest_path: str) -> None:
48
+ """Generate a new xsoar_config.json manifest from installed content packs.
49
+
50
+ This command assumes that you do not have any custom content packs uploaded to XSOAR.
51
+ All packs will be added as "marketplace_packs" in the manifest.
52
+ """
53
+ if not environment:
54
+ environment = ctx.obj["default_environment"]
55
+ xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
56
+ installed_packs = xsoar_client.get_installed_packs()
57
+ manifest_data = {
58
+ "marketplace_packs": [],
59
+ }
60
+ for item in installed_packs:
61
+ tmpobj = {
62
+ "id": item["id"],
63
+ "version": item["currentVersion"],
64
+ }
65
+ manifest_data["marketplace_packs"].append(tmpobj)
66
+ write_manifest(manifest_path, manifest_data)
67
+
68
+
69
+ @click.option("--environment", default=None, help="Default environment set in config file.")
43
70
  @click.argument("manifest", type=str)
44
71
  @click.command()
45
72
  @click.pass_context
46
73
  @load_config
47
- def update(ctx: click.Context, environment: str, manifest: str) -> None:
74
+ def update(ctx: click.Context, environment: str | None, manifest: str) -> None:
48
75
  """Update manifest on disk with latest available content pack versions."""
76
+ if not environment:
77
+ environment = ctx.obj["default_environment"]
49
78
  xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
50
79
  manifest_data = load_manifest(manifest)
51
80
  click.echo("Fetching outdated packs from XSOAR server. This may take a minute...", nl=False)
@@ -81,14 +110,16 @@ def update(ctx: click.Context, environment: str, manifest: str) -> None:
81
110
  write_manifest(manifest, manifest_data)
82
111
 
83
112
 
84
- @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
113
+ @click.option("--environment", default=None, help="Default environment set in config file.")
85
114
  @click.argument("manifest", type=str)
86
115
  @click.command()
87
116
  @click.pass_context
88
117
  @load_config
89
- def validate(ctx: click.Context, environment: str, manifest: str) -> None:
118
+ def validate(ctx: click.Context, environment: str | None, manifest: str) -> None:
90
119
  """Validate manifest JSON and all pack availability. Validates upstream pack availability by doing HTTP CONNECT.
91
120
  Custom pack availability is implementation dependant."""
121
+ if not environment:
122
+ environment = ctx.obj["default_environment"]
92
123
  xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
93
124
  manifest_data = load_manifest(manifest)
94
125
  click.echo("Manifest is valid JSON")
@@ -121,14 +152,16 @@ def validate(ctx: click.Context, environment: str, manifest: str) -> None:
121
152
  click.echo("Manifest is valid JSON and all packs are reachable.")
122
153
 
123
154
 
124
- @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
155
+ @click.option("--environment", default=None, help="Default environment set in config file.")
125
156
  @click.argument("manifest", type=str)
126
157
  @click.command()
127
158
  @click.pass_context
128
159
  @load_config
129
- def diff(ctx: click.Context, manifest: str, environment: str) -> None:
160
+ def diff(ctx: click.Context, manifest: str, environment: str | None) -> None:
130
161
  """Prints out the differences (if any) between what is defined in the xsoar_config.json manifest and what is actually
131
162
  installed on the XSOAR server."""
163
+ if not environment:
164
+ environment = ctx.obj["default_environment"]
132
165
  xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
133
166
  manifest_data = load_manifest(manifest)
134
167
  installed_packs = xsoar_client.get_installed_packs()
@@ -147,14 +180,14 @@ def diff(ctx: click.Context, manifest: str, environment: str) -> None:
147
180
  click.echo("All packs up to date.")
148
181
 
149
182
 
150
- @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
183
+ @click.option("--environment", default=None, help="Default environment set in config file.")
151
184
  @click.option("--verbose", is_flag=True, default=False)
152
185
  @click.option("--yes", is_flag=True, default=False)
153
186
  @click.command()
154
187
  @click.argument("manifest", type=str)
155
188
  @click.pass_context
156
189
  @load_config
157
- def deploy(ctx: click.Context, environment: str, manifest: str, verbose: bool, yes: bool) -> None: # noqa: FBT001
190
+ def deploy(ctx: click.Context, environment: str | None, manifest: str, verbose: bool, yes: bool) -> None: # noqa: FBT001
158
191
  """
159
192
  Deploys content packs to the XSOAR server as defined in the xsoar_config.json manifest.
160
193
  The PATH argument expects the full or relative path to xsoar_config.json
@@ -169,7 +202,8 @@ def deploy(ctx: click.Context, environment: str, manifest: str, verbose: bool, y
169
202
  )
170
203
  if not should_continue:
171
204
  ctx.exit()
172
-
205
+ if not environment:
206
+ environment = ctx.obj["default_environment"]
173
207
  xsoar_client: Client = ctx.obj["server_envs"][environment]["xsoar_client"]
174
208
  manifest_data = load_manifest(manifest)
175
209
  click.echo("Fetching installed packs...", err=True)
@@ -198,3 +232,4 @@ manifest.add_command(deploy)
198
232
  manifest.add_command(diff)
199
233
  manifest.add_command(update)
200
234
  manifest.add_command(validate)
235
+ manifest.add_command(generate)
@@ -0,0 +1,36 @@
1
+ # Pack
2
+
3
+ Content pack management commands for XSOAR.
4
+
5
+ ## Delete
6
+
7
+ Delete a content pack from the XSOAR server. Verifies the pack is installed before attempting deletion.
8
+
9
+ **Syntax:** `xsoar-cli pack delete [OPTIONS] PACK_ID`
10
+
11
+ **Options:**
12
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
13
+
14
+ **Arguments:**
15
+ - `PACK_ID` - The ID of the content pack to delete
16
+
17
+ **Examples:**
18
+ ```
19
+ xsoar-cli pack delete MyCustomPack
20
+ xsoar-cli pack delete --environment prod CommonScripts
21
+ ```
22
+
23
+ ## Get Outdated
24
+
25
+ Display a list of outdated content packs showing current and latest available versions in table format.
26
+
27
+ **Syntax:** `xsoar-cli pack get-outdated [OPTIONS]`
28
+
29
+ **Options:**
30
+ - `--environment TEXT` - Target environment (default: uses default environment from config)
31
+
32
+ **Examples:**
33
+ ```
34
+ xsoar-cli pack get-outdated
35
+ xsoar-cli pack get-outdated --environment staging
36
+ ```