DeepInstinct v3

Deep Instinct is a prevention-first approach to stopping ransomware and other malware using the world's first purpose-built, deep learning cybersecurity framework.

Endpoint · DeepInstinct

Details

IDDeepInstinct v3
ProviderDeep Instinct
CategoryEndpoint
From Version6.2.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM

README

Deep Instinct is a prevention-first approach to stopping ransomware and other malware using the world’s first purpose-built, deep learning cybersecurity framework.
This integration was integrated and tested with version 3.3.x of DeepInstinct v3

This is the default integration for this content pack when configured by the Data Onboarder in Cortex XSIAM.

Configure DeepInstinct v3 in Cortex

Parameter Required
Base server URL True
API Key True
First event ID to fetch from False
Fetch incidents False
Incidents Fetch Interval False
Incident type False
Trust any certificate (not secure) False
Use system proxy settings False

Commands

You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.

deepinstinctv3-get-device


Get device information from its ID

Base Command

deepinstinctv3-get-device

Input

Argument Name Description Required
device_id Get device information from its ID. Required

Context Output

Path Type Description
deepinstinctv3.devices.ID number Device ID
deepinstinctv3.devices.os string Device OS
deepinstinctv3.devices.osv string Device OS version
deepinstinctv3.devices.ip_address string Device IP address
deepinstinctv3.devices.email sting Device email ip_address
deepinstinctv3.devices.mac_address string Device mac address
deepinstinctv3.devices.hostname string Device hostname
deepinstinctv3.devices.domain string Device domain
deepinstinctv3.devices.scanned_files number Num of device scanned files
deepinstinctv3.devices.comment string Device comment
deepinstinctv3.devices.tag string Device tag
deepinstinctv3.devices.connectivity_status string Device connectivity status
deepinstinctv3.devices.deployment_status string Device deployment status
deepinstinctv3.devices.deployment_status_last_update string Device last client version update
deepinstinctv3.devices.license_status string Device license status
deepinstinctv3.devices.last_registration string Device last registration datetime
deepinstinctv3.devices.last_contact string Device last contact datetime
deepinstinctv3.devices.distinguished_name string Device distinguished name
deepinstinctv3.devices.group_name string Device group name
deepinstinctv3.devices.group_id number Device group ID
deepinstinctv3.devices.policy_name string Device policy name
deepinstinctv3.devices.policy_id number Device policy ID
deepinstinctv3.devices.log_status string Device log status
deepinstinctv3.devices.agent_version string Device agent version
deepinstinctv3.devices.brain_version string Device brain version
deepinstinctv3.devices.logged_in_users string Device logged in user(s)
deepinstinctv3.devices.msp_name string Device msp name
deepinstinctv3.devices.msp_id number Device msp ID
deepinstinctv3.devices.tenant_name string Device tenant name
deepinstinctv3.devices.tenant_id number Device tenant ID

deepinstinctv3-get-events


Get all events after given event ID

Base Command

deepinstinctv3-get-events

Input

Argument Name Description Required
first_event_id Get all events. Max events in response is 50, use first_event_id parameter to define first event id to get. Default is 0. Required

Context Output

Path Type Description
deepinstinctv3.Events.events.id number event ID
deepinstinctv3.Events.events.device_id number event device ID
deepinstinctv3.Events.events.timestamp string event timestamp from device
deepinstinctv3.Events.events.insertion_timestamp string event timestamp from console
deepinstinctv3.Events.events.close_timestamp string event closed timestamp
deepinstinctv3.Events.events.last_action string event last last_action
deepinstinctv3.Events.events.status string event status
deepinstinctv3.Events.events.comment string event comment
deepinstinctv3.Events.events.recorded_device_info unknown event device information
deepinstinctv3.Events.events.msp_name string event msp name
deepinstinctv3.Events.events.msp_id number event msp id
deepinstinctv3.Events.events.tenant_name string event tenant name
deepinstinctv3.Events.events.tenant_id number event tenant id
deepinstinctv3.Events.events.mitre_classifications unknown event MITRE classification
deepinstinctv3.Events.events.type string event type
deepinstinctv3.Events.events.trigger string event trigger
deepinstinctv3.Events.events.action string event action
deepinstinctv3.Events.events.close_trigger string event close trigger
deepinstinctv3.Events.events.reoccurrence_count number event reoccurrence_count
deepinstinctv3.Events.events.file_type string event file type
deepinstinctv3.Events.events.file_hash string event file hash
deepinstinctv3.Events.events.file_archive_hash string event file archive hash
deepinstinctv3.Events.events.path unknown event file path
deepinstinctv3.Events.events.file_size number event file size
deepinstinctv3.Events.events.threat_severity string event threat severity
deepinstinctv3.Events.events.certificate_thumbprint string event certificate certificate thumbprint
deepinstinctv3.Events.events.certificate_vendor_name string event certificate certificate vendor name
deepinstinctv3.Events.events.deep_classification string Deep Instinct classification
deepinstinctv3.Events.events.file_status string event file status
deepinstinctv3.Events.events.sandbox_status string event sandbox status

