Cisco Umbrella Reporting

The Umbrella Reporting v2 API provides visibility into your core network and security activities and Umbrella logs.

Network Security · Cisco Umbrella Reporting

Details

IDCisco Umbrella Reporting
ProviderCisco Systems
CategoryNetwork Security
From Version6.5.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM

README

Cisco Umbrella Reporting

Use Cisco Umbrella’s Reporting to monitor your Umbrella integration and gain a better understanding of your Umbrella usage. Gain insights into request activity and blocked activity, determining which of your identities are generating blocked requests. Reports help build actionable intelligence in addressing security threats including changes in usage trends over time.

The Umbrella Reporting v2 API provides visibility into your core network and security activities and Umbrella logs. This integration was integrated and tested with version v2 of Cisco-umbrella-reporting.

Configure Cisco Umbrella Reporting in Cortex

Parameter Description Required
API URL Cisco Umbrella Reporting API base URL. True
API Key API Key True
API Secret API Secret True
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.

umbrella-reporting-destination-list


List of destinations ordered by the number of requests made in descending order.

Base Command

umbrella-reporting-destination-list

Input

Argument Name Description Required
traffic_type Specify the type of traffic. By default, all supported traffic types are included. Possible values are: dns, proxy, firewall, ip. Optional
domains A domain name or comma-separated list of domain names. Optional
ip An IP address. Optional
urls A URL or comma-separated list of URLs. Optional
ports A port number or comma-separated list of port numbers. Optional
sha256 A SHA-256 hash. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.Destination.count Number Total number of requests made for this destination.
UmbrellaReporting.Destination.domain String Destination.
UmbrellaReporting.Destination.bandwidth Number The total bandwidth of proxy requests uploaded and downloaded for this destination.
UmbrellaReporting.Destination.rank Number The rank of the result based on the number of requests.
UmbrellaReporting.Destination.policycategories.id Number ID of the category.
UmbrellaReporting.Destination.policycategories.label String The human readable label of the category.
UmbrellaReporting.Destination.policycategories.type String The type of category.
UmbrellaReporting.Destination.policycategories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.Destination.policycategories.integration Boolean Whether the category is an integration.
UmbrellaReporting.Destination.categories.id Number ID of the category.
UmbrellaReporting.Destination.categories.label String The human readable label of the category.
UmbrellaReporting.Destination.categories.type String The type of category.
UmbrellaReporting.Destination.categories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.Destination.categories.integration Boolean Whether the category is an integration.
UmbrellaReporting.Destination.counts.allowedrequests Number Number of requests that were allowed.
UmbrellaReporting.Destination.counts.blockedrequests Number Number of requests that were blocked.
UmbrellaReporting.Destination.counts.requests Number Total number of requests.

Command example

!umbrella-reporting-destination-list limit=2

Context Example

{
    "UmbrellaReporting": {
        "Destination": [
            {
                "bandwidth": null,
                "categories": [
                    {
                        "deprecated": false,
                        "id": 167,
                        "integration": false,
                        "label": "Computers and Internet",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 123,
                        "integration": false,
                        "label": "Infrastructure and Content Delivery Networks",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    },
                    {
                        "deprecated": true,
                        "id": 25,
                        "integration": false,
                        "label": "abc/efgh",
                        "type": "content"
                    },
                    {
                        "deprecated": true,
                        "id": 32,
                        "integration": false,
                        "label": "Business Services",
                        "type": "content"
                    }
                ],
                "count": 1286,
                "counts": {
                    "allowedrequests": 1286,
                    "blockedrequests": 0,
                    "requests": 1286
                },
                "domain": "dummy.domain.com",
                "policycategories": [],
                "rank": 1
            },
            {
                "bandwidth": null,
                "categories": [
                    {
                        "deprecated": false,
                        "id": 163,
                        "integration": false,
                        "label": "Business and Industry",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 167,
                        "integration": false,
                        "label": "Computers and Internet",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 142,
                        "integration": false,
                        "label": "Online Meetings",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    },
                    {
                        "deprecated": true,
                        "id": 25,
                        "integration": false,
                        "label": "abc/efgh",
                        "type": "content"
                    },
                    {
                        "deprecated": true,
                        "id": 32,
                        "integration": false,
                        "label": "Business Services",
                        "type": "content"
                    }
                ],
                "count": 1003,
                "counts": {
                    "allowedrequests": 1003,
                    "blockedrequests": 0,
                    "requests": 1003
                },
                "domain": "dummy.domain.com",
                "policycategories": [],
                "rank": 2
            }
        ]
    }
}

Human Readable Output

Destination List

Destination Category Allowed Blocked Requests
www.cisco.com Computers and Internet, Infrastructure and Content Delivery Networks, Application, abc/efgh, Business Services 1286 0 1286
presence.teams.microsoft.com Business and Industry, Computers and Internet, Online Meetings, Application, abc/efgh, Business Services 1003 0 1003

umbrella-reporting-category-list


List of categories ordered by the number of requests made matching the categories in descending order.

Base Command

umbrella-reporting-category-list

Input

Argument Name Description Required
traffic_type Specify the type of traffic. By default, all supported traffic types are included. Possible values are: dns, proxy, ip. Optional
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
sha256 A SHA-256 hash. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.Category.count Number Number of requests made that match this category.
UmbrellaReporting.Category.bandwidth String The total bandwidth of proxy requests uploaded and downloaded for this category.
UmbrellaReporting.Category.category.id Number Category ID.
UmbrellaReporting.Category.category.type String Category type.
UmbrellaReporting.Category.category.label String Category label.
UmbrellaReporting.Category.category.integration Boolean Category integration.
UmbrellaReporting.Category.category.deprecated String Category deprecated.
UmbrellaReporting.Category.rank Number Rank of the category.

Command example

!umbrella-reporting-category-list limit=2

Context Example

{
    "UmbrellaReporting": {
        "Category": [
            {
                "bandwidth": 7974662,
                "category": {
                    "deprecated": false,
                    "id": 148,
                    "integration": false,
                    "label": "Application",
                    "type": "application"
                },
                "count": 32446,
                "rank": 1
            },
            {
                "bandwidth": null,
                "category": {
                    "deprecated": true,
                    "id": 25,
                    "integration": false,
                    "label": "abc/efgh",
                    "type": "content"
                },
                "count": 26112,
                "rank": 2
            }
        ]
    }
}

Human Readable Output

Category List

Category Type Activity
Application application 32446
abc/efgh content 26112

umbrella-reporting-identity-list


List of identities ordered by the number of requests made matching the categories in descending order.

Base Command

umbrella-reporting-identity-list

Input

Argument Name Description Required
traffic_type Specify the type of traffic. By default, all supported traffic types are included. Possible values are: dns, proxy, firewall, ip. Optional
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
ports A port number or comma-separated list of port numbers. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
sha256 A SHA-256 hash. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
identity_types An identity type or comma-separated list of identity types. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.Identity.requests Number Total number of requests made by this identity.
UmbrellaReporting.Identity.bandwidth Number The total bandwidth of proxy requests uploaded and downloaded for this identity.
UmbrellaReporting.Identity.rank Number The rank of the result based on the number of requests.
UmbrellaReporting.Identity.counts.allowedrequests Number Number of requests that were allowed.
UmbrellaReporting.Identity.counts.blockedrequests Number Number of requests that were blocked.
UmbrellaReporting.Identity.counts.requests Number Total number of requests.
UmbrellaReporting.Identity.identity.id Number Identity ID.
UmbrellaReporting.Identity.identity.type.id Number Origin type for the identity.
UmbrellaReporting.Identity.identity.type.type String Origin type name for the identity.
UmbrellaReporting.Identity.identity.type.label String Origin type label for the identity.
UmbrellaReporting.Identity.identity.label String Label for the identity.
UmbrellaReporting.Identity.identity.deleted Boolean Indicates whether the identity was deleted.

Command example

!umbrella-reporting-identity-list limit=2

Context Example

{
    "UmbrellaReporting": {
        "Identity": [
            {
                "bandwidth": 7974662,
                "counts": {
                    "allowedrequests": 29540,
                    "blockedrequests": 72,
                    "requests": 29753
                },
                "identity": {
                    "deleted": false,
                    "id": 589064228,
                    "label": "DESKTOP-IIQVPJ7",
                    "type": {
                        "id": 9,
                        "label": "Roaming Computers",
                        "type": "roaming"
                    }
                },
                "rank": 1,
                "requests": 29753
            },
            {
                "bandwidth": null,
                "counts": {
                    "allowedrequests": 17950,
                    "blockedrequests": 59,
                    "requests": 18082
                },
                "identity": {
                    "deleted": false,
                    "id": 593805843,
                    "label": "S\u2019s MacBook Pro",
                    "type": {
                        "id": 9,
                        "label": "Roaming Computers",
                        "type": "roaming"
                    }
                },
                "rank": 2,
                "requests": 18082
            }
        ]
    }
}

Human Readable Output

Identities List

Identity Requests
DESKTOP-IIQVPJ7 29753
S’s MacBook Pro 18082

umbrella-reporting-event-type-list


List of event types ordered by the number of requests made for each type of event in descending order. The event types are: domain_security, domain_integration, url_security, url_integration, cisco_amp and antivirus.

Base Command

umbrella-reporting-event-type-list

Input

Argument Name Description Required
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.EventType.eventtype String The event type. One of “domain_security”, “domain_integration”, “url_security”, “url_integration”, “cisco_amp” and “antivirus”.
UmbrellaReporting.EventType.count Number Number of requests made that match this event type.

Command example


#### Context Example

