Go to the table of contents Go to the previous page Go to the next page View or print as PDF
Creating Remediation Scripts for Forcepoint DLP > Using the DiscoveryIncidentProcessing module
Using the DiscoveryIncidentProcessing module
Creating Remediation Scripts | Forcepoint DLP | v8.4.x, v8.5.x, v8.6.x
To make it easier to write remediation scripts for common use cases, Forcepoint DLP includes a helper Python module that performs some common tasks with the incident data XML file. The module:
*
*
*
Administrators can instead write their own XML parsing routines.
 
Note 
The DiscoveryIncidentProcessing module includes the routines described in the following sections.
GetFilePathFromXML(IncidentXml)
This routine reads and analyzes the incident details from the provided XML file.
Parameters
 
Returns
 
Example
>>> import DiscoveryIncidentProcessing
>>> DiscoveryIncidentProcessing.GetFilePathFromXML(r'C:\Temp\5371106770671816417.xml')
(u'NETWORK', u'\\\\10.4.228.150\\DiscoveryTarget\\TestFile.txt', True)
>>>
ProcessDicoveryIncident(IncidentXml, Command)
This routine runs a command, providing the incident file name as a parameter. This is quite useful to run commands that expect the original file as one of its parameters.
NOTE: The typo in the function name will be fixed in future versions.
Parameters
 
Returns
None
Example
>>> DiscoveryIncidentProcessing.ProcessDicoveryIncident(r'C:\Temp\5371106770671816417.xml',
u'notepad.exe filepath ')
2017-07-19 18:32:45,312 root Debug Processing C:\Temp\5371106770671816417.xml Encryption
2017-07-19 18:32:45,496 root Debug Processing \\10.4.228.150\DiscoveryTarget\TestFile.txt
2017-07-19 18:32:45,500 root Debug Command:notepad.exe \\10.4.228.150\DiscoveryTarget\TestFile.txt
2017-07-19 18:32:50,898 root Debug \\10.4.228.150\DiscoveryTarget\TestFile.txt RunCommand Successful
>>>
MoveDiscoveryIncident (IncidentXml, Location, RemoveFile, DaysKeepActiveFiles, QuarentineMsg)
This routine moves the file pointed to by the incident into a folder.
The file is moved by copying it to the destination folder, then overwriting the original file with a text message.
Alternatively, the file can be copied (rather than moved).
The file is checked for access before it is copied or moved, and it is not moved if it has been accessed recently.
Parameters
 
 
Returns
None
Example
>>> DiscoveryIncidentProcessing.MoveDiscoveryIncident(r'C:\Temp\5371106770671816417.xml',r'C:\Temp',False,0,'')
2017-07-21 16:03:16,365 root Debug Processing C:\Temp\5371106770671816417.xml move file 0
2017-07-21 16:03:16,742 root Debug Moving \\10.4.228.150\DiscoveryTarget\TestFile.txt to C:\Temp
2017-07-21 16:03:16,786 root Debug Creating C:\Temp\10.4.228.150\DiscoveryTarget
>>>

Go to the table of contents Go to the previous page Go to the next page View or print as PDF
Creating Remediation Scripts for Forcepoint DLP > Using the DiscoveryIncidentProcessing module
Copyright 2018 Forcepoint. All rights reserved.