CiscoEmailSecurity Deprecated
Deprecated. Use Cisco Security Management Appliance instead.
Network Security · Cisco Email Security (Beta) (Deprecated)
Details
| ID | CiscoEmailSecurity |
|---|---|
| Provider | Cisco Systems |
| Category | Network Security |
| From Version | 5.0.0 |
| Docker Image | demisto/python3:3.10.8.37753 |
| Supported Modules | Agentix |
README
Cisco Email Security is an email security gateway . It detects and blocks a wide variety of email-borne threats, such as malware, spam and phishing.
This integration was integrated and tested with version 13 of CiscoEmailSecurity
Configure CiscoEmailSecurity in Cortex
| Parameter | Description | Required |
|---|---|---|
| base_url | Server URL (e.g. https://192.168.0.1) | True |
| credentials | API Username | True |
| insecure | Trust any certificate (not secure) | False |
| proxy | Use system proxy settings | False |
| timeout | request timeout | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
cisco-email-security-report-get
Retrieves details of an email security report by counter type.
Base Command
cisco-email-security-report-get
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| counter | Fetch data from a specific counter. Possible values are “reporting_system”, “mail_incoming_traffic_summary”, “mail_vof_threat_summary”, “mail_vof_specific_threat_summary”, and “mail_amp_threat_summary”. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.Report.MailAmpThreatSummary.incoming_malicious | Number | The number of incoming malicious messages. |
| CiscoEmailSecurity.Report.MailAmpThreatSummary.outgoing_malicious | Number | The number of outgoing malicious messages. |
| CiscoEmailSecurity.Report.MailVofSpecificThreatSummary.threat_detected_virus_or_malware | Number | The number of the messages identified as a virus or malware. |
| CiscoEmailSecurity.Report.MailVofThreatSummary.threat_detected | Number | The total number of messages identified as a threat. |
| CiscoEmailSecurity.Report.ReportingSystem.heartbeat | Number | The reporting system heartbeat. |
| CiscoEmailSecurity.Report.ReportingSystem.end_time | String | The reporting end time. |
| CiscoEmailSecurity.Report.ReportingSystem.begin_time | String | The reporting start time. |
| CiscoEmailSecurity.Report.ReportingSystem.centralized_reporting_expired | Number | The number of messages that centralized reporting expired. |
| CiscoEmailSecurity.Report.ReportingSystem.centralized_reporting_enabled | Number | The number of messages that centralized reporting enabled. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.blocked_dmarc | Number | The number of blocked dmarc messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.blocked_invalid_recipient | Number | The number of blocked invalid recipient messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.blocked_reputation | Number | The number of blocked reputation messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.bulk_mail | Number | The number of bulk mail messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.detected_amp | Number | The number of detected amp messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.detected_spam | Number | The number of detected spam messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.detected_virus | Number | The number of detected virus messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.malicious_url | Number | The number of malicious URL messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.marketing_mail | Number | The number of blocked dmarc messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.social_mail | Number | The number of marketing mail messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.threat_content_filter | Number | The number of threat content filter messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.total_clean_recipients | Number | The total number of clean recipients. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.total_graymail_recipients | Number | The total number of graymail recipients. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.total_recipients | Number | The tota number of recipients. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.total_threat_recipients | Number | The total number of threat recipients. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.verif_decrypt_fail | Number | The number of verif decrypt fail messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.verif_decrypt_success | Number | The number of verif decrypt success messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.detected_spam_suspect | Number | The number of suspected spam messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.detected_spam_certain | Number | The number of certain spam certain messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.failed_spf | Number | The number of failed spf messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.failed_dkim | Number | The number of failed dkim messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.total_spoofed_emails | Number | The total number of spoofed email messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.total_mailbox_auto_remediated_recipients | Number | The total number of mailbox auto-remediated recipients. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.detected_virus_per_msg | Number | The number of detected virus per msg messages. |
| CiscoEmailSecurity.Report.MailIncomingTrafficSummary.ims_spam_increment_over_case | Number | The number of ims spam increment over case messages. |
cisco-email-security-messages-search
Executes a search for messages in Cisco Email Security.
Base Command
cisco-email-security-messages-search
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| limit | The maximum number of records to retrieve. If you set a limit you should also use an offset. |
Optional |
| offset | Specify an offset value to retrieve a subset of records starting with the offset value. If you use an offset you should also set a retrieval limit. |
Optional |
| attachment_name_operator | Attachment name operator to filter by. If you want to use attachment, you need to pass the following arguments: attachment_name_operator and attachment_name_value. Possible values are: “is”, “begins_with”, and “contains”. |
Optional |
| attachment_name_value | Attachment name value to filter by. If you want to use attachment, you need to pass the following arguments: attachment_name_operator and attachment_name_value. |
Optional |
| file_hash | File SHA256 hash to filter by. | Optional |
| recipient_filter_operator | Recipient filter operator to filter by. If you want to use recipient, you need to pass the following arguments: recipient_filter_operator and recipient_filter_value. Possible values are: “is”, “begins_with”, and “contains”. |
Optional |
| recipient_filter_value | Recipient filter value to filter with. If you want to use recipient, you need to pass the following arguments: recipient_filter_operator and recipient_filter_value. |
Optional |
| sender_filter_operator | Sender filter operator to filter with. If you want to use sender, you need to pass the following arguments: sender_filter_operator and sender_filter_value. Possible values are: “is”, “begins_with”, and “contains”. |
Optional |
| sender_filter_value | Sender filter value to filter by. If you want to use sender, you need to pass the following arguments: sender_filter_operator and sender_filter_value. |
Optional |
| subject_filter_operator | Subject filter operator to filter by If you want to use subject, you need to pass the following arguments: subject_filter_operator and subject_filter_value. Possible values are: “is”, “begins_with”, and “contains”. |
Optional |
| subject_filter_value | Subject filter value to filter by. If you want to use subject, you need to pass the following arguments: subject_filter_operator and subject_filter_value. |
Optional |
| message_id | Message ID to filter with | Optional |
| cisco_message_id | Cisco message ID to filter by. | Optional |
| sender_ip | Sender IP address to filter by. | Optional |
| message_direction | Message direction to filter by. Possible values are “incoming” and “outgoing”. | Optional |
| spam_positive | Whether to filter by positive spam positive. Possible values are: “True” and “False”. | Optional |
| quarantined_as_spam | Whether to filter by in spam quarantine. Possible values: are “True” and “False”. | Optional |
| quarantine_status | Quarantine status to filter. Possible values are: “POLICY”, “AMP”, “AV”, “UNCLASSIFIED”, “DLP”, and “OUTBREAK”. | Optional |
| url_reputation | URL reputation to filter by. Possible values are: “Malicious” and “Suspicious”. | Optional |
| virus_positive | Virus positive to filter by. Possible values are: “True” and “False”. | Optional |
| domain_name_operator | Domain name operator to filter by. If you want to use domain filter, you need to pass the following arguments: domain_name_operator and domain_name_value. Possible values are: “is”, “begins_with”, and “contains”. |
Optional |
| domain_name_value | Domain name value to filter by. If you want to use domain filter, you need to pass the following arguments: domain_name_operator and domain_name_value. |
Optional |
| contained_malicious_urls | Whether to filter by contained malicious URLs. Possible values are: “True” and “False”. | Optional |
| contained_neutral_urls | Whether to filter by is contained natural URLs. Possible values are: “True” and “False”. | Optional |
| macro_file_types_detected | Macro file types detected to filter by. temlate of macro_file_types_detected - Microsoft%20Office%20Files,Adobe%20Portable%20Document%20Format |
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.Messages.attributes.direction | String | The message direction. |
| CiscoEmailSecurity.Messages.attributes.hostName | String | The message hostName. |
| CiscoEmailSecurity.Messages.attributes.icid | Number | The message injection connection ID. |
| CiscoEmailSecurity.Messages.attributes.isCompleteData | Boolean | Whether all data is in the message. |
| CiscoEmailSecurity.Messages.attributes.mailPolicy | String | The message mail policy. |
| CiscoEmailSecurity.Messages.attributes.messageStatus | String | The status of the message. |
| CiscoEmailSecurity.Messages.attributes.mid | Number | The message ID. |
| CiscoEmailSecurity.Messages.attributes.recipient | String | The recipient of the message. |
| CiscoEmailSecurity.Messages.attributes.replyTo | String | Who the message is in reply to. |
| CiscoEmailSecurity.Messages.attributes.sbrs | String | The message sender base score. |
| CiscoEmailSecurity.Messages.attributes.sender | String | The message sender. |
| CiscoEmailSecurity.Messages.attributes.senderDomain | String | The message sender domain. |
| CiscoEmailSecurity.Messages.attributes.senderGroup | String | The message sender group. |
| CiscoEmailSecurity.Messages.attributes.senderIp | String | The message sender IP address. |
| CiscoEmailSecurity.Messages.attributes.serialNumber | String | The message serial number. |
| CiscoEmailSecurity.Messages.attributes.subject | String | The message subject. |
| CiscoEmailSecurity.Messages.attributes.timestamp | String | The message datetime. |
| CiscoEmailSecurity.Messages.attributes.verdictChart | String | The message verdict chart. |
cisco-email-security-message-details-get
Retrieves details of a message.
Base Command
cisco-email-security-message-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| cisco_id | Cisco message ID to filter with. | Required |
| message_id | Message ID to filter with. | Required |
| appliance_serial_number | Appliance serial number to filter with. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.Message.attachments | String | The attachments of the message. |
| CiscoEmailSecurity.Message.direction | String | The message direction. |
| CiscoEmailSecurity.Message.hostName | String | The message host name. |
| CiscoEmailSecurity.Message.isCompleteData | Number | Is there in the message all the data. |
| CiscoEmailSecurity.Message.mailPolicy | String | The message mail policy. |
| CiscoEmailSecurity.Message.messageSize | String | The size of the message. |
| CiscoEmailSecurity.Message.messageStatus | String | The status of the message. |
| CiscoEmailSecurity.Message.mid | Number | Message ID. |
| CiscoEmailSecurity.Message.midHeader | String | The header message ID of the message. |
| CiscoEmailSecurity.Message.recipient | String | The recipient of the message. |
| CiscoEmailSecurity.Message.sender | String | The sender of the message. |
| CiscoEmailSecurity.Message.senderGroup | String | The sender group of the message. |
| CiscoEmailSecurity.Message.sendingHostSummary.ipAddress | String | The IP address of the host message. |
| CiscoEmailSecurity.Message.sendingHostSummary.reverseDnsHostname | String | The dns host name of the message. |
| CiscoEmailSecurity.Message.sendingHostSummary.sbrsScore | String | The sender base score host of the message. |
| CiscoEmailSecurity.Message.showAMP | Boolean | Is the AMP shown. |
| CiscoEmailSecurity.Message.showDLP | Boolean | Wheter the DLP is shown. |
| CiscoEmailSecurity.Message.showSummaryTimeBox | Boolean | Whether the summary time box is shown. |
| CiscoEmailSecurity.Message.showURL | Boolean | Whether the URL is shown. |
| CiscoEmailSecurity.Message.smtpAuthId | String | The SMTP auth ID of the message. |
| CiscoEmailSecurity.Message.subject | String | The message date subject. |
| CiscoEmailSecurity.Message.summary.description | String | The message summary description. |
| CiscoEmailSecurity.Message.summary.lastEvent | Number | The message summary last event. |
| CiscoEmailSecurity.Message.summary.timestamp | String | The message summary timestamp. |
| CiscoEmailSecurity.Message.timestamp | String | The message timestamp. |
cisco-email-security-spam-quarantine-search
Executes a search for spam quarantine.
Base Command
cisco-email-security-spam-quarantine-search
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| limit | Specify the number of records to retrieve. If you use a limit you should also use a offset. |
Optional |
| offset | Specify an offset value to retrieve a subset of records starting with the offset value. If you use an offset you should also set a retrieval limit. |
Optional |
| order_by_from_address | From address to filter by. | Optional |
| order_by_to_address | To address to filter by. | Optional |
| order_by_subject | Subject to filter by | Optional |
| order_dir_from_address | From address order to filter by. Possible values are: “asc” and “desc”. | Optional |
| order_dir_to_address | To address order to filter by. Possible values are: “asc” and “desc”. | Optional |
| order_dir_subject | Subject order to filter by. Possible values are: “asc” and “desc”. | Optional |
| recipient_value | Recipient value to filter by. | Optional |
| recipient_operator | Recipient operator to filter by. Possible values are: “is”, “begins_with”, and “contains”. | Optional |
| filter_value | Filter value to filter by. | Optional |
| filter_operator | Filter operator to filter by. Possible values are: “is”, “begins_with”, and “contains”. | Optional |
Context Output
There is no context output for this command.
cisco-email-security-spam-quarantine-message-details-get
Retrieves details for a quarantined message.
Base Command
cisco-email-security-spam-quarantine-message-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| message_id | Message ID to filter by. | Required |
Context Output
There is no context output for this command.
cisco-email-security-dlp-details-get
Retrieves details on a DLP.
Base Command
cisco-email-security-dlp-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| cisco_id | Cisco message ID to filter by. | Required |
| message_id | Message ID to filter by. | Required |
| appliance_serial_number | Appliance serial number to filter by. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.DLP.attachments | String | The attachments of the DLP. |
| CiscoEmailSecurity.DLP.direction | String | The DLP direction. |
| CiscoEmailSecurity.DLP.dlpDetails.dlpMatchedContent.messagePart | String | The message part of the DLP details. |
| CiscoEmailSecurity.DLP.dlpDetails.dlpMatchedContent.messagePartMatch.classifier | String | The classifier of the DLP details. |
| CiscoEmailSecurity.DLP.dlpDetails.dlpMatchedContent.messagePartMatch.classifierMatch | String | The classifier match of the DLP details. |
| CiscoEmailSecurity.DLP.dlpDetails.dlpPolicy | String | The DLP policy. |
| CiscoEmailSecurity.DLP.dlpDetails.mid | String | The message ID of the DLP details. |
| CiscoEmailSecurity.DLP.dlpDetails.riskFactor | Number | The risk factor of the DLP. |
| CiscoEmailSecurity.DLP.dlpDetails.violationSeverity | String | The violation severity of the DLP. |
| CiscoEmailSecurity.DLP.hostName | String | The host name of the DLP. |
| CiscoEmailSecurity.DLP.messageSize | String | The message size of the DLP. |
| CiscoEmailSecurity.DLP.mid | Number | The message ID of the DLP. |
| CiscoEmailSecurity.DLP.midHeader | String | The header message ID of the DLP. |
| CiscoEmailSecurity.DLP.recipient | String | The recipient of the DLP. |
| CiscoEmailSecurity.DLP.sender | String | The sender of the DLP. |
| CiscoEmailSecurity.DLP.senderGroup | String | The sender group of the DLP. |
| CiscoEmailSecurity.DLP.sendingHostSummary.ipAddress | String | The IP address of the host DLP. |
| CiscoEmailSecurity.DLP.sendingHostSummary.reverseDnsHostname | String | The DNS host name of the DLP. |
| CiscoEmailSecurity.DLP.sendingHostSummary.sbrsScore | String | The sender base score host of the DLP. |
| CiscoEmailSecurity.DLP.showDLPDetails | Boolean | Whether the DLP details are shown. |
| CiscoEmailSecurity.DLP.smtpAuthId | String | The SMTP auth ID of the DLP. |
| CiscoEmailSecurity.DLP.subject | String | The subject of the DLP. |
| CiscoEmailSecurity.DLP.timestamp | String | The datetime of the DLP. |
cisco-email-security-amp-details-get
Retrieves details of an AMP.
Base Command
cisco-email-security-amp-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| cisco_id | Cisco message ID to filter by. | Required |
| message_id | Message ID to filter by. | Required |
| appliance_serial_number | Appliance serial number to filter by. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.AMP.ampDetails.description | String | The description of the AMP. |
| CiscoEmailSecurity.AMP.ampDetails.lastEvent | Boolean | Whether this is the last event of the AMP. |
| CiscoEmailSecurity.AMP.ampDetails.timestamp | String | The datetime of the AMP. |
| CiscoEmailSecurity.AMP.attachments | String | The attachments of the AMP. |
| CiscoEmailSecurity.AMP.direction | String | The direction of the AMP. |
| CiscoEmailSecurity.AMP.hostName | String | The hostname of the AMP. |
| CiscoEmailSecurity.AMP.messageSize | String | The message size of the AMP. |
| CiscoEmailSecurity.AMP.mid | Number | The message ID of the AMP. |
| CiscoEmailSecurity.AMP.midHeader | String | The header message ID of the AMP. |
| CiscoEmailSecurity.AMP.recipient | String | The recipient of the AMP. |
| CiscoEmailSecurity.AMP.sender | String | The sender of the AMP. |
| CiscoEmailSecurity.AMP.senderGroup | String | The sender group of the AMP. |
| CiscoEmailSecurity.AMP.sendingHostSummary.ipAddress | String | The IP address of the host AMP. |
| CiscoEmailSecurity.AMP.sendingHostSummary.reverseDnsHostname | String | The DNS hostname of the AMP. |
| CiscoEmailSecurity.AMP.sendingHostSummary.sbrsScore | String | The sender base score host of the AMP. |
| CiscoEmailSecurity.AMP.showAMPDetails | Boolean | Whether AMP details are shown. |
| CiscoEmailSecurity.AMP.smtpAuthId | String | The SMTP auth ID of the AMP. |
| CiscoEmailSecurity.AMP.subject | String | The subject of the AMP. |
| CiscoEmailSecurity.AMP.timestamp | String | The datetime of the AMP. |
cisco-email-security-url-details-get
Retrieves details of a URL.
Base Command
cisco-email-security-url-details-get
Input
| Argument Name | Description | Required |
|---|---|---|
| start_date | Start datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| end_date | End datetime for the search, in the following format: YYYY-MM-DD hh:mm:ss. The seconds must be 00, due to an API limitation. | Required |
| cisco_id | Cisco message ID to filter by. | Required |
| message_id | Message ID to filter by. | Required |
| appliance_serial_number | Appliance serial number to filter by. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.URL.attachments | String | The attachments of the URL. |
| CiscoEmailSecurity.URL.direction | String | The direction of the URL. |
| CiscoEmailSecurity.URL.hostName | String | The hostName of the URL. |
| CiscoEmailSecurity.URL.mid | Number | The message ID of the URL. |
| CiscoEmailSecurity.URL.midHeader | String | The header message ID of the URL. |
| CiscoEmailSecurity.URL.recipient | String | The recipient of the URL. |
| CiscoEmailSecurity.URL.sdrAge | String | The software defined radio age of the URL. |
| CiscoEmailSecurity.URL.sdrCategory | String | The software defined radio category of the URL. |
| CiscoEmailSecurity.URL.sdrReputation | String | The software defined radio reputation of the URL. |
| CiscoEmailSecurity.URL.sender | String | The URL of the sender. |
| CiscoEmailSecurity.URL.senderGroup | String | The sender group of the URL. |
| CiscoEmailSecurity.URL.sendingHostSummary.ipAddress | String | The IP address of the host URL. |
| CiscoEmailSecurity.URL.sendingHostSummary.reverseDnsHostname | String | The DNS host name of the URL. |
| CiscoEmailSecurity.URL.sendingHostSummary.sbrsScore | String | The sender base score host of the URL. |
| CiscoEmailSecurity.URL.showURLDetails | Boolean | Whether the URL details are shown. |
| CiscoEmailSecurity.URL.smtpAuthId | String | The SMTP auth ID of the URL. |
| CiscoEmailSecurity.URL.subject | String | The URL subject. |
| CiscoEmailSecurity.URL.urlDetails.description | String | The description of the URL. |
| CiscoEmailSecurity.URL.urlDetails.lastEvent | Boolean | Whether this is the last event of the URL. |
| CiscoEmailSecurity.URL.urlDetails.timestamp | String | The datetime of the URL details. |
cisco-email-security-spam-quarantine-messages-delete
Deletes quarantined messages.
Base Command
cisco-email-security-spam-quarantine-messages-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| messages_ids | A list of ID’s to delete, comma separated. | Required |
Context Output
There is no context output for this command.
cisco-email-security-spam-quarantine-messages-release
Releases quarantined messages.
Base Command
cisco-email-security-spam-quarantine-messages-release
Input
| Argument Name | Description | Required |
|---|---|---|
| messages_ids | A comma-separated list of IDs to release. | Required |
Context Output
There is no context output for this command.
cisco-email-security-list-entries-get
Retrieves a list of entries.
Base Command
cisco-email-security-list-entries-get
Input
| Argument Name | Description | Required |
|---|---|---|
| list_type | List type to filter by. Possible values are: “safelist” and “blocklist”. | Required |
| limit | Specify an offset value to retrieve a subset of records starting with the offset value. If you use an offset you should also set a retrieval limit. |
Optional |
| offset | Specify an offset value to retrieve a subset of records starting with the offset value. If you use a offset you should also use a limit. |
Optional |
| view_by | View by sender or recipient. | Required |
| order_by | How to order the results. Possible values are: “sender” and “recipient”. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| CiscoEmailSecurity.ListEntries.Safelist.senderList | String | The safelist sender list. |
| CiscoEmailSecurity.ListEntries.Safelist.recipientAddresses | String | The safelist recipient addresses. |
| CiscoEmailSecurity.ListEntries.Safelist.recipientList | String | The safelist recipient list. |
| CiscoEmailSecurity.ListEntries.Safelist.senderAddresses | Number | The safelist sender addresses. |
| CiscoEmailSecurity.ListEntries.Blocklist.senderList | String | The block list sender list. |
| CiscoEmailSecurity.ListEntries.Blocklist.recipientAddresses | String | The block list recipient addresses. |
| CiscoEmailSecurity.ListEntries.Blocklist.recipientList | String | The block list recipient list. |
| CiscoEmailSecurity.ListEntries.Blocklist.senderAddresses | Number | The bloc klist sender addresses. |
cisco-email-security-list-entry-add
Performs actions on list entries. Supports add, edit, and append.
Base Command
cisco-email-security-list-entry-add
Input
| Argument Name | Description | Required |
|---|---|---|
| list_type | List type. Possible values are: “safelist” and “blocklist”. | Required |
| action | Select the action to perform on the list. Possible values are: “add”, “edit”, and “append”. | Required |
| recipient_addresses | A comma-separated list of recipient addresses on which to perform the action. separated) | Optional |
| recipient_list | A comma-separated list of recipient lists on which to perform the action. | Optional |
| sender_addresses | A comma-separated list of sender addresses on which to perform the action. | Optional |
| sender_list | A comma-separated list of sender lists on which to perform the action. | Optional |
| view_by | View by “sender” or “recipient”. | Required |
Context Output
There is no context output for this command.
cisco-email-security-list-entry-delete
Deletes a list entry.
Base Command
cisco-email-security-list-entry-delete
Input
| Argument Name | Description | Required |
|---|---|---|
| list_type | List type | Required |
| recipient_list | A comma-separated list of recipient lists to delete. | Optional |
| sender_list | A comma-seaprated list of sender lists to delete. | Optional |
| view_by | View by “sender” or “recipient”. | Required |
Context Output
There is no context output for this command.
Configuration parameters
base_url— Server URL (e.g. https://192.168.0.1) (required)credentials— API Username (required)insecure— Trust any certificate (not secure)proxy— Use system proxy settingstimeout— Request Timeout
Commands (13)
-
cisco-email-security-amp-details-getRetrieves details of an AMP.
-
cisco-email-security-dlp-details-getRetrieves details on a DLP.
-
cisco-email-security-list-entries-getRetrieves a list of entries.
-
cisco-email-security-list-entry-addPerforms actions on list entries. Supports add, edit, and append.
-
cisco-email-security-list-entry-deleteDeletes a list entry.
-
cisco-email-security-message-details-getRetrieves details of a message.
-
cisco-email-security-messages-searchExecutes a search for messages in Cisco Email Security.
-
cisco-email-security-report-getRetrieves details of an email security report by counter type.
-
cisco-email-security-spam-quarantine-message-details-getRetrieves details for a quarantined message.
-
cisco-email-security-spam-quarantine-messages-deleteDeletes quarantined messages.
-
cisco-email-security-spam-quarantine-messages-releaseReleases quarantined messages.
-
cisco-email-security-spam-quarantine-searchExecutes a search for spam quarantine.
-
cisco-email-security-url-details-getRetrieves details of a URL.
import demistomock as demisto from CommonServerPython import * import urllib3 from typing import Any, Dict # Disable insecure warnings urllib3.disable_warnings() MAX_MESSAGES_TO_GET = 20 class Client(BaseClient): def __init__(self, params): self.username = params.get('credentials').get('identifier') self.password = params.get('credentials').get('password') self.timeout = int(params.get('timeout')) super().__init__(base_url=params.get('base_url'), verify=not params.get('insecure', False), ok_codes=tuple(), proxy=params.get('proxy', False)) self._jwt_token = self._generate_jwt_token() self._headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'jwtToken': self._jwt_token } def _generate_jwt_token(self) -> str: headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } data = { "data": { "userName": base64.b64encode(self.username.encode('ascii')).decode('utf-8'), "passphrase": base64.b64encode(self.password.encode('ascii')).decode('utf-8') } } response_token = self._http_request('POST', '/sma/api/v2.0/login', json_data=data, headers=headers) jwt_token = response_token.get('data').get('jwtToken') return jwt_token def list_report(self, url_params) -> Dict[str, Any]: return self._http_request( method='GET', url_suffix='/sma/api/v2.0/reporting' + url_params, timeout=self.timeout ) def list_messages(self, url_params) -> Dict[str, Any]: return self._http_request( method='GET', url_suffix='/sma/api/v2.0/message-tracking/messages' + url_params, timeout=self.timeout ) def list_get_message_details(self, url_params): return self._http_request( method='GET', url_suffix='/sma/api/v2.0/message-tracking/details' + url_params, timeout=self.timeout ) def list_get_dlp_details(self, url_params): return self._http_request( method='GET', url_suffix='/sma/api/v2.0/message-tracking/dlp-details' + url_params, timeout=self.timeout ) def list_get_amp_details(self, url_params): return self._http_request( method='GET', url_suffix='/sma/api/v2.0/message-tracking/amp-details' + url_params, timeout=self.timeout ) def list_get_url_details(self, url_params): return self._http_request( method='GET', url_suffix='/sma/api/v2.0/message-tracking/url-details' + url_params, timeout=self.timeout ) def list_spam_quarantine(self, url_params): return self._http_request( method='GET', url_suffix='/sma/api/v2.0/quarantine/messages' + url_params, timeout=self.timeout ) def list_quarantine_get_details(self, message_id): return self._http_request( method='GET', url_suffix=f'/sma/api/v2.0/quarantine/messages/details?mid={message_id}&quarantineType=spam', timeout=self.timeout ) def list_delete_quarantine_messages(self, request_body): return self._http_request( method='DELETE', url_suffix='/sma/api/v2.0/quarantine/messages', json_data=request_body, timeout=self.timeout ) def list_release_quarantine_messages(self, request_body): return self._http_request( method='POST', url_suffix='/sma/api/v2.0/quarantine/messages', json_data=request_body, timeout=self.timeout ) def list_entries_get(self, url_params, list_type): return self._http_request( method='GET', url_suffix=f"/sma/api/v2.0/quarantine/{list_type}" + url_params, timeout=self.timeout ) def list_entries_add(self, list_type, request_body): return self._http_request( method='POST', url_suffix=f"/sma/api/v2.0/quarantine/{list_type}", json_data=request_body, timeout=self.timeout ) def list_entries_delete(self, list_type, request_body): return self._http_request( method='DELETE', url_suffix=f"/sma/api/v2.0/quarantine/{list_type}", json_data=request_body, timeout=self.timeout ) def parse_dates_to_ces_format(date_str): splitted_date = date_str.split('T') date_day = splitted_date[0] full_date_time = splitted_date[1] date_time_without_ms = full_date_time.split('.')[0] date_time_without_seconds = date_time_without_ms[:-3] date_time_with_zero_seconds = f'{date_time_without_seconds}:00.000Z' return f'{date_day}T{date_time_with_zero_seconds}' def get_dates_for_test_module(): now = datetime.now() start = now - timedelta(days=2) end = now - timedelta(days=1) start_date = start.isoformat() end_date = end.isoformat() start_date = parse_dates_to_ces_format(start_date) end_date = parse_dates_to_ces_format(end_date) return start_date, end_date def test_module(client: Client) -> str: start_date, end_date = get_dates_for_test_module() suffix_url = f"?startDate={start_date}&" \ f"endDate={end_date}&ciscoHost=All_Hosts&searchOption=messages&offset=0&limit=20" try: client.list_messages(suffix_url) except DemistoException as e: if 'Forbidden' in str(e): return 'Authorization Error: make sure API Key or Service URL are correctly set' else: raise e return 'ok' def date_to_cisco_date(date): """ This function gets a date and returns it according to the standard of Cisco Email security. Args: date: YYYY-MM-DD hh:mm:ss. Returns: The date according to the standard of Cisco Email security - YYYY-MM-DDThh:mm:ss.000Z. """ return date.replace(' ', 'T') + '.000Z' def set_limit(limit): return int(limit) if limit and int(limit) <= MAX_MESSAGES_TO_GET else MAX_MESSAGES_TO_GET def message_ids_to_list_of_integers(args): messages_ids = args.get('messages_ids').split(',') messages_ids = [int(message_id) for message_id in messages_ids] return messages_ids def build_url_params_for_list_report(args, report_counter): start_date = date_to_cisco_date(args.get('start_date')) end_date = date_to_cisco_date(args.get('end_date')) device_group_name = args.get('device_group_name') url_params = f'/{report_counter}?startDate={start_date}&endDate={end_date}&device_type=esa' \ f'&device_group_name={device_group_name}' return url_params def set_var_to_output_prefix(counter): """ This function gets a variable and returns it according to the standard of outputs prefix. Args: counter: report counter - mail_incoming_traffic_summary. Returns: The counter according to the standard of outputs prefix - MailIncomingTrafficSummary. """ list_counter_words = counter.split('_') counter_words = '' for word in list_counter_words: counter_words += word + ' ' counter_words_capital_letter = counter_words.title() counter_output_prefix = counter_words_capital_letter.replace(' ', '') return counter_output_prefix def list_report_command(client: Client, args: Dict[str, Any]): counter = args.get('counter') url_params = build_url_params_for_list_report(args, counter) report_response_data = client.list_report(url_params) report_data = report_response_data.get('data', {}).get('resultSet') counter_output_prefix = set_var_to_output_prefix(counter) return CommandResults( readable_output=f'{report_response_data}', outputs_prefix=f'CiscoEmailSecurity.Report.{counter_output_prefix}', outputs_key_field=counter_output_prefix, outputs=report_data ) def build_url_params_for_list_messages(args): start_date = date_to_cisco_date(args.get('start_date')) end_date = date_to_cisco_date(args.get('end_date')) limit = set_limit(args.get('limit')) offset = int(args.get('offset', '0')) url_params = f'?startDate={start_date}&endDate={end_date}&searchOption=messages&ciscoHost=All_Hosts' \ f'&offset={offset}&limit={limit}' arguments = assign_params(**args) for key, value in arguments.items(): if key == 'attachment_name_value': attachment_name_operator = arguments.get('attachment_name_operator', 'is') url_params += f'&attachmentNameOperator={attachment_name_operator}&attachmentNameValue={value}' elif key == 'recipient_filter_value': recipient_operator = arguments.get('recipient_filter_operator', 'is') url_params += f'&envelopeRecipientfilterOperator={recipient_operator}&envelopeRecipientfilterValue={value}' elif key == 'sender_filter_value': sender_filter_operator = arguments.get('sender_filter_operator', 'is') url_params += f'&envelopeSenderfilterOperator={sender_filter_operator}&envelopeSenderfilterValue={value}' elif key == 'subject_filter_value': subject_filter_operator = arguments.get('subject_filter_operator', 'is') url_params += f'&subjectfilterOperator={subject_filter_operator}&subjectfilterValue={value}' elif key == 'domain_name_value': domain_name_operator = arguments.get('domain_name_operator', 'is') url_params += f'&domainNameOperator={domain_name_operator}&domainNameValue={value}' elif key == 'spam_positive' and value == 'True': url_params += f'&spamPositive={argToBoolean(value)}' elif key == 'quarantined_as_spam' and value == 'True': url_params += f'&quarantinedAsSpam={argToBoolean(value)}' elif key == 'virus_positive' and value == 'True': url_params += f'&virusPositive={argToBoolean(value)}' elif key == 'contained_malicious_urls' and value == 'True': url_params += f'&containedMaliciousUrls={argToBoolean(value)}' elif key == 'contained_neutral_urls' and value == 'True': url_params += f'&containedNeutralUrls={argToBoolean(value)}' elif key == 'file_hash': url_params += f'&fileSha256={value}' elif key == 'message_id': url_params += f'&messageIdHeader={int(value)}' elif key == 'cisco_id': url_params += f'&ciscoMid={int(value)}' elif key == 'sender_ip': url_params += f'&senderIp={value}' elif key == 'message_direction': url_params += f'&messageDirection={value}' elif key == 'quarantine_status': url_params += f'&quarantineStatus={value}' elif key == 'url_reputation': url_params += f'&urlReputation={value}' elif key == 'macro_file_types_detected': url_params += f'¯oFileTypesDetected={value}' return url_params def messages_to_human_readable(messages): messages_readable_outputs = [] for message in messages: readable_output = assign_params(message_id=dict_safe_get(message, ['attributes', 'mid'], None), cisco_id=dict_safe_get(message, ['attributes', 'icid'], None), sender=dict_safe_get(message, ['attributes', 'sender'], None), sender_ip=dict_safe_get(message, ['attributes', 'senderIp'], None), subject=dict_safe_get(message, ['attributes', 'subject'], None), serial_number=dict_safe_get(message, ['attributes', 'serialNumber'], None), timestamp=dict_safe_get(message, ['attributes', 'timestamp'], None)) messages_readable_outputs.append(readable_output) headers = ['timestamp', 'message_id', 'cisco_id', 'sender', 'sender_ip', 'subject', 'serial_number'] human_readable = tableToMarkdown('CiscoEmailSecurity Messages', messages_readable_outputs, headers, removeNull=True) return human_readable def list_search_messages_command(client, args): url_params = build_url_params_for_list_messages(args) messages_response_data = client.list_messages(url_params) messages_data = messages_response_data.get('data') for message in messages_data: message_details = message.get('attributes', {}) message_id = message_details.get('mid', [None])[0] message['attributes']['mid'] = message_id human_readable = messages_to_human_readable(messages_data) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.Message', outputs_key_field='attributes.mid', outputs=messages_data ) def build_url_params_for_get_details(args): start_date = date_to_cisco_date(args.get('start_date')) end_date = date_to_cisco_date(args.get('end_date')) message_id = args.get('message_id') cisco_id = args.get('cisco_id') appliance_serial_number = args.get('appliance_serial_number') url_params = f'?startDate={start_date}&endDate={end_date}&mid={message_id}&icid={cisco_id}' \ f'&serialNumber={appliance_serial_number}' return url_params def details_get_to_human_readable(message): readable_output = assign_params(message_id=message.get('mid'), direction=message.get('direction'), sender=message.get('sender'), recipient=message.get('recipient'), subject=message.get('subject'), timestamp=message.get('timestamp')) headers = ['message_id', 'direction', 'sender', 'recipient', 'subject', 'timestamp'] human_readable = tableToMarkdown('CiscoEmailSecurity Messages', readable_output, headers, removeNull=True) return human_readable def response_data_to_context_and_human_readable(response_data): context_data = response_data.get('data') context_message = context_data.get('messages') context_message['mid'] = context_message.get('mid', [None])[0] human_readable = details_get_to_human_readable(context_message) return context_message, human_readable def list_get_message_details_command(client, args): url_params = build_url_params_for_get_details(args) message_get_details_response_data = client.list_get_message_details(url_params) message_data, human_readable = response_data_to_context_and_human_readable(message_get_details_response_data) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.Message', outputs_key_field='mid', outputs=message_data ) def list_get_dlp_details_command(client, args): url_params = build_url_params_for_get_details(args) message_get_details_response_data = client.list_get_dlp_details(url_params) message_data, human_readable = response_data_to_context_and_human_readable(message_get_details_response_data) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.DLP', outputs_key_field='mid', outputs=message_data ) def list_get_amp_details_command(client, args): url_params = build_url_params_for_get_details(args) message_get_details_response_data = client.list_get_amp_details(url_params) message_data, human_readable = response_data_to_context_and_human_readable(message_get_details_response_data) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.AMP', outputs_key_field='mid', outputs=message_data ) def list_get_url_details_command(client, args): url_params = build_url_params_for_get_details(args) message_get_details_response_data = client.list_get_url_details(url_params) message_data, human_readable = response_data_to_context_and_human_readable(message_get_details_response_data) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.URL', outputs_key_field='mid', outputs=message_data ) def build_url_params_for_spam_quarantine(args): start_date = date_to_cisco_date(args.get('start_date')) end_date = date_to_cisco_date(args.get('end_date')) limit = set_limit(args.get('limit')) offset = int(args.get('offset', '0')) url_params = f'?startDate={start_date}&endDate={end_date}&quarantineType=spam&offset={offset}&limit={limit}' arguments = assign_params(**args) for key, value in arguments.items(): if key == 'order_by': order_dir = arguments.get('order_dir', 'asc') url_params += f'&orderBy={value}&orderDir={order_dir}' elif key == 'recipient_value': recipient_operator = arguments.get('recipient_operator', 'is') url_params += f'&envelopeRecipientfilterOperator={recipient_operator}&envelopeRecipientfilterValue={value}' elif key == 'filter_value': filter_operator = arguments.get('filter_operator', 'is') url_params += f'&filterOperator={filter_operator}&filterValue={value}' return url_params def spam_quarantine_to_human_readable(spam_quarantine): spam_quarantine_readable_outputs = [] for message in spam_quarantine: readable_output = assign_params(message_id=message.get('mid'), recipient=dict_safe_get(message, ['attributes', 'envelopeRecipient'], None), to_address=dict_safe_get(message, ['attributes', 'toAddress'], None), subject=dict_safe_get(message, ['attributes', 'subject'], None), date=dict_safe_get(message, ['attributes', 'date'], None), from_address=dict_safe_get(message, ['attributes', 'fromAddress'], None)) spam_quarantine_readable_outputs.append(readable_output) headers = ['message_id', 'recipient', 'to_address', 'from_address', 'subject', 'date'] human_readable = tableToMarkdown('CiscoEmailSecurity The Quarantine Messages', spam_quarantine_readable_outputs, headers, removeNull=True) return human_readable def list_search_spam_quarantine_command(client, args): url_params = build_url_params_for_spam_quarantine(args) spam_quarantine_response_data = client.list_spam_quarantine(url_params) spam_quarantine_data = spam_quarantine_response_data.get('data') human_readable = spam_quarantine_to_human_readable(spam_quarantine_data) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.SpamQuarantine', outputs_key_field='mid', outputs=spam_quarantine_data ) def quarantine_message_details_data_to_human_readable(message): readable_output = assign_params(recipient=message.get('envelopeRecipient'), date=message.get('date'), to_address=message.get('toAddress'), subject=message.get('subject'), from_address=message.get('fromAddress')) headers = ['recipient', 'to_address', 'from_address', 'subject', 'date'] human_readable = tableToMarkdown('CiscoEmailSecurity QuarantineMessageDetails', readable_output, headers, removeNull=True) return human_readable def list_get_quarantine_message_details_command(client, args): message_id = args.get('message_id') quarantine_message_details_response = client.list_quarantine_get_details(message_id) quarantine_message_details = quarantine_message_details_response.get('data') human_readable = quarantine_message_details_data_to_human_readable(quarantine_message_details.get('attributes')) return CommandResults( readable_output=human_readable, outputs_prefix='CiscoEmailSecurity.QuarantineMessageDetail', outputs_key_field='mid', outputs=quarantine_message_details ) def list_delete_quarantine_messages_command(client, args): messages_ids = message_ids_to_list_of_integers(args) request_body = { "quarantineType": "spam", "mids": messages_ids } delete_quarantine_messages_response = client.list_delete_quarantine_messages(request_body) total_count = dict_safe_get(delete_quarantine_messages_response, ['data', 'totalCount'], None) return CommandResults( readable_output=f'{total_count} messages successfully deleted from quarantine list', ) def list_release_quarantine_messages_command(client, args): messages_ids = message_ids_to_list_of_integers(args) request_body = { "action": "release", "quarantineType": "spam", "mids": messages_ids } release_quarantine_messages_response = client.list_release_quarantine_messages(request_body) total_count = dict_safe_get(release_quarantine_messages_response, ['data', 'totalCount'], None) return CommandResults( readable_output=f'{total_count} messages successfully released from quarantine list', ) def build_url_filter_for_get_list_entries(args): limit = set_limit(args.get('limit')) offset = int(args.get('offset', '0')) view_by = args.get('view_by') order_by = args.get('order_by') url_params = f"?action=view&limit={limit}&offset={offset}&quarantineType=spam&orderDir=desc&viewBy={view_by}" \ f"&orderBy={order_by}" return url_params def list_entries_get_command(client, args): list_type = args.get('list_type') url_params = build_url_filter_for_get_list_entries(args) list_entries_response = client.list_entries_get(url_params, list_type) list_entries = list_entries_response.get('data', [None]) output_prefix = list_type.title() return CommandResults( readable_output=list_entries, outputs_prefix=f'CiscoEmailSecurity.ListEntry.{output_prefix}', outputs_key_field=output_prefix, outputs=list_entries ) def build_request_body_for_add_list_entries(args): request_body = { "action": args.get('action'), "quarantineType": "spam", "viewBy": args.get('view_by') } if 'recipient_addresses' in args: request_body["recipientAddresses"] = args.get('recipient_addresses').split(',') if 'recipient_list' in args: request_body["recipientList"] = args.get('recipient_list').split(',') if 'sender_addresses' in args: request_body["senderAddresses"] = args.get('sender_addresses').split(',') if 'sender_list' in args: request_body["senderList"] = args.get('sender_list').split(',') return request_body def set_outputs_key_for_list_recipient_and_sender(args): """ This function checks which argument used and returns it for the outputs prefix. Args: args: The recipient list or the sender list. Returns: The recipient list or the sender list, depending on what was used. """ return args.get('recipient_list') if args.get('recipient_list') else args.get('sender_list') def list_entries_add_command(client, args): list_type = args.get('list_type') request_body = build_request_body_for_add_list_entries(args) list_entries_response = client.list_entries_add(list_type, request_body) list_entries = list_entries_response.get('data') output_prefix = list_type.title() outputs_key_field = set_outputs_key_for_list_recipient_and_sender(args) return CommandResults( readable_output=list_entries, outputs_prefix=f'CiscoEmailSecurity.listEntry.{output_prefix}', outputs_key_field=outputs_key_field, ) def build_request_body_for_delete_list_entries(args): request_body = { "quarantineType": "spam", "viewBy": args.get('view_by') } if args.get('recipient_list'): request_body["recipientList"] = args.get('recipient_list').split(',') if args.get('sender_list'): request_body["senderList"] = args.get('sender_list').split(',') return request_body def list_entries_delete_command(client, args): list_type = args.get('list_type') request_body = build_request_body_for_delete_list_entries(args) list_entries_response = client.list_entries_delete(list_type, request_body) list_entries = list_entries_response.get('data') output_prefix = list_type.title() outputs_key_field = set_outputs_key_for_list_recipient_and_sender(args) return CommandResults( readable_output=list_entries, outputs_prefix=f'CiscoEmailSecurity.listEntry.{output_prefix}', outputs_key_field=outputs_key_field, ) def main() -> None: params = demisto.params() args = demisto.args() demisto.debug(f'Command being called is {demisto.command()}') try: client = Client(params) if demisto.command() == 'test-module': result = test_module(client) return_results(result) elif demisto.command() == 'cisco-email-security-report-get': return_results(list_report_command(client, args)) elif demisto.command() == 'cisco-email-security-messages-search': return_results(list_search_messages_command(client, args)) elif demisto.command() == 'cisco-email-security-message-details-get': return_results(list_get_message_details_command(client, args)) elif demisto.command() == 'cisco-email-security-spam-quarantine-search': return_results(list_search_spam_quarantine_command(client, args)) elif demisto.command() == 'cisco-email-security-spam-quarantine-message-details-get': return_results(list_get_quarantine_message_details_command(client, args)) elif demisto.command() == 'cisco-email-security-spam-quarantine-messages-delete': return_results(list_delete_quarantine_messages_command(client, args)) elif demisto.command() == 'cisco-email-security-spam-quarantine-messages-release': return_results(list_release_quarantine_messages_command(client, args)) elif demisto.command() == 'cisco-email-security-dlp-details-get': return_results(list_get_dlp_details_command(client, args)) elif demisto.command() == 'cisco-email-security-amp-details-get': return_results(list_get_amp_details_command(client, args)) elif demisto.command() == 'cisco-email-security-url-details-get': return_results(list_get_url_details_command(client, args)) elif demisto.command() == 'cisco-email-security-list-entries-get': return_results(list_entries_get_command(client, args)) elif demisto.command() == 'cisco-email-security-list-entry-add': return_results(list_entries_add_command(client, args)) elif demisto.command() == 'cisco-email-security-list-entry-delete': return_results(list_entries_delete_command(client, args)) # Log exceptions and return errors except Exception as e: return_error(f'Failed to execute {demisto.command()} command.\nError:\n{str(e)}') ''' ENTRY POINT ''' if __name__ in ('__main__', '__builtin__', 'builtins'): main()