Windows-Containers icon indicating copy to clipboard operation
Windows-Containers copied to clipboard

Defender module for Powershell in mcr.microsoft.com/windows/server:ltsc2022 image

Open super-brian opened this issue 1 year ago • 1 comments

The docker image mcr.microsoft.com/windows/server:ltsc2022 is used. It looks like the powershell inside it doesn't have 'Defender' module. https://learn.microsoft.com/en-us/powershell/module/defender/?view=windowsserver2022-ps#defender This is necessary to use Add-MpPreference cmdlet to exclude some folders from scanning since it fails build step in GitHub Actions from time to time (It is self-hosted runners). How could I do Install-Module Defender? Is it possible? When I see windows server 2022 (Datacenter) or windows 11, they all have Defender folder under C:\Windows\system32\windowspowershell\v1.0

super-brian avatar Sep 18 '24 14:09 super-brian

Thank you for creating an Issue. Please note that GitHub is not an official channel for Microsoft support requests. To create an official support request, please open a ticket here. Microsoft and the GitHub Community strive to provide a best effort in answering questions and supporting Issues on GitHub.

github-actions[bot] avatar Sep 18 '24 14:09 github-actions[bot]

Hi @super-brian, you've brought up an interesting question. We didn't include Defender into full server because we expected to run it on the container host, not inside the container. There may be a way to achieve the behavior you're expecting but it would help to get some more information first. Could you explain what it is that you're trying to do? And why you're trying to block certain files?

ntrappe-msft avatar Oct 14 '24 22:10 ntrappe-msft

This issue has been open for 30 days with no updates. no assignees, please provide an update or close this issue.

🏓 Pinging this thread again.

ntrappe-msft avatar Dec 10 '24 18:12 ntrappe-msft

thanks for pinging again. So, our situation is like this: I work for Solventum (spinoff of 3M, about 1/4 of it), and we have ARC team (GitHub Actions). the windows image originally was windows core, but our app requires Audio, so ARC team made a custom image using windows server. So the windows server is used as a container. And we do CI/CD using the container via GitHub Actions. And I found that some signing process (of artifacts) fails sometimes because of the defender activity. (It is quite random) So I want to exclude some folders from defender's scanning activity. That's why I need that module. Please ask questions if still anything is not clear.

super-brian avatar Dec 10 '24 20:12 super-brian

This issue has been open for 30 days with no updates. no assignees, please provide an update or close this issue.

This issue has been open for 30 days with no updates. no assignees, please provide an update or close this issue.