Skip to content
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

Update Integration: CTM360 #38199

Conversation

edx-sayed-salem
Copy link
Contributor

Contributing to Cortex XSOAR Content

Make sure to register your contribution by filling the contribution registration form

The Pull Request will be reviewed only after the contribution registration form is filled.

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Description

An update to the integration to make use of changes to endpoint to pull incidents from different modules:

  • New playbook based on the old one with slight modification to work for multi-instance setup.
  • New incident field used in dashboard widget.
  • Instance configuration option to select API module.
  • Updated Dashboard: Moved widgets around.
  • Updated incoming mapper for new added field.
  • Updated pack README.

Must have

  • Tests
  • Documentation

@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Partner Support Level Indicates that the contribution is for Partner supported pack labels Jan 16, 2025
@content-bot content-bot changed the base branch from master to contrib/CTM360-Integrations_ctm360-cbs-1 January 16, 2025 13:11
@content-bot
Copy link
Collaborator

Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @talzich will know the proposed changes are ready to be reviewed.
For your convenience, here is a link to the contributions SLAs document.

@content-bot
Copy link
Collaborator

Hi @edx-sayed-salem, thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution please follow this link.

@edx-sayed-salem
Copy link
Contributor Author

edx-sayed-salem commented Jan 16, 2025

I think pre-commit failed due to docker image error. But locally I passed all.
image

