Skip to content

Commit

Permalink
Update FullSecurityScanShouldPass.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Jan 22, 2025
1 parent 75a09f1 commit a0bdb28
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,10 @@ public Task FullSecurityScanShouldPass() =>
},
maxActiveScanDurationInMinutes: 5,
maxRuleDurationInMinutes: 1),
changeConfiguration: configuration => configuration.AssertAppLogsAsync = async webApplicationInstance =>
{
var logsWithoutUnwantedExceptionMessages = (await webApplicationInstance.GetLogOutputAsync())
.SplitByNewLines()
.Where(message =>
!message.ContainsOrdinalIgnoreCase("System.IO.DirectoryNotFoundException: Could not find a part of the path") &&
!message.ContainsOrdinalIgnoreCase(
"System.IO.IOException: The filename, directory name, or volume label syntax is incorrect") &&
!message.ContainsOrdinalIgnoreCase("System.InvalidOperationException: This action intentionally causes an exception!"));

logsWithoutUnwantedExceptionMessages.ShouldNotContain(item => item.Contains("|ERROR|"));
});
changeConfiguration: configuration => configuration.UseAssertAppLogsForSecurityScan(
"System.IO.DirectoryNotFoundException: Could not find a part of the path",
"System.IO.IOException: The filename, directory name, or volume label syntax is incorrect",
"System.InvalidOperationException: This action intentionally causes an exception!"));

private static void FalsePositive(
SecurityScanConfiguration configuration,
Expand Down

0 comments on commit a0bdb28

Please sign in to comment.