Skip to content

Commit 6c32281

Browse files
committed
bump 5.0.0 and fixes for playbooks
1 parent 7601e2c commit 6c32281

File tree

6 files changed

+18
-36
lines changed

6 files changed

+18
-36
lines changed

Diff for: .github/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [5.0.0](https://github.com/intelowlproject/pyintelowl/releases/tag/5.0.0)
4+
- Fixes for Playbook Analysis
5+
36
## [4.4.7](https://github.com/intelowlproject/pyintelowl/releases/tag/4.4.7)
47
- Fixed Running Playbook without TLP set
58

Diff for: docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import os
1414
import sys
1515

16-
VERSION = "4.4.7"
16+
VERSION = "5.0.0"
1717
GITHUB_URL = "https://github.com/intelowlproject/pyintelowl"
1818

1919
sys.path.append(os.path.abspath("../"))

Diff for: pyintelowl/cli/_jobs_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _render_job_reports_table(rows, title: str, verbose=False):
5959
]
6060
if verbose:
6161
for field in ["report", "errors", "runtime_configuration"]:
62-
cols.append(get_json_syntax(el[field]) if el[field] else None)
62+
cols.append(get_json_syntax(el[field]) if el.get(field, "") else None)
6363
table.add_row(*cols)
6464
return table
6565

Diff for: pyintelowl/cli/analyse.py

+10-27
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,8 @@
8080
# doing it twice to remove --analyzers-list and --connectors-list
8181
__playbook_analyse_options.pop(0)
8282
__playbook_analyse_options.pop(0)
83-
84-
__playbook_analyse_options.append(
85-
click.option(
86-
"-pl",
87-
"--playbooks-list",
88-
type=str,
89-
default="",
90-
help="""
91-
Comma separated list of playbook names to invoke.
92-
Defaults to all configured playbooks.
93-
""",
94-
),
95-
)
83+
__playbook_analyse_options.pop(3)
84+
__playbook_analyse_options.pop(2)
9685

9786

9887
@click.group("analyse")
@@ -184,57 +173,53 @@ def file(
184173

185174
@analyse.command(help="Send playbook analysis request for an observable")
186175
@click.argument("value")
176+
@click.argument("playbook")
187177
@add_options(__playbook_analyse_options)
188178
@click.pass_context
189179
def playbook_observable(
190180
ctx: ClickContext,
191181
value: str,
192-
playbooks_list: str,
182+
playbook: str,
193183
tags_list: str,
194184
tlp: str,
195-
check,
196-
check_minutes_ago: int,
197185
runtime_config,
198186
should_poll: bool,
199187
):
200-
playbooks_list = playbooks_list.split(",") if len(playbooks_list) else []
201188
tags_labels = tags_list.split(",") if len(tags_list) else []
202189
if runtime_config:
203190
runtime_config = get_json_data(runtime_config)
204191
else:
205192
runtime_config = {}
206193
try:
194+
print("here")
207195
ctx.obj._new_analysis_playbook_cli(
208196
value,
209197
"observable",
210-
check,
198+
playbook,
211199
tlp,
212-
playbooks_list,
213200
runtime_config,
214201
tags_labels,
215202
should_poll,
216-
check_minutes_ago,
217203
)
204+
print("here3")
218205
except IntelOwlClientException as e:
219206
ctx.obj.logger.fatal(str(e))
220207

221208

222209
@analyse.command(help="Send playbook analysis request for an observable")
223210
@click.argument("filepath", type=click.Path(exists=True, resolve_path=True))
211+
@click.argument("playbook")
224212
@add_options(__playbook_analyse_options)
225213
@click.pass_context
226214
def playbook_file(
227215
ctx: ClickContext,
228216
filepath: str,
229-
playbooks_list: str,
217+
playbook: str,
230218
tags_list: str,
231219
tlp: str,
232-
check,
233-
check_minutes_ago: int,
234220
runtime_config,
235221
should_poll: bool,
236222
):
237-
playbooks_list = playbooks_list.split(",") if len(playbooks_list) else []
238223
tags_labels = tags_list.split(",") if len(tags_list) else []
239224
if runtime_config:
240225
runtime_config = get_json_data(runtime_config)
@@ -244,13 +229,11 @@ def playbook_file(
244229
ctx.obj._new_analysis_playbook_cli(
245230
filepath,
246231
"file",
247-
check,
232+
playbook,
248233
tlp,
249-
playbooks_list,
250234
runtime_config,
251235
tags_labels,
252236
should_poll,
253-
check_minutes_ago,
254237
)
255238
except IntelOwlClientException as e:
256239
ctx.obj.logger.fatal(str(e))

Diff for: pyintelowl/pyintelowl.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -769,13 +769,11 @@ def _new_analysis_playbook_cli(
769769
self,
770770
obj: str,
771771
type_: str,
772-
check,
773772
playbook: str,
774773
tlp: TLPType = None,
775774
runtime_configuration: Dict = None,
776775
tags_labels: List[str] = None,
777776
should_poll: bool = False,
778-
minutes_ago: int = None,
779777
) -> None:
780778
"""
781779
For internal use by the pyintelowl CLI.
@@ -785,8 +783,6 @@ def _new_analysis_playbook_cli(
785783
if not tags_labels:
786784
tags_labels = []
787785

788-
return
789-
790786
self.logger.info(
791787
f"""Requesting analysis..
792788
{type_}: [blue]{obj}[/]
@@ -799,8 +795,8 @@ def _new_analysis_playbook_cli(
799795
if type_ == "observable":
800796
resp = self.send_observable_analysis_playbook_request(
801797
observable_name=obj,
802-
tlp=tlp,
803798
playbook_requested=playbook,
799+
tlp=tlp,
804800
runtime_configuration=runtime_configuration,
805801
tags_labels=tags_labels,
806802
)
@@ -809,8 +805,8 @@ def _new_analysis_playbook_cli(
809805
resp = self.send_file_analysis_playbook_request(
810806
filename=path.name,
811807
binary=path.read_bytes(),
812-
tlp=tlp,
813808
playbook_requested=playbook,
809+
tlp=tlp,
814810
runtime_configuration=runtime_configuration,
815811
tags_labels=tags_labels,
816812
)

Diff for: pyintelowl/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.0.0-rc"
1+
__version__ = "5.0.0"

0 commit comments

Comments
 (0)