import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * """ IMPORTS """ from datetime import datetime from typing import Any, AnyStr import urllib3 # Disable insecure warnings urllib3.disable_warnings() """GLOBALS/PARAMS Attributes: INTEGRATION_NAME: Name of the integration as shown in the integration UI, for example: Microsoft Graph User. INTEGRATION_COMMAND_NAME: Command names should be written in all lower-case letters, and each word separated with a hyphen, for example: msgraph-user. INTEGRATION_CONTEXT_NAME: Context output names should be written in camel case, for example: MSGraphUser. """ INTEGRATION_NAME = "PhishLabs IOC - EIR" INTEGRATION_COMMAND_NAME = "phishlabs-ioc-eir" INTEGRATION_CONTEXT_NAME = "PhishLabsIOC" class Client(BaseClient): def __init__(self, base_url, verify=True, proxy=False, auth=None, reliability=DBotScoreReliability.B): BaseClient.__init__(self, base_url=base_url, verify=verify, proxy=proxy, auth=auth) self.reliability = reliability def test_module(self) -> dict: """Performs basic GET request to check if the API is reachable and authentication is successful. Returns: Response json """ return self.get_incidents(limit=1, period=demisto.params().get("fetchTime")) def get_incidents( self, status: str | None = None, created_after: str | None = None, created_before: str | None = None, closed_before: str | None = None, closed_after: str | None = None, sort: str | None = None, direction: str | None = None, limit: str | int = 25, offset: str | int = 0, period: str = None, ) -> dict: """ Query the specified kwargs with default parameters if not defined Args: status: open,closed created_after: Timestamp is in RFC3339 format created_before: Timestamp is in RFC3339 format closed_before: Timestamp is in RFC3339 format closed_after: Timestamp is in RFC3339 format sort: created_at,closed_at direction: asc,desc limit: Limit amounts of incidents (0-50, default 50) offset: Offset from last incident period: timestamp (