手動調整Windows的TLS設定

手動調整Windows的TLS設定

Windows-web-servers-should-be-configured-to-use-secure-communication-protocols

在Azure VM上有個高風險警告,原本以為用之前「停用不安全的TLS版本」的IISCrypto工具處理即可,以下借用黑大的PowerShell取得IISCrypto套用的結果。

PS D:\> Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers'


    Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers


Name                           Property
----                           --------
AES 128/128                    Enabled : 4294967295
AES 256/256                    Enabled : 4294967295
DES 56/56                      Enabled : 0
NULL                           Enabled : 0
RC2 128/128                    Enabled : 0
RC2 40/128                     Enabled : 0
RC2 56/128                     Enabled : 0
RC4 128/128                    Enabled : 0
RC4 40/128                     Enabled : 0
RC4 56/128                     Enabled : 0
RC4 64/128                     Enabled : 0
Triple DES 168                 Enabled : 4294967295


PS D:\> Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\' -Recurse |
>> ForEach-Object {
>>     $p = Get-ItemProperty -Path $_.PSPath
>>     if ('Enabled' -in $p.PSObject.Properties.Name) {
>>         $_.PSPath.Split(':')[2]
>>         "Enabled = $($p.Enabled)"
>>     }
>> }
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Client
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Server
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Client
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Server
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server
Enabled = 0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client
Enabled = 4294967295
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server
Enabled = 4294967295
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client
Enabled = 4294967295
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server
Enabled = 4294967295
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client
Enabled = 4294967295
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server
Enabled = 4294967295

但沒想到前後調了幾天都沒讓它Pass,最後全部自己手動調整機碼才完成。(時間有點長是因為,調整完要等Azure去重新掃描,好像12小時才一次,因此一天調一次。)

TLS調整這部分的資訊蠻零散,修改前記得相關主題裡的注意事項要看一下,不然修改後出事,我可不負責哦。

PowerShell與UTF8(with BOM)的迷團解答

PowerShell與UTF8(with BOM)的迷團解答

前一篇,只是因為在Write-Debug寫了幾個中文,浪費了大量的時間查找問題。後來黑大在FB留言一句:「好奇 .ps1 存成含 BOM 的 UTF8 編碼可避開錯誤嗎?」不試不知道,原來是我書讀的太少。將原本.ps1的UTF8改以UTF with BOM儲存後,在英文版Windows Server匯入含中文.ps1的Import-Module立馬成功了!

Import-Module之「Missing argument in parameter list」鬼打牆筆記

Import-Module之「Missing argument in parameter list」鬼打牆筆記

故事是這樣的,我在PowerShell Core環境下開發了一個PowerShell Module。但不是每一台Windows Server都有PowerShell Core的執行環境,當部屬至Windows Server的PowerShell時才發現某些主機怪怪的。

此Module在我Windows 11開發機裡的PowerShell或PowerShell Core都有先測試過都,都能正常執行。

Import Module Success
Import Module Fail

兩台不同的Windows Server 2019主機上,PowerShell的Import-Module一台正常,一台不正常。而且在特定同事的開發機上也有類似的情況,也會出現匯入錯誤的情況。

停用不安全的TLS版本

如何在Windows用tar格式進行多檔案打包

如何在Windows用tar格式進行多檔案打包

最近購入新的個人工作機(Surface Pro 9),在轉移資料與應用程式方面採用了幾個不同的方式,覺得又發現一條的路徑,以下整理一些採用的作法給大家參考看看。

資料轉移方面,Windows+OneDrive是最佳組合。新主機登入完Microsoft帳號之後,等待一些同步時間之後,資料就同步完畢,完全無腦,這就不再多說。