Skip to content

Commit

Permalink
update notification/logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vigi86 committed May 19, 2023
1 parent e2f723c commit 97be84a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/DLP_Win/DLP_Win/ScanEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private static void SearchFiles(frmMain frmMain, DirectoryInfo directory, string
{
FileSecurity fileSecurity = file.GetAccessControl();
IdentityReference author = fileSecurity.GetOwner(typeof(NTAccount));
frmMain.LoggerBox = $"{Environment.NewLine}Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
frmMain.LoggerBox = $"{Environment.NewLine}{DateTime.Now} - Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
$"{Environment.NewLine}{file.FullName}" +
$"{Environment.NewLine}Autor: {author}{Environment.NewLine}";
//Logger(loggerBox, $"{Environment.NewLine}Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:{Environment.NewLine}{file.FullName}{Environment.NewLine}");
Expand All @@ -288,11 +288,11 @@ private static void SearchFiles(frmMain frmMain, DirectoryInfo directory, string
{
FileSecurity fileSecurity = file.GetAccessControl();
IdentityReference author = fileSecurity.GetOwner(typeof(NTAccount));
frmMain.LoggerBox = $"{Environment.NewLine}Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
frmMain.LoggerBox = $"{Environment.NewLine}{DateTime.Now} - Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
$"{Environment.NewLine}{file.FullName}" +
$"{Environment.NewLine}Autor: {author}{Environment.NewLine}";
Toast.ToastMessage("Datei gefunden",
$"Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
Toast.ToastMessage("Datei gefunden",
$"{DateTime.Now} - Passende Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
$"{Environment.NewLine}{file.FullName}" +
$"{Environment.NewLine}Autor: {author}{Environment.NewLine}");
}
Expand Down Expand Up @@ -330,7 +330,10 @@ private static void SearchFiles(frmMain frmMain, DirectoryInfo directory, string
File.Move(file.FullName, Path.Combine(QUARANTINE_FOLDER, file.Name));
string text = $"Verdächtige Datei {file.Name} von Autor {author} in Quarantäne verschoben";
Toast.ToastMessage("Quarantäne", text);
frmMain.LoggerBox = $"{Environment.NewLine}Verdächtige Datei {file.FullName} von Autor {author} in Quarantäne verschoben{Environment.NewLine}";
frmMain.LoggerBox = $"{Environment.NewLine}{DateTime.Now} - Verdächtige Datei zum Ruleset \"{ruleset.If} {ruleset.SelectionType} {ruleset.Condition}\" gefunden:" +
$"{Environment.NewLine}{file.FullName} in Quarantäne verschoben" +
$"{Environment.NewLine}Autor: {author}{Environment.NewLine}";

//Logger(loggerBox, $"{Environment.NewLine}{file.FullName} wurde in die Quarantäne verschoben!{Environment.NewLine}");
}
}
Expand Down

0 comments on commit 97be84a

Please sign in to comment.