簡體   English   中英

在Windows Docker容器Windows Server 2016中運行時的Windows Defender /更新問題

[英]Windows Defender/Update issues when running inside Windows Docker Container Windows Server 2016

我創建了一個ASP.NET Web API,該API檢索文件作為流內容,保存到磁盤並使用Windows Defender(MpCmdRun.exe)掃描文件。 在我的計算機上本地運行API時,一切都很好。 但是,我想在雲端(Azure)中托管此API,因為我的其余應用程序都在那里。 我決定將此Web API放入docker容器中,然后將其發布到Azure。 但是,在Docker容器中運行Windows Defender時,出現以下錯誤:

正在運行:

C:\Program Files\Windows Defender>MpCmdRun.exe -Scan -ScanType 3 -File ThirdPartyNotices.txt

返回值:

Scan starting...
CmdTool: Failed with hr = 0x8050800C. Check C:\Users\ContainerAdministrator\AppData\Local\Temp\MpCmdRun.log for more information

日志文件沒有提供更多信息。

MpCmdRun: Command Line: MpCmdRun.exe  -Scan -ScanType 3 -File 
ThirdPartyNotices.txt
Start Time: ?Sun ?Dec ?03 ?2017 23:53:16

Starting RunCommandScan.
INFO: ScheduleJob is not set. Skipping signature update.
Scanning path as file: ThirdPartyNotices.txt.
Start: MpScan(MP_FEATURE_SUPPORTED, dwOptions=16385, path 
ThirdPartyNotices.txt, DisableRemediation = 0, BootSectorScan
= 0, Timeout in days = 1)
MpScan() started
Warning: MpScan() encounter errror. hr = 0x8050800c
MpScan() was completed
ERROR: MpScan(dwOptions=16385) Completion Failed 8050800C
MpCmdRun: End Time: ?Sun ?Dec ?03 ?2017 23:53:16

Dockerfile:

FROM microsoft/aspnet

COPY ./bin/Release/PublishOutput/ /inetpub/wwwroot

#So I can write sent file to disk in container
RUN powershell New-Item c:\inetpub\wwwroot\temp_files -type directory
RUN icacls c:\inetpub\wwwroot\temp_files /grant IIS_IUSRS:F

#Without this Windows Update is disabled
RUN powershell Set-Service wuauserv -StartupType "Automatic"

#Without this Windows defender is disabled
RUN reg add "HKLM\SYSTEM\CurrentControlSet\services\WinDefend" /v Start /t REG_DWORD /d 2 /f

#Tried running these, as well as Update-MpSignature in powershell, to no success.
#RUN ["c:\\Program Files\\Windows Defender\\MpCmdRun.exe", "-RemoveDefinitions", "-All"]
#RUN ["c:\\Program Files\\Windows Defender\\MpCmdRun.exe", "-SignatureUpdate"]

在Docker容器中時(docker exec -it測試powershell)。 在powershell中運行Get-MpComputerStatus返回以下內容:

AMEngineVersion                 : 1.1.14306.0
AMProductVersion                : 4.10.14393.1794
AMServiceEnabled                : True
AMServiceVersion                : 4.10.14393.1794
AntispywareEnabled              : True
AntispywareSignatureAge         : 0
AntispywareSignatureLastUpdated : 12/3/2017 8:15:49 PM
AntispywareSignatureVersion     : 1.257.1327.0
AntivirusEnabled                : True
AntivirusSignatureAge           : 0
AntivirusSignatureLastUpdated   : 12/3/2017 8:15:51 PM
AntivirusSignatureVersion       : 1.257.1327.0
BehaviorMonitorEnabled          : False
ComputerState                   : 0
FullScanAge                     : 4294967295
FullScanEndTime                 :
FullScanStartTime               :
IoavProtectionEnabled           : False
LastFullScanSource              : 0
LastQuickScanSource             : 0
NISEnabled                      : False
NISEngineVersion                : 0.0.0.0
NISSignatureAge                 : 4294967295
NISSignatureLastUpdated         :
NISSignatureVersion             : 0.0.0.0
OnAccessProtectionEnabled       : False
QuickScanAge                    : 4294967295
QuickScanEndTime                :
QuickScanStartTime              :
RealTimeProtectionEnabled       : False
RealTimeScanDirection           : 0
PSComputerName                  :

在這里,我擔心NIS設置為0.0.0.0。

嘗試使用Update-MpSignature更新Windows Defender簽名時,返回:

Update-MpSignature : Virus and spyware definitions update was completed with 
errors.
At line:1 char:1
+ Update-MpSignature
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: 
(MSFT_MpSignature:ROOT\Microsoft\...SFT_MpSignature) [Update-MpSignature],
CimException
+ FullyQualifiedErrorId : HRESULT 0x80070643,Update-MpSignature

我實際上不能將RDP放入docker容器中(據我所知,使用Microsoft / aspnet映像是不可能的)。 這意味着我必須在命令提示符/ powershell中執行所有操作,而我對此還很陌生。

這可能不是足夠的信息,甚至是跟蹤此問題的正確信息,但我一直堅持很長時間。 如果有人可以給我一些指示,以尋找想要的東西/如何繼續查找/修復這些問題,那真是太棒了。 先感謝您!

以管理員身份運行以完全禁用Windows Defender

Set-MpPreference -DisableRealtimeMonitoring $true

Windows Server 2016默認情況下使用進程隔離(不是HyperV),並且防病毒軟件已經掃描了未標記磁盤和卷上的文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM