[英]Security issue when using the same keystore for trust store and server store?
Is there a security issue when using the same keystore for the trust store (certificates used for authenticating clients) and server store (private keys used by the server)? 将相同的密钥库用于信任存储区(用于验证客户端的证书)和服务器存储区(服务器使用的私钥)时是否存在安全问题? I ask this because I know that there is a recommendation to have two separate files (and I wonder why this is). 我之所以这样问,是因为我知道建议您有两个单独的文件(我想知道为什么会这样)。
I know that there is a recommendation to have two separate files (for the trust store and the server store) 我知道建议您有两个单独的文件(用于信任存储和服务器存储)
The reason for such a recommendation is that you typically store only public keys and the related certificates of trusted CAs in the truststore, while the keystore is meant to store private-keys and the associated public keys (along with the related certificates). 提出此建议的原因是,通常您仅将公共密钥和受信任CA的相关证书存储在信任库中,而密钥库用于存储私钥和相关的公共密钥(以及相关证书)。
When you start managing both as a single file, it is quite possible for any agent (a user or even application code) that has knowledge of the truststore password to read and modify the private keys of the keystore as well. 当您开始将这两个文件作为一个文件进行管理时,知道信任库密码的任何代理(用户甚至应用程序代码)都很有可能也可以读取和修改密钥库的私钥。 This is not what you want, for private keys ought to be private by nature, and known only to a single entity (the one that owns the key). 这不是您想要的,因为私钥本质上应该是私有的,并且仅对单个实体(拥有密钥的实体)知道。
Likewise, it is also possible for an agent to modify the truststore through the knowledge of the keystore password, to add certificates to the truststore. 同样,代理也可以通过了解密钥库密码来修改信任库,以将证书添加到信任库。 On it's own, this may appear benign, but usually multiple clients can use the same truststore (like the cacerts
file of the JRE), resulting in the scenario where one agent can poison the trust relationship (by adding the certificate of a malicious CA into the truststore) between a client and a server. 单独看似良性,但通常多个客户端可以使用相同的信任库(例如JRE的cacerts
文件),从而导致一种情况可能会毒化信任关系(通过将恶意CA的证书添加到其中)客户端和服务器之间的信任库)。
In reality, the recommendation is more of a defense-in-depth practice, unless your agents aren't trustworthy (in which case you ought to be adopting several other practices). 实际上,除非您的代理人不值得信任(否则您应该采用其他几种做法),否则建议通常是纵深防御做法。
There is one security concern, but I think most of the reason for the recommendation is a logical separation of responsibilities. 有一个安全问题,但我认为建议的大多数原因是逻辑上的责任分离。 From Keystores and Truststores : 从密钥库和信任库 :
Using two different files instead of a single keystore file provides for a cleaner separation of the logical distinction between your own certificates (and corresponding private keys) and others' certificates. 使用两个不同的文件而不是单个密钥库文件可以使您自己的证书(和相应的私钥)与其他人的证书之间的逻辑区别更加清晰地分开。 You could provide more protection for your private keys if you store them in a keystore with restricted access, while providing the trusted certificates in a more publicly accessible keystore if needed. 如果将私钥存储在访问受限的密钥库中,则可以为私钥提供更多保护,而如果需要,则可以在可公开访问的密钥库中提供可信证书。
The key security point here is that by separating the trusted (public) certificates from your own certificates that contain your private keys, you can use whatever level of restriction you deem necessary to protect your own private keys, while keeping trusted certificates public. 此处的关键安全点是,通过将受信任的(公共)证书与包含私钥的自己的证书分开,您可以使用您认为必要的任何级别的限制来保护自己的私钥,同时使受信任的证书保持公开。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.