Tomcat 安全管理器 - 确定 Web 应用程序需要哪些权限

发布于 2024-10-08 03:28:32 字数 413 浏览 3 评论 0原文

我有一个非常大的 Web 应用程序,我想发布有关“Tomcat 安全管理器”需要授予哪些权限才能与该 Web 应用程序正常工作的规范。

是否有任何自动方法来运行 Web 应用程序并生成所需的所有权限的列表?

我尝试通过启用 Tomcat 安全管理器并解决安全异常并添加所需的权限来手动执行此操作。然而,这样做的问题是一次只显示一个安全异常,并且在每个异常之后我需要更新 catalina.policy,重新启动 Tomcat 并移至下一个异常。

我实际上花了两个小时来做​​这件事,但没有任何接近完成的迹象。必须有更好的方法。

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.

Tomcat Security Manager

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

落墨 2024-10-15 03:28:32

我还有一个运行 Tomcat 安全管理器的大型 Web 应用程序,唯一出现权限问题的情况是 Tomcat 已部署、停止、添加了安全开关,然后重新启动时。

grant codeBase "file:${catalina.home}/path/to/my/application-" {
  permission java.net.SocketPermission "IPAddress:Port", "connect";
  permission java.security.AllPermission;

};

这正是我解决它的方法。您可以将 /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.

grant codeBase "file:${catalina.home}/path/to/my/application-" {
  permission java.net.SocketPermission "IPAddress:Port", "connect";
  permission java.security.AllPermission;

};

Is exactly how I resolved it. You can replace /path/to/my/application with something like this /webapps/mySuperAwesomeApplication

只是在用心讲痛 2024-10-15 03:28:32

我已经找到了这个问题的答案。

将以下 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

情独悲 2024-10-15 03:28:32

使用 -Djava.security.debug=fail 怎么样?

What about using -Djava.security.debug=fail ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文