xsoar-cli 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl

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.

xsoar_cli/__about__.py CHANGED
@@ -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.0"
4
+ __version__ = "1.0.2"
@@ -63,17 +63,21 @@ def clone(ctx: click.Context, casenumber: int, source: str, dest: str) -> None:
63
63
 
64
64
 
65
65
  @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
66
+ @click.option("--casetype", default="", show_default=True, help="Create case of specified type. Default type set in config file.")
66
67
  @click.argument("details", type=str, default="Placeholder case details")
67
68
  @click.argument("name", type=str, default="Test case created from xsoar-cli")
68
- @click.command(help="Creates a single new case in XSOAR")
69
+ @click.command()
69
70
  @click.pass_context
70
71
  @load_config
71
- def create(ctx: click.Context, environment: str, name: str, details: str) -> None:
72
+ def create(ctx: click.Context, environment: str, casetype: str, name: str, details: str) -> None:
73
+ """Creates a new case in XSOAR. If invalid case type is specified as a command option, XSOAR will default to using Unclassified."""
72
74
  xsoar_client: Client = ctx.obj["server_envs"][environment]
75
+ if not casetype:
76
+ casetype = ctx.obj["default_new_case_type"]
73
77
  data = {
74
78
  "createInvestigation": True,
75
79
  "name": name,
76
- "type": "MyCaseType", # grab this from config maybe?
80
+ "type": casetype,
77
81
  "details": details,
78
82
  }
79
83
  case_data = xsoar_client.create_case(data=data)
xsoar_cli/utilities.py CHANGED
@@ -80,6 +80,7 @@ def parse_config(config: dict, ctx: click.Context) -> None:
80
80
  ctx.obj = {}
81
81
  ctx.obj["default_environment"] = config["default_environment"]
82
82
  ctx.obj["custom_pack_authors"] = config["custom_pack_authors"]
83
+ ctx.obj["default_new_case_type"] = config["default_new_case_type"]
83
84
  ctx.obj["server_envs"] = {}
84
85
  for key in config["server_config"]:
