如何在tomcat 7中加密server.xml的密码

问题描述 投票:2回答:1

我想要消化/加密tomcat的server.xml密码。我在互联网上看到了几个代码,导致我在资源标签中添加工厂,如下所示。不幸的是我已经在工厂添加了Atomikos,不允许我添加第二工厂。

为了在服务器中使用加密密码,请你帮助我第二种方式。 xml或者你知道在server.xml的Resource标签中添加第二个工厂的方法吗?

如果我的问题不明确,我会举出更多例子。任何帮助表示赞赏。谢谢。

<Resource auth="Container" driverClassName="net.sourceforge.jtds.jdbc.Driver" factory="com.atomikos.tomcat.EnhancedTomcatAtomikosBeanFactory" 
maxPoolSize="50" minPoolSize="1" name="global/EFaturaDS" testQuery="SELECT 1" type="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean" 
uniqueResourceName="global/EFaturaDS" url="jdbc:jtds:sqlserver://localhost:8080/application;instance=APP08;charset=cp1254;" /> 
java tomcat digest
1个回答
3
投票

这个简短的答案是否定的:你不能在server.xml文件中加密你的密码。要获得更长的答案,您应该在passwords in configuration files上阅读Tomcat的wiki页面。

以下是回答问题“为什么配置文件中有纯文本密码?”的相关部分。

Because there is no good way to "secure" them. When Tomcat needs to connect to a database, it needs the original password. While the password could be encoded, there still needs to be a mechanism to decode it.

它继续详细解释为什么只有当你错误地说服自己提高安全性时才能实现这一点,以及为什么Tomcat开发人员不会竭尽全力帮助你做到这一点。

如果你有一个过于严厉的安全评估,你需要通过并且只需要完成它,有一个关于如何“做它”的部分,即使它没有以任何有意义的方式保护你。

© www.soinside.com 2019 - 2024. All rights reserved.