最近、SSL 3.0の脆弱性「POODLE」の情報が公開されました。
- Microsoft Security Advisory 3009008: Vulnerability in SSL 3.0 Could Allow Information Disclosure (マイクロソフト セキュリティ アドバイザリ 3009008: SSL 3.0 の脆弱性により、情報漏えいが起こる) (2014/10/14)
Azure Websites、Cloud Services、Virtual Machinesでは、既定でSSL 3.0が有効化されていますが、SSL 3.0を無効化し、TLSのみを使うように構成できます。
Azure WebsitesでのSSL 3.0の無効化
方法1: 「Disable SSLv3」サイト拡張機能の使用
Azureプレビュー ポータル、または、自分のWebサイトのSCMサイト (https://.scm.azurewebsites.net/) で、自分のWebサイトに「Disable SSLv3」サイト拡張機能をインストール。
- Azure Blog > Azure Web Sites Extensions (Azure Web Sites の Site Extensions)
- GitHub > davidebbo > DisableSSLv3SiteExtension
方法2: web.configでのURLRewriteルールの構成
Azure Websitesフロント エンド (ロード バランサー) は、SSL 3.0使用時にリクエスト ヘッダー X-Forwarded-SSLv30: 1を送信するので、web.configでURLRewriteルールを定義することで、SSL 3.0使用時に403エラー レスポンスを返すなどの対策が可能。
<configuration> <system.webServer> <rewrite> <rules> <rule name="Block SSL3.0" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_X_FORWARDED_SSL30}" pattern="1" /> </conditions> <action type="CustomResponse" statusCode="403" subStatusCode="900" statusReason="Forbidden" statusDescription="SSLv3 connections are forbidden by this site" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Azure Cloud ServicesでのSSL 3.0の無効化
手順1: スタートアップ スクリプトの作成と、ロール構成でのスクリプトの配置
DisableSslv3.cmd ファイルを作成:
PowerShell -ExecutionPolicy Unrestricted .DisableSslv3.ps1 >> “%TEMP%StartupLog.txt” 2>&1 EXIT /B 0
DisableSslv3.ps1 ファイルを作成:
$regkeys = @( "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Client", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.2Server", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0Client", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 2.0Server", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 3.0", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 3.0Client", "HKLM:SYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsSSL 3.0Server", "HKLM:SOFTWAREPoliciesMicrosoftCryptographyConfigurationSSL0010002" ) $cipherorder = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256," $cipherorder += "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256," $cipherorder += "TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256," $cipherorder += "TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA," $cipherorder += "TLS_RSA_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_RC4_128_MD5" # If any settings are changed, this will change to $True and the server will reboot $reboot = $False Function Set-CryptoSetting { param ( $keyindex, $value, $valuedata, $valuetype, $restart ) # Check for existence of registry key, and create if it does not exist If (!(Test-Path -Path $regkeys[$keyindex])) { New-Item $regkeys[$keyindex] | Out-Null } # Get data of registry value, or null if it does not exist $val = (Get-ItemProperty -Path $regkeys[$keyindex] -Name $value -ErrorAction SilentlyContinue).$value If ($val -eq $null) { # Value does not exist - create and set to desired value New-ItemProperty -Path $regkeys[$keyindex] -Name $value -Value $valuedata -PropertyType $valuetype | Out-Null $restart = $True } Else { # Value does exist - if not equal to desired value, change it If ($val -ne $valuedata) { Set-ItemProperty -Path $regkeys[$keyindex] -Name $value -Value $valuedata $restart = $True } } return $restart } # Check for existence of parent registry keys (SSL 2.0 and SSL 3.0), and create if they do not exist For ($i = 9; $i -le 12; $i = $i + 3) { If (!(Test-Path -Path $regkeys[$i])) { New-Item $regkeys[$i] | Out-Null } } # Ensure SSL 2.0 disabled for client $reboot = Set-CryptoSetting 10 DisabledByDefault 1 DWord $reboot # Ensure SSL 2.0 disabled for server $reboot = Set-CryptoSetting 11 Enabled 0 DWord $reboot # Ensure SSL 3.0 disabled for client $reboot = Set-CryptoSetting 13 DisabledByDefault 1 DWord $reboot # Ensure SSL 3.0 disabled for server $reboot = Set-CryptoSetting 14 Enabled 0 DWord $reboot # If any settings were changed, reboot If ($reboot) { Write-Host "Rebooting now..." shutdown.exe /r /t 5 /c "Crypto settings changed" /f /d p:2:4 }
手順2: ロールのサービス定義 (csdef) へのスタートアップ タスクの追加
<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"> <WebRole name="WebRole1"> <Startup> <Task commandLine="DisableSslv3.cmd" executionContext="elevated" taskType="simple"> </Task> </Startup> </WebRole> <ServiceDefinition>
- Run Startup Tasks in Azure (Azure でスタートアップ タスクを実行する)
Azure Virtual MachinesでのSSL 3.0の無効化
前述のAzure Cloud Services向けのPowerShellスクリプトは、Windows VMでも有効。Linux VMについては、ディストリビューション ベンダーのガイドを参照。
関連情報
- Azure Blog > How to Disable SSL 3.0 in Azure Websites, Roles, and Virtual Machines (2014/10/19)
- Fabric Controller > The POODLE SSL vulnerability: disabling SSL v3 in your Azure Virtual Machines and Web Roles (2014/10/15)
- 英語 – http://fabriccontroller.net/blog/posts/the-poodle-ssl-vulnerability-disabling-ssl-v3-in-your-azure-virtual-machines-and-web-roles/
- 日本語 – http://www.microsofttranslator.com/bv.aspx?from=en&to=ja&a=http%3A%2F%2Ffabriccontroller.net%2Fblog%2Fposts%2Fthe-poodle-ssl-vulnerability-disabling-ssl-v3-in-your-azure-virtual-machines-and-web-roles%2F