.Net 与安全
我正在查看我的安全模型,想知道您如何处理项目中的安全性(访问控制)?
我对简单的 winapps 或 webapps 不感兴趣,而是对 n 层应用程序感兴趣。您如何控制访问?您是在每一层都执行此操作,还是仅在用户/服务前端执行此操作?您使用的是自制解决方案还是有任何标准方法?您是否使用 IPrincipal 和 IIdentity,在这种情况下:如何?
很多问题。回答那些适用于您的问题。非常欢迎所有答案。
I'm looking over my security model and is wondering how you handle security (access control) in your projects?
I'm not interested in simple winapps or webapps, but in n-tier applications. How do you control access? Do you do it in each tier, or only in the User/Service frontends? Are you using a homebrewed solution or are there any standard ways? Are you using IPrincipal and IIdentity, in that case: How?
Lot's of questions. Answer those that apply to you. All answers are most welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
身份验证 (authN) 和/或授权 (authZ) 应在距离资源“最近”的位置进行,这意味着您必须在每一层上执行 authN 和 authZ - 这与纵深防御策略一致。始终假设“调用者”已被泄露,因此您需要验证和验证调用者的身份。
遵循标准方法通常是个好主意,除非您确定自己开发的解决方案的稳健性,这同样适用于加密
如果完全是 Windows 环境,是的,使用 IPrincipal 和 IIdentity 是有意义的。 “如何”部分很棘手 - 只需查看 MSDN 示例,您就可以扩展 IPrincipal 和 IIdentity 以在非同质(非 Windows)网络的情况下实现您自己的 authN 和 authZ。
祝你好运!
Authentication (authN) and/or authorization (authZ) should be done "nearest" to the resources which means that you must do authN and authZ on each layer- this is inline with defense in depth strategy. Always assume the "caller" has been compromised so you need to verify and validate the identity of caller.
It is usually a good idea to follow standard ways, unless you are certain about robustness of your homegrown solution, same applies regarding encryption
If it is totally a Windows environment, yes, using IPrincipal and IIdentity makes sense. The "how" party is tricky - just look at MSDN samples, you can extend the IPrincipal and IIdentity to implement your own authN and authZ in case of non-homogeneous (non-Windows) network.
Good luck!
您可以从学习表格和表格开始ASP.net 中的 Windows 身份验证。其他一切都随之而来。
You can start by learning Forms & Windows Authentication in ASP.net. Everything else follows.