deepinstinctv3-get-suspicious-events


Get all suspicious events after given event ID

Base Command

deepinstinctv3-get-suspicious-events

Input

Argument Name Description Required
first_event_id Get all suspicious events. Max events in response is 50, use first_event_id parameter to define first event id to get. Default is 0. Required

Context Output

Path Type Description
deepinstinctv3.Suspicious-Events.events.ID number event ID
deepinstinctv3.Suspicious-Events.events.device_id number event device ID
deepinstinctv3.Suspicious-Events.events.timestamp string event timestamp from device
deepinstinctv3.Suspicious-Events.events.insertion_timestamp string event timestamp from console
deepinstinctv3.Suspicious-Events.events.status string event status
deepinstinctv3.Suspicious-Events.events.recorded_device_info unkown event device info
deepinstinctv3.Suspicious-Events.events.msp_name string event msp name
deepinstinctv3.Suspicious-Events.events.msp_id number event msp id
deepinstinctv3.Suspicious-Events.events.tenant_name string event tenant name
deepinstinctv3.Suspicious-Events.events.tenant_id number event tenant id
deepinstinctv3.Suspicious-Events.events.mitre_classifications unknown event MITRE classification
deepinstinctv3.Suspicious-Events.events.type string event type
deepinstinctv3.Suspicious-Events.events.trigger string event trigger
deepinstinctv3.Suspicious-Events.events.action string event action
deepinstinctv3.Suspicious-Events.events.close_trigger string event close trigger
deepinstinctv3.Suspicious-Events.events.file_type string event file type
deepinstinctv3.Suspicious-Events.events.rule_trigger string event rule trigger
deepinstinctv3.Suspicious-Events.events.file_archive_hash string event file archive hash
deepinstinctv3.Suspicious-Events.events.remediation unknown event remediation
deepinstinctv3.Suspicious-Events.events.path unknown event file path

deepinstinctv3-get-all-groups


Get all groups

Base Command

deepinstinctv3-get-all-groups

Input

There are no input arguments for this command.

Context Output

Path Type Description
deepinstinctv3.Groups.ID number group id
deepinstinctv3.Groups.is_default_group boolean True if group is a default group, false otherwise
deepinstinctv3.Groups.msp_id number msp ID
deepinstinctv3.Groups.name string group name
deepinstinctv3.Groups.os string group operation system
deepinstinctv3.Groups.policy_id number group policy ID

deepinstinctv3-get-all-policies


Get list of all policies

Base Command

deepinstinctv3-get-all-policies

Input

There are no input arguments for this command.

Context Output

Path Type Description
deepinstinctv3.Policies.ID number policy ID
deepinstinctv3.Policies.name string policy name
deepinstinctv3.Policies.os string policy operating system
deepinstinctv3.Policies.is_default_policy boolean True if policy is a default policy, False otherwise
deepinstinctv3.Policies.msp_id number msp ID
deepinstinctv3.Policies.msp_name string msp name

deepinstinctv3-add-hash-to-deny-list


Add file hash to Deny List

Base Command

deepinstinctv3-add-hash-to-deny-list

Input

Argument Name Description Required
policy_id Policy ID. Required
file_hash file hash. Required
comment comment to hash field. Optional

Context Output

There is no context output for this command.

deepinstinctv3-add-hash-to-allow-list


Add file hash to Allow List

Base Command

deepinstinctv3-add-hash-to-allow-list

Input

Argument Name Description Required
policy_id Policy ID. Required
file_hash file hash. Required
comment comment to hash field. Optional

