Java SecurityManager:策略文件的良好介绍
您能否推荐一份关于标准 Java SecurityManager 的重要策略文件的详细介绍?
是否有超出 Java 网站提供范围的示例?或者也许有人描述了如何保护运行大量不同 Web 应用程序的 Tomcat?
[编辑] 我的用例是一个可以运行由三类用户编写的脚本的应用程序:1.应用程序开发人员,2.应用程序管理员和3.最终用户。
第 1 组的用户需要能够访问几乎所有资源(= 不需要特殊的 SM)。
第 2 组可以信任,但我们希望保护他们免受愚蠢错误的影响(例如调用 System.exit)。
第三组不可信。他们通常只写小脚本。
当我运行脚本时,我知道它来自哪里。策略文件对我的用例有帮助还是我需要编写自己的 SecurityManager?
Can you recommend a good introduction to non-trivial policy files for the standard Java SecurityManager?
Are there examples that go beyond what the Java website offers? Or maybe someone describes how to secure a Tomcat that runs a whole bunch of different web applications?
[EDIT] My use case is an application that can run scripts written by three types of users: 1. application developers, 2. application admins and 3. end users.
Users from group 1 need to be able to access almost any resource (= no need for a special SM).
Group #2 can be trusted but we'd like to protect them from silly mistakes (like calling System.exit
).
Group #3 can't be trusted. They usually only write small scripts.
When I run a script, I know where it comes from. Will policy files help with my use case or do I need to write my own SecurityManager?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否真正查看过 SecurityManager 上可用的方法?
Police 文件仅适用于需要一些安全约束的资源,这些安全约束可以用短文本形式表达,并且在 jvm 运行时不会更改。像下面这样的东西:
您的 q 实际上并没有说明您希望测试谁以及他们可能执行哪些操作。如果你试图保护页面(想想url),那么你可能需要考虑像Spring Security这样的东西,它允许你说这样的话:
您将需要添加自己的自定义逻辑来执行诸如只有创建 X 的用户或超级用户才能更新 X 之类的操作。
Have you actually looked at the methods available on SecurityManager ?
Police files are only good for resources that need some security constraints that can be expressed with in a short text form and wont change while the jvm is running. Stuff like the following:
Your q does not actually say who you wish test and for what actions they may perform. If you are attempgin tto protect pages (think urls) then you might want to consider something like Spring Security which allows you to say stuff like:
You will need to add your own custom logic to do stuff like only the user who created the X or a super user can update X.