efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Windows Defender scans (downloaded) EF Bundle as a Trojan

Open bartlannoeye opened this issue 11 months ago • 1 comments

File a bug

I was troubleshooting why EF Bundle did not deploy in one of my teams's Azure DevOps pipelines and thought to quickly download the build artifact to see if it was a Azure DevOps issue or a bundle file issue.

After downloading (both as exe and extracting as zipped root folder), I got a notification from Windows Defender.

image

Since building local does work, this issue is certainly not critical but I find it very interesting and worth some research.

Include your code

Build agent image:

pool:
  vmImage: 'windows-latest'

Bundle task in build pipeline

  - task: DotNetCoreCLI@2
    displayName: 'Install Dotnet EF Tool'
    inputs:
      command: custom
      custom: "tool"
      arguments: "install --global dotnet-ef"

  - task: DotNetCoreCLI@2
    displayName: EFBundle
    inputs:
      command: custom
      custom: 'ef '
      arguments: 'migrations bundle --self-contained --project "src/Infrastructure/Infrastructure.csproj" --startup-project "src/Api/Api.csproj" -r win-x64 -o $(Build.ArtifactStagingDirectory)/SQL/Bundle.exe --verbose'

bartlannoeye avatar Mar 12 '24 10:03 bartlannoeye

Experiencing this as well right now.

Running dotnet ef migrations bundle on my local Win11 machine triggers Windows Defender.

image

I'm using:

  • .NET 8 SDK: 8.0.204
  • EF CLI Tools: 8.0.4

Any mitigation advice would be greatly appreciated 😀

william-liebenberg avatar Apr 26 '24 09:04 william-liebenberg

The workaround is to add the output folder to exclusion list for Windows Defender

AndriySvyryd avatar Aug 08 '24 17:08 AndriySvyryd