Search And Delete Emails - Generic v2

This playbook searches and deletes emails with similar attributes of a malicious email using one of the following integrations: * EWS * Microsoft Graph Security * Gmail * Agari Phishing Defense.

Common Playbooks · 23 tasks · 11 inputs · 0 outputs

Inputs

  • From — The value of the malicious email's "From" attribute.
  • Subject — The value of the malicious email's "Subject" attribute.
  • AttachmentName — The value of the malicious email's "AttachmentName" attribute.
  • SearchAndDeleteIntegration — The integration in which to run the search and delete action. Can be MS Graph, Gmail, EWS, or Agari Phishing Defense.
  • SearchThisWeek — Whether to limit the search to the current week. Disabling this may increase search scope, execution time, and risk of timeout for large mailboxes.
  • MsgCase — Used only with Microsoft Graph Security. The eDiscovery case name to use. Looked up by name and created if missing.
  • MsgKQL — Used only with Microsoft Graph Security. KQL query identifying the emails to search and delete. Built automatically from the From, Subject, and AttachmentName inputs if left empty.
  • MsgRecipients — Used only with Microsoft Graph Security. CSV of recipient email addresses to scope the search when MsgMailboxScope is recipientsOnly.
  • MsgMailboxScope — Used only with Microsoft Graph Security. Determines which mailboxes to search. Use recipientsOnly to limit to specific recipients, allTenantMailboxes to search the entire tenant.
  • MsgDeleteType — Used only with Microsoft Graph Security. The delete type to perform on the search results. Possible values are Hard or Soft, or leave empty to select manually (Hard = unrecoverable, Soft = recoverable).
  • MsgMailboxExclusion — Used only with Microsoft Graph Security. CSV of mailboxes to exclude from the search. Honored only when MsgMailboxScope is allTenantMailboxes. Note: exclusion works at the message level, not the mailbox level — see subplaybook description for details.

Commands used

apd-remediate-message

Flowchart

Agari Phishing Defense Both Enabled, input is EWS Gmail Only EWS enabled Both Enabled, input is MS Graph Only MS Graph Enabled yes allTenantMailboxes recipientsOnly yes yes Start Start Search And Delete Emails - EWS - Search And Delete Emails - EWS Search And Delete Emails ... Search And Delete Emails - EWS Done Done In what integration should emails be searched and deleted? In what integration shoul... Is mailbox scope specified? Is mailbox scope specified? Manually select mailbox scope Manually select mailbox s... Set MsgMailboxScope = recipientsOnly - Set Set MsgMailboxScope = rec... Set Set MsgMailboxScope = allTenantMailboxes - Set Set MsgMailboxScope = all... Set Search And Delete Emails - Microsoft Graph Security - Search And Delete Emails - Microsoft Graph Security Search And Delete Emails ... Search And Delete Emails - Mi... Use EWS Use EWS Use MS Graph Use MS Graph Use MS Graph Use MS Graph Use Gmail Use Gmail Search And Delete Emails - Gmail - Search And Delete Emails - Gmail Search And Delete Emails ... Search And Delete Emails - Gmail Agari Phishing Defense Agari Phishing Defense Search And Delete Emails - Agari Phishing Defense - apd-remediate-message Search And Delete Emails ... apd-remediate-message Get time 7 days ago - GetTime Get time 7 days ago GetTime Create KQL query - provided query + search last 7 days - Set Create KQL query - provid... Set Search this week only and query not already time-bounded? Search this week only and... Set the non-modified KQL query - Set Set the non-modified KQL ... Set KQL query provided? KQL query provided? Create KQL query - search last 7 days - Set Create KQL query - search... Set Delete Time7DaysAgo from Context - DeleteContext Delete Time7DaysAgo from ... DeleteContext