如何在Azure Web角色上禁用RC4密码

时间:2015-04-21 16:06:24

标签: azure ssl ssl-certificate azure-web-roles

我有一个托管在Microsoft Azure Web角色上的Web应用程序。 如何禁用RC4密码?

4 个答案:

答案 0 :(得分:9)

我使用Powershell脚本遇到的问题是需要修改的键包含正斜杠,而Powershell将其视为路径分隔符并且脚本失败。

解决方案是创建一个控制台应用程序并将其设置为在启动时运行:

class Program
{
    static void Main(string[] args)
    {
        string[] subKeys = new string[]
        {
            "RC4 40/128",
            "RC4 56/128",
            "RC4 64/128",
            "RC4 128/128",
        };

        RegistryKey parentKey = Registry.LocalMachine.OpenSubKey(
            @"SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers", true);

        foreach (string keyName in subKeys)
        {
            var newKey = parentKey.CreateSubKey(keyName);
            newKey.SetValue("Enabled", 0);
            newKey.Close();
        }
        parentKey.Close();
    }
}

将输出文件(在我的情况下为DisableRc4.exe)复制到webrole的根目录并设置为始终复制

创建一个包含

的文件DisableRc4.cmd
.\DisableRc4.exe
EXIT /B 0

为您的网络角色更新ServiceDefinition.csdef,如下所示

<Startup>
    <Task commandLine="DisableRc4.cmd" executionContext="elevated" taskType="simple" />
</Startup>

我使用https://www.ssllabs.com/ssltest/index.html

验证了RC4支持已被删除

在修改之前 Before startup cmd

After startup cmd

答案 1 :(得分:1)

1月发布后,PaaS Guest OS映像中禁用了SSL 3.0。有关详细信息,请参阅http://azure.microsoft.com/en-us/documentation/articles/cloud-services-guestos-update-matrix/

为什么你认为SSL 3.0仍然启用?

答案 2 :(得分:1)

上周有一篇博文更新,默认情况下会禁用RC4 cypher。 https://azure.microsoft.com/en-us/blog/azure-services-ssl-tls-cipher-suite-update-and-removal-of-rc4/

此更新应该在本月推出,如果操作系统版本配置为自动,它将自动安装在云服务上(见下图)

下一位客户操作系统:WA-GUEST-OS-4.31_201604-01
发布日期:2016年5月2日

Operation system version configuration

答案 3 :(得分:0)

我看到我们很少有人讨论过Powershell和使用forward&#34; /&#34;在脚本中,但以下解决了问题。它有效。

Alias /blah_blah/ "/data/www/blah_blah"