@JudahSchwartz JudahSchwartz requested review from ilaredo and removed request for talzich January 21, 2025 08:27
@JudahSchwartz JudahSchwartz assigned ilaredo and unassigned talzich Jan 21, 2025
response = self._http_request(
method='GET',
retries=MAX_RETRIES,
backoff_factor=10,
status_list_to_retry=[400, 429, 500],
url_suffix=f'{CBS_API_ENDPOINT}/xsoar',
url_suffix=CBS_API_ENDPOINT + API['FETCH'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url_suffix=CBS_API_ENDPOINT + API['FETCH'],
url_suffix=CBS_API_ENDPOINT + API.get('FETCH'),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made required change

:type last_run_incident_identifiers: List[str]

:return: Returns updated list of event hashes and unique incidents that should be created.
:return: Returns updated list of event ids and unique incidents that should be created.
:rtype: ``tuple[list,list]``
"""
log(DEBUG, "at Dedup function")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid using log(), you can use demisto.debug(), demisto.info(), demisto.error(), etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log() is a helper function that eventually calls demisto.debug(), demisto.error(), demisto.info() but adds something to the log message before doing so, is it necessary to remove it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After double-checking with @edik24, it was made clear to me that it is okay to use the log function in this integration.

except Exception as e:
log(ERROR, f'Skipping insertion of current incident. Error while calculating hash for {incident=}. Error: {str(e)}')
log(ERROR, f'Skipping insertion of current incident. Error while fetching ID from {incident=}. Error: {str(e)}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid using log(), you can use demisto.debug(), demisto.info(), demisto.error(), etc.

conditions:
- label: "yes"
condition:
- - operator: in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use "in" operator? If the status is just "closed" you can use equals + Ignore case flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is an artifact, the task may have started with a list comparison. Will make the adjustment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected operator

- "3"
scriptarguments:
id:
simple: ${incident.dbotMirrorId}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it returns only 1 id or is it possible to receive multiple?
In both cases, we will prefer to use input as "complex" and not simple.

Copy link
Contributor Author

@edx-sayed-salem edx-sayed-salem Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 1 id only.

For the "complex" input, is it set by adding transformations? Because there is no "simple/complex" option to choose from. It was set when using the transformation menu.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to click on the {} sign and then to put the value in the "get", like this:
image
No need to add transformers. sometimes we are adding "unique" transformer to avoid duplicate content. (but it is not mandatory)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complex version will look like this:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted to complex

@richardbluestone richardbluestone removed their assignment Feb 9, 2025
section: Collect
- defaultvalue: Incidents
display: Module To Use
additionalinfo: "Choose the module you want to use: Incidents, or Leaks."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional information you listed only 2 modules, but it looks like there are several modules according to the options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

| **Parameter** | **Description** | **Required** |
| --- | --- | --- |
| Incident Mirroring Direction | Choose the direction to mirror the incident: Incoming \(from CyberBlindspot to Cortex XSOAR\), Outgoing \(from Cortex XSOAR to CyberBlindspot\), or Incoming and Outgoing \(from/to Cortex XSOAR and CyberBlindspot\). | False |
| Module To Use | Choose the module you want to use: Incidents, or Leaks. | False |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to line 30-35 in the yml file, there are several modules, not just Incidents or Leaks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also Updated

@ShirleyDenkberg
Copy link
Contributor

@ilaredo @karinafishman Doc review completed.

edx-sayed-salem and others added 14 commits February 9, 2025 13:46
…Incident_Management_V2_README.md

Co-authored-by: ShirleyDenkberg <[email protected]>
…Incident_Management_V2.yml

Co-authored-by: ShirleyDenkberg <[email protected]>
…Incident_Management_V2.yml

Co-authored-by: ShirleyDenkberg <[email protected]>
…Incident_Management_V2.yml

Co-authored-by: ShirleyDenkberg <[email protected]>
…Incident_Management_V2.yml

Co-authored-by: ShirleyDenkberg <[email protected]>
…Incident_Management_V2.yml

Co-authored-by: ShirleyDenkberg <[email protected]>
…Incident_Management_V2.yml

Co-authored-by: ShirleyDenkberg <[email protected]>
@ilaredo
Copy link
Contributor

ilaredo commented Feb 9, 2025

@edx-sayed-salem can you commit an empty commit to trigger the build process again? It looks like there is an issue with GitHub

@ilaredo
Copy link
Contributor

ilaredo commented Feb 9, 2025

@edx-sayed-salem Just one last check before merging it, I would like you to create a short video demo showcasing the changes you made and confirming that they work correctly. Please also demonstrate that the test module passes successfully.
Again, thank you for your work, and I look forward to hearing from you.

@ilaredo ilaredo added the pending-demo Demo pending label Feb 9, 2025
@edx-sayed-salem
Copy link
Contributor Author

Hope this covers it GDrive

@ilaredo ilaredo merged commit 3b32cbd into demisto:contrib/CTM360-Integrations_ctm360-cbs-1 Feb 10, 2025
17 checks passed
@content-bot content-bot mentioned this pull request Feb 10, 2025
5 tasks
Copy link

Thank you for your contribution. Your external PR has been merged and the changes are now included in an internal PR for further review. The internal PR will be merged to the master branch within 3 business days.

ilaredo pushed a commit that referenced this pull request Feb 10, 2025
* Update CyberBlindspot integration

* Empty-Commit to trigger CI

* Fix pre-commit error

* Ran format command to correct file(s)

* Revert version and add configuration sections

* use `.get()` for safe dictionary access.

* Add contributors

* Extend dashboard to cover whole page

* Remove comments

* Add default value for key

* Use `equals` instead of `in` operator

* Use complex field value

* Add `IsIntegrationAvailable()` check

* ran `demisto-sdk format`

* Ran `demisto-sdk format`

* Update Packs/CTM360-CyberBlindspot/Integrations/CyberBlindspot/CyberBlindspot.yml



* Update Packs/CTM360-CyberBlindspot/Integrations/CyberBlindspot/README.md



* Update Packs/CTM360-CyberBlindspot/ReleaseNotes/2_1_0.md



* Update Packs/CTM360-CyberBlindspot/ReleaseNotes/2_1_0.md



* Update Packs/CTM360-CyberBlindspot/README.md



* Update Packs/CTM360-CyberBlindspot/README.md



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2_README.md



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2.yml



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2.yml



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2.yml



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2.yml



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2.yml



* Update Packs/CTM360-CyberBlindspot/Playbooks/playbook-CyberBlindspot_Incident_Management_V2.yml



* Update `Module To Use` additional info

* Empty-Commit

---------

Co-authored-by: S. AlQasim D. <[email protected]>
Co-authored-by: ShirleyDenkberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! docs-approved External PR Partner Support Level Indicates that the contribution is for Partner supported pack Partner Partner-Approved pending-demo Demo pending Security Approved If a contribution has been approved for merge by the security team, then this will allow a merge Security Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants