如何清理用户上传的工作流程?
我有一个多租户应用程序,可以根据需要运行任意工作流程。
我计划使用工作流设计器来创建这些工作流,但即使我限制工具箱中的活动,也不能阻止恶意用户编辑自己的 XAML 文件,执行我不希望他们进行的活动(特别是调用.NET 框架)
对于给定的工作流程,我如何验证正在使用的唯一操作是我批准的操作? XPath 查询是唯一的方法吗?或者 WF 中是否有功能可以验证这一点?
I have a multi-tenant application that may run arbitrary workflows as needed.
I plan on using the workflow designer to create these workflows, but even if I limit the Activities in the Toolbox, that doesn't prevent a malicious user from editing his own XAML file, doing activities I'd rather them not (specifically calling out to the .NET framework)
For a given workflow, how do I verify that the only actions being used are those I approve of? Is an XPath query the only way, or is there a feature within WF that will validate this?
If you need a visual introduction to what I'm looking for here is a sample project and video referring to it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只需将工作流程加载到沙盒AppDomain中。您可以使用 SecurityManager 的 GetStandardSandbox 静态方法来设置起来相对容易(而且安全)。
当然,我还没有真正完成此操作,但我确实正在考虑将其中一些添加到我当前的 WF 代码中(该代码确实使用 AppDomains 将工作流的执行与我的应用程序隔离)。
I'd just load the workflows in a sandboxed AppDomain. You can Use the GetStandardSandbox static method of the SecurityManager to set this up relatively easily (and safely).
Of course, I haven't actually done this yet, but I'm definitely thinking about adding some of this to my current WF code (which does use AppDomains to isolate execution of workflows from my application).
您所能做的就是将 XAML 加载为 XML 并检查其中的内容。并确保检查输入的任何 VB 表达式,因为用户也可以在其中放入有趣的内容。
All you can do is load the XAML as XML and check what is in there. And make sure to check any VB expression entered as users can put interesting things in there as well.