```json
{
    "UmbrellaReporting": {
        "EventType": [
            {
                "count": 2,
                "eventtype": "domain_security"
            },
            {
                "count": 0,
                "eventtype": "url_integration"
            },
            {
                "count": 0,
                "eventtype": "url_security"
            },
            {
                "count": 0,
                "eventtype": "antivirus"
            },
            {
                "count": 0,
                "eventtype": "application"
            },
            {
                "count": 0,
                "eventtype": "cisco_amp"
            },
            {
                "count": 0,
                "eventtype": "domain_integration"
            }
        ]
    }
}

Human Readable Output

Event Type List

Event Type Count
domain_security 2
url_integration 0
url_security 0
antivirus 0
application 0
cisco_amp 0
domain_integration 0

umbrella-reporting-file-list


List of files within a time frame. Only returns proxy data.

Base Command

umbrella-reporting-file-list

Input

Argument Name Description Required
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
sha256 A SHA-256 hash. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
identity_types An identity type or comma-separated list of identity types. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.File.requests Number Number of requests.
UmbrellaReporting.File.identitycount Number Number of identities for entry.
UmbrellaReporting.File.sha256 String SHA256 for entry.
UmbrellaReporting.File.filenames Unknown Array of filenames for entry.
UmbrellaReporting.File.filetypes Unknown Array of file types for entry.
UmbrellaReporting.File.categories.id Number ID of the category.
UmbrellaReporting.File.categories.label String The human readable label of the category.
UmbrellaReporting.File.categories.type String The type of category.
UmbrellaReporting.File.categories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.File.categories.integration Boolean Whether the category is an integration.

Command example

!umbrella-reporting-file-list limit=2

Context Example

{
    "UmbrellaReporting": {
        "File": [
            {
                "categories": [
                    {
                        "deprecated": false,
                        "id": 142,
                        "integration": false,
                        "label": "Online Meetings",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    }
                ],
                "filenames": [
                    "AnyDesk.exe"
                ],
                "filetypes": [],
                "identitycount": 1,
                "requests": 2,
                "sha256": "dummy_sha256"
            }
        ]
    }
}

Human Readable Output

File List

Requests Identity Count SHA256 Category Category Type File Name
2 1 94fe42af4a67ed5be45bd7913d8a8aebc4e35afddd5675d01bd37df8e9b399ae Online Meetings, Application content, application AnyDesk.exe

umbrella-reporting-threat-list


List of top threats within a time frame. Returns both DNS and Proxy data.

Base Command

umbrella-reporting-threat-list

Input

Argument Name Description Required
traffic_type Specify the type of traffic. By default, all supported traffic types are included. Possible values are: dns, proxy. Optional
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
domains A domain name or comma-separated list of domain names. Optional
ip An IP address. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.Threat.threat String The threat name.
UmbrellaReporting.Threat.threattype String The threat type.
UmbrellaReporting.Threat.count Number The number of requests for that threat name.

Command example

!umbrella-reporting-threat-list limit=1

Context Example

{
   "UmbrellaReporting":{
      "Threat":[
        {
            "threat": "",
            "threattype": "Adware",
            "count": 1
        }
    ]
   }
}

Human Readable Output

Threat List

Threat Type Count
Adware 1

umbrella-reporting-activity-list


List all activity entries (dns/proxy/firewall/ip/intrusion/amp) within the time frame.

Base Command

umbrella-reporting-activity-list

Input

Argument Name Description Required
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
ports A port number or comma-separated list of port numbers. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
file_name A string that identifies a filename. Filter the request by the filename. Supports globbing or use of the wildcard character (‘’). The asterisk (*) matches zero or more occurrences of any character. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output

Path Type Description
UmbrellaReporting.Activity.type String Type of the request.
UmbrellaReporting.Activity.externalip String External IP address for entry.
UmbrellaReporting.Activity.internalip String Internal IP address for entry.
UmbrellaReporting.Activity.policycategories.id Number ID of the category.
UmbrellaReporting.Activity.policycategories.label String The human readable label of the category.
UmbrellaReporting.Activity.policycategories.type String Type of the request. A DNS request always has type dns.
UmbrellaReporting.Activity.policycategories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.Activity.policycategories.integration Boolean Whether the category is an integration.
UmbrellaReporting.Activity.categories.id Number ID of the category.
UmbrellaReporting.Activity.categories.label String The human readable label of the category.
UmbrellaReporting.Activity.categories.type String The type of category.
UmbrellaReporting.Activity.categories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.Activity.categories.integration Boolean Whether the category is an integration.
UmbrellaReporting.Activity.verdict String Verdict for entry.
UmbrellaReporting.Activity.domain String Domain for entry.
UmbrellaReporting.Activity.timestamp Number Timestamp in ms.
UmbrellaReporting.Activity.time String The time in 24 hour format based on the time zone parameter.
UmbrellaReporting.Activity.date String The date from the timestamp based on the time zone parameter.
UmbrellaReporting.Activity.identities.id Number ID of the identity.
UmbrellaReporting.Activity.identities.type.id Number Origin type for the identity.
UmbrellaReporting.Activity.identities.type.type String Origin type name for the identity.
UmbrellaReporting.Activity.identities.type.label String Origin type label for the identity.
UmbrellaReporting.Activity.identities.label String Label for the identity.
UmbrellaReporting.Activity.identities.deleted Boolean Indicates whether the identity was deleted.
UmbrellaReporting.Activity.threats.label Boolean The threat name or label.
UmbrellaReporting.Activity.threats.type String The type of threat.
UmbrellaReporting.Activity.allapplications.id Number ID of the application.
UmbrellaReporting.Activity.allapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.Activity.allapplications.label String Label of the application.
UmbrellaReporting.Activity.allapplications.category.label String Label of the application category.
UmbrellaReporting.Activity.allapplications.category.id Number ID of the application category.
UmbrellaReporting.Activity.allowedapplications.id Number ID of the application.
UmbrellaReporting.Activity.allowedapplications.label String Label of the application.
UmbrellaReporting.Activity.allowedapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.Activity.allowedapplications.category.label String Label of the application category.
UmbrellaReporting.Activity.allowedapplications.category.id Number ID of the application category.
UmbrellaReporting.Activity.querytype String The type of DNS request that was made. For more information, see Common DNS Request Types. https://support.umbrella.com/hc/en-us/articles/232254248-Common-DNS-return-codes-for-any-DNS-service-and-Umbrella-
UmbrellaReporting.Activity.returncode Number The DNS return code for this request. For more information, see Common DNS return codes for any DNS service (and Umbrella). https://support.umbrella.com/hc/en-us/articles/232254248-Common-DNS-return-codes-for-any-DNS-service-and-Umbrella-
UmbrellaReporting.Activity.blockedapplications.id Number ID of the application.
UmbrellaReporting.Activity.blockedapplications.label String Label of the application.
UmbrellaReporting.Activity.blockedapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.Activity.blockedapplications.category.label String Label of the application category.
UmbrellaReporting.Activity.blockedapplications.category.id Number ID of the application category.

Command example

!umbrella-reporting-activity-list limit=2

Context Example

{
    "UmbrellaReporting": {
        "Activity": [
            {
                "allapplications": [
                    {
                        "category": {
                            "id": 46,
                            "label": "Ad Publishing"
                        },
                        "id": 46102,
                        "label": "Google Marketing Platform"
                    }
                ],
                "allowedapplications": [],
                "blockedapplications": [],
                "categories": [
                    {
                        "deprecated": false,
                        "id": 27,
                        "integration": false,
                        "label": "Advertisements",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    }
                ],
                "date": "2022-10-29",
                "device": {
                    "id": null
                },
                "domain": "dummy.domain.com",
                "externalip": "4.4.4.4",
                "identities": [
                    {
                        "deleted": false,
                        "id": 593805843,
                        "label": "S\u2019s MacBook Pro",
                        "type": {
                            "id": 9,
                            "label": "Roaming Computers",
                            "type": "roaming"
                        }
                    }
                ],
                "internalip": "1.1.1.1",
                "policycategories": [],
                "querytype": "A",
                "returncode": 0,
                "threats": [],
                "time": "07:39:08",
                "timestamp": 1667029148000,
                "type": "dns",
                "verdict": "allowed"
            },
            {
                "allapplications": [
                    {
                        "category": {
                            "id": null,
                            "label": "Sample Application Group"
                        },
                        "id": 28,
                        "label": "Do Not Decrypt Application"
                    }
                ],
                "allowedapplications": [],
                "blockedapplications": [],
                "categories": [
                    {
                        "deprecated": true,
                        "id": 25,
                        "integration": false,
                        "label": "abc/efgh",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 123,
                        "integration": false,
                        "label": "Infrastructure and Content Delivery Networks",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    }
                ],
                "date": "2022-10-29",
                "device": {
                    "id": null
                },
                "domain": "dummy.domain.com",
                "externalip": "4.4.4.4",
                "identities": [
                    {
                        "deleted": false,
                        "id": 593805843,
                        "label": "S\u2019s MacBook Pro",
                        "type": {
                            "id": 9,
                            "label": "Roaming Computers",
                            "type": "roaming"
                        }
                    }
                ],
                "internalip": "1.1.1.1",
                "policycategories": [],
                "querytype": "AAAA",
                "returncode": 0,
                "threats": [],
                "time": "07:38:57",
                "timestamp": 1667029137000,
                "type": "dns",
                "verdict": "allowed"
            }
        ]
    }
}

Human Readable Output

Activity List

Request Identity Policy or Ruleset Identity Destination Internal IP External IP DNS Type Action Categories Public Application Application Category Date & Time
dns S’s MacBook Pro S’s MacBook Pro stats.g.doubleclick.net 1.1.1.1 4.4.4.4 A allowed Advertisements, Application Google Marketing Platform Ad Publishing 2022-10-29T07:39:08Z
dns S’s MacBook Pro S’s MacBook Pro google.com 1.1.1.1 4.4.4.4 AAAA allowed abc/efgh, Infrastructure and Content Delivery Networks, Application Do Not Decrypt Application Sample Application Group 2022-10-29T07:38:57Z

umbrella-reporting-activity-get


List all entries within a time frame based on the traffic type selected. Valid activity types are dns, proxy, firewall, intrusion, ip, amp.
Only one activity type can be selected at a time.

Base Command

umbrella-reporting-activity-get

Input

Argument Name Description Required
traffic_type Specify the type of traffic. By default, all supported traffic types are included. Possible values are: dns, proxy, firewall, ip, intrusion, amp.

Supported optional parameters for DNS traffic type are limit, from, to, offset, domains, ip, verdict, threats, threat_types.

Supported optional parameters for Proxy traffic type are limit, from, to, offset, domains, ip, verdict, threats, threat_types, urls, ports, identity_types, file_name, amp_disposition.

Supported optional parameters for Firewall traffic type are limit, from, to, offset, ip, ports, verdict.

Supported optional parameters for Intrusion traffic type are limit, from, to, offset, ip, ports, signatures, intrusion_action.

Supported optional parameters for IP traffic type are limit, from, to, offset, ip, ports, identity_types, verdict.

Supported optional parameters for Advanced Malware Protection (AMP) traffic type are limit, from, to, offset, amp_disposition, sha256.
Required
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
ports A port number or comma-separated list of port numbers. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
file_name A string that identifies a filename. Filter the request by the filename. Supports globbing or use of the wildcard character (‘’). The asterisk (*) matches zero or more occurrences of any character. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
signatures A comma-separated list of Generator id - Signatures ID. Where Generator ID is unique id assigned to the part of the IPS which generated the event and Signature ID is used to uniquely identify signatures. Example:- 1-2,1-4. Optional
intrusion_action Comma-separated list of intrusion actions. Possible values: would_block, blocked, detected. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output for traffic_type = dns for base command umbrella-reporting-activity-get

Path Type Description
UmbrellaReporting.ActivityDns.type String Type of the request. A DNS request always has type DNS.
UmbrellaReporting.ActivityDns.externalip String External IP address for entry.
UmbrellaReporting.ActivityDns.internalip String Internal IP address for entry.
UmbrellaReporting.ActivityDns.policycategories.id Number ID of the category.
UmbrellaReporting.ActivityDns.policycategories.label String The human readable label of the category.
UmbrellaReporting.ActivityDns.policycategories.type String Type of the request. A DNS request always has type dns.
UmbrellaReporting.ActivityDns.policycategories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.ActivityDns.policycategories.integration Boolean Whether the category is an integration.
UmbrellaReporting.ActivityDns.categories.id Number ID of the category.
UmbrellaReporting.ActivityDns.categories.label String The human readable label of the category.
UmbrellaReporting.ActivityDns.categories.type String The type of category.
UmbrellaReporting.ActivityDns.categories.deprecated Boolean Whether the category is a legacy category.
UmbrellaReporting.ActivityDns.categories.integration Boolean Whether the category is an integration.
UmbrellaReporting.ActivityDns.verdict String Verdict for entry.
UmbrellaReporting.ActivityDns.domain String Domain for entry.
UmbrellaReporting.ActivityDns.timestamp Number Timestamp in ms.
UmbrellaReporting.ActivityDns.time String The time in 24 hour format based on the time zone parameter.
UmbrellaReporting.ActivityDns.date String The date from the timestamp based on the time zone parameter.
UmbrellaReporting.ActivityDns.identities.id Number ID of the identity.
UmbrellaReporting.ActivityDns.identities.type.id Number Origin type for the identity.
UmbrellaReporting.ActivityDns.identities.type.type String Origin type name for the identity.
UmbrellaReporting.ActivityDns.identities.type.label String Origin type label for the identity.
UmbrellaReporting.ActivityDns.identities.label String Label for the identity.
UmbrellaReporting.ActivityDns.identities.deleted Boolean Indicates whether the identity was deleted.
UmbrellaReporting.ActivityDns.threats.label Boolean The threat name or label.
UmbrellaReporting.ActivityDns.threats.type String The type of threat.
UmbrellaReporting.ActivityDns.allapplications.id Number ID of the application.
UmbrellaReporting.ActivityDns.allapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.ActivityDns.allapplications.label String Label of the application.
UmbrellaReporting.ActivityDns.allapplications.category.label String Label of the application category.
UmbrellaReporting.ActivityDns.allapplications.category.id Number ID of the application category.
UmbrellaReporting.ActivityDns.allowedapplications.id Number ID of the application.
UmbrellaReporting.ActivityDns.allowedapplications.label String Label of the application.
UmbrellaReporting.ActivityDns.allowedapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.ActivityDns.allowedapplications.category.label String Label of the application category.
UmbrellaReporting.ActivityDns.allowedapplications.category.id Number ID of the application category.
UmbrellaReporting.ActivityDns.querytype String The type of DNS request that was made. For more information, see https://support.umbrella.com/hc/en-us/articles/232254248-Common-DNS-return-codes-for-any-DNS-service-and-Umbrella-
UmbrellaReporting.ActivityDns.returncode Number The DNS return code for this request. For more information, see Common DNS return codes for any DNS service (and Umbrella). https://support.umbrella.com/hc/en-us/articles/232254248-Common-DNS-return-codes-for-any-DNS-service-and-Umbrella-
UmbrellaReporting.ActivityDns.blockedapplications.id Number ID of the application.
UmbrellaReporting.ActivityDns.blockedapplications.label String Label of the application.
UmbrellaReporting.ActivityDns.blockedapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.ActivityDns.blockedapplications.category.label String Label of the application category.
UmbrellaReporting.ActivityDns.blockedapplications.category.id Number ID of the application category.

Command example for traffic_type = dns for base command umbrella-reporting-activity-get

!umbrella-reporting-activity-get traffic_type=dns limit=2

Context Example for traffic_type = dns for base command umbrella-reporting-activity-get

{
    "UmbrellaReporting": {
        "ActivityDns": [
            {
                "allapplications": [
                    {
                        "category": {
                            "id": 46,
                            "label": "Ad Publishing"
                        },
                        "id": 46102,
                        "label": "Google Marketing Platform"
                    }
                ],
                "allowedapplications": [],
                "blockedapplications": [],
                "categories": [
                    {
                        "deprecated": false,
                        "id": 27,
                        "integration": false,
                        "label": "Advertisements",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    }
                ],
                "date": "2022-10-29",
                "device": {
                    "id": null
                },
                "domain": "dummy.domain.com",
                "externalip": "4.4.4.4",
                "identities": [
                    {
                        "deleted": false,
                        "id": 593805843,
                        "label": "S\u2019s MacBook Pro",
                        "type": {
                            "id": 9,
                            "label": "Roaming Computers",
                            "type": "roaming"
                        }
                    }
                ],
                "internalip": "1.1.1.1",
                "policycategories": [],
                "querytype": "A",
                "returncode": 0,
                "threats": [],
                "time": "07:39:08",
                "timestamp": 1667029148000,
                "type": "dns",
                "verdict": "allowed"
            },
            {
                "allapplications": [
                    {
                        "category": {
                            "id": null,
                            "label": "Sample Application Group"
                        },
                        "id": 28,
                        "label": "Do Not Decrypt Application"
                    }
                ],
                "allowedapplications": [],
                "blockedapplications": [],
                "categories": [
                    {
                        "deprecated": true,
                        "id": 25,
                        "integration": false,
                        "label": "abc/efgh",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 123,
                        "integration": false,
                        "label": "Infrastructure and Content Delivery Networks",
                        "type": "content"
                    },
                    {
                        "deprecated": false,
                        "id": 148,
                        "integration": false,
                        "label": "Application",
                        "type": "application"
                    }
                ],
                "date": "2022-10-29",
                "device": {
                    "id": null
                },
                "domain": "dummy.domain.com",
                "externalip": "4.4.4.4",
                "identities": [
                    {
                        "deleted": false,
                        "id": 593805843,
                        "label": "S\u2019s MacBook Pro",
                        "type": {
                            "id": 9,
                            "label": "Roaming Computers",
                            "type": "roaming"
                        }
                    }
                ],
                "internalip": "1.1.1.1",
                "policycategories": [],
                "querytype": "AAAA",
                "returncode": 0,
                "threats": [],
                "time": "07:38:57",
                "timestamp": 1667029137000,
                "type": "dns",
                "verdict": "allowed"
            }
        ]
    }
}

Human Readable Output

Dns Activity List

Identity Policy or Ruleset Identity Destination Internal IP External IP DNS Type Action Categories Public Application Application Category Date & Time
S’s MacBook Pro S’s MacBook Pro stats.g.doubleclick.net 1.1.1.1 4.4.4.4 A allowed Advertisements, Application Google Marketing Platform Ad Publishing 2022-10-29T07:39:08Z
S’s MacBook Pro S’s MacBook Pro google.com 1.1.1.1 4.4.4.4 AAAA allowed abc/efgh, Infrastructure and Content Delivery Networks, Application Do Not Decrypt Application Sample Application Group 2022-10-29T07:38:57Z

Context Output for traffic_type = amp for base command umbrella-reporting-activity-get

Path Type Description
UmbrellaReporting.ActivityAMPRetro.timestamp Number Timestamp in ms.
UmbrellaReporting.ActivityAMPRetro.firstseenat Number First seen Timestamp.
UmbrellaReporting.ActivityAMPRetro.disposition String Disposition for entry.
UmbrellaReporting.ActivityAMPRetro.hostname String Hostname for entry.
UmbrellaReporting.ActivityAMPRetro.malwarename String Malware name for entry.
UmbrellaReporting.ActivityAMPRetro.sha256 String SHA256 for entry.
UmbrellaReporting.ActivityAMPRetro.score Number Score for entry.

Command example for traffic_type = amp for base command umbrella-reporting-activity-get

!umbrella-reporting-activity-get traffic_type=amp limit=2

Context Example for traffic_type = amp for base command umbrella-reporting-activity-get

{
   "UmbrellaReporting":{
      "ActivityAMPRetro":[
        {
            "timestamp": 1548311506,
            "firstseenat": 1548311506,
            "disposition": "clean",
            "score": 10,
            "hostname": "google.com",
            "malwarename": "malware",
            "sha256": "dummy_sha256"
        }
    ]
   }
}

Human Readable Output

AMP Activity List

First Seen Disposition Score Host Name Malware SHA256 Date & Time
1548311506 clean 10 google.com malware 9495b6c155044053953efe30ebaf804780c114e7b721b14f6a5b0a782769696e Sep 16, 2022 05:52 AM

Context Output for traffic_type = proxy for base command umbrella-reporting-activity-get

Path Type Description
UmbrellaReporting.ActivityProxy.type String Type of the request. A Proxy request always has type Proxy.
UmbrellaReporting.ActivityProxy.externalip String External IP for entry.
UmbrellaReporting.ActivityProxy.destinationip String Destination IP for entry.
UmbrellaReporting.ActivityProxy.blockedfiletype String locked file type for entry.
UmbrellaReporting.ActivityProxy.contenttype String The type of web content, typically text/html.
UmbrellaReporting.ActivityProxy.forwardingmethod String The request method (GET, POST, HEAD, etc.)
UmbrellaReporting.ActivityProxy.internalip String Internal IP for entry.
UmbrellaReporting.ActivityProxy.referer String The referring domain or URL.
UmbrellaReporting.ActivityProxy.requestmethod String The HTTP request method that was made.
UmbrellaReporting.ActivityProxy.responsefilename String Response filename for entry.
UmbrellaReporting.ActivityProxy.sha256 String The hex digest of the response content.
UmbrellaReporting.ActivityProxy.url String The URL requested.
UmbrellaReporting.ActivityProxy.useragent String The browser agent that made the request.
UmbrellaReporting.ActivityProxy.warnstatus String Warn Status.
UmbrellaReporting.ActivityProxy.securityoverridden Boolean Specify whether to filter on requests that override security.
UmbrellaReporting.ActivityProxy.tenantcontrols Boolean If the request was part of a tenant control policy.
UmbrellaReporting.ActivityProxy.bundleid Number A proxy bundle ID.
UmbrellaReporting.ActivityProxy.port Number Request Port.
UmbrellaReporting.ActivityProxy.requestsize Number Request size in bytes.
UmbrellaReporting.ActivityProxy.responsesize Number Response size in bytes.
UmbrellaReporting.ActivityProxy.statuscode Number The HTTP status code; should always be 200 or 201.
UmbrellaReporting.ActivityProxy.policycategories.id Number ID of category.
UmbrellaReporting.ActivityProxy.policycategories.label String The human readable label of the category.
UmbrellaReporting.ActivityProxy.policycategories.type String Type of the request. a dns request always has type dns.
UmbrellaReporting.ActivityProxy.policycategories.deprecated Boolean If the category is a legacy category.
UmbrellaReporting.ActivityProxy.policycategories.integration Boolean If the category is an integration.
UmbrellaReporting.ActivityProxy.categories.id Number id of category
UmbrellaReporting.ActivityProxy.categories.label String The human readable label of the category
UmbrellaReporting.ActivityProxy.categories.type String The type of category
UmbrellaReporting.ActivityProxy.categories.deprecated Boolean If the category is a legacy category
UmbrellaReporting.ActivityProxy.categories.integration Boolean If the category is an integration
UmbrellaReporting.ActivityProxy.antivirusthreats.others Unknown Other antivirus threats.
UmbrellaReporting.ActivityProxy.antivirusthreats.puas Unknown Potentially unwanted applications.
UmbrellaReporting.ActivityProxy.antivirusthreats.viruses Unknown Viruses.
UmbrellaReporting.ActivityProxy.verdict String Verdict for entry.
UmbrellaReporting.ActivityProxy.timestamp Number Timestamp in ms.
UmbrellaReporting.ActivityProxy.time String The time in 24 hour format based on the timezone parameter.
UmbrellaReporting.ActivityProxy.date String The date from the timestamp based on the timezone parameter.
UmbrellaReporting.ActivityProxy.identities.id Number ID of identity.
UmbrellaReporting.ActivityProxy.identities.type.id Number Origin type for identity
UmbrellaReporting.ActivityProxy.identities.type.type String Origin type name for identity
UmbrellaReporting.ActivityProxy.identities.type.label String Origin type label for identity
UmbrellaReporting.ActivityProxy.identities.label String Label for identity
UmbrellaReporting.ActivityProxy.identities.deleted Boolean Indicates whether the identity was deleted or not
UmbrellaReporting.ActivityProxy.threats.label String The threat name or label.
UmbrellaReporting.ActivityProxy.threats.type String The type of threat.
UmbrellaReporting.ActivityProxy.datacenter.id String Unique ID for the data center.
UmbrellaReporting.ActivityProxy.datacenter.label String Name of the data center.
UmbrellaReporting.ActivityProxy.datalossprevention.state String If the request was Blocked for DLP. Either ‘blocked’ or ‘’.
UmbrellaReporting.ActivityProxy.egress.ip String Egress IP.
UmbrellaReporting.ActivityProxy.egress.type String Egress Type.
UmbrellaReporting.ActivityProxy.isolated.fileaction String A string that describes the remote browser isolation (RBI) file action type.
UmbrellaReporting.ActivityProxy.isolated.state String A string that describes the remote browser isolation(RBI) isolation type.
UmbrellaReporting.ActivityProxy.allapplications.id Number ID of the application.
UmbrellaReporting.ActivityProxy.allapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.ActivityProxy.allapplications.label String Label of the application.
UmbrellaReporting.ActivityProxy.allapplications.category.label String Label of the application category.
UmbrellaReporting.ActivityProxy.allapplications.category.id Number ID of the application category.
UmbrellaReporting.ActivityProxy.allowedapplications.id Number ID of the application.
UmbrellaReporting.ActivityProxy.allowedapplications.label String Label of the application.
UmbrellaReporting.ActivityProxy.allowedapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.ActivityProxy.allowedapplications.category.label String Label of the application category.
UmbrellaReporting.ActivityProxy.allowedapplications.category.id Number ID of the application category.
UmbrellaReporting.ActivityProxy.blockedapplications.id Number ID of the application.
UmbrellaReporting.ActivityProxy.blockedapplications.label String Label of the application.
UmbrellaReporting.ActivityProxy.blockedapplications.type String Type of the application, NBAR or AVC.
UmbrellaReporting.ActivityProxy.blockedapplications.category.label String Label of the application category.
UmbrellaReporting.ActivityProxy.blockedapplications.category.id Number Label of the application category.
UmbrellaReporting.ActivityProxy.policy.timebasedrule Boolean Whether the policy triggered a time-of-day rule.
UmbrellaReporting.ActivityProxy.policy.ruleid Number The rule ID for the policy.
UmbrellaReporting.ActivityProxy.policy.rulesetid Number The rule set ID for the policy.
UmbrellaReporting.ActivityProxy.policy.destinationlistids Unknown The destination lists that the policy triggered.
UmbrellaReporting.ActivityProxy.httperrors.reason String The name of the error.
UmbrellaReporting.ActivityProxy.httperrors.type String Type of the error CertificateError or TLSError.
UmbrellaReporting.ActivityProxy.httperrors.attributes Unknown Map of additional information about the error.
UmbrellaReporting.ActivityProxy.httperrors.code String The http error code.
UmbrellaReporting.ActivityProxy.amp.disposition String Advanced Malware Protection (AMP) disposition.
UmbrellaReporting.ActivityProxy.amp.malware String Advanced Malware Protection (AMP) malware.
UmbrellaReporting.ActivityProxy.amp.score Number Advanced Malware Protection (AMP) score.

Command example for traffic_type = proxy for base command umbrella-reporting-activity-get

!umbrella-reporting-activity-get traffic_type=proxy limit=2

Context Example for traffic_type = proxy for base command umbrella-reporting-activity-get

{
    "UmbrellaReporting": {
        "ActivityProxy": [
            {
                "allapplications": [],
                "allowedapplications": [],
                "amp": {
                    "disposition": "",
                    "malware": "",
                    "score": 0
                },
                "antivirusthreats": {
                    "others": [],
                    "puas": [],
                    "viruses": []
                },
                "blockedapplications": [],
                "blockedfiletype": "",
                "bundleid": 13531789,
                "categories": [
                    {
                        "deprecated": false,
                        "id": 123,
                        "integration": false,
                        "label": "Infrastructure and Content Delivery Networks",
                        "type": "content"
                    }
                ],
                "contenttype": "application/pkix-crl",
                "datacenter": {
                    "id": "",
                    "label": ""
                },
                "datalossprevention": {
                    "state": ""
                },
                "date": "2022-10-17",
                "destinationip": "1.1.1.1",
                "egress": {
                    "ip": "",
                    "type": ""
                },
                "externalip": "4.4.4.4",
                "forwardingmethod": "",
                "httperrors": [],
                "identities": [
                    {
                        "deleted": false,
                        "id": 589064228,
                        "label": "DESKTOP-IIQVPJ7",
                        "type": {
                            "id": 9,
                            "label": "Roaming Computers",
                            "type": "roaming"
                        }
                    }
                ],
                "internalip": "1.1.1.1",
                "isolated": {
                    "fileaction": "",
                    "state": ""
                },
                "policy": {
                    "destinationlistids": [],
                    "ruleid": null,
                    "rulesetid": null,
                    "timebasedrule": false
                },
                "policycategories": [],
                "port": 80,
                "referer": "",
                "requestmethod": "GET",
                "requestsize": 0,
                "responsefilename": " ",
                "responsesize": 0,
                "securityoverridden": false,
                "sha256": "dummy_sha256",
                "statuscode": 304,
                "tenantcontrols": false,
                "threats": [],
                "time": "09:38:32",
                "timestamp": 1665999512000,
                "type": "proxy",
                "url": "http://google.com",
                "useragent": "Microsoft-CryptoAPI/10.0",
                "verdict": "allowed",
                "warnstatus": ""
            },
            {
                "allapplications": [],
                "allowedapplications": [],
                "amp": {
                    "disposition": "",
                    "malware": "",
                    "score": 0
                },
                "antivirusthreats": {
                    "others": [],
                    "puas": [],
                    "viruses": []
                },
                "blockedapplications": [],
                "blockedfiletype": "",
                "bundleid": 13531789,
                "categories": [
                    {
                        "deprecated": false,
                        "id": 123,
                        "integration": false,
                        "label": "Infrastructure and Content Delivery Networks",
                        "type": "content"
                    }
                ],
                "contenttype": "application/pkix-crl",
                "datacenter": {
                    "id": "",
                    "label": ""
                },
                "datalossprevention": {
                    "state": ""
                },
                "date": "2022-10-17",
                "destinationip": "1.1.1.1",
                "egress": {
                    "ip": "",
                    "type": ""
                },
                "externalip": "4.4.4.4",
                "forwardingmethod": "",
                "httperrors": [],
                "identities": [
                    {
                        "deleted": false,
                        "id": 589064228,
                        "label": "DESKTOP-IIQVPJ7",
                        "type": {
                            "id": 9,
                            "label": "Roaming Computers",
                            "type": "roaming"
                        }
                    }
                ],
                "internalip": "1.1.1.1",
                "isolated": {
                    "fileaction": "",
                    "state": ""
                },
                "policy": {
                    "destinationlistids": [],
                    "ruleid": null,
                    "rulesetid": null,
                    "timebasedrule": false
                },
                "policycategories": [],
                "port": 80,
                "referer": "",
                "requestmethod": "GET",
                "requestsize": 0,
                "responsefilename": " ",
                "responsesize": 0,
                "securityoverridden": false,
                "sha256": "dummy_sha256",
                "statuscode": 304,
                "tenantcontrols": false,
                "threats": [],
                "time": "08:36:16",
                "timestamp": 1665995776000,
                "type": "proxy",
                "url": "google.com",
                "useragent": "Microsoft-CryptoAPI/10.0",
                "verdict": "allowed",
                "warnstatus": ""
            }
        ]
    }
}

Human Readable Output

Proxy Activity List

Identity Policy or Ruleset Identity Internal IP External IP Action Categories Date & Time
DESKTOP-IIQVPJ7 DESKTOP-IIQVPJ7 10.10.10.217 4.4.4.4 allowed Infrastructure and Content Delivery Networks 2022-10-17T09:38:32Z
DESKTOP-IIQVPJ7 DESKTOP-IIQVPJ7 10.10.10.217 4.4.4.4 allowed Infrastructure and Content Delivery Networks 2022-10-17T08:36:16Z

Context Output for traffic_type = firewall for base command umbrella-reporting-activity-get

Path Type Description
UmbrellaReporting.ActivityFirewall.type String Type of the request. A Firewall request always has type Firewall.
UmbrellaReporting.ActivityFirewall.destinationip String Destination IP for entry.
UmbrellaReporting.ActivityFirewall.direction String The direction of the packet. It is destined either towards the internet or to the customer’s network.
UmbrellaReporting.ActivityFirewall.sourceip String Source IP for entry.
UmbrellaReporting.ActivityFirewall.destinationport Number Destination port for entry.
UmbrellaReporting.ActivityFirewall.sourceport Number Source port for entry.
UmbrellaReporting.ActivityFirewall.packetsize Number The size of the packet that Umbrella CDFW received.
UmbrellaReporting.ActivityFirewall.verdict String Verdict for entry.
UmbrellaReporting.ActivityFirewall.timestamp Number Timestamp in ms.
UmbrellaReporting.ActivityFirewall.time String The time in 24 hour format based on the timezone parameter.
UmbrellaReporting.ActivityFirewall.date String The date from the timestamp based on the timezone parameter.
UmbrellaReporting.ActivityFirewall.identities.id Number ID of identity.
UmbrellaReporting.ActivityFirewall.identities.type.id Number Origin type for identity
UmbrellaReporting.ActivityFirewall.identities.type.type String Origin type name for identity
UmbrellaReporting.ActivityFirewall.identities.type.label String Origin type label for identity
UmbrellaReporting.ActivityFirewall.identities.label String Label for identity
UmbrellaReporting.ActivityFirewall.identities.deleted Boolean Indicates whether the identity was deleted or not
UmbrellaReporting.ActivityFirewall.protocol.label String Name of the protocol.
UmbrellaReporting.ActivityFirewall.protocol.id Number ID of protocol.
UmbrellaReporting.ActivityFirewall.allapplications.id Number ID of the application.
UmbrellaReporting.ActivityFirewall.allapplications.app String Type: “IT Service Management” (string) - application/protocol type.
UmbrellaReporting.ActivityFirewall.allapplications.label String Label of the application.
UmbrellaReporting.ActivityFirewall.rule.label String Name of the rule
UmbrellaReporting.ActivityFirewall.rule.id String ID of rule.
UmbrellaReporting.ActivityFirewall.rule.privateapplicationgroup.label String Name of application group.
UmbrellaReporting.ActivityFirewall.rule.privateapplicationgroup.id Number ID of application group
UmbrellaReporting.ActivityFirewall.applicationprotocols.id Number ID of the application.
UmbrellaReporting.ActivityFirewall.applicationprotocols.app String Type: “IT Service Management” (string) - application/protocol type.
UmbrellaReporting.ActivityFirewall.applicationprotocols.label String Application/Protocol label.

Command example for traffic_type = firewall for base command umbrella-reporting-activity-get

!umbrella-reporting-activity-get traffic_type=firewall limit=2

Context Example for traffic_type = firewall for base command umbrella-reporting-activity-get

{
   "UmbrellaReporting":{
      "ActivityFirewall":[
        {
            "date": "2019",
            "destinationip": "1.1.1.1",
            "sourceip": "192.168.0.1",
            "sourceport": 0,
            "destinationport": 0,
            "verdict": "allowed",
            "time": "12:34",
            "timestamp": 1548311506,
            "identities": [
                {
                    "id": 1,
                    "label": "Catch Rate Testing System",
                    "type": {
                        "id": 21,
                        "label": "Sites",
                        "type": "site"
                    },
                    "deleted": false
                }
            ],
            "protocol": {
                "id": 17,
                "label": "UDP"
            },
            "rule": {
                "id": 1,
                "label": "Default Rule"
            },
            "type": "firewall",
            "allapplications": [
                {
                    "id": 72,
                    "label": "dns IT Service Management",
                    "app": ""
                }
            ],
            "applicationprotocols": [
                {
                    "id": 72,
                    "label": "dns IT Service Management",
                    "app": ""
                }
            ],
            "packetsize": 32,
            "direction": "towards"
        }
    ]
   }
}

Human Readable Output

Firewall Activity List

Identity Policy or Ruleset Identity Internal IP Source IP Source Port Destination Port Protocol Rule Type Action Public Application Direction Date & Time
Catch Rate Testing System Catch Rate Testing System 1.1.1.1 192.168.0.1 0 0 UDP Default Rule firewall allowed dns IT Service Management towards Sep 16, 2022 05:52 AM

Context Output for traffic_type = intrusion for base command umbrella-reporting-activity-get

Path Type Description
UmbrellaReporting.ActivityIntrusion.type String Type of the request. A Intrusion request always has type Intrusion.
UmbrellaReporting.ActivityIntrusion.classification String The category of attack detected by a rule that is part of a more general type of attack class, such as trojan-activity, attempted-user, and unknown.
UmbrellaReporting.ActivityIntrusion.destinationip String Destination IP for entry.
UmbrellaReporting.ActivityIntrusion.severity String The severity level of the rule, such as High, Medium, Low, and Very Low.
UmbrellaReporting.ActivityIntrusion.sourceip String Source IP for entry
UmbrellaReporting.ActivityIntrusion.destinationport Number Destination port for entry.
UmbrellaReporting.ActivityIntrusion.sessionid Number The unique identifier of a session, which is used to group the correlated events between various services.
UmbrellaReporting.ActivityIntrusion.sourceport Number Source port for entry.
UmbrellaReporting.ActivityIntrusion.verdict String Verdict for entry.
UmbrellaReporting.ActivityIntrusion.timestamp Number Timestamp in ms.
UmbrellaReporting.ActivityIntrusion.time String The time in 24 hour format based on the timezone parameter.
UmbrellaReporting.ActivityIntrusion.date String The date from the timestamp based on the timezone parameter.
UmbrellaReporting.ActivityIntrusion.identities.id Number ID of identity.
UmbrellaReporting.ActivityIntrusion.identities.type.id Number Origin type for identity
UmbrellaReporting.ActivityIntrusion.identities.type.type String Origin type name for identity
UmbrellaReporting.ActivityIntrusion.identities.type.label String Origin type label for identity
UmbrellaReporting.ActivityIntrusion.identities.label String Label for identity
UmbrellaReporting.ActivityIntrusion.identities.deleted Boolean Indicates whether the identity was deleted or not
UmbrellaReporting.ActivityIntrusion.protocol.label String Name of the protocol.
UmbrellaReporting.ActivityIntrusion.protocol.id Number ID of protocol.
UmbrellaReporting.ActivityIntrusion.signature.id Number ID of the application.
UmbrellaReporting.ActivityIntrusion.signature.generatorid Number Unique id assigned to the part of the IPS which generated the event.
UmbrellaReporting.ActivityIntrusion.signature.label String A brief description of the signature.
UmbrellaReporting.ActivityIntrusion.signature.cves String An identifier for a known security vulnerability/exposure.
UmbrellaReporting.ActivityIntrusion.signaturelist.id Number Unique id assigned to a Default or Custom Signature List.

Command example for traffic_type = intrusion for base command umbrella-reporting-activity-get

!umbrella-reporting-activity-get traffic_type=intrusion limit=2

Context Example for traffic_type = intrusion for base command umbrella-reporting-activity-get

{
   "UmbrellaReporting":{
      "ActivityIntrusion":[
        {
            "type": "intrusion",
            "date": "12-02-22",
            "destinationip": "10.10.10.10",
            "protocol": {
                "id": 17,
                "label": "UDP"
            },
            "sourceip": "10.10.10.10",
            "signaturelist": { "id": 1111 },
            "classification": "malicious",
            "sourceport": 22,
            "sessionid": 190898098,
            "verdict": "detected",
            "destinationport": 33,
            "timestamp": 1594557262000,
            "time": "09:30",
            "identities": [
                {
                    "id": 211034846,
                    "type": {
                        "id": 34,
                        "type": "anyconnect",
                        "label": "Anyconnect Roaming Client"
                    },
                    "label": "omerta",
                    "deleted": false
                }
            ],
            "severity": "HIGH",
            "signature": {
                "generatorid": 1,
                "id": 47829,
                "label": "SERVER-OTHER JBoss Richfaces expression language injection attempt",
                "cves": [
                    "cve-2015-0279",
                    "cve-2018-12532"
                ]
            }
        }
    ]
   }
}

Context Output for traffic_type = ip for base command umbrella-reporting-activity-get

Path Type Description
UmbrellaReporting.ActivityIP.type String Type of the request. A IP request always has type IP.
UmbrellaReporting.ActivityIP.destinationip String Destination IP for entry.
UmbrellaReporting.ActivityIP.sourceip String Source IP for entry
UmbrellaReporting.ActivityIP.destinationport Number Destination port for entry.
UmbrellaReporting.ActivityIP.sourceport Number Source port for entry.
UmbrellaReporting.ActivityIP.verdict String Verdict for entry.
UmbrellaReporting.ActivityIP.timestamp Number Timestamp in ms.
UmbrellaReporting.ActivityIP.time String The time in 24 hour format based on the timezone parameter.
UmbrellaReporting.ActivityIP.date String The date from the timestamp based on the timezone parameter.
UmbrellaReporting.ActivityIP.identities.id Number ID of identity.
UmbrellaReporting.ActivityIP.identities.type.id Number Origin type for identity
UmbrellaReporting.ActivityIP.identities.type.type String Origin type name for identity
UmbrellaReporting.ActivityIP.identities.type.label String Origin type label for identity
UmbrellaReporting.ActivityIP.identities.label String Label for identity
UmbrellaReporting.ActivityIP.identities.deleted Boolean Indicates whether the identity was deleted or not
UmbrellaReporting.ActivityIP.categories.id Number id of category
UmbrellaReporting.ActivityIP.categories.label String The human readable label of the category
UmbrellaReporting.ActivityIP.categories.type String The type of category
UmbrellaReporting.ActivityIP.categories.deprecated Boolean If the category is a legacy category
UmbrellaReporting.ActivityIP.categories.integration Boolean If the category is an integration

Command example

!umbrella-reporting-activity-get traffic_type=ip limit=2

Context Example for traffic_type = ip for base command umbrella-reporting-activity-get

{
   "UmbrellaReporting":{
      "ActivityIP":[
        {
            "destinationip": "1.1.1.1",
            "sourceip": "192.168.0.1",
            "date": "03-15-22",
            "sourceport": 0,
            "destinationport": 0,
            "verdict": "allowed",
            "timestamp": 1548311506,
            "time": "10:15",
            "identities": [
                {
                    "id": 1,
                    "label": "Catch Rate Testing System",
                    "type": {
                        "id": 21,
                        "label": "Sites",
                        "type": "site"
                    },
                    "deleted": false
                }
            ],
            "categories": [
                {
                    "id": 66,
                    "label": "Malware",
                    "type": "security",
                    "integration": true
                }
            ],
            "type": "ip"
        }
    ]
   }
}

Human Readable Output

IP Activity List

Identity Destination IP Source IP Source Port Destination Port Categories Type Action Date & Time
Catch Rate Testing System 10.10.10.10 10.10.10.10 22 33 Malware IP allowed Sep 16, 2022 05:52 AM

umbrella-reporting-summary-list


Get the summary.

Base Command

umbrella-reporting-summary-list

Input

Argument Name Description Required
summary_type Get summary list of different summary types. Valid values for summary_type are category, destination, intrusion_rule.
If summary type is not provided by the user, then all summary types i.e., category, destination, intrusion_rule will be considered.

Supported optional parameters for category summary type are domain, urls, ip, identity_types, verdict, file_name, threats, threat_types, amp_disposition.

Supported optional parameters for destination summary type are domain, urls, ip, identity_types, verdict, file_name, threats, threat_types, amp_disposition.

Supported optional parameters for intrusion_rule summary type are signatures, ip, identity_types, intrusion_action, ports.
Optional
from A timestamp (milliseconds) or relative time string (for example:-1days’ or ‘1639146300000’). Filter for data that appears after this time. Default is -7days. Optional
to A timestamp (milliseconds) or relative time string (for example:’now’ or 1661510185000). Filter for data that appears before this time. Default is ‘now’. Optional
limit The maximum number of records to return from the collection. Limit default value is 50. If the page_size argument is set by the user then the limit argument will be ignored. Optional
domains A domain name or comma-separated list of domain names. Optional
urls A URL or comma-separated list of URLs. Optional
ip An IP address. Optional
ports A port number or comma-separated list of port numbers. Optional
identity_types An identity type or comma-separated list of identity types. Optional
verdict A verdict string. Possible values are: allowed, blocked, proxied. Optional
file_name A string that identifies a filename. Filter the request by the filename. Supports globbing or use of the wildcard character (‘’). The asterisk (*) matches zero or more occurrences of any character. Optional
threats A threat name or comma-separated list of threat names. Optional
threat_types A threat type or comma-separated list of threat types. Optional
amp_disposition An Advanced Malware Protection (AMP) disposition string. Possible values are: clean, malicious, unknown. Optional
page The page number. Default is 1. Optional
page_size The number of requested results per page. Default is 50. Optional
signatures A comma-separated list of Generator id - Signatures ID. Where Generator ID is unique id assigned to the part of the IPS which generated the event and Signature ID is used to uniquely identify signatures. Example:- 1-2,1-4. Optional
intrusion_action Comma-separated List of intrusion actions. Possible values: would_block, blocked, detected. Optional
categories A comma-separated list of category ids to filter on. Optional
identityids A comma-separated list of identity ids to filter on. Optional

Context Output for summary for base command umbrella-reporting-summary-list

Path Type Description
UmbrellaReporting.Summary.applications Number Total number of applications (avc or total).
UmbrellaReporting.Summary.applicationsallowed Number Total number of allowed applications.
UmbrellaReporting.Summary.applicationsblocked Number Total number of blocked applications.
UmbrellaReporting.Summary.categories Number Total number of categories.
UmbrellaReporting.Summary.domains Number Total number of domains.
UmbrellaReporting.Summary.files Number Total number of files.
UmbrellaReporting.Summary.filetypes Number Total number of file types.
UmbrellaReporting.Summary.identities Number Total number of identities.
UmbrellaReporting.Summary.identitytypes Number Total number of identity types.
UmbrellaReporting.Summary.policycategories Number Total number of blocked categories.
UmbrellaReporting.Summary.policyrequests Number Total number of policy requests.
UmbrellaReporting.Summary.requests Number Total number of requests.
UmbrellaReporting.Summary.requestsallowed Number Total number of allowed requests.
UmbrellaReporting.Summary.requestsblocked Number Total number of blocked requests.

Command example

!umbrella-reporting-summary-list domains=api.tunnels.cdfw.umbrella.com

Context Example

{
    "UmbrellaReporting": {
        "Summary": {
            "applications": 0,
            "applicationsallowed": 0,
            "applicationsblocked": 0,
            "categories": 4,
            "domains": 1,
            "files": 0,
            "filetypes": 0,
            "identities": 3,
            "identitytypes": 2,
            "policycategories": 0,
            "policyrequests": 0,
            "requests": 6,
            "requestsallowed": 6,
            "requestsblocked": 0
        }
    }
}

Human Readable Output

Summary List

Application Allowed Application Blocked Application Category Domain File File Type Identity Identity Type Policy Category Policy Request Request Allowed Request Blocked Request
0 0 0 4 1 0 0 3 2 0 0 6 6 0

Context Output for summary_type=category for base command umbrella-reporting-summary-list

Path Type Description
UmbrellaReporting.SummaryWithCategory.category.label String The human readable label of the category.
UmbrellaReporting.SummaryWithCategory.category.type String The type of category.
UmbrellaReporting.SummaryWithCategory.category.deprecated Boolean If the category is a legacy category.
UmbrellaReporting.SummaryWithCategory.category.integration boolean If the category is an integration.
UmbrellaReporting.SummaryWithCategory.category.id Number ID of category.
UmbrellaReporting.SummaryWithCategory.summary.applications Number Total number of applications (avc or total).
UmbrellaReporting.SummaryWithCategory.summary.applicationsallowed Number Total number of allowed applications.
UmbrellaReporting.SummaryWithCategory.summary.applicationsblocked Number Total number of blocked applications.
UmbrellaReporting.SummaryWithCategory.summary.categories Number Total number of categories.
UmbrellaReporting.SummaryWithCategory.summary.domains Number Total number of domains.
UmbrellaReporting.SummaryWithCategory.summary.files Number Total number of files.
UmbrellaReporting.SummaryWithCategory.summary.filetypes Number Total number of file types.
UmbrellaReporting.SummaryWithCategory.summary.identities Number Total number of identities.
UmbrellaReporting.SummaryWithCategory.summary.identitytypes Number Total number of identity types.
UmbrellaReporting.SummaryWithCategory.summary.policycategories Number Total number of blocked categories.
UmbrellaReporting.SummaryWithCategory.summary.policyrequests Number Total number of policy requests.
UmbrellaReporting.SummaryWithCategory.summary.requests Number Total number of requests.
UmbrellaReporting.SummaryWithCategory.summary.requestsallowed Number Total number of allowed requests.
UmbrellaReporting.SummaryWithCategory.summary.requestsblocked Number Total number of blocked requests.

Command example for summary_type=category for base command umbrella-reporting-summary-list

!umbrella-reporting-summary-list summary_type=category limit=1

Context Example for summary_type=category for base command umbrella-reporting-summary-list

{
   "UmbrellaReporting":{
      "SummaryWithCategory":[
        {
            "category": {
                "id": 66,
                "label": "Malware",
                "type": "security",
                "integration": true
            },
            "summary": {
                "applications": 0,
                "domains": 0,
                "requestsblocked": 0,
                "filetypes": 0,
                "policycategories": 0,
                "requests": 0,
                "requestsallowed": 0,
                "categories": 0,
                "identitytypes": 0,
                "applicationsblocked": 0,
                "files": 0,
                "identities": 0,
                "applicationsallowed": 0,
                "policyrequests": 0
            }
        }
    ]
   }
}

Human Readable Output

Summary with Category List

Category Type Category Name Application Allowed Application Blocked Application Category Domain File File Type Identity Identity Type Policy Category Policy Request Request Allowed Request Blocked Request
security Malware 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Context Output for summary_type=destination for base command umbrella-reporting-summary-list

Path Type Description
UmbrellaReporting.SummaryWithDestination.domain String Destination domain.
UmbrellaReporting.SummaryWithDestination.summary.applications Number Total number of applications (avc or total).
UmbrellaReporting.SummaryWithDestination.summary.applicationsallowed Number Total number of allowed applications.
UmbrellaReporting.SummaryWithDestination.summary.applicationsblocked Number Total number of blocked applications.
UmbrellaReporting.SummaryWithDestination.summary.categories Number Total number of categories.
UmbrellaReporting.SummaryWithDestination.summary.domains Number Total number of domains.
UmbrellaReporting.SummaryWithDestination.summary.files Number Total number of files.
UmbrellaReporting.SummaryWithDestination.summary.filetypes Number Total number of file types.
UmbrellaReporting.SummaryWithDestination.summary.identities Number Total number of identities.
UmbrellaReporting.SummaryWithDestination.summary.identitytypes Number Total number of identity types.
UmbrellaReporting.SummaryWithDestination.summary.policycategories Number Total number of blocked categories.
UmbrellaReporting.SummaryWithDestination.summary.policyrequests Number Total number of policy requests.
UmbrellaReporting.SummaryWithDestination.summary.requests Number Total number of requests.
UmbrellaReporting.SummaryWithDestination.summary.requestsallowed Number Total number of allowed requests.
UmbrellaReporting.SummaryWithDestination.summary.requestsblocked Number Total number of blocked requests.

Command example for summary_type=destination for base command umbrella-reporting-summary-list

!umbrella-reporting-summary-list summary_type=destination limit=1

Context Example for summary_type=destination for base command umbrella-reporting-summary-list

{
   "UmbrellaReporting":{
      "SummaryWithDestination":[
        {
            "domain": "dummy.domain.com",
            "summary": {
                "applications": 0,
                "domains": 0,
                "requestsblocked": 0,
                "filetypes": 0,
                "policycategories": 0,
                "policyrequests": 0,
                "requests": 0,
                "requestsallowed": 0,
                "categories": 0,
                "identitytypes": 0,
                "applicationsblocked": 0,
                "files": 0,
                "identities": 0,
                "applicationsallowed": 0
            }
        }
    ]
   }
}

Human Readable Output

Summary with Destination List

Destination Application Allowed Application Blocked Application Category Domain File File Type Identity Identity Type Policy Category Policy Request Request Allowed Request Blocked Request
www.google.com 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Context Output for summary_type=intrusion_rule for base command umbrella-reporting-summary-list

Path Type Description
UmbrellaReporting.SignatureListSummary.signaturelist.id Number Unique id assigned to a Default or Custom Signature List.
UmbrellaReporting.SignatureListSummary.signatures.generatorid Number Generator id.
UmbrellaReporting.SignatureListSummary.signatures.id Number Signature ID.
UmbrellaReporting.SignatureListSummary.signatures.lasteventat Number Last Eevent At.
UmbrellaReporting.SignatureListSummary.signatures.counts.blocked Number Blocked
UmbrellaReporting.SignatureListSummary.signatures.counts.detected Number Detected.
UmbrellaReporting.SignatureListSummary.signatures.counts.wouldblock Number Would Block.

Command example for summary_type=intrusion_rule for base command umbrella-reporting-summary-list

!umbrella-reporting-summary-list summary_type=intrusion_rule limit=1

Context Example for summary_type=intrusion_rule for base command umbrella-reporting-summary-list

{
   "UmbrellaReporting":{
      "SignatureListSummary":[
        {
            "signaturelist": { "id": 1111 },
            "signatures": [
                {
                    "counts": {
                        "blocked": 0,
                        "detected": 1,
                        "wouldblock": 0
                    },
                    "generatorid": 1,
                    "lasteventat": 1594557262000,
                    "id": 47829
                }
            ]
        }
    ]
   }
}

Human Readable Output

Summary with Intrusion List

Blocked Detected Would Block Last Event
0 1 0 1594557262000

Configuration parameters

  • api_url — API URL (required)
  • credentials — API Key (required)
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings

Commands (9)

  • umbrella-reporting-activity-get

    List all entries within a time frame based on the traffic type selected. Valid activity types are dns, proxy, firewall, intrusion, ip, amp. Only one activity type can be selected at a time.

  • umbrella-reporting-activity-list

    List all activity entries (dns/proxy/firewall/ip/intrusion/amp) within the time frame.

  • umbrella-reporting-category-list

    List of categories ordered by the number of requests made matching the categories in descending order.

  • umbrella-reporting-destination-list

    List of destinations ordered by the number of requests made in descending order.

  • umbrella-reporting-event-type-list

    List of event types ordered by the number of requests made for each type of event in descending order. The event types are: domain_security, domain_integration, url_security, url_integration, cisco_amp and antivirus.

  • umbrella-reporting-file-list

    List of files within a time frame. Only returns proxy data.

  • umbrella-reporting-identity-list

    List of identities ordered by the number of requests made matching the categories in descending order.

  • umbrella-reporting-summary-list

    Get the summary.

  • umbrella-reporting-threat-list

    List of top threats within a time frame. Returns both DNS and Proxy data.

import demistomock as demisto

from CommonServerPython import *
from datetime import datetime
import requests
import urllib3

# Disable insecure warnings
urllib3.disable_warnings()  # pylint: disable=no-member


""" CONSTANTS """

DEFAULT_PAGE_SIZE = 50
DEFAULT_FROM_DATE = "-7days"
DEFAULT_TO_DATE = "now"
DEFAULT_OFFSET = 0
INTEGRATION_CONTEXT_NAME = "UmbrellaReporting"
IP_PARAM = "ip"
DOMAIN_PARAM = "domains"
URL_PARAM = "urls"
SHA256_PARAM = "sha256"
CATEGORIES_PARAM = "categories"
INTRUSION_ACTION = "intrusion_action"
IDENTITYIDS_PARAM = "identityids"
DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"  # ISO8601 format with UTC, default in XSOAR
PAGE_NUMBER_ERROR_MSG = "Invalid Input Error: page number should be greater than zero."
PAGE_SIZE_ERROR_MSG = "Invalid Input Error: page size should be greater than zero."
INVALID_ORG_ID_ERROR_MSG = "Authorization Error: The provided Organization ID is invalid."
INVALID_CREDENTIALS_ERROR_MSG = (
    "Authorization Error: The provided credentials for Cisco Umbrella Reporting are"
    " invalid. Please provide a valid Client ID and Client Secret."
)

ACTIVITY_TRAFFIC_TYPE_DICT = {
    "dns": [
        "traffic_type",
        "limit",
        "from",
        "to",
        "offset",
        "domains",
        "ip",
        "verdict",
        "threats",
        "threat_types",
        "identity_types",
        "page",
        "page_size",
        "categories",
        "identityids",
    ],
    "proxy": [
        "traffic_type",
        "limit",
        "from",
        "to",
        "offset",
        "domains",
        "ip",
        "verdict",
        "threats",
        "threat_types",
        "urls",
        "ports",
        "identity_types",
        "file_name",
        "amp_disposition",
        "page",
        "page_size",
        "categories",
        "identityids",
    ],
    "firewall": ["traffic_type", "limit", "from", "to", "offset", "ip", "ports", "verdict", "page", "page_size", "identityids"],
    "intrusion": [
        "traffic_type",
        "limit",
        "from",
        "to",
        "offset",
        "ip",
        "ports",
        "signatures",
        "intrusion_action",
        "page",
        "page_size",
        "identityids",
    ],
    "ip": [
        "traffic_type",
        "limit",
        "from",
        "to",
        "offset",
        "ip",
        "ports",
        "identity_types",
        "verdict",
        "page",
        "page_size",
        "categories",
        "identityids",
    ],
    "amp": ["traffic_type", "limit", "from", "to", "offset", "amp_disposition", "sha256", "page", "page_size"],
}

SUMMARY_TYPE_DICT = {
    "all": [
        "summary_type",
        "limit",
        "from",
        "to",
        "offset",
        "domains",
        "urls",
        "ip",
        "identity_types",
        "verdict",
        "file_name",
        "threats",
        "threat_types",
        "amp_disposition",
        "page",
        "page_size",
        "ports",
        "categories",
        "identityids",
    ],
    "category": [
        "summary_type",
        "limit",
        "from",
        "to",
        "offset",
        "domains",
        "urls",
        "ip",
        "identity_types",
        "verdict",
        "file_name",
        "threats",
        "threat_types",
        "amp_disposition",
        "page",
        "page_size",
        "categories",
        "identityids",
    ],
    "destination": [
        "summary_type",
        "limit",
        "from",
        "to",
        "offset",
        "domains",
        "urls",
        "ip",
        "identity_types",
        "verdict",
        "file_name",
        "threats",
        "threat_types",
        "amp_disposition",
        "page",
        "page_size",
        "categories",
        "identityids",
    ],
    "intrusion_rule": [
        "summary_type",
        "limit",
        "from",
        "to",
        "offset",
        "signatures",
        "ip",
        "identity_types",
        "intrusion_action",
        "ports",
        "page",
        "page_size",
        "identityids",
    ],
}
""" CLIENT CLASS """


class Client(BaseClient):
    """
    This Client implements API calls, and does not contain any XSOAR logic.
    Should only do requests and return data.
    It inherits from BaseClient defined in CommonServer Python.
    Most calls use _http_request() that handles proxy, SSL verification, etc.
    For this implementation, no special attributes defined
    """

    def __init__(self, base_url: str, secret_key: str, client_key: str, verify=None, proxy=None):
        super().__init__(base_url, verify=verify, proxy=proxy)
        self.secret_key = secret_key
        self.client_key = client_key

    def get_access_token(self):
        """
        Generate Access token
        Returns:
            Returns the access_token
        """
        payload = {"grant_type": "client_credentials"}

        token_response = self._http_request(
            method="POST",
            full_url=urljoin(self._base_url, "/auth/v2/token"),
            auth=(self.client_key, self.secret_key),
            data=payload,
            error_handler=cisco_umbrella_access_token_error_handler,
        )
        return token_response.get("access_token")

    def query_cisco_umbrella_api(self, end_point: str, params: dict) -> dict:
        """
        Call Cisco Umbrella Reporting API

        Redirection:
        Umbrella stores the reporting data in geolocated data warehouses.
        EU: api.eu.reports.umbrella.com
        US: api.us.reports.umbrella.com
        If an HTTP client request does not originate from the same continent
        as the location of the Umbrella data warehouse,
        the Umbrella server responds with 302 Found.

        Here in first request we make an API call and if users not belongs to
        same continent as the location of the Umbrella data warehouse,
        the status code will be in range of (300 - 310) and in the second call we take
        the redirected url from  the first response header location and make a new call.

        for more info see:
         https://developer.cisco.com/docs/cloud-security/#!api-reference-reports-reporting-overview/http-redirects-and-request-authorization-header

        Args:
            end_point (str): Cisco Umbrella Reporting endpoint
            params (dict): Params
        Returns:
            Return the raw api response from Cisco Umbrella Reporting API.
        """
        result: dict = {}
        url_path = urljoin(self._base_url, f"/reports/v2/{end_point}")
        access_token = self.get_access_token()
        response = self._http_request(
            method="GET",
            full_url=url_path,
            headers={"Authorization": f"Bearer {access_token}"},
            params=params,
            resp_type="response",
            allow_redirects=False,
            error_handler=cisco_umbrella_error_handler,
        )
        if response.status_code in range(300, 310):  # Redirection - explained in the function's docstring
            response = self._http_request(
                method="GET",
                full_url=response.headers["Location"],
                headers={"Authorization": f"Bearer {access_token}"},
                data={},
                allow_redirects=True,
            )
            if response:
                result = response

        else:  # Success response (status code == 200)
            result = response.json()

        return result


""" HELPER FUNCTIONS """


def cisco_umbrella_access_token_error_handler(response: requests.Response):
    """
    Error Handler for Cisco Umbrella access_token
    Args:
        response (response): Cisco Umbrella Token url response
    Raise:
         DemistoException
    """
    if response.status_code == 401:
        raise DemistoException(INVALID_CREDENTIALS_ERROR_MSG)
    elif response.status_code >= 400:
        raise DemistoException("Error: something went wrong, please try again.")


def cisco_umbrella_error_handler(response: requests.Response):
    """
    Error Handler for Cisco Umbrella
    Args:
        response (response): Cisco Umbrella response
    Raise:
         DemistoException
    """
    if response.status_code >= 400:
        error_message = response.json().get("data", {}).get("error")
        if "invalid organization" in error_message:
            raise DemistoException(INVALID_ORG_ID_ERROR_MSG)
        elif "unauthorized" in error_message:
            raise DemistoException(INVALID_CREDENTIALS_ERROR_MSG)
        raise DemistoException(error_message)


def check_valid_indicator_value(indicator_type: str, indicator_value: str) -> bool:
    """
    Check the validity of indicator values
    Args:
        indicator_type: Indicator type provided in the command
        indicator_value: Indicator value provided in the command
    Returns:
        True if the provided indicator values are valid
    """
    if indicator_type == DOMAIN_PARAM:
        indicator_value_list = argToList(indicator_value)
        for domain in indicator_value_list:
            if not re.match(domainRegex, domain):
                raise ValueError(f"Domain {domain} is invalid")

    elif indicator_type == URL_PARAM:
        indicator_value_list = argToList(indicator_value)
        for url in indicator_value_list:
            if not re.match(urlRegex, url):
                raise ValueError(f"URL {url} is invalid")

    elif indicator_type == IP_PARAM and not is_ip_valid(indicator_value, accept_v6_ips=True):
        raise ValueError(f'IP "{indicator_value}" is invalid')

    if indicator_type == SHA256_PARAM and not re.match(sha256Regex, indicator_value):
        raise ValueError(f"SHA256 value {indicator_value} is invalid")

    if indicator_type == INTRUSION_ACTION:
        intrusion_list = argToList(indicator_value)
        for intrusion in intrusion_list:
            if intrusion not in ["would_block", "blocked", "detected"]:
                raise ValueError(
                    "Invalid input Error: supported values for intrusion_action are: 'would_block', 'blocked' and 'detected'."
                )

    if indicator_type == CATEGORIES_PARAM:
        categories = argToList(indicator_value)
        for category in categories:
            if not category.lstrip("-").isdigit():
                raise ValueError(f"Invalid input Error: Categories argument is not a valid list of integers: {indicator_value}")

    if indicator_type == IDENTITYIDS_PARAM:
        identityids = argToList(indicator_value)
        for identityid in identityids:
            if not identityid.lstrip("-").isdigit():
                raise ValueError(f"Invalid input Error: Identityids argument is not a valid list of integers: {indicator_value}")

    return True


def get_command_title_string(sub_context: str, page: int | None, page_size: int | None) -> str:
    """
    Define command title
    Args:
        sub_context: Commands sub_context
        page: page_number
        page_size: page_size
    Returns:
        Returns the title for the readable output
    """
    if page and page_size and (page > 0 and page_size > 0):
        return f"{sub_context} List\nCurrent page size: {page_size}\nShowing page {page} out of others that may exist"

    return f"{sub_context} List"


def destination_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    destination_list = []
    for destination in results:
        category = [label.get("label") for label in destination.get("categories", [])]
        new = {
            "Destination": destination.get("domain", ""),
            "Category": ", ".join(category),
            "Allowed": destination.get("counts", {}).get("allowedrequests", ""),
            "Blocked": destination.get("counts", {}).get("blockedrequests", ""),
            "Requests": destination.get("counts", {}).get("requests", ""),
        }
        destination_list.append(new)
    headers = destination_list[0] if destination_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, destination_list, headers=headers, removeNull=True)

    return markdown


def categories_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """

    categories_list = []
    for category in results:
        new = {
            "Category": category.get("category", {}).get("label", ""),
            "Type": category.get("category", {}).get("type", ""),
            "Activity": category.get("count", 0),
        }
        categories_list.append(new)
    headers = categories_list[0] if categories_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, categories_list, headers=headers, removeNull=True)

    return markdown


def summary_lookup_to_markdown(summary: dict, title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        summary (dict): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """

    summary_list = []
    new = {
        "Application": summary.get("applications", 0),
        "Allowed Application": summary.get("applicationsallowed", 0),
        "Blocked Application": summary.get("applicationsblocked", 0),
        "Category": summary.get("categories", 0),
        "Domain": summary.get("domains", 0),
        "File": summary.get("files", 0),
        "File Type": summary.get("filetypes", 0),
        "Identity": summary.get("identities", 0),
        "Identity Type": summary.get("identitytypes", 0),
        "Policy Category": summary.get("policycategories", 0),
        "Policy Request": summary.get("policyrequests", 0),
        "Request": summary.get("requests", 0),
        "Allowed Request": summary.get("requestsallowed", 0),
        "Blocked Request": summary.get("requestsblocked", 0),
    }
    summary_list.append(new)

    headers = summary_list[0] if summary_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, summary_list, headers=headers, removeNull=True)
    return markdown


def summary_category_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    summary_category = []
    for summary_cat in results:
        summary = summary_cat.get("summary", {})
        new = {
            "Category Type": summary_cat.get("category", {}).get("type", ""),
            "Category Name": summary_cat.get("category", {}).get("label", ""),
            "Application": summary.get("applications", 0),
            "Allowed Application": summary.get("applicationsallowed", 0),
            "Blocked Application": summary.get("applicationsblocked", 0),
            "Category": summary.get("categories", 0),
            "Domain": summary.get("domains", 0),
            "File": summary.get("files", 0),
            "File Type": summary.get("filetypes", 0),
            "Identity": summary.get("identities", 0),
            "Identity Type": summary.get("identitytypes", 0),
            "Policy Category": summary.get("policycategories", 0),
            "Policy Request": summary.get("policyrequests", 0),
            "Request": summary.get("requests", 0),
            "Allowed Request": summary.get("requestsallowed", 0),
            "Blocked Request": summary.get("requestsblocked", 0),
        }
        summary_category.append(new)

    headers = summary_category[0] if summary_category else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, summary_category, headers=headers, removeNull=True)
    return markdown


def summary_rule_lookup_to_markdown(results: list[dict], title: str):
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    summary_rule = []
    for result in results:
        sigantures = result.get("signatures", [])
        for sign in sigantures:
            new = {
                "Blocked": sign.get("counts").get("blocked"),
                "Detected": sign.get("counts").get("detected"),
                "Would Block": sign.get("counts").get("wouldblock"),
                "Last Event": sign.get("lasteventat"),
            }
            summary_rule.append(new)
    headers = ["Blocked", "Detected", "Would Block", "Last Event"]
    markdown = tableToMarkdown(title, summary_rule, headers=headers, removeNull=True)
    return markdown


def summary_destination_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    summary_dest = []
    for destination in results:
        summary = destination.get("summary", {})
        new = {
            "Destination": destination.get("domain", ""),
            "Application": summary.get("applications", 0),
            "Allowed Application": summary.get("applicationsallowed", 0),
            "Blocked Application": summary.get("applicationsblocked", 0),
            "Category": summary.get("categories", 0),
            "Domain": summary.get("domains", 0),
            "File": summary.get("files", 0),
            "File Type": summary.get("filetypes", 0),
            "Identity": summary.get("identities", 0),
            "Identity Type": summary.get("identitytypes", 0),
            "Policy Category": summary.get("policycategories", 0),
            "Policy Request": summary.get("policyrequests", 0),
            "Request": summary.get("requests", 0),
            "Allowed Request": summary.get("requestsallowed", int),
            "Blocked Request": summary.get("requestsblocked", 0),
        }
        summary_dest.append(new)
    headers = summary_dest[0] if summary_dest else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, summary_dest, headers=headers, removeNull=True)
    return markdown


def identities_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    identities_list = []
    for identity in results:
        new = {"Identity": identity.get("identity", {}).get("label", ""), "Requests": identity.get("requests", 0)}
        identities_list.append(new)
    headers = identities_list[0] if identities_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, identities_list, headers=headers, removeNull=True)
    return markdown


def file_type_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    file_list = []
    for file in results:
        category = []
        type_list = []
        for label in file.get("categories", []):
            category.append(label.get("label", ""))
            type_list.append(label.get("type", ""))
        new = {
            "Requests": file.get("requests", ""),
            "Identity Count": file.get("identitycount", ""),
            "SHA256": file.get("sha256", ""),
            "Category": ", ".join(category),
            "Category Type": ", ".join(type_list),
            "File Name": ", ".join(file.get("filenames", [])),
            "File Types": ", ".join(file.get("filetypes", [])),
        }
        file_list.append(new)
    headers = file_list[0] if file_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, file_list, headers=headers, removeNull=True)

    return markdown


def event_types_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    event_list = []
    for event in results:
        new = {"Event Type": event.get("eventtype", ""), "Count": event.get("count", 0)}
        event_list.append(new)
    headers = event_list[0] if event_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, event_list, headers=headers, removeNull=True)

    return markdown


def threat_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    threat_list = []
    for threat in results:
        new = {"Threat": threat.get("threat", ""), "Threat Type": threat.get("threattype", ""), "Count": threat.get("count", 0)}
        threat_list.append(new)
    headers = threat_list[0] if threat_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, threat_list, headers=headers, removeNull=True)

    return markdown


def activity_build_data(activity: dict) -> dict:
    """
    Build activity data
    Args:
        activity (dict): Single object from cisco data
    Returns:
        Return activity data
    """
    category = [label.get("label") for label in activity.get("categories", [])]
    identity = [label.get("label") for label in activity.get("identities", [])]
    signature_cve = activity["signature"].get("cves") if activity.get("signature") else []
    signature_lebel = activity["signature"].get("label") if activity.get("signature") else ""
    all_application = []
    application_category = []
    for application in activity.get("allapplications", []):
        all_application.append(application.get("label"))
        application_category.append(application.get("category").get("label"))
    timestamp = activity.get("timestamp", 0)
    timestamp_string = datetime.utcfromtimestamp(timestamp / 1000.0).strftime(DATE_TIME_FORMAT)
    activity_data = {
        "category": category,
        "identity": identity,
        "all_application": all_application,
        "application_category": application_category,
        "timestamp_string": timestamp_string,
        "signature_cve": signature_cve,
        "signature_lebel": signature_lebel,
    }
    return activity_data


def activity_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        activity_data = activity_build_data(activity)
        new = {
            "Request": activity.get("type", ""),
            "Identity": ", ".join(activity_data.get("identity", [])),
            "Policy or Ruleset Identity": ", ".join(activity_data.get("identity", [])),
            "Destination": activity.get("domain", ""),
            "Internal IP": activity.get("internalip", ""),
            "External IP": activity.get("externalip", ""),
            "DNS Type": activity.get("querytype", ""),
            "Action": activity.get("verdict", ""),
            "Categories": ", ".join(activity_data.get("category", [])),
            "Public Application": ", ".join(activity_data.get("all_application", [])),
            "Application Category": ", ".join(activity_data.get("application_category", [])),
            "Date & Time": activity_data.get("timestamp_string"),
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)

    return markdown


def activity_dns_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        activity_data = activity_build_data(activity)
        new = {
            "Identity": ", ".join(activity_data.get("identity", [])),
            "Policy or Ruleset Identity": ", ".join(activity_data.get("identity", [])),
            "Destination": activity.get("domain", ""),
            "Internal IP": activity.get("internalip", ""),
            "External IP": activity.get("externalip", ""),
            "DNS Type": activity.get("querytype", ""),
            "Action": activity.get("verdict", ""),
            "Categories": ", ".join(activity_data.get("category", [])),
            "Public Application": ", ".join(activity_data.get("all_application", [])),
            "Application Category": ", ".join(activity_data.get("application_category", [])),
            "Date & Time": activity_data.get("timestamp_string"),
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)
    return markdown


def activity_proxy_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        activity_data = activity_build_data(activity)
        new = {
            "Identity": ", ".join(activity_data.get("identity", [])),
            "Policy or Ruleset Identity": ", ".join(activity_data.get("identity", [])),
            "Internal IP": activity.get("internalip", ""),
            "External IP": activity.get("externalip", ""),
            "Action": activity.get("verdict", ""),
            "Categories": ", ".join(activity_data.get("category", [])),
            "Public Application": ", ".join(activity_data.get("all_application", [])),
            "Application Category": ", ".join(activity_data.get("application_category", [])),
            "Date & Time": activity_data.get("timestamp_string"),
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)
    return markdown


def activity_firewall_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        activity_data = activity_build_data(activity)
        new = {
            "Identity": ", ".join(activity_data.get("identity", [])),
            "Policy or Ruleset Identity": ", ".join(activity_data.get("identity", [])),
            "Destination IP": activity.get("destinationip", ""),
            "Source IP": activity.get("sourceip", ""),
            "Source Port": activity.get("sourceport", ""),
            "Destination Port": activity.get("destinationport", ""),
            "Protocol": activity["protocol"].get("label") if activity.get("protocol") else "",
            "Rule": activity["rule"].get("label") if activity.get("rule") else "",
            "Type": activity.get("type", ""),
            "Action": activity.get("verdict", ""),
            "Public Application": ", ".join(activity_data.get("all_application", [])),
            "Direction": activity.get("direction", ""),
            "Date & Time": activity_data.get("timestamp_string"),
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)
    return markdown


def activity_intrusion_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        activity_data = activity_build_data(activity)
        new = {
            "Identity": ", ".join(activity_data.get("identity", [])),
            "Classification": activity.get("classification", ""),
            "Destination IP": activity.get("destinationip", ""),
            "Source IP": activity.get("sourceip", ""),
            "Source Port": activity.get("sourceport", ""),
            "Destination Port": activity.get("destinationport", ""),
            "Protocol": activity["protocol"].get("label") if activity.get("protocol") else "",
            "Severity": activity.get("severity", ""),
            "CVE": ", ".join(activity_data.get("signature_cve", [])),
            "Signature": activity_data.get("signature_lebel"),
            "Type": activity.get("type", ""),
            "Action": activity.get("verdict", ""),
            "Date & Time": activity_data.get("timestamp_string"),
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)
    return markdown


def activity_ip_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        activity_data = activity_build_data(activity)
        new = {
            "Identity": ", ".join(activity_data.get("identity", [])),
            "Destination IP": activity.get("destinationip", ""),
            "Source IP": activity.get("sourceip", ""),
            "Source Port": activity.get("sourceport", ""),
            "Destination Port": activity.get("destinationport", ""),
            "Categories": ", ".join(activity_data.get("category", [])),
            "Type": activity.get("type", ""),
            "Action": activity.get("verdict", ""),
            "Date & Time": activity_data.get("timestamp_string"),
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)
    return markdown


def activity_amp_lookup_to_markdown(results: list[dict], title: str) -> str:
    """
    Parsing the Cisco Umbrella Reporting data
    Args:
        results (list): Cisco Umbrella Reporting data
        title (str): Title string
    Returns:
        A string representation of the markdown table
    """
    activity_list = []
    for activity in results:
        timestamp = activity.get("timestamp", 0)
        timestamp_string = datetime.utcfromtimestamp(timestamp / 1000.0).strftime(DATE_TIME_FORMAT)
        new = {
            "First Seen": activity.get("firstseenat", ""),
            "Disposition": activity.get("disposition", ""),
            "Score": activity.get("score", ""),
            "Host Name": activity.get("hostname", ""),
            "Malware": activity.get("malwarename", ""),
            "SHA256": activity.get("sha256", ""),
            "Date & Time": timestamp_string,
        }
        activity_list.append(new)
    headers = activity_list[0] if activity_list else {}
    headers = list(headers.keys())
    markdown = tableToMarkdown(title, activity_list, headers=headers, removeNull=True)
    return markdown


def pagination(page: int | None, page_size: int | None):
    """
    Define pagination.
    Args:
        page: The page number.
        page_size: The number of requested results per page.
    Returns:
        limit (int): Records per page.
        offset (int): The number of records to be skipped.
    """
    if page is None:
        page = DEFAULT_OFFSET
    elif page <= 0:
        raise DemistoException(PAGE_NUMBER_ERROR_MSG)
    else:
        page = page - 1

    if page_size is None:
        page_size = DEFAULT_PAGE_SIZE
    elif page_size <= 0:
        raise DemistoException(PAGE_SIZE_ERROR_MSG)

    limit = page_size
    offset = page * page_size

    return limit, offset


def create_cisco_umbrella_args(limit: int | None, offset: int | None, args: dict) -> dict:
    """
    This function creates a dictionary of the arguments sent to the Cisco Umbrella API based on the demisto.args().
    Args:
        limit: Records per page.
        offset: The number of records to be skipped.
        args: demisto.args()
    Returns:
        Return arguments dict.
    """
    cisco_umbrella_args: dict = {}

    if sha256 := args.get("sha256"):
        check_valid_indicator_value("sha256", sha256)
    if ip := args.get("ip"):
        check_valid_indicator_value("ip", ip)
    if domains := args.get("domains"):
        check_valid_indicator_value("domains", domains)
    if urls := args.get("urls"):
        check_valid_indicator_value("urls", urls)
    if intrusion_action := args.get("intrusion_action"):
        check_valid_indicator_value("intrusion_action", intrusion_action)
    if categories := args.get("categories"):
        check_valid_indicator_value("categories", categories)
    if identityids := args.get("identityids"):
        check_valid_indicator_value("identityids", identityids)

    max_limit = arg_to_number(args.get("limit", DEFAULT_PAGE_SIZE), arg_name="limit")

    cisco_umbrella_args["limit"] = limit if limit != DEFAULT_PAGE_SIZE else max_limit
    cisco_umbrella_args["offset"] = offset
    cisco_umbrella_args["from"] = args.get("from", DEFAULT_FROM_DATE)
    cisco_umbrella_args["to"] = args.get("to", DEFAULT_TO_DATE)
    cisco_umbrella_args["threattypes"] = args.get("threat_types")
    cisco_umbrella_args["identitytypes"] = args.get("identity_types")
    cisco_umbrella_args["ampdisposition"] = args.get("amp_disposition")
    cisco_umbrella_args["filename"] = args.get("file_name")
    cisco_umbrella_args["intrusionaction"] = intrusion_action
    cisco_umbrella_args["domains"] = domains
    cisco_umbrella_args["urls"] = urls
    cisco_umbrella_args["ip"] = ip
    cisco_umbrella_args["ports"] = args.get("ports")
    cisco_umbrella_args["verdict"] = args.get("verdict")
    cisco_umbrella_args["threats"] = args.get("threats")
    cisco_umbrella_args["signatures"] = args.get("signatures")
    cisco_umbrella_args["sha256"] = sha256
    cisco_umbrella_args["categories"] = argToList(categories)
    cisco_umbrella_args["identityids"] = argToList(identityids)

    return cisco_umbrella_args


""" COMMAND FUNCTIONS """


def test_module(client: Client) -> str:
    """
    Tests API connectivity and authentication
    When 'ok' is returned it indicates the integration works like
    it is supposed to and connection to the service is successful.
    Args:
        client(Client): Client class object
    Returns:
        Connection ok
    """
    params: dict = {"limit": 1, "from": "-1days", "to": "now", "offset": 0}
    client.query_cisco_umbrella_api("activity", params)

    return "ok"


def get_destinations_list_command(client: Client, args: dict[str, Any]):
    """
    get_destinations_list_command: List of destinations ordered by the number of requests made in descending order.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    traffic_type = args.get("traffic_type")
    endpoint = f"top-destinations/{traffic_type}" if traffic_type else "top-destinations"
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    title = get_command_title_string("Destination", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = destination_lookup_to_markdown(data, title)
    else:
        readable_output = "No destinations to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.Destination",
        outputs_key_field="domain",
        outputs=data,
    )


def get_categories_list_command(client: Client, args: dict[str, Any]):
    """
    get_categories_list_command: List of categories ordered by the number of
        requests made matching the categories in descending order.

    * Due to a bug in the API - the limit and page_size arguments are not supported in the get_categories_list_command.

    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    traffic_type = args.get("traffic_type")
    endpoint = f"top-categories/{traffic_type}" if traffic_type else "top-categories"
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    title = get_command_title_string("Category", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = categories_lookup_to_markdown(data, title)
    else:
        readable_output = "No categories to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.Category",
        outputs_key_field="category.id",
        outputs=data,
    )


def get_identities_list_command(client: Client, args: dict[str, Any]):
    """
    get_identities_list_command: List of identities ordered by the number of requests they made in descending order.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    traffic_type = args.get("traffic_type")
    endpoint = f"top-identities/{traffic_type}" if traffic_type else "top-identities"
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    title = get_command_title_string("Identities", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = identities_lookup_to_markdown(data, title)
    else:
        readable_output = "No identities to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.Identity",
        outputs_key_field="identity.id",
        outputs=data,
    )


def get_file_list_command(client: Client, args: dict[str, Any]):
    """
    get_file_list_command: List of files within a timeframe. Only returns proxy data.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    endpoint = "top-files"
    title = get_command_title_string("File", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = file_type_lookup_to_markdown(data, title)
    else:
        readable_output = "No files to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.File",
        outputs_key_field="sha256",
        outputs=data,
    )


def get_threat_list_command(client: Client, args: dict[str, Any]):
    """
    get_threat_list_command: List of threats within a timeframe. Returns both DNS and Proxy data.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    traffic_type = args.get("traffic_type")
    endpoint = f"top-threats/{traffic_type}" if traffic_type else "top-threats"
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    title = get_command_title_string("Threat", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = threat_lookup_to_markdown(data, title)
    else:
        readable_output = "No threats to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.Threat",
        outputs_key_field="threat",
        outputs=data,
    )


def get_event_types_list_command(client: Client, args: dict[str, Any]):
    """
    get_event_types_list_command: List of event types ordered by the number
     of requests made for each type of event in descending order.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    endpoint = "top-eventtypes"
    title = get_command_title_string("Event Type", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = event_types_lookup_to_markdown(data, title)
    else:
        readable_output = "No event types to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.EventType",
        outputs_key_field="eventtype",
        outputs=data,
    )


def get_activity_list_command(client: Client, args: dict[str, Any]):
    """
    get_activity_list_command: List all activity entries (dns/proxy/firewall/ip/intrusion/amp) within timeframe.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed to ``return_results``, that contains an updated
            result.
    """
    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    endpoint = "activity"
    title = get_command_title_string("Activity", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = activity_lookup_to_markdown(data, title)
    else:
        readable_output = "No activities to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.Activity",
        outputs_key_field="domain",
        outputs=data,
    )


def get_activity_by_traffic_type_command(client: Client, args: dict[str, Any]):
    """
    get_activity_by_traffic_type_command: List all entries within a timeframe
     based on the activity type selected. Valid activity types are dns,
     proxy, firewall, intrusion, ip, amp.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed
         to ``return_results``, that contains an updated result.
    """
    traffic_type = args.get("traffic_type")
    if traffic_type:
        endpoint = "activity/amp-retrospective" if traffic_type == "amp" else f"activity/{traffic_type}"
    else:
        raise DemistoException("Please select a traffic type.")
    markdown_function = {
        "dns": activity_dns_lookup_to_markdown,
        "proxy": activity_proxy_lookup_to_markdown,
        "firewall": activity_firewall_lookup_to_markdown,
        "ip": activity_ip_lookup_to_markdown,
        "intrusion": activity_intrusion_lookup_to_markdown,
        "amp": activity_amp_lookup_to_markdown,
    }
    context_output_name = {
        "dns": "ActivityDns",
        "proxy": "ActivityProxy",
        "firewall": "ActivityFirewall",
        "intrusion": "ActivityIntrusion",
        "ip": "ActivityIP",
        "amp": "ActivityAMPRetro",
    }
    traffic_type_params_list = ACTIVITY_TRAFFIC_TYPE_DICT[traffic_type]
    if not set(args.keys()).issubset(traffic_type_params_list):
        raise DemistoException(
            f"Invalid optional parameter is selected for traffic type {traffic_type}.\n"
            f"Supported optional parameters for {traffic_type} traffic type are:"
            f" {', '.join(traffic_type_params_list)}."
        )

    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    title = get_command_title_string(f"{traffic_type.capitalize()} Activity", page, page_size)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)
    data = raw_json_response.get("data", [])
    if data:
        readable_output = markdown_function[traffic_type](data, title)
    else:
        readable_output = f"No {traffic_type} activities to present.\n"

    return CommandResults(
        readable_output=readable_output,
        outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.{context_output_name[traffic_type]}",
        outputs_key_field="",
        outputs=data,
    )


def get_summary_list_command(client: Client, args: dict[str, Any]):
    """
    get_summary_list_command: Get the summary.
    Args:
        client: Cisco Umbrella Reporting client to use.
        args: all command arguments, usually passed from ``demisto.args()``.
    Returns:
        CommandResults: A ``CommandResults`` object that is then passed
         to ``return_results``, that contains an updated result.
    """
    summary_outputs_key_field = {"category": "category.id", "destination": "domain", "intrusion_rule": "signaturelist.id"}
    summary_endpoint_dict = {
        "category": "summaries-by-category",
        "destination": "summaries-by-destination",
        "intrusion_rule": "summaries-by-rule/intrusion",
    }
    summary_markdown_dict = {
        "category": summary_category_lookup_to_markdown,
        "destination": summary_destination_lookup_to_markdown,
        "intrusion_rule": summary_rule_lookup_to_markdown,
    }
    context_output_name = {
        "category": "SummaryWithCategory",
        "destination": "SummaryWithDestination",
        "intrusion_rule": "SignatureListSummary",
    }
    summary_type = args.get("summary_type", "")
    endpoint = summary_endpoint_dict.get(summary_type, "summary")
    category_type_param_list = SUMMARY_TYPE_DICT.get(summary_type, SUMMARY_TYPE_DICT["all"])
    if not set(args.keys()).issubset(category_type_param_list):
        raise DemistoException(
            f"Invalid optional parameter is selected for summary type {summary_type}.\n"
            f"Supported optional parameters for {summary_type} summary type are:"
            f" {', '.join(category_type_param_list)}."
        )

    page = arg_to_number(args.get("page"), arg_name="page")
    page_size = arg_to_number(args.get("page_size", DEFAULT_PAGE_SIZE), arg_name="page_size")
    limit, offset = pagination(page, page_size)
    cisco_umbrella_args = create_cisco_umbrella_args(limit, offset, args)
    raw_json_response = client.query_cisco_umbrella_api(endpoint, cisco_umbrella_args)

    if summary_type:
        data = raw_json_response.get("data", [])
        title = get_command_title_string(f"Summary with {summary_type.split('_')[0].capitalize()}", page, page_size)
        if data:
            readable_output = summary_markdown_dict[summary_type](data, title)
        else:
            readable_output = f"No {summary_type} summary to present.\n"
        return CommandResults(
            readable_output=readable_output,
            outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.{context_output_name[summary_type]}",
            outputs_key_field=f"{summary_outputs_key_field[summary_type]}",
            outputs=data,
        )

    else:
        data = raw_json_response.get("data", {})
        title = get_command_title_string("Summary", page, page_size)
        if data:
            readable_output = summary_lookup_to_markdown(data, title)
        else:
            readable_output = "No summary to present.\n"
        return CommandResults(
            readable_output=readable_output,
            outputs_prefix=f"{INTEGRATION_CONTEXT_NAME}.Summary",
            outputs_key_field="",
            outputs=data,
        )


def main():
    """
    PARSE AND VALIDATE INTEGRATION PARAMS
    """
    args = demisto.args()
    command = demisto.command()
    params = demisto.params()
    secret_key = params.get("credentials", {}).get("password")
    client_key = params.get("credentials", {}).get("identifier")

    # get the service API url
    base_url = params.get("api_url")

    proxy = params.get("proxy", False)
    handle_proxy()
    verify_certificate = not params.get("insecure", False)

    demisto.debug(f"Command being called is {command}")
    try:
        client = Client(base_url=base_url, secret_key=secret_key, client_key=client_key, proxy=proxy, verify=verify_certificate)

        commands = {
            "umbrella-reporting-destination-list": get_destinations_list_command,
            "umbrella-reporting-category-list": get_categories_list_command,
            "umbrella-reporting-identity-list": get_identities_list_command,
            "umbrella-reporting-event-type-list": get_event_types_list_command,
            "umbrella-reporting-file-list": get_file_list_command,
            "umbrella-reporting-threat-list": get_threat_list_command,
            "umbrella-reporting-activity-list": get_activity_list_command,
            "umbrella-reporting-activity-get": get_activity_by_traffic_type_command,
            "umbrella-reporting-summary-list": get_summary_list_command,
        }
        if command == "test-module":
            return_results(test_module(client))
        elif command in commands:
            return_results(commands[command](client, args))
        else:
            raise NotImplementedError
    # Log exceptions
    except Exception as e:
        return_error(f"Failed to execute {command} command. Error: {str(e)}")


if __name__ in ("__main__", "__builtin__", "builtins"):
    main()