Context Output

There is no context output for this command.

deepinstinctv3-remove-hash-from-deny-list


Remove hash from Deny List

Base Command

deepinstinctv3-remove-hash-from-deny-list

Input

Argument Name Description Required
policy_id Policy ID. Required
file_hash file hash. Required

Context Output

There is no context output for this command.

deepinstinctv3-remove-hash-from-allow-list


Remove hash from Allow List

Base Command

deepinstinctv3-remove-hash-from-allow-list

Input

Argument Name Description Required
policy_id Policy ID. Required
file_hash file hash. Required

Context Output

There is no context output for this command.

deepinstinctv3-add-devices-to-group


Add multiple devices to a group

Base Command

deepinstinctv3-add-devices-to-group

Input

Argument Name Description Required
group_id group ID. Required
device_ids comma seperated list of device ids to address. Required

Context Output

There is no context output for this command.

deepinstinctv3-remove-devices-from-group


Remove list of devices from groups

Base Command

deepinstinctv3-remove-devices-from-group

Input

Argument Name Description Required
group_id Group ID to remove from. Required
device_ids Comma seperated list of device ids to remove. Required

Context Output

There is no context output for this command.

deepinstinctv3-delete-files-remotely


Delete multiple files remotely

Base Command

deepinstinctv3-delete-files-remotely

Input

Argument Name Description Required
event_ids comma separated list of event ids. Required

Context Output

There is no context output for this command.

deepinstinctv3-terminate-processes


Terminate list of processes

Base Command

deepinstinctv3-terminate-processes

Input

Argument Name Description Required
event_ids comma separated list of event ids. Required

Context Output

There is no context output for this command.

deepinstinctv3-close-events


Close list of events

Base Command

deepinstinctv3-close-events

Input

Argument Name Description Required
event_ids comma separated list of event ids. Required

Context Output

There is no context output for this command.

deepinstinctv3-disable-device


Disable device at next check-in

Base Command

deepinstinctv3-disable-device

Input

Argument Name Description Required
device_id single device id. Required

Context Output

There is no context output for this command.

deepinstinctv3-enable-device


Enable device at next check-in

Base Command

deepinstinctv3-enable-device

Input

Argument Name Description Required
device_id single device id. Required

Context Output

There is no context output for this command.

deepinstinctv3-isolate-from-network


Isolate device(s) from Network

Base Command

deepinstinctv3-isolate-from-network

Input

Argument Name Description Required
device_ids comma separated list of device ids. Required

Context Output

There is no context output for this command.

deepinstinctv3-release-from-isolation


Release device(s) from isolation

Base Command

deepinstinctv3-release-from-isolation

Input

Argument Name Description Required
device_ids comma separated list of device ids. Required

Context Output

There is no context output for this command.

deepinstinctv3-remote-file-upload


Upload file associated with given event id at next check-in

Base Command

deepinstinctv3-remote-file-upload

Input

Argument Name Description Required
event_id the event id. Required

Context Output

There is no context output for this command.

deepinstinctv3-upload-logs


Upload device logs from given device at next check-in

Base Command

deepinstinctv3-upload-logs

Input

Argument Name Description Required
device_id single device id. Required

Context Output

There is no context output for this command.

deepinstinctv3-remove-device


Remove agent from device at next check-in

Base Command

deepinstinctv3-remove-device

Input

Argument Name Description Required
device_id single device id. Required

Context Output

There is no context output for this command.

Configuration parameters

  • base_url — Base server URL (required)
  • apikey — API Key (required)
  • first_fetch — First event ID to fetch from
  • max_fetch — Maximum number of indicators per fetch, max is 1000.
  • isFetch — Fetch incidents
  • incidentFetchInterval — Incidents Fetch Interval
  • incidentType — Incident type
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings

