Skip to content

Commit 21374a5

Browse files
edthedevddriddlempitceltzturnerzdc217
authored
Fix - source, duration and autoscale are not required (#53)
Co-authored-by: David Riddle <ddriddle@illinois.edu> Co-authored-by: Edward Delaporte <delaport@illinois.edu> Co-authored-by: Michelle Pitcel <mpitcel2@illinois.edu> Co-authored-by: Tyler Turner <tzturner@illinois.edu> Co-authored-by: Zach Carrington <zdc@illinois.edu>
1 parent 2df23eb commit 21374a5

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

requirements-test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ git+https://github.com/splunk/pytest-splunk-soar-connectors.git
2323
python-dateutil==2.8.2
2424
PyYAML==6.0.1
2525
requests==2.31.0
26-
rich==13.5.2
26+
rich==13.5.3
2727
six==1.16.0
2828
soupsieve==2.5
2929
tomli==2.0.1
3030
types-beautifulsoup4==4.12.0.6
3131
types-html5lib==1.1.11.15
3232
types-requests==2.31.0.2
3333
types-urllib3==1.26.25.14
34-
typing_extensions==4.7.1
34+
typing_extensions==4.8.0
3535
urllib3==1.26.16
3636
vcrpy==5.1.0
3737
wrapt==1.15.0

src/app/app.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,19 @@ def _handle_test_connectivity(self, param):
206206
def _handle_block(self, param):
207207
action_result = self.add_action_result(ActionResult(param))
208208

209-
args = {}
210-
for key in ["cidr", "source", "why", "duration", "autoscale"]:
211-
args[key] = phantom.get_req_value(param, key)
209+
bhr_args = {}
210+
for key in ["cidr", "why", "source", "duration", "autoscale"]:
211+
bhr_args[key] = param.get(key, None)
212212

213-
if "autoscale" in args:
214-
args["autoscale"] = True if args["autoscale"] == "true" else False
213+
if "autoscale" in bhr_args:
214+
bhr_args["autoscale"] = \
215+
True if bhr_args["autoscale"] == "true" else False
215216

216-
self._bhr.block(**args)
217+
self.debug_print(f"Block arguments: {bhr_args}")
218+
self._bhr.block(**bhr_args)
217219

218220
return action_result.set_status(
219-
phantom.APP_SUCCESS, f"Blocked {args['cidr']}")
221+
phantom.APP_SUCCESS, f"Blocked {bhr_args['cidr']}")
220222

221223
def handle_action(self, param):
222224
ret_val = phantom.APP_SUCCESS
@@ -225,6 +227,9 @@ def handle_action(self, param):
225227
action_id = self.get_action_identifier()
226228

227229
self.debug_print("action_id", self.get_action_identifier())
230+
self.debug_print("git_hash", __git_hash__)
231+
self.debug_print("version", __version__)
232+
self.debug_print("build_time", __deployed__)
228233

229234
if action_id == 'test_connectivity':
230235
ret_val = self._handle_test_connectivity(param)

0 commit comments

Comments
 (0)