N 层应用程序中的 WCF 和 Silverlight 4.0:安全服务调用(无 SSL、无消息安全、无 x.509)
我们的架构是一个简单的 N 层模型,由位于 IIS7 中的 ASP.Net 应用程序(托管在 DiscountASP 中)组成,该应用程序公开 WCF 服务上的方法。这些方法使用 EF4 与数据库通信。客户端使用的是 Silverlight 4.0。
三个要点:
身份验证和授权不是问题 - 调用 服务是匿名,我们不关心服务的身份 呼叫者。
方法中传输的数据以不敏感方式调用。
我们只是想确保任何人都无法拨打电话。
如果错误请纠正我:
消息安全性不是一个选项,因为 Silverlight 不支持它。
传输安全性(HTTPS 和 x.509/SSL 证书)也无法在 Silverlight 中完成,
因此我们采取的强制一定程度的安全性的步骤是:
密钥被硬编码到XAP。
此 dll 已被扰乱,因此无法重新设计。
密钥作为参数发送给所有服务方法 来电。
在每个方法开始时,根据 原始位于数据库中。
从服务中删除 MetaDataExchange 端点。
考虑到这个最小的设置和它的许多缺陷,最大的缺陷可能是传输不安全(HTTP),并且密钥被暴露。所以问题是:
如果恶意用户想要损害我们的系统,他需要付出多少努力才能提取密钥,找到暴露的方法并开始调用它们?
是否有其他一些 WCFcombiantion 可以在每次调用时提供基本的凭据保护(无 HTTPS 或证书)?
Our architecture is a straightforward N-Tier model, which consists of a ASP.Net Application sitting in IIS7 (hosted in DiscountASP), that exposes methods on a WCF Service. Those methods talk to the DB using EF4. The clients are in Silverlight 4.0.
Three important points:
Authentication and Authurazation are not a concern - calls to the
service are anonymous and we don't care about the identity of the
caller.The data transferred in the methods calls in not sensitive.
We just want to make sure that calls can't be made by anyone.
Correct me if In wrong:
Message security is not an option because it's not supported in Silverlight.
Transport security (HTTPS and x.509/SSL certificates) also can't be done in Silverlight
So the steps we take to enforce some level of security are:
A secret key is hard-coded into on of the dll's in the XAP.
This dll is scrambled so it can't be re-engineered.
The secret key is sent as a parameter to all the service method
calls.At the start of each method, check the secret key against the
original sitting in the DB.Remove the MetaDataExchange endpoint from the service.
Considering this minimal setup and it's many flaws, the biggest flaw is probably the fact that the transfer is not secured(HTTP), and the secret key is exposed. So the questions are:
If a malicious user want to harm our system, how much effort does he need to put in order to extract the secret key, find what methods are exposed and start calling them ?
Is there some other WCFcombiantion that can provide the basic protection of credentials on each call (No HTTPS or Certificates )?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,不,您的 合同中的安全性意味着什么变得更加清楚上一个问题。安全性由几个组成方面。
这是一个矛盾。如果您想确保您正在寻求身份验证的每个人都无法拨打电话。
另一个矛盾——你显然想要发送敏感数据。
消息安全性不是 Silverlight 的一个选项 - 如果我们谈论消息加密和签名,则确实如此,但如果您使用 HTTPS 提供安全通道 =
TransportWithMessageCredential
,您仍然可以在消息中传递用户名和密码需要付出多少努力才能找到一把秘密钥匙?
如果您想保护传输并构建安全的解决方案,则必须使用 HTTPS。 Silverlight 可以使用通过 HTTPS 公开的服务。您还可以使用用户名和密码来识别您的客户。客户将负责对用户名和密码保密,因为如果他们不这样做,您将看到谁的帐户损害了您的应用程序。
Well no it becomes much more clear what you mean by security in contract to your previous question. Security consists of several aspects.
That is a contradiction. If you want to ensure that calls cannot be made by everyone you are looking for authentication.
Another contradiction - you are obviously want to send sensitive data.
Message security is not an option for Silverlight - that is true if we are talking about message encryption and signing but you can still pass user name and password in the message if you use HTTPS for providing secure channel =
TransportWithMessageCredential
How much effort is needed to find a secret key?
If you want to secure your transmission and build secure solution you must use HTTPS. Services exposed over HTTPS can be consumed by Silverlight. You can also use user name and password to identify your clients. Clients will be responsible for keeping the user name and password in secret because if they will not you will see who's account harmed your application.