简体   繁体   English

SSL客户端证书验证优化

[英]SSL Client Cert Verification optimisation

We currently have a group of web-services exposing interfaces to a variety of different client types and roles. 我们目前有一组Web服务公开了各种不同客户端类型和角色的接口。

Background: 背景:

  • Authentication is handled through SSL Client Certificate Verification. 身份验证通过SSL客户端证书验证进行处理。 This is currently being done in web-service code (not by the HTTP server). 目前这是在Web服务代码中完成的(而不是由HTTP服务器完成)。 We don't want to use any scheme less secure than this. 我们不想使用任何不如此安全的方案。 This post is not talking about Authorisation, only Authentication. 这篇文章不是关于授权,只是认证。
  • The web-services talk both SOAP and REST(JSON) and I'm definitely not interested in starting a discussion about the merits of either approach. Web服务谈论SOAP和REST(JSON),我绝对不想开始讨论任何一种方法的优点。
  • All operations exposed via the web-services are stateless. 通过Web服务公开的所有操作都是无状态的。

My problem is that verifying the client certificate on each requests is very heavyweight, and easily dominates CPU time on the application server. 我的问题是,在每个请求上验证客户端证书是非常重要的,并且很容易控制应用程序服务器上的CPU时间。 I've already tried seperating the Authentication & Application portions onto different physical servers to reduce load, but that doesn't improve dispatch speed overall - the request still takes a constant time to authenticate, no matter where that is done. 我已经尝试将身份验证和应用程序部分分离到不同的物理服务器上以减少负载,但这并不能提高整体的调度速度 - 无论在何处完成,请求仍需要一段时间进行身份验证。

I'd like to try limiting the number of authentications by generating an HTTP cookie (with an associated server-side session) after successful client certificate verification, which when supplied by the client will cause client certificate verification to be skipped (though still talking over SSL). 我想尝试通过在成功进行客户端证书验证后生成HTTP cookie(带有关联的服务器端会话)来限制身份验证的数量,这在客户端提供时将导致客户端证书验证被跳过(尽管仍然在讨论SSL)。 I'd also like to time-limit the sessions, and make the processes as transparent as possible from a client perspective. 我还想对会话进行时间限制,并从客户的角度使流程尽可能透明。

