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 incident occurred time #31404

Conversation

wolyslager
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)

Related Issues

fixes: link to the issue

Description

Updating the "occurred time" field for incidents created. Previously this was just using the fetch time for the incident - but now we have incident details available (added in a previous pr) so we can accurately display the correct occurred time.

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 Dec 11, 2023
@content-bot content-bot changed the base branch from master to contrib/wolyslager_update-incident-occurred-time December 11, 2023 17:37
@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 @adi88d will know the proposed changes are ready to be reviewed.
For your convenience, here is a link to the contributions SLAs document.

@wolyslager wolyslager mentioned this pull request Dec 13, 2023
4 tasks
Copy link
Contributor

@adi88d adi88d left a comment

Choose a reason for hiding this comment

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

Great Job!
Thanks a lot for this contribution, It is highly appreciated.

  • Please update the currentVersion value in pack_metadata.json
  • update the docker image by running:
    demisto-sdk format -ud -i Packs/AbnormalSecurity/Integrations/AbnormalSecurity/AbnormalSecurity.yml
  • fix the tests that failed in AbnormalSecurity_test.py
  • update lines 752 and 762 inside AbnormalSecurity.py - Line is too long

incidents = []
for threat in threats:
threat_details = client.get_details_of_a_threat_request(threat["threatId"])
incident = {
"dbotMirrorId": str(threat["threatId"]),
"name": "Threat",
"occurred": current_iso_format_time,
"occurred": threat_details["messages"][0]["receivedTime"],
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
"occurred": threat_details["messages"][0]["receivedTime"],
"occurred": threat_details["messages"][0].get("receivedTime"),

incidents = []
for campaign in campaigns:
campaign_details = client.get_details_of_an_abuse_mailbox_campaign_request(campaign["campaignId"])
incident = {"dbotMirrorId": str(campaign["campaignId"]), "name": "Abuse Campaign", "occurred": current_iso_format_time,
incident = {"dbotMirrorId": str(campaign["campaignId"]), "name": "Abuse Campaign", "occurred": campaign_details["firstReported"],
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
incident = {"dbotMirrorId": str(campaign["campaignId"]), "name": "Abuse Campaign", "occurred": campaign_details["firstReported"],
incident = {"dbotMirrorId": str(campaign["campaignId"]), "name": "Abuse Campaign", "occurred": campaign_details.get("firstReported"),

incidents = []
for case in cases:
case_details = client.get_details_of_an_abnormal_case_request(case["caseId"])
incident = {"dbotMirrorId": str(case["caseId"]), "name": "Account Takeover Case", "occurred": current_iso_format_time,
incident = {"dbotMirrorId": str(case["caseId"]), "name": "Account Takeover Case", "occurred": case_details["firstObserved"],
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
incident = {"dbotMirrorId": str(case["caseId"]), "name": "Account Takeover Case", "occurred": case_details["firstObserved"],
incident = {"dbotMirrorId": str(case["caseId"]), "name": "Account Takeover Case", "occurred": case_details.get("firstObserved"),

@adi88d adi88d added pending-contributor The PR is pending the response of its creator Partner-Approved labels Dec 14, 2023
@content-bot content-bot added Contribution Form Filled Whether contribution form filled or not. Partner labels Dec 14, 2023
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2023

CLA assistant check
All committers have signed the CLA.

@adi88d adi88d removed the request for review from michal-dagan December 17, 2023 13:14
@adi88d adi88d force-pushed the update-incident-occurred-time branch from 9a3d1a2 to 7b13be4 Compare December 17, 2023 13:21
@adi88d adi88d self-requested a review December 17, 2023 13:33
Copy link
Contributor

@adi88d adi88d left a comment

Choose a reason for hiding this comment

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

Nice!

@adi88d adi88d merged commit 353ed1d into demisto:contrib/wolyslager_update-incident-occurred-time Dec 17, 2023
12 of 21 checks passed
@content-bot content-bot mentioned this pull request Dec 17, 2023
5 tasks
adi88d added a commit that referenced this pull request Dec 17, 2023
* Update incident occurred time (#31404)

* updating occurred time for incidents

* release notes

* validation fixes

* nit

* fix formatting

* update RN

---------

Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>

* add new line

* update RN

* remove whitespace from blank line

---------

Co-authored-by: William Olyslager <wolyslager@abnormalsecurity.com>
Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>
sapirshuker pushed a commit that referenced this pull request Dec 21, 2023
* Update incident occurred time (#31404)

* updating occurred time for incidents

* release notes

* validation fixes

* nit

* fix formatting

* update RN

---------

Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>

* add new line

* update RN

* remove whitespace from blank line

---------

Co-authored-by: William Olyslager <wolyslager@abnormalsecurity.com>
Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>
maimorag pushed a commit that referenced this pull request Dec 31, 2023
* Update incident occurred time (#31404)

* updating occurred time for incidents

* release notes

* validation fixes

* nit

* fix formatting

* update RN

---------

Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>

* add new line

* update RN

* remove whitespace from blank line

---------

Co-authored-by: William Olyslager <wolyslager@abnormalsecurity.com>
Co-authored-by: Adi Daud <46249224+adi88d@users.noreply.github.com>
Co-authored-by: adi88d <adaud@paloaltonetworks.com>
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! External PR Partner Support Level Indicates that the contribution is for Partner supported pack Partner Partner-Approved pending-contributor The PR is pending the response of its creator TIM Review
Projects
None yet
5 participants