FireEye Central Management

FireEye Central Management (CM Series) is the FireEye threat intelligence hub. It services the FireEye ecosystem, ensuring that FireEye products share the latest intelligence and correlate across attack vectors to detect and prevent cyber attacks.

Analytics & SIEM · FireEye Central Management

Details

IDFireEye Central Management
ProviderTrellix
CategoryAnalytics & SIEM
From Version5.5.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM

README

FireEye Central Management (CM Series) is the FireEye threat intelligence hub. It services the FireEye ecosystem, ensuring that FireEye products share the latest intelligence and correlate across attack vectors to detect and prevent cyber attacks
This integration was integrated and tested with version 9.0.2 of FireEye Central Management

API Key management

This integration generates an API Key from the username and password given to be authenticated with FireEye.
The API Key is valid for 15 minutes.
The integration manages the storage of this key, and its re-generation when the key expires.

Fetch FireEye EX Alert Emails

To fetch a FireEye EX alert email, you will need the UUID.

  1. Run the fireeye-cm-get-alert-details** command with the alert ID. For example,
    **
    !fireeye-cm-get-alert-details alert_id=542
    *
  2. Locate the UUID in the context data and run the fireeye-cm-get-artifacts-by-uuid command with the UUID. For example:
    !fireeye-cm-get-artifacts-by-uuid uuid=243a2555-a915-47a1-a947-e71049f4971c
  3. Download the email.

Access the FireEye Alert URL

To display a proper link in the FireEye NX Alert URL field of the FireEye NX or EX Alert layout, you need to configure the hostname in the appliance settings of the FireEye application.

  1. Log in to your FireEye application.
  2. Navigate to Appliance Settings > Network > Hostname.
  3. In the Hostname field, enter your URL/server/ip address.

Configure FireEye Central Management in Cortex

Parameter Required
Your server URL True
Username True
Fetch incidents False
Max incidents to fetch False
First fetch timestamp (<number> <time unit>, e.g., 12 hours, 7 days, 3 months, 1 year) False
Incident type False
Info level for fetched alerts False
Trust any certificate (not secure) False
Use system proxy settings 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.

fireeye-cm-get-alerts


Searches and retrieves FireEye CM alerts based on several filters.

Base Command

fireeye-cm-get-alerts

Input

Argument Name Description Required
alert_id The ID number of the alert to retrieve. Optional
duration The time interval to search. This filter is used with either the start_time or end_time filter. If duration, start time, and end time are not specified, the system defaults to duration=12_hours, end_time=current_time. If only the duration is specified, the end_time defaults to the current_time. Possible values are: 1_hour, 2_hours, 6_hours, 12_hours, 24_hours, 48_hours. Optional
start_time The start time of the search. This filter is optional. Syntax: start_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om or ‘1 day/month/year’. Default is 1 day. Optional
end_time The end time of the search. This filter is used with the duration filter. If the end_time is specified but not the duration, the system defaults to duration=12_hours, ending at the specified end_time. Syntax: end_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om. Optional
callback_domain Searches for alerts that include callbacks to the specified domain. Optional
dst_ip The destination IPv4 address related to the malware alert. Optional
src_ip The source IPv4 address related to the malware alert. Optional
file_name The name of the malware file. Optional
file_type The malware file type. Optional
info_level The level of information to be returned. Possible values: “concise”, “normal”, and “extended”. Possible values are: concise, normal, extended. Default is concise. Optional
malware_name The name of the malware object. Optional
malware_type The type of the malware object. Possible values: “domain_match”, “malware_callback”, “malware_object”, “web_infection”, “infection_match”, “riskware-infection”, “riskware-callback”, “riskware-object”. Possible values are: domain_match, malware_callback, malware_object, web_infection, infection_match, riskware-infection, riskware-callback, riskware-object. Optional
md5 Searches for alerts that include a specific MD5 hash. Optional
recipient_email The email address of the malware object receiver. Optional
sender_email The email address of the malware object sender. Optional
url Searches for a specific alert URL. Optional
limit Maximum number of alerts to return. Default is 20. Optional

Context Output

Path Type Description
FireEyeCM.Alerts.id String The ID of the alert.
FireEyeCM.Alerts.uuid String The UUID of the alert.
FireEyeCM.Alerts.occurred String The time when the alert occurred.
FireEyeCM.Alerts.product String The product name of the alert.
FireEyeCM.Alerts.rootInfection String The ID of the infection associated with the malware alert.
FireEyeCM.Alerts.name String The link to the infection associated with the malware alert.
FireEyeCM.Alerts.vlan String The virtual LAN (VLAN) of the alert.
FireEyeCM.Alerts.malicious String A flag indicating whether the alert is malicious.
FireEyeCM.Alerts.severity String The severity of the alert.
FireEyeCM.Alerts.sensor String The sensor name that the alert is associated with.
FireEyeCM.Alerts.applianceId String The appliance ID of the alert.
FireEyeCM.Alerts.sensorIp String The sensor IP that the alert is associated with.
FireEyeCM.Alerts.ack String A flag indicating whether an acknowledgment is received.
FireEyeCM.Alerts.src Unknown The source of the alert.
FireEyeCM.Alerts.dst Unknown The destination of the alert.
FireEyeCM.Alerts.explanation Unknown The explanation data of the alert.

