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
Details
| ID | ImpSfScheduleTask |
|---|---|
| Language | python |
| From Version | 5.0.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Tags | Imperva Skyfence |
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.
import demistomock as demisto from ImpSfScheduleTask import main def test_schedule_task(mocker): res = [{"Type": 1, "Contents": {"id": "stam"}, "ContentsFormat": "json"}] mocker.patch.object(demisto, "executeCommand", return_value=res) demisto_results_mocker = mocker.patch.object(demisto, "results") demisto_set_context_mocker = mocker.patch.object(demisto, "setContext") main() assert demisto_results_mocker.called assert demisto_results_mocker.call_args.args[0][0].get("ContentsFormat") == "json" assert demisto_results_mocker.call_count == 1 assert demisto_set_context_mocker.called