Windows關閉停用 SSL 2.0 , SSL 3.0 和 TLS 1.0, 1.1,並強制使用 TLS 1.2
有一台windows server 2012 R2 主機, 被弱點掃描軟體Nessus,掃出
SSL Version 2 and 3 Protocol Detection "The remote service encrypts traffic using a protocol with known weaknesses." "The remote service accepts connections encrypted using SSL 2.0 and/or
SSL 3.0. These versions of SSL are affected by several cryptographic flaws, including:
- An insecure padding scheme with CBC ciphers.
- Insecure session renegotiation and resumption schemes.
An attacker can exploit these flaws to conduct man-in-the-middle attacks or to decrypt communications between the affected service and clients.
Although SSL/TLS has a secure means for choosing the highest supported version of the protocol (so that these versions will be used only if the client or server support nothing better), many web browsers
implement this in an unsafe way that allows an attacker to downgrade a connection (such as in POODLE). Therefore, it is recommended that these protocols be disabled entirely.
NIST has determined that SSL 3.0 is no longer acceptable for secure communications. As of the date of enforcement found in PCI DSS v3.1, any version of SSL will not meet the PCI SSC's definition of 'strong
cryptography'." "Consult the application's documentation to disable SSL 2.0 and 3.0.
Use TLS 1.2 (with approved cipher suites) or higher instead.
處理方式:
應該關閉 SSL 2.0 與 SSL 3.0,並強制使用 TLS 1.2。
通常弱掃做到這點了,都會順便關掉TLS 1.0和TLS 1.1,避免多花一次工。
這項弱點(主要是為了防範 POODLE 攻擊)在現代安全標準中是非常基礎且必要的修復。SSL 2.0/3.0 早已被證明存在嚴重的加密缺陷,攻擊者可以利用這些漏洞進行中間人攻擊 (MITM) 並解密通訊內容。
由於 Windows Server 2012 R2 的預設設定較舊,通常需要手動調整註冊表或使用工具來符合目前的 Nessus 掃描要求。
1. 修復步驟:停用舊協定並啟用 TLS 1.2
在 Windows Server 2012 R2 中,所有的協定控制都在以下註冊表路徑:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols
A. 停用 SSL 2.0 , SSL 3.0 和 TLS 1.0, 1.1。
你需要針對 SSL 2.0 , SSL 3.0 和 TLS 1.0, 1.1分別建立 Client 與 Server 子機碼,並將其停用:
建立機碼:Protocols\SSL 3.0\Server
在右側建立 DWORD (32-bit) 值:
Enabled = 0
DisabledByDefault = 1
對以下種類重複上述動作。
- SSL 3.0 client 和 Server
- SSL 2.0 client 和 Server
- TLS 1.0 client 和 Server
- TLS 1.1 client 和 Server
B. 啟用 TLS 1.2
雖然 2012 R2 支援 TLS 1.2,但有時並未預設開啟。請確保以下路徑已正確設定:
建立機碼:Protocols\TLS 1.2\Server
在右側建立 DWORD (32-bit) 值:
Enabled = 1
DisabledByDefault = 0
下圖範例參考為Windows Server 2022:
(Windows Server 2012 不支援TLS 1.3)
重要補充1:.NET Framework 的相容性 (隱藏陷阱)
在 Windows Server 2012 R2 上,即便你關閉了系統層級的 SSL 3.0,有些執行在 .NET Framework (3.5 或 4.x) 上的應用程式可能還是會嘗試使用舊協定。為了確保 .NET 應用程式也使用 TLS 1.2,建議增加以下註冊表項:
重要補充2:就算是關掉了以下3DES,DES,SSL 2.0,SSL 3.0,TLS 1.0,TLS 1.1的windows 安全通道。僅留下TLS 1.2可通。但弱掃,還是有找出這些弱點的結果。
原因是這些主機的AP用的不是走windows的安全通道。因為早期發展SSL/TLS不是很成熟,各廠商通常自幹或幾乎各玩各的。早期 Schannel 的問題很多,Windows 很晚才成熟。更重要的是:企業開始受不了「每套軟體自己管 TLS」。
| 時代 | 狀況 |
|---|
| 2003 / 2008 | 幾乎各玩各的 |
| 2012 / 2012 R2 | 過渡期 |
| 2016 | 開始大量整合 Schannel |
| 2019 / 2022 | 已經很普遍 |
資安稽核也開始逼廠商
尤其:
PCI-DSS
HIPAA
ISO 27001
金融監管
開始要求:
TLS policy centralized
OS-level hardening
統一 Cipher Policy
於是:
廠商開始發現:
「跟著 OS TLS Policy 走,比較不會被客戶罵。」
這是人類文明少數因為懶惰而進步的例子。
重要補充3:若因為弱掃還是被找出弱點?
可以查看弱掃結果看port number是多少,是什麼程式在用的。舉例 port 6701 , 9999
PowerShell
netstat -ano | findstr :9999