Commands (21)

  • deepinstinctv3-add-devices-to-group

    Add multiple devices to a group.

  • deepinstinctv3-add-hash-to-allow-list

    Add file hash to Allow List.

  • deepinstinctv3-add-hash-to-deny-list

    Add file hash to Deny List.

  • deepinstinctv3-close-events

    Close list of events.

  • deepinstinctv3-delete-files-remotely

    Delete multiple files remotely.

  • deepinstinctv3-disable-device

    Disable device at next check-in.

  • deepinstinctv3-enable-device

    Enable device at next check-in.

  • deepinstinctv3-get-all-groups

    Get all groups.

  • deepinstinctv3-get-all-policies

    Get list of all policies.

  • deepinstinctv3-get-device

    Get device information from its ID.

  • deepinstinctv3-get-events

    Get all events after given event ID.

  • deepinstinctv3-get-suspicious-events

    Get all suspicious events after given event ID.

  • deepinstinctv3-isolate-from-network

    Isolate device(s) from Network.

  • deepinstinctv3-release-from-isolation

    Release device(s) from isolation.

  • deepinstinctv3-remote-file-upload

    Upload file associated with given event id at next check-in.

  • deepinstinctv3-remove-device

    Remove agent from device at next check-in.

  • deepinstinctv3-remove-devices-from-group

    Remove list of devices from groups.

  • deepinstinctv3-remove-hash-from-allow-list

    Remove hash from Allow List.

  • deepinstinctv3-remove-hash-from-deny-list

    Remove hash from Deny List.

  • deepinstinctv3-terminate-processes

    Terminate list of processes.

  • deepinstinctv3-upload-logs

    Upload device logs from given device at next check-in.

import json

import requests
import urllib3
from CommonServerPython import *

urllib3.disable_warnings()


def http_request(method, url_suffix, json=None):
    """
    Helper function to perform http request
    """
    try:
        api_suffix = "/api/v1"
        base_url = demisto.params().get("base_url")
        if base_url.endswith("/"):  # remove slash in the end
            base_url = base_url[:-1]
        api_key = demisto.params().get("apikey")
        verify = not demisto.params().get("insecure", True)

        headers = {"Content-Type": "application/json", "Accept": "application/json", "Authorization": str(api_key)}
        r = requests.request(method, base_url + api_suffix + url_suffix, json=json, headers=headers, verify=verify)

        if r.status_code == 401:
            return_error(message="Authentication parameters are invalid, Please check your URL address and your API token")

        if r.status_code not in (200, 204):
            result = r.json()
            return_error(message=f"Error {r.status_code} occurred with command. Error is: {str((result)['statusText'])}")
        try:
            return r.json()
        except ValueError:
            return None
    except Exception as e:
        return_error(message=f"Error occurred on API call: {base_url + api_suffix + url_suffix}. Error is: {str(e)}")


def get_specific_device():
    """
    Get specific device by id
    """
    device_id = demisto.args().get("device_id")
    result = http_request("GET", f"/devices/{str(device_id)}")
    ec = {"DeepInstinct.Devices(val.id && val.id == obj.id)": result}

    return_results(CommandResults(readable_output=tableToMarkdown("Device", result), outputs=ec, raw_response=result))


def get_events():
    """
    Get events
    """
    first_event_id = demisto.args().get("first_event_id")
    result = http_request("GET", "/events?after_event_id=" + str(first_event_id))
    events = {}
    if "events" in result:
        events = result["events"]
    ec = {"DeepInstinct.Events(val.id && val.id == obj.id)": events}

    return_results(CommandResults(readable_output=tableToMarkdown("Events", events), outputs=ec, raw_response=events))


def get_all_groups():
    """
    Get all groups

    """
    result = http_request("GET", "/groups")
    ec = {"DeepInstinct.Groups(val.id && val.id == obj.id)": result}

    return_results(CommandResults(readable_output=tableToMarkdown("Groups", result), outputs=ec, raw_response=result))


def get_all_policies():
    """
    Get all policies

    """
    result = http_request("GET", "/policies")
    ec = {"DeepInstinct.Policies(val.id && val.id == obj.id)": result}

    return_results(CommandResults(readable_output=tableToMarkdown("Policies", result), outputs=ec, raw_response=result))


def add_hash_to_denylist():
    """
    Add hash to deny-list
    """
    policy_id = demisto.args().get("policy_id")
    file_hash = demisto.args().get("file_hash")
    comment = demisto.args().get("comment") or ""
    http_request("POST", f"/policies/{str(policy_id)}/deny-list/hashes/{file_hash}", json={"comment": comment})
    return_results("ok")


def add_hash_to_allowlist():
    """
    Add hash to allow-list
    """
    policy_id = demisto.args().get("policy_id")
    file_hash = demisto.args().get("file_hash")
    comment = demisto.args().get("comment") or ""
    http_request("POST", f"/policies/{str(policy_id)}/allow-list/hashes/{file_hash}", json={"comment": comment})
    return_results("ok")


