From 84499cadf9a66b722e3e7b56cbf396c00d95d8f3 Mon Sep 17 00:00:00 2001 From: mmomin-crest <85155176+mmomin-crest@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:41:14 +0530 Subject: [PATCH 1/2] PAPP-34998: Decertify pagerduty (#9) * - Run pre-commit hook - De-certify app - Add release notes * Update README.md * Update release notes to add correct ticket id. * Update minimum phantom version Add required log statements in each actions * Update README.md * Remove white space to solve linting --------- Co-authored-by: splunk-soar-connectors-admin --- .pre-commit-config.yaml | 2 +- LICENSE | 2 +- README.md | 6 +++--- pagerduty.json | 6 +++--- pagerduty_connector.py | 16 ++++++++++++++++ pyproject.toml | 1 + release_notes/unreleased.md | 1 + tox.ini | 5 +---- 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 791ae8e..f93fed1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/phantomcyber/dev-cicd-tools - rev: v1.22 + rev: v1.23 hooks: - id: org-hook - id: package-app-dependencies diff --git a/LICENSE b/LICENSE index b7b3c69..12536c5 100644 --- a/LICENSE +++ b/LICENSE @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/README.md b/README.md index 1e99b05..cf73409 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ [comment]: # "Auto-generated SOAR connector documentation" # PagerDuty -Publisher: Splunk -Connector Version: 2.0.7 +Publisher: Splunk Community +Connector Version: 3.0.0 Product Vendor: PagerDuty Product Name: PagerDuty Product Version Supported (regex): ".\*" -Minimum Product Version: 6.2.1 +Minimum Product Version: 6.2.2 This app integrates with PagerDuty to implement investigative and ticketing actions diff --git a/pagerduty.json b/pagerduty.json index dff2f50..db1d910 100644 --- a/pagerduty.json +++ b/pagerduty.json @@ -2,17 +2,17 @@ "appid": "932c09b3-e09d-40ff-a2b7-b090f7468c54", "name": "PagerDuty", "description": "This app integrates with PagerDuty to implement investigative and ticketing actions", - "publisher": "Splunk", + "publisher": "Splunk Community", "package_name": "phantom_pagerduty", "type": "ticketing", "license": "Copyright (c) 2016-2024 Splunk Inc.", "main_module": "pagerduty_connector.py", - "app_version": "2.0.7", + "app_version": "3.0.0", "utctime_updated": "2024-10-01T07:26:12.000000Z", "product_vendor": "PagerDuty", "product_name": "PagerDuty", "product_version_regex": ".*", - "min_phantom_version": "6.2.1", + "min_phantom_version": "6.2.2", "fips_compliant": true, "logo": "logo_pagerduty.svg", "logo_dark": "logo_pagerduty_dark.svg", diff --git a/pagerduty_connector.py b/pagerduty_connector.py index 27d82c9..101c96d 100644 --- a/pagerduty_connector.py +++ b/pagerduty_connector.py @@ -259,11 +259,13 @@ def _paginator(self, endpoint, action_result): def _handle_list_oncalls(self, param): # Add an action result to the App Run + self.debug_print("Running action - list oncalls") action_result = self.add_action_result(ActionResult(dict(param))) result_list = self._paginator("/oncalls?", action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list oncalls' failed") return action_result.get_status() for oncall in result_list: @@ -276,11 +278,13 @@ def _handle_list_oncalls(self, param): def _handle_list_teams(self, param): # Add an action result to the App Run + self.debug_print("Running action - list teams") action_result = self.add_action_result(ActionResult(dict(param))) result_list = self._paginator("/teams?", action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list teams' failed") return action_result.get_status() for team in result_list: @@ -293,6 +297,7 @@ def _handle_list_teams(self, param): def _handle_list_services(self, param): # Add an action result to the App Run + self.debug_print("Running action - list services") action_result = self.add_action_result(ActionResult(dict(param))) str_endpoint = "" @@ -311,6 +316,7 @@ def _handle_list_services(self, param): result_list = self._paginator(endpoint, action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list services' failed") return action_result.get_status() for service in result_list: @@ -323,6 +329,7 @@ def _handle_list_services(self, param): def _handle_list_users(self, param): # Add an action result to the App Run + self.debug_print("Running action - list users") action_result = self.add_action_result(ActionResult(dict(param))) str_endpoint = "" @@ -341,6 +348,7 @@ def _handle_list_users(self, param): result_list = self._paginator(endpoint, action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list users' failed") return action_result.get_status() for user in result_list: @@ -354,6 +362,7 @@ def _handle_list_escalations(self, param): # Add an action result to the App Run action_result = self.add_action_result(ActionResult(dict(param))) + self.debug_print("Running action - list escalations") str_endpoint = "" if param.get("team_ids"): @@ -382,6 +391,7 @@ def _handle_list_escalations(self, param): result_list = self._paginator(endpoint, action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list escalations' failed") return action_result.get_status() if result_list is None: @@ -397,6 +407,7 @@ def _handle_list_escalations(self, param): def _handle_create_incident(self, param): # Add an action result to the App Run + self.debug_print("Running action - create incident") action_result = self.add_action_result(ActionResult(dict(param))) body = { @@ -420,6 +431,7 @@ def _handle_create_incident(self, param): ret_val, resp_data = self._make_rest_call("/incidents", action_result, data=body, headers=headers, method="post") if phantom.is_fail(ret_val): + self.debug_print("Action 'create incident' failed") return action_result.get_status() action_result.add_data(resp_data) @@ -432,6 +444,7 @@ def _handle_get_oncall_user(self, param): # Add an action result to the App Run action_result = self.add_action_result(ActionResult(dict(param))) + self.debug_print("Running action - get oncall user") # Setup params params = {"escalation_policy_ids[]": param["escalation_id"]} @@ -455,6 +468,7 @@ def _handle_get_oncall_user(self, param): ret_val, resp_data_user = self._make_rest_call("/users/{0}".format(user_id), action_result, params={}) if phantom.is_fail(ret_val): + self.debug_print("Action 'get oncall users' failed") return action_result.get_status() user["user"] = resp_data_user.get("user") @@ -464,6 +478,7 @@ def _handle_get_oncall_user(self, param): def _handle_get_user_info(self, param): + self.debug_print("Running action - get user info") # Add an action result to the App Run action_result = self.add_action_result(ActionResult(dict(param))) @@ -472,6 +487,7 @@ def _handle_get_user_info(self, param): ret_val, resp_data = self._make_rest_call("/users/{0}".format(user_id), action_result, params={}) if phantom.is_fail(ret_val): + self.debug_print("Action 'get user info' failed") return action_result.get_status() try: diff --git a/pyproject.toml b/pyproject.toml index 474efd9..4c594fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,4 @@ verbose = true [tool.isort] line_length = 145 +profile = "black" diff --git a/release_notes/unreleased.md b/release_notes/unreleased.md index fbcb2fd..1bb1a45 100644 --- a/release_notes/unreleased.md +++ b/release_notes/unreleased.md @@ -1 +1,2 @@ **Unreleased** +* De-certify and release as Splunk Community App[PAPP-34998] \ No newline at end of file diff --git a/tox.ini b/tox.ini index 2b96e78..720a141 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,4 @@ [flake8] max-line-length = 145 max-complexity = 28 -extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D - -[isort] -line_length = 145 +extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D,W503 From 8d8f04e60bee56d9f453484317b4341792cc887b Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Oct 2024 03:12:26 -0700 Subject: [PATCH 2/2] Release notes for version 3.0.0 --- LICENSE | 2 +- release_notes/3.0.0.md | 1 + release_notes/unreleased.md | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 release_notes/3.0.0.md diff --git a/LICENSE b/LICENSE index 12536c5..b7b3c69 100644 --- a/LICENSE +++ b/LICENSE @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/release_notes/3.0.0.md b/release_notes/3.0.0.md new file mode 100644 index 0000000..8c5dddb --- /dev/null +++ b/release_notes/3.0.0.md @@ -0,0 +1 @@ +* De-certify and release as Splunk Community App[PAPP-34998] \ No newline at end of file diff --git a/release_notes/unreleased.md b/release_notes/unreleased.md index 1bb1a45..fbcb2fd 100644 --- a/release_notes/unreleased.md +++ b/release_notes/unreleased.md @@ -1,2 +1 @@ **Unreleased** -* De-certify and release as Splunk Community App[PAPP-34998] \ No newline at end of file