85
86
  ctx.obj["server_envs"][key] = Client(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xsoar-cli
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Project-URL: Documentation, https://github.com/tlium/xsoar-cli#readme
5
5
  Project-URL: Issues, https://github.com/tliumb/xsoar-cli/issues
6
6
  Project-URL: Source, https://github.com/tlium/xsoar-cli
@@ -26,9 +26,14 @@ Description-Content-Type: text/markdown
26
26
  # xsoar-cli
27
27
  -----
28
28
  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
29
- the terminal. Merge requests are very welcome and appreciated!
29
+ the terminal. It is mostly useful if you are using a CICD workflow to deploy your XSOAR content, and most of the functionality assumest that
30
+ you have your content stored in a [content repository](https://github.com/demisto/content-ci-cd-template).
30
31
 
31
- *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
32
+ Pull Requests are very welcome and appreciated!
33
+
34
+
35
+ *IMPORTANT NOTE*
36
+ This CLI tools is made to be run from the root of a content repository. Some commands depends on files located in your
32
37
  content repository or expects a certain directory structure to be available from your currently working directory.
33
38
 
34
39
  ## Installation
@@ -47,9 +52,11 @@ The xsoar-cli config file is located in `~/.config/xsoar-cli/config.json`. To cr
47
52
  xsoar-cli config create
48
53
  ```
49
54
  Open up the newly created configuration file and add values that correspond with your environment.
50
- *IMPORTANT NOTE*: the configuration key `"custom_pack_authors": ["SOMEONE"]` is needed in order for `xsoar-cli` to be able to
51
- 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
52
- pack_metadata.json in the content packs in your content repository.
55
+
56
+ *IMPORTANT NOTES*
57
+ - The configuration key `"custom_pack_authors": ["SOMEONE"]` is needed in order for `xsoar-cli` to be able to determine which content packs
58
+ are your own custom content packs and which are supplied from Palo Alto upstream. Use whatever values you may have set in pack_metadata.json
59
+ in the content packs in your content repository.
53
60
 
54
61
  ## Usage
55
62
  ```
@@ -62,10 +69,11 @@ For more information on a specific command execute `xsoar-cli <command> --help.`
62
69
  ### Commands
63
70
  1. [case](src/xsoar_cli/case/README.md)
64
71
  2. [config](src/xsoar_cli/config/README.md)
65
- 3. [manifest](src/xsoar_cli/manifest/README.md)
66
- 4. [pack](src/xsoar_cli/pack/README.md)
67
- 5. [playbook](src/xsoar_cli/playbook/README.md)
68
- 6. [plugins](src/xsoar_cli/plugins/README.md)
72
+ 3. [graph](src/xsoar_cli/graph/README.md)
73
+ 4. [manifest](src/xsoar_cli/manifest/README.md)
74
+ 5. [pack](src/xsoar_cli/pack/README.md)
75
+ 6. [playbook](src/xsoar_cli/playbook/README.md)
76
+ 7. [plugins](src/xsoar_cli/plugins/README.md)
69
77
 
70
78
  ## Plugin System
71
79
 
@@ -1,10 +1,10 @@
1
- xsoar_cli/__about__.py,sha256=UwzPvIhrJjNrphNqLJZLyE0GgLGP3J42waCbFFgqmY4,127
1
+ xsoar_cli/__about__.py,sha256=cwkA9vKz4-QApCiApwquYub4oxcNxa_UUZycn3J1BsI,127
2
2
  xsoar_cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
3
  xsoar_cli/cli.py,sha256=iAlSeZe2iR6ciTVrJYLt-CDZk7b5I-hzHFXbYoXhupA,1342
4
- xsoar_cli/utilities.py,sha256=_gfgwBV5p1_QwNl6qw1fluO6kP7jGW_oItAEJnaR3rA,3860
4
+ xsoar_cli/utilities.py,sha256=nmvb7aclp1Uil6gVtSBTy6wa-GfRLAWOsV_0a8Nc3Vk,3931
5
5
  xsoar_cli/case/README.md,sha256=MTfgVeW3qJXRPNFo8CkZvulm2vwbN8sgiW86V-qXRFw,1342
6
6
  xsoar_cli/case/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- xsoar_cli/case/commands.py,sha256=q1rHb8UQ0NvN6kLh6NRWla5s6qG35PV0xhIOIR325Eg,3233
7
+ xsoar_cli/case/commands.py,sha256=EWFld2BfLPgBhPJs5QqWsddlzrUvNIWmlKG4HwnpukU,3511
8
8
  xsoar_cli/config/README.md,sha256=pcO858PDL9c0qtwj3_a6B8q2CGvcka3dwclVnwi2vlA,516
9
9
  xsoar_cli/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  xsoar_cli/config/commands.py,sha256=SJqIBUBq4tHmnXusycXuIOkmHhyc-vKvQwFMjIHh3Cc,3884
@@ -24,8 +24,8 @@ xsoar_cli/plugins/README.md,sha256=qQ_shzxcJcJKHuWfuN_cTVhtaew4BEGBEjn9wxaZG5c,1
24
24
  xsoar_cli/plugins/__init__.py,sha256=81IZsMbZsqrLdB6TjA9t6s3yS8FkuihliBFX4xZUpTo,1753
25
25
  xsoar_cli/plugins/commands.py,sha256=HC0sWu149uQG9Ztag4t2CNPKXTM4WJbEdLSvFMEjw80,10660
26
26
  xsoar_cli/plugins/manager.py,sha256=7RPk3lAYDifGMLOU-hFOqyPxTVk8ibBVzBqH7R8wy4g,13012
27
- xsoar_cli-1.0.0.dist-info/METADATA,sha256=14SSW-9o-CaY_8Gcxre4zwbWNZ_meJ6MXaWvpfT4nJo,4375
28
- xsoar_cli-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- xsoar_cli-1.0.0.dist-info/entry_points.txt,sha256=s6Klu4QRekXsmZaBxMyFlE4Q-4_jIA9uijk4qIYUPvE,48
30
- xsoar_cli-1.0.0.dist-info/licenses/LICENSE.txt,sha256=l6xnqWKshqwwTXt6ayO6MX8Uvygq0YnkUuFTNnR3ba4,1097
31
- xsoar_cli-1.0.0.dist-info/RECORD,,
27
+ xsoar_cli-1.0.2.dist-info/METADATA,sha256=Oqf719w5HhWZgyYifNZXktW90EyVk_L_tE6uErKj_2M,4659
28
+ xsoar_cli-1.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
+ xsoar_cli-1.0.2.dist-info/entry_points.txt,sha256=s6Klu4QRekXsmZaBxMyFlE4Q-4_jIA9uijk4qIYUPvE,48
30
+ xsoar_cli-1.0.2.dist-info/licenses/LICENSE.txt,sha256=l6xnqWKshqwwTXt6ayO6MX8Uvygq0YnkUuFTNnR3ba4,1097
31
+ xsoar_cli-1.0.2.dist-info/RECORD,,