def remove_hash_from_denylist():
    """
    Remove hash from deny-list
    """
    policy_id = demisto.args().get("policy_id")
    file_hash = demisto.args().get("file_hash")

    item_list = [{"item": file_hash}]

    http_request("DELETE", f"/policies/{str(policy_id)}/deny-list/hashes", json={"items": item_list})
    return_results("ok")


def remove_hash_from_allowlist():
    """
    Remove hash from allow-list
    """
    policy_id = demisto.args().get("policy_id")
    file_hash = demisto.args().get("file_hash")

    item_list = [{"item": file_hash}]

    http_request("DELETE", f"/policies/{str(policy_id)}/allow-list/hashes", json={"items": item_list})
    return_results("ok")


def add_devices_to_group():
    """
    Add devices to specific group
    """
    group_id = demisto.args().get("group_id")
    device_ids_input = demisto.args().get("device_ids")
    device_ids = [int(num) for num in device_ids_input.split(",")]
    http_request("POST", f"/groups/{str(group_id)}/add-devices", json={"devices": device_ids})
    return_results("ok")


def remove_devices_from_group():
    """
    Remove devices from group
    """
    group_id = demisto.args().get("group_id")
    device_ids_input = demisto.args().get("device_ids")
    device_ids = [int(num) for num in device_ids_input.split(",")]

    http_request("POST", f"/groups/{str(group_id)}/remove-devices", json={"devices": device_ids})
    return_results("ok")


def delete_files_remotely():
    """
    Delete given file ids remotely
    """
    event_ids_input = demisto.args().get("event_ids")
    event_ids = [int(num) for num in event_ids_input.split(",")]
    http_request("POST", "/devices/actions/delete-remote-files", json={"ids": event_ids})
    return_results("ok")


def terminate_remote_processes():
    """
    Terminate remove processes by given event ids
    """
    event_ids_input = demisto.args().get("event_ids")
    event_ids = [int(num) for num in event_ids_input.split(",")]
    http_request("POST", "/devices/actions/terminate-remote-process", json={"ids": event_ids})
    return_results("ok")


def close_events():
    """
    Close events by event ids
    """
    event_ids_input = demisto.args().get("event_ids")
    event_ids = [int(num) for num in event_ids_input.split(",")]
    http_request("POST", "/events/actions/close", json={"ids": event_ids})
    return_results("ok")


def fetch_incidents():
    incidents: list = []
    last_id = arg_to_number(demisto.params().get("first_fetch", 0))
    max_fetch = arg_to_number(demisto.params().get("max_fetch")) or 50

    last_run = demisto.getLastRun()
    if last_run and last_run.get("last_id") is not None:
        last_id = last_run.get("last_id")

    events = http_request("GET", "/events?after_event_id=" + str(last_id))
    while events and events["events"] and len(incidents) < max_fetch:
        for event in events["events"]:
            incident = {
                "name": "DeepInstinct_" + str(event["id"]),  # name is required field, must be set
                "occurred": event["insertion_timestamp"],
                "rawJSON": json.dumps(event),
            }
            incidents.append(incident)
            if len(incidents) >= max_fetch:
                demisto.setLastRun({"last_id": event["id"]})
                break

        demisto.setLastRun({"last_id": events["last_id"]})
        events = http_request("GET", "/events?after_event_id=" + str(events["last_id"]))

    demisto.incidents(incidents)


def test_module():
    """
    Test Module
    """
    try:
        api_suffix = "/api/v1"
        base_url = demisto.params().get("base_url")
        if base_url.endswith("/"):  # remove slash in the end
            base_url = base_url[:-1]
        api_key = demisto.params().get("apikey")

        headers = {"Content-Type": "application/json", "Accept": "application/json", "Authorization": str(api_key)}
        request_url = f"{base_url}/{api_suffix}/groups/"

        r = requests.get(request_url, headers=headers)

        if r.status_code == 200:
            demisto.results("ok")

        if r.status_code == 401:
            return_error(message="Unauthorized request. Please Check your API token and try again")
    except Exception:
        return_error(message="Invalid URL, please correct and try again")


