diff --git a/requirements-test.txt b/requirements-test.txt index 4f9af13..c90c617 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -23,7 +23,7 @@ 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 @@ -31,7 +31,7 @@ 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 diff --git a/src/app/app.py b/src/app/app.py index a6957f1..cfc5b3e 100644 --- a/src/app/app.py +++ b/src/app/app.py @@ -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 @@ -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)