ImpSfListEndpoints

The endpoints list request enables a client application to receive a list of all managed and unmanaged endpoints, with their basic details. This list can then be externally filtered or searched by the application to identify individual endpoints that might require action. For any such endpoint, the application can obtain fuller details (see Endpoint Details Request below) and if relevant change its enrollment status.

python · Imperva Skyfence

Source

from datetime import date

import demistomock as demisto  # noqa: F401
from CommonServerPython import *  # noqa: F401


def main():
    resp = demisto.executeCommand("imp-sf-list-endpoints", demisto.args())

    if isError(resp[0]):
        demisto.results(resp)
    else:
        data = demisto.get(resp[0], "Contents.result")
        if data:
            for i in range(len(data)):
                data[i]["last_updated_date"] = date.fromtimestamp(float(data[i]["last_updated"]) / 1000.0).strftime(
                    "%Y-%m-%d %H:%M:%S"
                )

            data = data if isinstance(data, list) else [data]
            data = [{k: formatCell(row[k]) for k in row} for row in data]
            demisto.results({"ContentsFormat": formats["table"], "Type": entryTypes["note"], "Contents": data})
        else:
            demisto.results("No results.")


# python2 uses __builtin__ python3 uses builtins
if __name__ in ["__main__", "__builtin__", "builtins"]:
    main()

README

Enables a clients application to receive a list of all managed and unmanaged endpoints, with their basic details. This list can then be externally filtered or searched by the application to identify individual endpoints that might require action. For any such endpoint, the application can obtain fuller details (see Endpoint Details Request below) and if relevant change its enrollment status.

Script Data


Name Description
Script Type python
Tags Imperva Skyfence

Dependencies


This script uses the following commands and scripts.

  • imp-sf-list-endpoints

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.