-
Notifications
You must be signed in to change notification settings - Fork 57
migrate micro_focus_itsma #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.11 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
||
| from __future__ import annotations | ||
| from soar_sdk.SiemplifyUtils import output_handler | ||
| from soar_sdk.SiemplifyAction import SiemplifyAction | ||
| from ..core.MicroFocusITSMAManager import MicroFocusITSMAManager | ||
|
|
||
|
|
||
| ITSMA_PROVIDER = "MicroFocusITSMA" | ||
|
|
||
|
|
||
| @output_handler | ||
| def main(): | ||
| # Configuration | ||
| siemplify = SiemplifyAction() | ||
| conf = siemplify.get_configuration(ITSMA_PROVIDER) | ||
| itsma_manager = MicroFocusITSMAManager( | ||
| conf["API Root"], | ||
| conf["Username"], | ||
| conf["Password"], | ||
| conf["Tenant ID"], | ||
| conf["External System"], | ||
| conf["External ID"], | ||
| conf["Verify SSL"], | ||
| ) | ||
|
|
||
| # Parameters. | ||
| display_label = siemplify.parameters.get("Display Label") | ||
| description = siemplify.parameters.get("Description") | ||
| impact_scope = siemplify.parameters.get("Impact Scope") | ||
| urgency = siemplify.parameters.get("Urgency") | ||
| service_id = siemplify.parameters.get("Service ID") | ||
|
|
||
| incident_id = itsma_manager.create_incident( | ||
| display_label, description, impact_scope, urgency, service_id | ||
| ) | ||
|
|
||
| if incident_id: | ||
| output_message = ( | ||
| f'An incident with id "{incident_id}" was successfully created.' | ||
| ) | ||
| else: | ||
| output_message = "No ticket was created." | ||
|
|
||
| siemplify.end(output_message, incident_id) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
||
| name: Create Incident | ||
| description: Create a new incident | ||
| documentation_link: https://cloud.google.com/chronicle/docs/soar/marketplace-integrations/micro-focus-itsma#create_incident | ||
| integration_identifier: MicroFocusITSMA | ||
| parameters: | ||
| - name: Display Label | ||
| type: string | ||
| description: The display label of the incident | ||
| is_mandatory: true | ||
| - name: Description | ||
| type: string | ||
| description: The description of the incident | ||
| is_mandatory: true | ||
| - name: Impact Scope | ||
| type: string | ||
| description: The impact scope of the incident | ||
| is_mandatory: true | ||
| - name: Urgency | ||
| type: string | ||
| description: The urgency of the incident | ||
| is_mandatory: true | ||
| - name: Service ID | ||
| type: string | ||
| description: The id of the category of the incident | ||
| is_mandatory: true | ||
| dynamic_results_metadata: [] | ||
| creator: admin | ||
| script_result_name: incident_id |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
||
| from __future__ import annotations | ||
| from soar_sdk.SiemplifyUtils import output_handler | ||
| from soar_sdk.SiemplifyAction import SiemplifyAction | ||
| from ..core.MicroFocusITSMAManager import MicroFocusITSMAManager | ||
|
|
||
| ITSMA_PROVIDER = "MicroFocusITSMA" | ||
|
|
||
|
|
||
| @output_handler | ||
| def main(): | ||
| # Configuration | ||
| siemplify = SiemplifyAction() | ||
| conf = siemplify.get_configuration(ITSMA_PROVIDER) | ||
| itsma_manager = MicroFocusITSMAManager( | ||
| conf["API Root"], | ||
| conf["Username"], | ||
| conf["Password"], | ||
| conf["Tenant ID"], | ||
| conf["External System"], | ||
| conf["External ID"], | ||
| conf["Verify SSL"], | ||
| ) | ||
|
|
||
| result_value = itsma_manager.get_token() | ||
|
|
||
| if result_value: | ||
| output_message = "Connection Established." | ||
| else: | ||
| output_message = "Connection Failed." | ||
|
|
||
| siemplify.end(output_message, result_value) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
||
| name: Ping | ||
| description: Test Connectivity | ||
| documentation_link: https://cloud.google.com/chronicle/docs/soar/marketplace-integrations/micro-focus-itsma#ping | ||
| integration_identifier: MicroFocusITSMA | ||
| parameters: [] | ||
| dynamic_results_metadata: [] | ||
| creator: admin |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||||||||||||||||
| # Copyright 2026 Google LLC | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||||||||
| # you may not use this file except in compliance with the License. | ||||||||||||||||||||||
| # You may obtain a copy of the License at | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # Unless required by applicable law or agreed to in writing, software | ||||||||||||||||||||||
| # 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. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| from __future__ import annotations | ||||||||||||||||||||||
| from soar_sdk.SiemplifyUtils import output_handler | ||||||||||||||||||||||
| from soar_sdk.SiemplifyAction import SiemplifyAction | ||||||||||||||||||||||
| from ..core.MicroFocusITSMAManager import MicroFocusITSMAManager | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ITSMA_PROVIDER = "MicroFocusITSMA" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| @output_handler | ||||||||||||||||||||||
| def main(): | ||||||||||||||||||||||
| # Configuration | ||||||||||||||||||||||
| siemplify = SiemplifyAction() | ||||||||||||||||||||||
| conf = siemplify.get_configuration(ITSMA_PROVIDER) | ||||||||||||||||||||||
| itsma_manager = MicroFocusITSMAManager( | ||||||||||||||||||||||
| conf["API Root"], | ||||||||||||||||||||||
| conf["Username"], | ||||||||||||||||||||||
| conf["Password"], | ||||||||||||||||||||||
| conf["Tenant ID"], | ||||||||||||||||||||||
| conf["External System"], | ||||||||||||||||||||||
| conf["External ID"], | ||||||||||||||||||||||
| conf["Verify SSL"], | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Parameters. | ||||||||||||||||||||||
| incident_id = siemplify.parameters.get("Incident ID") | ||||||||||||||||||||||
| display_label = siemplify.parameters.get("Display Label") | ||||||||||||||||||||||
| description = siemplify.parameters.get("Description") | ||||||||||||||||||||||
| impact_scope = siemplify.parameters.get("Impact Scope") | ||||||||||||||||||||||
| urgency = siemplify.parameters.get("Urgency") | ||||||||||||||||||||||
| service_id = siemplify.parameters.get("Service ID") | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| result_value = itsma_manager.update_incident( | ||||||||||||||||||||||
| incident_id, | ||||||||||||||||||||||
| display_label, | ||||||||||||||||||||||
| description, | ||||||||||||||||||||||
| impact_scope, | ||||||||||||||||||||||
| urgency, | ||||||||||||||||||||||
| service_id | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if result_value: | ||||||||||||||||||||||
| updated_params = [ | ||||||||||||||||||||||
| param | ||||||||||||||||||||||
| for param, value in siemplify.parameters.items() | ||||||||||||||||||||||
| if value and key is not "Incident ID" | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
|
Comment on lines
+57
to
+61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| output_message = f'An incident with id "{incident_id}" was successfully updated. \n Updated parameters: {",".join(updated_params)}' | ||||||||||||||||||||||
| else: | ||||||||||||||||||||||
| output_message = "No ticket was updated." | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| siemplify.end(output_message, result_value) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if __name__ == "__main__": | ||||||||||||||||||||||
| main() | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
||
| name: Update Incident | ||
| description: Update an existing incident | ||
| documentation_link: https://cloud.google.com/chronicle/docs/soar/marketplace-integrations/micro-focus-itsma#update_incident | ||
| integration_identifier: MicroFocusITSMA | ||
| parameters: | ||
| - name: Incident ID | ||
| type: string | ||
| description: The ID of the incident | ||
| is_mandatory: true | ||
| - name: Display Label | ||
| type: string | ||
| description: The updated display label of the incident | ||
| is_mandatory: false | ||
| - name: Description | ||
| type: string | ||
| description: The updated description of the incident | ||
| is_mandatory: false | ||
| - name: Impact Scope | ||
| type: string | ||
| description: The updated impact score of the incident | ||
| is_mandatory: false | ||
| - name: Urgency | ||
| type: string | ||
| description: The updated urgency of the incident | ||
| is_mandatory: false | ||
| - name: Service ID | ||
| type: string | ||
| description: The updated Id of the category of the incident | ||
| is_mandatory: false | ||
| dynamic_results_metadata: [] | ||
| creator: admin | ||
| script_result_name: is_succeed |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # 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. | ||
|
|
||
| from __future__ import annotations | ||
| from soar_sdk.SiemplifyUtils import output_handler | ||
| from soar_sdk.SiemplifyAction import SiemplifyAction | ||
| from ..core.MicroFocusITSMAManager import MicroFocusITSMAManager | ||
|
|
||
|
|
||
| ITSMA_PROVIDER = "MicroFocusITSMA" | ||
|
|
||
|
|
||
| @output_handler | ||
| def main(): | ||
| # Configuration | ||
| siemplify = SiemplifyAction() | ||
| conf = siemplify.get_configuration(ITSMA_PROVIDER) | ||
| itsma_manager = MicroFocusITSMAManager( | ||
| conf["API Root"], | ||
| conf["Username"], | ||
| conf["Password"], | ||
| conf["Tenant ID"], | ||
| conf["External System"], | ||
| conf["External ID"], | ||
| conf["Verify SSL"], | ||
| ) | ||
|
|
||
| # Parameters. | ||
| incident_id = siemplify.parameters.get("Incident ID") | ||
| status = siemplify.parameters.get("Status") | ||
|
|
||
| result_value = itsma_manager.update_external_incident_status( | ||
| incident_id, | ||
| status | ||
| ) | ||
|
|
||
| if result_value: | ||
| output_message = f'An incident with id "{incident_id}" external status was change to {status}' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| else: | ||
| output_message = "No ticket was updated." | ||
|
|
||
| siemplify.end(output_message, result_value) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
mainfunction is missing a return type annotation, which is required by the style guide (line 80). Please add-> None. This applies to themainfunction in other actions as well (Ping.py,UpdateIncident.py,UpdateIncidentExternalStatus.py).References