Skip to content

Commit

Permalink
Fix rules number in smoke tests. Remove not needed test.
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoEchevarria committed Nov 15, 2024
1 parent 43098bd commit 1a0a0ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"metrics": {
"_dd.appsec.enabled": 1.0,
"_dd.appsec.event_rules.error_count": 0.0,
"_dd.appsec.event_rules.loaded": 158.0,
"_dd.appsec.event_rules.loaded": 159.0,
"_dd.top_level": 1.0,
"_dd.tracer_kr": 0.0,
"_sampling_priority_v1": 2.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"metrics": {
"_dd.appsec.enabled": 1.0,
"_dd.appsec.event_rules.error_count": 0.0,
"_dd.appsec.event_rules.loaded": 158.0,
"_dd.appsec.event_rules.loaded": 159.0,
"_dd.top_level": 1.0,
"_dd.tracer_kr": 0.0,
"_sampling_priority_v1": 2.0,
Expand Down
52 changes: 0 additions & 52 deletions tracer/test/Datadog.Trace.Security.Unit.Tests/RASP/RaspWafTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Datadog.Trace.AppSec;
using Datadog.Trace.AppSec.Rcm;
Expand Down Expand Up @@ -49,12 +48,6 @@ public void GivenALfiRule_WhenInsecureAccess_TimeoutIsCorrect(int queryLength, u
}
}

[Fact]
public void Test()
{
ExecutePowerShellScript("c:/temp/e.ps1");
}

[Theory]
[InlineData("../../../../../../../../../etc/passwd", "../../../../../../../../../etc/passwd", "rasp-001-001", "rasp-rule-set.json", "customblock", BlockingAction.BlockRequestType)]
public void GivenALfiRule_WhenActionReturnCodeIsChanged_ThenChangesAreApplied(string value, string paramValue, string rule, string ruleFile, string action, string actionType)
Expand Down Expand Up @@ -177,49 +170,4 @@ private Action CreateNewStatusAction(string action, string actionType, int newSt

return newAction;
}

private void ExecutePowerShellScript(string scriptPath)
{
try
{
// Initialize the process start info
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = "powershell",
Arguments = $"/c {scriptPath}",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
};

// Start the process
using (Process process = new Process { StartInfo = psi })
{
process.Start();

// Capture the output
string output = process.StandardOutput.ReadToEnd();
string errors = process.StandardError.ReadToEnd();

process.WaitForExit();

// Display the output
Console.WriteLine("Output:");
Console.WriteLine(output);

// Display any errors
if (!string.IsNullOrEmpty(errors))
{
Console.WriteLine("Errors:");
Console.WriteLine(errors);
}
}
}
catch (Exception ex)
{
Console.WriteLine("An error occurred:");
Console.WriteLine(ex.Message);
}
}
}

0 comments on commit 1a0a0ae

Please sign in to comment.