Tomcat 安全管理器 - 确定 Web 应用程序需要哪些权限
我有一个非常大的 Web 应用程序,我想发布有关“Tomcat 安全管理器”需要授予哪些权限才能与该 Web 应用程序正常工作的规范。
是否有任何自动方法来运行 Web 应用程序并生成所需的所有权限的列表?
我尝试通过启用 Tomcat 安全管理器并解决安全异常并添加所需的权限来手动执行此操作。然而,这样做的问题是一次只显示一个安全异常,并且在每个异常之后我需要更新 catalina.policy,重新启动 Tomcat 并移至下一个异常。
我实际上花了两个小时来做这件事,但没有任何接近完成的迹象。必须有更好的方法。
I have a very large web application that I would like to publish specifications on what permissions are needed to be granted for "Tomcat Security Manager" to work properly with the web application.
Is there any automatic way to run the web application and generate a list of all the permissions that are needed?
I've tried doing this manually by enabling Tomcat Security Manager and working my way through the security exceptions and adding the needed permissions. The problem with this, however, is that only one security exception is shown at a time and after every exception I need to update the catalina.policy, restart Tomcat and move to the next exception.
I have literally spent 2hrs doing this without any hint of being close to complete. There has to be a better way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还有一个运行 Tomcat 安全管理器的大型 Web 应用程序,唯一出现权限问题的情况是 Tomcat 已部署、停止、添加了安全开关,然后重新启动时。
};
这正是我解决它的方法。您可以将
/path/to/my/application
替换为/webapps/mySuperAwesomeApplication
I have a large web application as well that runs the Tomcat Security Manager and the only time there were permission issues is when Tomcat was already deployed, stopped, had the security switch added, and then restarted.
};
Is exactly how I resolved it. You can replace
/path/to/my/application
with something like this/webapps/mySuperAwesomeApplication
我已经找到了这个问题的答案。
将以下 Java 选项添加到 Tomcat 将在 stderr 中为所需的每个权限创建一个条目:
-Djava.security.debug=all
我不确定为什么我之前没有找到此选项,但它记录在 Tomcat 6.0 手册中。
http://tomcat.apache.org/tomcat-6.0 -doc/security-manager-howto.html#故障排除
I have found the answer to this question.
Adding the following Java option to Tomcat will create an entry in stderr for every permission that is needed:
-Djava.security.debug=all
I'm not sure why I didn't find this before, but its documented in the Tomcat 6.0 manual.
http://tomcat.apache.org/tomcat-6.0-doc/security-manager-howto.html#Troubleshooting
使用 -Djava.security.debug=fail 怎么样?
What about using -Djava.security.debug=fail ?