Command Example


#### Context Example

```json
{
    "FireEyeCM": {
        "Alerts": [
            {
                "ack": "no",
                "action": "notified",
                "alertUrl": "https://FireEyeCM/event_stream/events_for_bot?ev_id=35685",
                "applianceId": "test",
                "attackTime": "2021-06-10 21:52:43 +0000",
                "dst": {
                    "ip": "1.1.1.1",
                    "mac": "00:50:56:94:b8:42",
                    "port": 443
                },
                "explanation": {
                    "malwareDetected": {
                        "malware": [
                            {
                                "name": "Trojan.Malicious.SSL.Certificate.Dridex"
                            }
                        ]
                    },
                    "osChanges": []
                },
                "id": 35685,
                "malicious": "yes",
                "name": "MALWARE_CALLBACK",
                "occurred": "2021-06-10 21:52:43 +0000",
                "product": "WEB_MPS",
                "rootInfection": 34670,
                "scVersion": "1163.102",
                "sensor": "sensor",
                "sensorIp": "1.1.1.1",
                "severity": "CRIT",
                "src": {
                    "ip": "1.1.1.1",
                    "port": 8080
                },
                "uuid": "529023c0-6ddf-4933-9241-fe4ec71a788e",
                "vlan": 0
            }
        ]
    }
}

Human Readable Output

FireEye Central Management Alerts

id occurred product name malicious severity alertUrl
35685 2021-06-10 21:52:43 +0000 WEB_MPS MALWARE_CALLBACK yes CRIT https://FireEyeCM/event_stream/events_for_bot?ev_id=35685

fireeye-cm-get-alert-details


Searches and retrieves the details of a single alert.

Base Command

fireeye-cm-get-alert-details

Input

Argument Name Description Required
alert_id The ID of the alert for which to retrieve its details. Required
timeout Timeout to retrieve the artifacts. Default is 30 seconds. Optional

Context Output

Path Type Description
FireEyeCM.Alerts.id String The ID of the alert.
FireEyeCM.Alerts.uuid String The UUID of the alert.
FireEyeCM.Alerts.occurred String The time when the alert occurred.
FireEyeCM.Alerts.product String The product name of the alert.
FireEyeCM.Alerts.rootInfection String The ID of the infection associated with the malware alert.
FireEyeCM.Alerts.name String The link to the infection associated with the malware alert.
FireEyeCM.Alerts.vlan String The virtual LAN (VLAN) of the alert.
FireEyeCM.Alerts.malicious String A flag indicating whether the alert is malicious.
FireEyeCM.Alerts.severity String The severity of the alert.
FireEyeCM.Alerts.sensor String The sensor name that the alert is associated with.
FireEyeCM.Alerts.applianceId String The appliance ID of the alert.
FireEyeCM.Alerts.sensorIp String The sensor IP that the alert is associated with.
FireEyeCM.Alerts.ack String A flag indicating whether an acknowledgment is received.
FireEyeCM.Alerts.src Unknown The source of the alert.
FireEyeCM.Alerts.dst Unknown The destination of the alert.
FireEyeCM.Alerts.explanation Unknown The explanation data of the alert.

Command Example

!fireeye-cm-get-alert-details alert_id=35685

Context Example

{
    "FireEyeCM": {
        "Alerts": {
            "ack": "no",
            "action": "notified",
            "alertUrl": "https://FireEyeCM/event_stream/events_for_bot?ev_id=35685",
            "applianceId": "test",
            "attackTime": "2021-06-10 21:52:43 +0000",
            "dst": {
                "ip": "1.1.1.1",
                "mac": "00:50:56:94:b8:42",
                "port": 443
            },
            "explanation": {
                "malwareDetected": {
                    "malware": [
                        {
                            "name": "Trojan.Malicious.SSL.Certificate.Dridex"
                        }
                    ]
                },
                "osChanges": []
            },
            "id": 35685,
            "malicious": "yes",
            "name": "MALWARE_CALLBACK",
            "occurred": "2021-06-10 21:52:43 +0000",
            "product": "WEB_MPS",
            "rootInfection": 34670,
            "scVersion": "1163.102",
            "sensor": "sensor",
            "sensorIp": "1.1.1.1",
            "severity": "CRIT",
            "src": {
                "ip": "1.1.1.1",
                "port": 8080
            },
            "uuid": "529023c0-6ddf-4933-9241-fe4ec71a788e",
            "vlan": 0
        }
    }
}

Human Readable Output

FireEye Central Management Alerts

id occurred product name malicious action src dst severity alertUrl
35685 2021-06-10 21:52:43 +0000 WEB_MPS MALWARE_CALLBACK yes notified ip: 34.252.247.142
port: 51270
mac: 00:50:56:94:b8:42
port: 443
ip: 192.168.1.202
CRIT https://FireEyeCM/event_stream/events_for_bot?ev_id=35685

fireeye-cm-alert-acknowledge


Confirms that the alert has been reviewed.

Base Command

fireeye-cm-alert-acknowledge

Input

Argument Name Description Required
uuid The universally unique identifier (UUID) for the alert. Required

Context Output

There is no context output for this command.

Command Example

!fireeye-cm-alert-acknowledge uuid=529023c0-6ddf-4933-9241-fe4ec71a788e

Human Readable Output

Alert 529023c0-6ddf-4933-9241-fe4ec71a788e was acknowledged successfully.

fireeye-cm-get-artifacts-by-uuid


Downloads malware artifacts data for the specified UUID as a zip file.

Base Command

fireeye-cm-get-artifacts-by-uuid

Input

Argument Name Description Required
uuid The universally unique identifier (UUID) for the alert. Required
timeout Timeout to retrieve the artifacts. Default is 120 seconds. Optional

Context Output

Path Type Description
InfoFile.EntryID string The EntryID of the artifact file.
InfoFile.Extension string The extension of the artifact file.
InfoFile.Name string The name of the artifact file.
InfoFile.Info string The info of the artifact file.
InfoFile.Size number The size of the artifact file.
InfoFile.Type string The type of the artifact file.

Command Example

!fireeye-cm-get-artifacts-by-uuid uuid=b38b83a0-4b96-408c-999f-4e97a5099f61

Context Example

{
    "InfoFile": {
        "EntryID": "400@2c246757-e02c-458a-8620-dbc236283fb8",
        "Extension": "zip",
        "Info": "application/zip",
        "Name": "artifacts_b38b83a0-4b96-408c-999f-4e97a5099f61.zip",
        "Size": 5501,
        "Type": "Zip archive data, at least v2.0 to extract"
    }
}

Human Readable Output

fireeye-cm-get-artifacts-metadata-by-uuid


Gets artifacts metadata for the specified UUID.

Base Command

fireeye-cm-get-artifacts-metadata-by-uuid

Input

Argument Name Description Required
uuid The universally unique identifier (UUID) for the alert. Required

Context Output

Path Type Description
FireEyeCM.Alerts.uuid string Universally unique ID (UUID) of the alert.
FireEyeCM.Alerts.artifactsInfoList.artifactType string The artifact type.
FireEyeCM.Alerts.artifactsInfoList.artifactName string The artifact name.
FireEyeCM.Alerts.artifactsInfoList.artifactSize string The zipped artifact size in bytes.

Command Example

!fireeye-cm-get-artifacts-metadata-by-uuid uuid=b38b83a0-4b96-408c-999f-4e97a5099f61

Context Example

{
    "FireEyeCM": {
        "Alerts": {
            "artifactsInfoList": [
                {
                    "artifactName": "34.252.247.142-192.168.1.202-1620538334558058-33354739.txt.gz",
                    "artifactSize": "1641",
                    "artifactType": "l7_context_file"
                },
                {
                    "artifactName": "192.168.1.202-34.252.247.142-1620538334557811-33354739-cs.pcap",
                    "artifactSize": "3645",
                    "artifactType": "bott_communication_capture"
                }
            ],
            "uuid": "b38b83a0-4b96-408c-999f-4e97a5099f61"
        }
    }
}

Human Readable Output

FireEye Central Management b38b83a0-4b96-408c-999f-4e97a5099f61 Artifact metadata

artifactName artifactSize artifactType
34.252.247.142-192.168.1.202-1620538334558058-33354739.txt.gz 1641 l7_context_file
192.168.1.202-34.252.247.142-1620538334557811-33354739-cs.pcap 3645 bott_communication_capture

fireeye-cm-get-events


Retrieves information about existing IPS NX events. An IPS enabled appliance is a prerequisite to be able to retrieve IPS event data.

Base Command

fireeye-cm-get-events

Input

Argument Name Description Required
duration The time interval in which to search. This filter is used with the end_time filter. If the duration is not specified, the system defaults to duration=12_hours, end_time=current_time. Possible values are: 1_hour, 2_hours, 6_hours, 12_hours, 24_hours, 48_hours. Optional
end_time The end time of the search. This filter is used with the duration filter. If the end_time is specified but not the duration, the system defaults to duration=12_hours, ending at the specified end_time. Syntax: end_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om. Optional
mvx_correlated_only Specifies whether to include all IPS events or MVX-correlated events only. Possible values: “true” and “false”. Possible values are: false, true. Default is false. Optional
limit Maximum number of events to return. Default is 20. Optional

Context Output

Path Type Description
FireEyeCM.Events.eventId Number The ID of the event.
FireEyeCM.Events.occurred string The date and time when the event occurred.
FireEyeCM.Events.srcIp string The IP address of the victim.
FireEyeCM.Events.srcPort Number The port address of the victim.
FireEyeCM.Events.dstIp string The IP address of the attacker.
FireEyeCM.Events.dstPort Number The port address of the attacker.
FireEyeCM.Events.vlan Number The virtual LAN (VLAN) of the event.
FireEyeCM.Events.signatureMatchCnt String The date and time when the event occurred.
FireEyeCM.Events.signatureId String The ID of the event.
FireEyeCM.Events.signatureRev String The date and time when the event occurred.
FireEyeCM.Events.severity String The ID of the event.
FireEyeCM.Events.vmVerified String The date and time when the event occurred.
FireEyeCM.Events.srcMac String The MAC address of the source machine.
FireEyeCM.Events.dstMac String The MAC address of the destination machine.
FireEyeCM.Events.ruleName String The rule name for the event.
FireEyeCM.Events.sensorId String The sensor ID of the FireEye machine.
FireEyeCM.Events.cveId String The CVE ID found in the event.
FireEyeCM.Events.actionTaken String The IPS blocking action taken on the event.
FireEyeCM.Events.attackMode String The attack mode mentioned in the event.
FireEyeCM.Events.interfaceId Number The interface ID of the event.
FireEyeCM.Events.protocol Number The protocol used in the event.
FireEyeCM.Events.incidentId Number The incident ID of the event on FireEye.

Command Example

!fireeye-cm-get-events duration="48_hours" end_time="2021-05-14T01:08:04.000-02:00" mvx_correlated_only="true"

Human Readable Output

No events in the given timeframe were found.

fireeye-cm-get-quarantined-emails


Searches and retrieves quarantined emails.

Base Command

fireeye-cm-get-quarantined-emails

Input

Argument Name Description Required
start_time Specifies the start time of the search. This filter is optional. Syntax: start_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om or ‘1 day/month/year’. Default is 1 day. Optional
end_time Specifies the end time of the search. Default is now. Syntax: end_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om or ‘1 day/month/year’. Optional
from The sender email. Optional
subject The email subject. Must be URL encoded. Optional
appliance_id The appliance ID. Optional
limit Number of emails to return. Default is 20. Optional

Context Output

Path Type Description
FireEyeCM.QuarantinedEmail.appliance_id string The appliance ID associated with the quarantined email.
FireEyeCM.QuarantinedEmail.completed_at string The time the email has been quarantined.
FireEyeCM.QuarantinedEmail.email_uuid string The quarantined email UUID.
FireEyeCM.QuarantinedEmail.from string The quarantined email sender.
FireEyeCM.QuarantinedEmail.message_id string The quarantined email message ID.
FireEyeCM.QuarantinedEmail.quarantine_path string The quarantined email path.
FireEyeCM.QuarantinedEmail.The quarantined email queue id. string The quarantined email queue ID.
FireEyeCM.QuarantinedEmail.subject string The quarantined email subject.

Command Example

!fireeye-cm-get-quarantined-emails start_time="1 month" limit=4

Context Example

{
    "FireEyeCM": {
        "QuarantinedEmail": [
            {
                "appliance_id": "test",
                "completed_at": "2021-05-24T09:04:03",
                "email_uuid": "d7738eb0-7fe7-4b5d-8fcb-2b053ef57e13",
                "from": "test@malicious.net",
                "message_id": "queue-id-test@no-message-id",
                "quarantine_path": "/data/email-analysis/quarantine2/2021-05-24/09/test",
                "queue_id": "4FpWV31wpbzTgF9",
                "subject": "test"
            },
            {
                "appliance_id": "test",
                "completed_at": "2021-05-24T16:01:16",
                "email_uuid": "9e73ca23-b935-47c2-8d2a-fe1a10071db2",
                "from": "test@malicious.net",
                "message_id": "queue-id-test@no-message-id",
                "quarantine_path": "/data/email-analysis/quarantine2/2021-05-24/16/test",
                "queue_id": "test",
                "subject": "test"
            },
            {
                "appliance_id": "test",
                "completed_at": "2021-05-24T16:01:16",
                "email_uuid": "e7b52446-555d-40d0-b8ad-e8f1f2a7ab7a",
                "from": "test@malicious.net",
                "message_id": "queue-id-test@no-message-id",
                "quarantine_path": "/data/email-analysis/quarantine2/2021-05-24/16/test",
                "queue_id": "test",
                "subject": "test"
            },
            {
                "appliance_id": "test",
                "completed_at": "2021-05-24T16:01:16",
                "email_uuid": "ebb991b5-06ef-44f4-b44d-e1daef67ce70",
                "from": "test@malicious.net",
                "message_id": "queue-id-test@no-message-id",
                "quarantine_path": "/data/email-analysis/quarantine2/2021-05-24/16/test",
                "queue_id": "test",
                "subject": "test"
            }
        ]
    }
}

Human Readable Output

FireEye Central Management Quarantined emails

email_uuid from subject message_id completed_at
d7738eb0-7fe7-4b5d-8fcb-2b053ef57e13 test@malicious.net test queue-id-test@no-message-id 2021-05-24T09:04:03
9e73ca23-b935-47c2-8d2a-fe1a10071db2 test@malicious.net test queue-id-test@no-message-id 2021-05-24T16:01:16
e7b52446-555d-40d0-b8ad-e8f1f2a7ab7a test@malicious.net test queue-id-test@no-message-id 2021-05-24T16:01:16
ebb991b5-06ef-44f4-b44d-e1daef67ce70 test@malicious.net test queue-id-test@no-message-id 2021-05-24T16:01:16

fireeye-cm-release-quarantined-emails


Releases and deletes quarantined emails. This is not available when Email Security is in Drop mode.

Base Command

fireeye-cm-release-quarantined-emails

Input

Argument Name Description Required
queue_ids A comma-separated list of quarantined email queue IDs. Supports up to 100 IDs. Required
sensor_name The sensor display name. Required

Context Output

There is no context output for this command.

fireeye-cm-delete-quarantined-emails


Deletes quarantined emails. This is not available when Email Security is in Drop mode.

Base Command

fireeye-cm-delete-quarantined-emails

Input

Argument Name Description Required
queue_ids A comma-separated list of quarantined email queue IDs. Supports up to 100 IDs. Required
sensor_name The sensor display name. Required

Context Output

There is no context output for this command.

fireeye-cm-download-quarantined-emails


Download quarantined emails.

Base Command

fireeye-cm-download-quarantined-emails

Input

Argument Name Description Required
queue_id The quarantined emails queue ID. Required
sensor_name The sensor display name. Required

Context Output

Path Type Description
File.Name String The name of the email.
File.MD5 String The MD5 hash of the email.
File.SHA1 String The SHA1 hash of the email.
File.SHA256 String The SHA256 hash of the email.
File.Type String The file type.
File.Size Number The size of the email in bytes.
File.SSDeep String The SSDeep hash of the email.

Command Example

!fireeye-cm-download-quarantined-emails sensor_name=FireEyeEX queue_id=test

Context Example

{
    "File": {
        "EntryID": "420@2c246757-e02c-458a-8620-dbc236283fb8",
        "Extension": "eml",
        "Info": "message/rfc822",
        "MD5": "634996e695399dfc43488047c8316eaf",
        "Name": "quarantined_email_4FpWV31wpbzTgF9.eml",
        "SHA1": "5e6f89930c81da3f562eb630b4f881315bb56103",
        "SHA256": "218f9c5975dc12e3e3857474669cda62df063051a46213042f5b404ae8bf138f",
        "SHA512": "a7c19471fb4f2b752024246c28a37127ea7475148c04ace743392334d0ecc4762baf30b892d6a24b335e1065b254166f905fc46cc3ba5dba89e757bb7023a211",
        "SSDeep": "6:tnWrw+bcnWd4jXQ93f9FfZPny8ZijRSF1OZKi1rzfSY4SXfT8oERf:tnWrwWcnWd4M9fZvy8SUF184MfPE5",
        "Size": 269,
        "Type": "RFC 822 mail text, ASCII text"
    }
}

Human Readable Output

fireeye-cm-get-reports


Returns reports on selected alerts.

Base Command

fireeye-cm-get-reports

Input

Argument Name Description Required
report_type The report type. Requests for ipsTopNAttack, ipsTopNAttacker, ipsTopNVictim, or ipsTopNMvxVerified reports must be used with the limit parameter set to either 25, 50, 75, or 100. You must have an Intrusion Prevention System (IPS)-enabled appliance to be able to generate the IPS reports. Possible values are: empsEmailAVReport, empsEmailActivity, empsEmailExecutiveSummary, empsEmailHourlyStat, mpsCallBackServer, mpsExecutiveSummary, mpsInfectedHostsTrend, mpsMalwareActivity, mpsWebAVReport, ipsExecutiveSummary, ipsTopNAttack, ipsTopNAttacker, ipsTopNVictim, ipsTopNMvxVerified, alertDetailsReport. Required
start_time The start time of the search. This filter is optional. Syntax: start_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om or ‘1 day/month/year’. Default is 1 week. Optional
end_time Specifies the end time of the search. Default is now. Syntax: end_time=YYYY-MM-DDTHH:mm:ss.sss-OH:om or ‘1 day/month/year’. Optional
limit The maximum number of items covered by each report. This option is required only for IPS TopN reports. Default is 100. Optional
interface The internet interface to one of the values. This option is required only for IPS reports. Possible values are: A, B, AB. Optional
alert_id Alert ID. This argument is only relevant when retrieving a report of type alertDetailsReport. Optional
infection_id Infection ID. This argument is only relevant when retrieving a report of type alertDetailsReport with conjunction to the infection_type argument. Optional
infection_type Infection type. Possible values: “malware-object”, “malware-callback”, “infection-match”, “domain-match”, “web-infection”. This argument is only relevant when retrieving a report of type alertDetailsReport with conjunction to the infection_id argument. Possible values are: malware-object, malware-callback, infection-match, domain-match, web-infection. Optional
timeout Timeout to retrieve the reports. Default is 120 seconds. Optional

Context Output

Path Type Description
InfoFile.EntryID string The EntryID of the artifact file.
InfoFile.Extension string The extension of the artifact file.
InfoFile.Name string The name of the artifact file.
InfoFile.Info string The info of the artifact file.
InfoFile.Size number The size of the artifact file.
InfoFile.Type string The type of the artifact file.

Command Example

``````

Human Readable Output

Known Limitations

Clicking the Test button of the Integration instance settings window verifies that the instance configuration is correct.
Due to a known limitation, clicking the Test button several times in quick succession may result in an “Unauthorized” error, even after a successful result was initially returned. It is enough to receive one success message to verify that the configuration is correct. “Unauthorized” error messages received from repeated clicking of the instance configuration Test button do not affect the validity of the instance if the initial response was successful.

Configuration parameters

  • url — Your server URL (required)
  • credentials — Username (required)
  • isFetch — Fetch incidents
  • max_fetch — Max incidents to fetch
  • first_fetch — First fetch timestamp (<number> <time unit>, e.g., 12 hours, 7 days, 3 months, 1 year)
  • incidentType — Incident type
  • incidentFetchInterval — Incidents Fetch Interval
  • info_level — Info level for fetched alerts
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings

Commands (11)

  • fireeye-cm-alert-acknowledge

    Confirms that the alert has been reviewed.

  • fireeye-cm-delete-quarantined-emails

    Deletes quarantined emails. This is not available when Email Security is in Drop mode.

  • fireeye-cm-download-quarantined-emails

    Download quarantined emails.

  • fireeye-cm-get-alert-details

    Searches and retrieves the details of a single alert.

  • fireeye-cm-get-alerts

    Searches and retrieves FireEye CM alerts based on several filters.

  • fireeye-cm-get-artifacts-by-uuid

    Downloads malware artifacts data for the specified UUID as a zip file.

  • fireeye-cm-get-artifacts-metadata-by-uuid

    Gets artifacts metadata for the specified UUID.

  • fireeye-cm-get-events

    Retrieves information about existing IPS NX events. An IPS enabled appliance is a prerequisite to be able to retrieve IPS event data.

  • fireeye-cm-get-quarantined-emails

    Searches and retrieves quarantined emails.

  • fireeye-cm-get-reports

    Returns reports on selected alerts.

  • fireeye-cm-release-quarantined-emails

    Releases and deletes quarantined emails. This is not available when Email Security is in Drop mode.

import pytest
from FireEyeCM import *
from freezegun import freeze_time
from test_data.result_constants import (
    GET_ALERTS_CONTEXT,
    GET_ALERTS_DETAILS_CONTEXT,
    GET_ARTIFACTS_METADATA_CONTEXT,
    GET_EVENTS_CONTEXT,
    QUARANTINED_EMAILS_CONTEXT,
)


def util_load_json(path):
    with open(path, encoding="utf-8") as f:
        return json.loads(f.read())


def test_get_alerts(mocker):
    """Unit test
    Given
    - get_alerts command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_alerts_request response.
    Then
    - Validate The entry context
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_alerts_request", return_value=util_load_json("test_data/get_alerts.json"))
    command_results = get_alerts(client=client, args={"limit": "2", "start_time": "8 days", "src_ip": "2.2.2.2"})
    assert command_results.outputs == GET_ALERTS_CONTEXT


def test_get_alert_details(mocker):
    """Unit test
    Given
    - get_alert_details command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_alert_details_request response.
    Then
    - Validate The entry context
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(
        FireEyeClient, "get_alert_details_request", return_value=util_load_json("test_data/get_alert_details.json")
    )
    command_results = get_alert_details(client=client, args={"alert_id": "563"})
    assert command_results[0].outputs == GET_ALERTS_DETAILS_CONTEXT


def test_alert_acknowledge(mocker):
    """Unit test
    Given
    - alert_acknowledge command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's alert_acknowledge_request response.
    Then
    - Validate the human readable
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "alert_acknowledge_request", return_value=None)
    command_results = alert_acknowledge(client=client, args={"uuid": "uuid"})
    assert command_results[0].readable_output == "Alert uuid was acknowledged successfully."


def test_alert_acknowledge_already_acknowledged(mocker):
    """Unit test
    Given
    - alert_acknowledge command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's alert_acknowledge_request response for an already acknowledged alert.
    Then
    - Validate the human readable
    """
    error_msg = (
        "Error in API call [404] - Not Found"
        '{"fireeyeapis": {"@version": "v2.0.0", "description": "Alert not found or cannot update.'
        ' code:ALRTCONF008", "httpStatus": 404, "message": "Alert not found or cannot update"}}'
    )

    def error_404_mock(*kwargs):
        raise Exception(error_msg)

    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)

    mocker.patch("FireEyeCM.FireEyeClient.alert_acknowledge_request", side_effect=error_404_mock)

    command_results = alert_acknowledge(client=client, args={"uuid": "uuid"})
    assert (
        command_results[0].readable_output
        == "Alert uuid was not found or cannot update. It may have been acknowledged in the past."
    )


def test_get_artifacts_metadata(mocker):
    """Unit test
    Given
    - get_artifacts_metadata_by_uuid command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_artifacts_metadata_by_uuidrequest response.
    Then
    - Validate The entry context
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(
        FireEyeClient,
        "get_artifacts_metadata_by_uuid_request",
        return_value=util_load_json("test_data/get_artifact_metadata.json"),
    )
    command_results = get_artifacts_metadata_by_uuid(client=client, args={"uuid": "uuid"})
    assert command_results[0].outputs == GET_ARTIFACTS_METADATA_CONTEXT


def test_get_quarantined_emails(mocker):
    """Unit test
    Given
    - get_quarantined_emails command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_quarantined_emails_request response.
    Then
    - Validate The entry context
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(
        FireEyeClient, "get_quarantined_emails_request", return_value=util_load_json("test_data/quarantined_emails.json")
    )
    command_results = get_quarantined_emails(client=client, args={})
    assert command_results.outputs == QUARANTINED_EMAILS_CONTEXT


def test_get_report_not_found(mocker):
    """Unit test
    Given
    - get_reports command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_reports_request response for a non found report.
    Then
    - Validate the human readable
    """
    error_msg = (
        "Error in API call [400] - Bad Request "
        '{"fireeyeapis": {"@version": "v2.0.0", "description": "WSAPI_REPORT_ALERT_NOT_FOUND.'
        ' code:WSAPI_WITH_ERRORCODE_2016", "httpStatus": 400,'
        ' "message": "parameters{infection_id=34013; infection_type=malware-callback}"}}'
    )

    def error_400_mock(*kwargs):
        raise Exception(error_msg)

    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)

    mocker.patch("FireEyeCM.FireEyeClient.get_reports_request", side_effect=error_400_mock)

    command_results = get_reports(
        client=client, args={"report_type": "alertDetailsReport", "infection_id": "34013", "infection_type": "mallware-callback"}
    )
    assert command_results.readable_output == "Report alertDetailsReport was not found with the given arguments."


def test_get_events_no_events(mocker):
    """Unit test
    Given
    - get_events command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_events_request response for no events.
    Then
    - Validate the human readable
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_events_request", return_value=util_load_json("test_data/get_events_none.json"))
    command_results = get_events(
        client=client, args={"end_time": "2020-05-19T23:00:00.000-00:00", "duration": "48_hours", "limit": "3"}
    )
    assert command_results.readable_output == "No events in the given timeframe were found."


def test_get_events(mocker):
    """Unit test
    Given
    - get_events command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_events_request response.
    Then
    - Validate The entry context
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_events_request", return_value=util_load_json("test_data/get_events.json"))
    command_results = get_events(
        client=client, args={"end_time": "2021-05-19T23:00:00.000-00:00", "duration": "48_hours", "limit": "3"}
    )
    assert command_results.outputs == GET_EVENTS_CONTEXT


def test_release_quarantined_emails(mocker):
    """Unit test
    Given
    - release_quarantined_emails command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's release_quarantined_emails_request response.
    Then
    - Validate that an error is raised from the command
    """

    def mocked_release_quarantined_emails_requests(*args):
        class MockResponse:
            def __init__(self, json_data, status_code):
                self.json_data = json_data
                self.status_code = status_code

            def json(self):
                return self.json_data

            def text(self):
                return "1234"

        return MockResponse({"1234": "Unable to release the email:quarantined email does not exist\\n"}, 200)

    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(
        FireEyeClient, "release_quarantined_emails_request", side_effect=mocked_release_quarantined_emails_requests
    )
    with pytest.raises(DemistoException):
        release_quarantined_emails(client=client, args={"sensor_name": "FireEyeEX", "queue_ids": "1234"})


def test_delete_quarantined_emails(mocker):
    """Unit test
    Given
    - delete_quarantined_emails command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's delete_quarantined_emails_request response.
    Then
    - Validate that an error is raised from the command
    """

    def mocked_delete_quarantined_emails_requests(*args):
        class MockResponse:
            def __init__(self, json_data, status_code):
                self.json_data = json_data
                self.status_code = status_code

            def json(self):
                return self.json_data

            def text(self):
                return "1234"

        return MockResponse({"1234": "Unable to delete the email:quarantined email does not exist\\n"}, 200)

    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "delete_quarantined_emails_request", side_effect=mocked_delete_quarantined_emails_requests)
    with pytest.raises(DemistoException):
        delete_quarantined_emails(client=client, args={"sensor_name": "FireEyeEX", "queue_ids": "1234"})


def test_fetch_incidents(mocker):
    """Unit test
    Given
    - fetch incidents command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_alerts_request.
    Then
    - run the fetch incidents command using the Client
    Validate The length of the results and the last_run.
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_alerts_request", return_value=util_load_json("test_data/alerts.json"))
    last_run, incidents = fetch_incidents(client=client, last_run={}, first_fetch="1 year", max_fetch=50, info_level="concise")
    assert len(incidents) == 11
    assert last_run.get("time") == "2021-05-18 12:02:54 +0000"  # occurred time of the last alert


def test_fetch_incidents_with_limit(mocker):
    """Unit test
    Given
    - fetch incidents command
    - command args with a harsh limit
    - command raw response
    When
    - mock the Client's token generation.
    - mock the Client's get_alerts_request.
    Then
    - run the fetch incidents command using the Client
    Validate The length of the results and the last_run of the limited incident.
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_alerts_request", return_value=util_load_json("test_data/alerts.json"))
    last_run, incidents = fetch_incidents(client=client, last_run={}, first_fetch="1 year", max_fetch=5, info_level="concise")
    assert len(incidents) == 5
    assert last_run.get("time") == "2021-05-18 05:04:36 +0000"  # occurred time of the last alert


def test_fetch_incidents_last_alert_ids(mocker):
    """Unit test
    Given
    - fetch incidents command
    - command args
    - command raw response
    When
    - mock the Client's token generation.
    - mock the last_event_alert_ids
    - mock the Client's get_alerts_request.
    Then
    - Validate that no incidents will be returned.
    - Validate that the last_run is pushed in two days from the latest incident fetched
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_alerts_request", return_value=util_load_json("test_data/alerts.json"))
    last_run_time = "2021-05-18T12:02:54+00:00"
    next_run_time = (dateparser.parse(last_run_time[:-6]) + timedelta(hours=48)).isoformat()
    last_alert_ids = '["35267", "35268", "35269", "35272", "35273", "35274", "35275", "35276", "35277", "35278", "35279"]'
    last_run = {"time": last_run_time, "last_alert_ids": last_alert_ids}
    next_run, incidents = fetch_incidents(
        client=client, last_run=last_run, first_fetch="1 year", max_fetch=50, info_level="concise"
    )

    assert len(incidents) == 0
    # trim miliseconds to avoid glitches such as 2021-05-19T10:21:52.121+00:00 != 2021-05-19T10:21:52.123+00:00
    assert next_run.get("time")[:-6] == next_run_time
    assert next_run.get("last_alert_ids") == last_alert_ids


# We freeze the time since we are using dateparser.parse('now') in the fetch incidents
@freeze_time("2021-02-15T17:10:00+00:00")
def test_fetch_incidents_no_alerts(mocker):
    """Unit test
    Given
    - Current time is 2021-02-15 17:10:00 +00:00
    - Fetch incidents command is called

    When
    - No results returned from the search for the start_time = 2021-02-14 17:01:14 +00:00 (no new alerts created until
    now)

    Then
    - Validate that no incident will be returned.
    - Validate that the last_run is set to the current time minus ten minutes (2021-02-15 17:00:00 +00:00)
    - Validate last_alert_ids is reset to empty list
    """
    mocker.patch.object(FireEyeClient, "_get_token", return_value="token")
    client = Client(base_url="https://fireeye.cm.com/", username="user", password="pass", verify=False, proxy=False)
    mocker.patch.object(FireEyeClient, "get_alerts_request", return_value=util_load_json("test_data/no_alerts.json"))
    last_run_time = "2021-02-14T17:01:14+00:00"
    last_alert_ids = '["1", "2", "3", "4", "5"]'
    last_run = {"time": last_run_time, "last_alert_ids": last_alert_ids}
    next_run, incidents = fetch_incidents(
        client=client, last_run=last_run, first_fetch="1 year", max_fetch=50, info_level="concise"
    )

    assert len(incidents) == 0
    assert next_run.get("time") == "2021-02-15T17:00:00+00:00"
    assert next_run.get("last_alert_ids") == []