Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ git+https://github.com/splunk/pytest-splunk-soar-connectors.git
python-dateutil==2.8.2
PyYAML==6.0.1
requests==2.31.0
rich==13.5.2
rich==13.5.3
six==1.16.0
soupsieve==2.5
tomli==2.0.1
types-beautifulsoup4==4.12.0.6
types-html5lib==1.1.11.15
types-requests==2.31.0.2
types-urllib3==1.26.25.14
typing_extensions==4.7.1
typing_extensions==4.8.0
urllib3==1.26.16
vcrpy==5.1.0
wrapt==1.15.0
Expand Down
19 changes: 12 additions & 7 deletions src/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,19 @@ def _handle_test_connectivity(self, param):
def _handle_block(self, param):
action_result = self.add_action_result(ActionResult(param))

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

if "autoscale" in args:
args["autoscale"] = True if args["autoscale"] == "true" else False
if "autoscale" in bhr_args:
bhr_args["autoscale"] = \
True if bhr_args["autoscale"] == "true" else False

self._bhr.block(**args)
self.debug_print(f"Block arguments: {bhr_args}")
self._bhr.block(**bhr_args)

return action_result.set_status(
phantom.APP_SUCCESS, f"Blocked {args['cidr']}")
phantom.APP_SUCCESS, f"Blocked {bhr_args['cidr']}")

def handle_action(self, param):
ret_val = phantom.APP_SUCCESS
Expand All @@ -225,6 +227,9 @@ def handle_action(self, param):
action_id = self.get_action_identifier()

self.debug_print("action_id", self.get_action_identifier())
self.debug_print("git_hash", __git_hash__)
self.debug_print("version", __version__)
self.debug_print("build_time", __deployed__)

if action_id == 'test_connectivity':
ret_val = self._handle_test_connectivity(param)
Expand Down