wcf - 具有 WCF Web 角色并通过 web.config 限制 IP 的 Windows Azure

标签 wcf security azure config

我尝试仅将某些 IP 地址限制为我的 Azure 托管 WCF 服务。我已遵循以下网站上列出的两条说明:

http://msdn.microsoft.com/en-us/library/windowsazure/jj154098.aspx

http://blog.elastacloud.com/2011/04/06/restricting-access-by-ip-in-azure-web-role-v1-4/

但我仍然可以从未列出的地址访问该服务。我有什么遗漏的吗?

这是 cmd 文件:

@echo off

@echo Installing “IPv4 Address and Domain Restrictions” feature
%windir%\System32\ServerManagerCmd.exe -install Web-IP-Security

@echo Unlocking configuration for “IPv4 Address and Domain Restrictions” feature
%windir%\system32\inetsrv\AppCmd.exe unlock config -section:system.webServer/security/ipSecurity

以及 web.config 部分:

<system.webServer>
   <security>
   <!-- IP addresses are denied access -->
    <ipSecurity allowUnlisted="false">
        <!--The following IP addresses are granted access -->
        <clear />
        <add allowed="true" ipAddress="x.x.x.x" />
    </ipSecurity>
   </security>
  </system.webServer>

最佳答案

感谢 Rick Rainey,我发现我可以通过 RDP 进入 Web 角色并手动运行脚本。我发现脚本的第一部分失败了,因为应用程序在服务器 2012 上运行。我将其更改为:

powershell -ExecutionPolicy Unrestricted -命令“Install-WindowsFeature Web-IP-Security”

现在一切都按预期进行......

关于wcf - 具有 WCF Web 角色并通过 web.config 限制 IP 的 Windows Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19573342/

相关文章:

iphone - 来自 iOS 应用程序的网络钓鱼 : Possible?

linux - 有没有办法可以在 linux 上查看真实进程 cmdline?

wcf - WCF 服务中莫名其妙的程序集负载 (IIS 7)

c# - WCF 循环引用序列化和堆栈溢出错误

wcf - 如何识别调用您的操作的 WCF 端点?

c - 在终端上解密 openssl 库生成的密码,反之亦然

sql - T-SQL 使用来自字段表中字符串的整个 WHERE 条件

azure - 遵循 Windows Azure 文档时,IP 限制不起作用

azure - 用于生成 Azure 函数成功和失败计数线图的 Kusto 查询

wcf - WCF服务不支持重载方法?