My questions: 我的问题:

  1. Is this still as secure? 这仍然是安全的吗? (and how can we optimise for security and pragmatism?) (我们如何优化安全性和实用性?)
  2. Are there free implementations of this scheme? 这个方案有免费实施吗? (I'm aware of the SiteMinder product by CA) (我知道CA的SiteMinder产品)
  3. Given the above, should we continue to do Authentication in-application, or move to in-server ? 鉴于上述情况,我们是否应该继续在应用程序中进行身份验证,或者转移到服务器中?

generating an HTTP cookie (with an associated server-side session) after successful client certificate verification, which when supplied by the client will cause client certificate verification to be skipped 在成功进行客户端证书验证后生成HTTP cookie(具有关联的服务器端会话),当客户端提供时将导致客户端证书验证被跳过

Is this still as secure? 这仍然是安全的吗? (and how can we optimise for security and pragmatism?) (我们如何优化安全性和实用性?)

It's not quite as secure in theory, because the server can no longer prove to himself that there's not a man-in-the-middle. 它在理论上并不那么安全,因为服务器再也无法证明自己没有中间人。

When the client was presents a client-side certificate, the server can trust it cryptographically. 当客户端提供客户端证书时,服务器可以以加密方式信任它。 The client and server should be encrypting and data (well, the session key) based on the client's key. 客户端和服务器应该基于客户端密钥加密和数据(以及会话密钥)。 Without a client-side cert, the server can only hope that the client has done a good job of validating the server's certificate (as perceived by the client) and by doing so eliminated the possibility of Mr. MitM. 如果没有客户端证书,服务器只能希望客户端能够很好地验证服务器的证书(如客户所知)并且这样做可以消除MitM先生的可能性。

An out-of-the-box Windows client trusts over 200 root CA certificates. 一个开箱即用的Windows客户端信任200多个根CA证书。 In the absence of a client-side cert, the server ends up trusting by extension. 在没有客户端证书的情况下,服务器最终会通过扩展来信任。

Here's a nice writeup of what to look for in a packet capture to verify that a client cert is providing defense against MitM: http://www.carbonwind.net/ISA/ACaseofMITM/ACaseofMITMpart3.htm 以下是对数据包捕获中要查找的内容的一个很好的解释,以验证客户端证书是否可以防御MitM: http//www.carbonwind.net/ISA/ACaseofMITM/ACaseofMITMpart3.htm

Explanation of this type of MitM. 这种MitM的解释。 http://www.networkworld.com/community/node/31124 http://www.networkworld.com/community/node/31124

This technique is actually used by some firewall appliances boxes to perform deep inspection into the SSL. 某些防火墙设备盒实际上使用此技术对SSL进行深入检查。

MitM used to seem like a big Mission Impossible-style production that took a lot to pull off. MitM曾经看起来像一个伟大的Mission Impossible风格的制作,需要花费很多时间。 Really though it doesn't take any more than a compromised DNS resolver or router anywhere along the way. 实际上,它在路上的任何地方都不会受到破坏的DNS解析器或路由器的影响。 There are a lot of little Linksys and Netgear boxes out there in the world and probably two or three of them don't have the latest security updates. 世界上有很多小的Linksys和Netgear盒子,其中有两三个没有最新的安全更新。

In practice, this seems to be good enough for major financial institutions' sites, although recent evidence suggests that their risk assessment strategies are somewhat less than ideal. 在实践中,这似乎对主要金融机构的网站来说已经足够好了,尽管最近的证据表明他们的风险评估策略有点不太理想。

Are there free implementations of this scheme? 这个方案有免费实施吗? (I'm aware of the SiteMinder product by CA) (我知道CA的SiteMinder产品)

Just a client-side cookie, right? 只是一个客户端cookie,对吗? That seems to be a pretty standard part of every web app framework. 这似乎是每个Web应用程序框架的标准组成部分。

Given the above, should we continue to do Authentication in-application, or move to in-server ? 鉴于上述情况,我们是否应该继续在应用程序中进行身份验证,或者转移到服务器中?

Hardware crypto accelerators (either a SSL proxy front end or an accelerator card) can speed this stuff up dramatically. 硬件加密加速器(SSL代理前端或加速器卡)可以显着提高速度。

Moving the cert validation into the HTTP server might help. 将证书验证移动到HTTP服务器可能会有所帮助。 You may be doing some duplication in the crypto math anyway. 无论如何,你可能在加密数学中做了一些重复。

See if you would benefit from a cheaper algorithm or smaller key size on the client certs. 看看您是否会从客户端证书上更便宜的算法或更小的密钥大小中受益。

Once you validate a client cert, you could try caching a hash digest of it (or even the whole thing) for short time. 验证客户端证书后,您可以尝试在短时间内缓存它的哈希摘要(甚至整个事件)。 That might save you from having to repeat the signature validations all the way up the chain of trust on every hit. 这可能使您不必在每次点击的重复信任链上重复签名验证。

How often to your clients transact? 您的客户多久交易一次? If the ones making up the bulk of your transactions are hitting you frequently, you may be able to convince them to combine multiple transactions in a single SSL negotiation/authentication. 如果构成大部分交易的人经常遇到您,您可能会说服他们在单个SSL协商/身份验证中合并多个交易。 Look into setting the HTTP Keep-Alive header. 查看设置HTTP Keep-Alive标头。 They may be doing that already to some extent. 他们可能已经在某种程度上这样做了。 Perhaps your app is doing client cert validation on every HTTP request/response, or just once at the beginning of each session? 也许您的应用程序正在对每个HTTP请求/响应进行客户端证书验证,或者在每个会话开始时只执行一次?

Anyway, those are some ideas, best of luck! 无论如何,这些是一些想法,祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM