ImpSfScheduleTask

Creating a schedule task that's call ImpSfRevokeUnaccessedDevices: Getting all devices data from server, if a device haven't been accessed to in over two months (and is still managed), the script will send the corresponding user a warning mail. If it's haven't been accessed to in over three months, the script will revoke the device credentials and notify the user by mail.

python · Imperva Skyfence

Source

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


def main():
    res = []
    SCHEDULE_TASK_ID_LABAL = "ScheduleTaskID"

    dArgs = demisto.args()
    dArgs["command"] = "!ImpSfRevokeUnaccessedDevices"

    res = demisto.executeCommand("scheduleEntry", dArgs)
    if isError(res[0]):
        demisto.results(res)
    else:
        taskID = demisto.get(res[0], "Contents.id")
        demisto.setContext(SCHEDULE_TASK_ID_LABAL, taskID)
        demisto.results(res)


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

README

Creates a schedule task that’s called ImpSfRevokeUnaccessedDevices.
Gets all of a device’s data from the server. If a device hasn’t been accessed in over two months (and is still managed), the script will send the corresponding user a warning mail.
If the device hasn’t been accessed in over three months, the script will revoke the device credentials and notify the user by mail.

Script Data


Name Description
Script Type python
Tags Imperva Skyfence

Dependencies


This script uses the following commands and scripts.

  • scheduleEntry
  • ImpSfRevokeUnaccessedDevices

Inputs


Argument Name Description
cron The interval between each check (in cron format).
times The number of times to execute the check.

Outputs


There are no outputs for this script.