Skip to content

Commit d075097

Browse files
authored
Revert "Add Windows Defender exception for integration tests (#4357)" (#4365)
This reverts commit 4509b55. The solution is not stable and sometimes fails. We need an alternative.
1 parent b5fdc6d commit d075097

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

pkg/testing/runner/windows.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@ type WindowsRunner struct{}
2121

2222
// Prepare the test
2323
func (WindowsRunner) Prepare(ctx context.Context, sshClient SSHClient, logger Logger, arch string, goVersion string) error {
24-
// Adding the user directory as an exception to Windows Defender, so it does not detect
25-
// temporary mage binaries as malware.
26-
//
27-
// https://github.com/elastic/elastic-agent/issues/4355
28-
// https://learn.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=windowsserver2022-ps
29-
logger.Logf("Adding exception in Windows Defender...")
30-
defenderException := `Set-MpPreference -Force -ExclusionPath $env:USERPROFILE`
31-
stdOut, errOut, err := sshRunPowershell(ctx, sshClient, defenderException)
32-
if err != nil {
33-
return fmt.Errorf("failed to add exception in Windows Defender: %w (stdout: %s, stderr: %s)", err, stdOut, errOut)
34-
}
35-
3624
// install chocolatey
3725
logger.Logf("Installing chocolatey")
3826
chocoInstall := `"[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"`
39-
stdOut, errOut, err = sshRunPowershell(ctx, sshClient, chocoInstall)
27+
stdOut, errOut, err := sshRunPowershell(ctx, sshClient, chocoInstall)
4028
if err != nil {
4129
return fmt.Errorf("failed to install chocolatey: %w (stdout: %s, stderr: %s)", err, stdOut, errOut)
4230
}

0 commit comments

Comments
 (0)