def get_suspicious_events():
    """
    Get suspicious events
    """
    first_event_id = demisto.args().get("first_event_id")
    result = http_request("GET", "/suspicious-events?after_event_id=" + str(first_event_id))
    events = {}
    if "events" in result:
        events = result["events"]
    ec = {"DeepInstinct.Suspicious-Events(val.id && val.id == obj.id)": events}

    return_results(CommandResults(readable_output=tableToMarkdown("Events", events), outputs=ec, raw_response=events))


def isolate_from_network():
    """
    Isolate given Device Id(s) from Network
    """
    device_ids_input = demisto.args().get("device_ids")
    device_ids = [int(num) for num in device_ids_input.split(",")]
    http_request("POST", "/devices/actions/isolate-from-network", json={"ids": device_ids})
    return_results("ok")


def release_from_isolation():
    """
    Release given Device Id(s) from Isolation
    """
    device_ids_input = demisto.args().get("device_ids")
    device_ids = [int(num) for num in device_ids_input.split(",")]
    http_request("POST", "/devices/actions/release-from-isolation", json={"ids": device_ids})
    return_results("ok")


def remote_file_upload():
    """
    Request Remote File Upload by Event ID
    """
    event_id = demisto.args().get("event_id")
    http_request("POST", f"/devices/actions/request-remote-file-upload/{str(event_id)}")
    return_results("ok")


def disable_device():
    """
    Disable D-client at next Check-In
    """
    device_id = demisto.args().get("device_id")
    http_request("POST", f"/devices/{str(device_id)}/actions/disable")
    return_results("ok")


def enable_device():
    """
    Enable D-Client at next Check-In
    """
    device_id = demisto.args().get("device_id")
    http_request("POST", f"/devices/{str(device_id)}/actions/enable")
    return_results("ok")


def remove_device():
    """
    Uninstall D-Client on device at next Check-In
    """
    device_id = demisto.args().get("device_id")
    http_request("POST", f"/devices/{str(device_id)}/actions/remove")
    return_results("ok")


def upload_logs():
    """
    Upload D-Client Logs at next Check-In
    """
    device_id = demisto.args().get("device_id")
    http_request("POST", f"/devices/{str(device_id)}/actions/upload-logs")
    return_results("ok")


def main():  # pragma: no cover
    try:
        # Commands
        command = demisto.command()
        if command == "test-module":
            test_module()

        elif command == "deepinstinctv3-get-device":
            get_specific_device()

        elif command == "deepinstinctv3-get-events":
            get_events()

        elif command == "deepinstinctv3-get-suspicious-events":
            get_suspicious_events()

        elif command == "deepinstinctv3-get-all-groups":
            get_all_groups()

        elif command == "deepinstinctv3-get-all-policies":
            get_all_policies()

        elif command == "deepinstinctv3-add-hash-to-deny-list":
            add_hash_to_denylist()

        elif command == "deepinstinctv3-add-hash-to-allow-list":
            add_hash_to_allowlist()

        elif command == "deepinstinctv3-remove-hash-from-deny-list":
            remove_hash_from_denylist()

        elif command == "deepinstinctv3-remove-hash-from-allow-list":
            remove_hash_from_allowlist()

        elif command == "deepinstinctv3-add-devices-to-group":
            add_devices_to_group()

        elif command == "deepinstinctv3-remove-devices-from-group":
            remove_devices_from_group()

        elif command == "deepinstinctv3-delete-files-remotely":
            delete_files_remotely()

        elif command == "deepinstinctv3-terminate-processes":
            terminate_remote_processes()

        elif command == "deepinstinctv3-close-events":
            close_events()

        elif command == "fetch-incidents":
            fetch_incidents()

        elif command == "deepinstinctv3-isolate-from-network":
            isolate_from_network()

        elif command == "deepinstinctv3-release-from-isolation":
            release_from_isolation()

        elif command == "deepinstinctv3-remote-file-upload":
            remote_file_upload()

        elif command == "deepinstinctv3-disable-device":
            disable_device()

        elif command == "deepinstinctv3-enable-device":
            enable_device()

        elif command == "deepinstinctv3-remove-device":
            remove_device()

        elif command == "deepinstinctv3-upload-logs":
            upload_logs()
    except Exception as e:
        return_error(f"Failed to execute {command} command. Error: {e}", error=traceback.format_exc())


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