on-the-wire encryption, addrs, and cephx
Hi all,
We had a call last night (Marcus, Haomai, Yehuda, our GSoC student Zhao, and me) to discuss on-the-wire encryption. The main concern was how the decision to encrypt would be wired in, so we spent most of an hour reviewing what the current auth handshake/negotiation code does and what our options were for changing it to securely support this.
The requirements were:
- the ability to securely encrypt sessions between new clients/servers
- the ability to also support unencrypted sessions between old clients
and new servers (for the transition period)
- tune the 'require' options to distinguish between clients and cluster
(mon/osd/mds) hosts.
There are several problems with our current auth and cephx code that prevent a trivial solution (using the existing cephx session key to encrypt) from working:
- the mon auth negotiation happens by exchanging MAuth messages, a
layer above the messenger, making a transition from unauthenticated to encrypted or signed awkward. (Notably, signing isn't supported here now either.)
- the messenger handshake exchanges feature bits without including them
in the authentication handshake, which means making a decision like "encrypt if it is supported" would not be not secure.
The current messenger handshake does not lend itself to clean negotiation of optional features until feature bits are exchanged (insecurely) several steps along in the process, making extensions awkward. Although we could hack it to switch to a new (more secure) protocol once peers decide they both support it, it would be ugly, and would force us to support the legacy protocol indefinitely (as opposed to deprecating it after a few releases).
So, the current plan is:
1) Create a new messenger handshake protocol that addresses the flaws in the current approach (secure feature negotation, mon authentication in messenger layer). Marcus is doing some background research to identify what protocols we should model or use here. We cannot drop the basic properties of messenger (e.g., async message exhange) by switching to something RPC based, for example.
(We talked about whether just jumping into a Kerberos world wholesale makes sense or would help here, and decided that although we could do what cephx does with kerberos, doing so doesn't change any of the protocol pieces--and in fact krb5 would effectivel slot in as an alternative, pluggable auth mode next to cephx. As we go through this process we should verify that a native kerberos approach fits in properly.)
2) We will finish the long-awaited wip-addr refactor. This will provide:
- better typing of entity_addr_t with a transport and/or protocol type,
so that we can distinguish between endpoints that speak the legacy vs new messenger protocol.
- the ability to list multiple endpoints for daemons where currently we
have only one. This way each daemon can bind to two ports, one speaking legacy and one speaking v2. When encoding the addrvec for legacy clients, we would include only the legacy addr.
3) The above works great for most daemons, but the monitors themselves also have to support both legacy and v2 connections. Conveniently, we also just got an IANA port assignment and need to transition to using that anyway. We can make monitors listen to legacy connections on 6789 and v2 connections on the new port 3300.
4) Finally, we can put all the new features in the new protocol. We want to support auth_none (no validation or authentication), authentication only, authentication and signing (integrity but not secrecy), and full encryption.
Notes from our call are on this etherpad:
http://pad.ceph.com/p/on-the-wire-encryption
The design for the new protocol (1) and work on the wip-addr refactor (2) can start now and proceed in parallel. Zhao is going to start with (2).
There are a few questions:
- Should we bother implementing v2 for SimpleMessenger? I think no.
- Should we work on native kerberos as an auth type at the same time? It would be nice to do this while desiging the v2 protocol to ensure that we don't box ourselves into a corner. OTOH, I don't think we have anyone to spare to do it and it's not really a priority. (We also don't want to make kerberos a dependency, so we can't/shouldn't abandon cephx.) If there is a new contributor who is interested in doing kerberos support, now would be the time to speak up.
Comments, questions welcome!
sage
Quoted 5 lines · Sage Weil
3) The above works great for most daemons, but the monitors themselves also have to support both legacy and v2 connections. Conveniently, we also just got an IANA port assignment and need to transition to using that anyway. We can make monitors listen to legacy connections on 6789 and v2 connections on the new port 3300.
Ha, this is a great use of that new port :)
I'll try and evaluate this in more detail later, but for now...
Quoted 76 lines · Sage Weil
Hi all,
We had a call last night (Marcus, Haomai, Yehuda, our GSoC student Zhao, and me) to discuss on-the-wire encryption. The main concern was how the decision to encrypt would be wired in, so we spent most of an hour reviewing what the current auth handshake/negotiation code does and what our options were for changing it to securely support this.
The requirements were:
- the ability to securely encrypt sessions between new clients/servers
- the ability to also support unencrypted sessions between old clients
and new servers (for the transition period)
- tune the 'require' options to distinguish between clients and cluster
(mon/osd/mds) hosts.There are several problems with our current auth and cephx code that prevent a trivial solution (using the existing cephx session key to encrypt) from working:
- the mon auth negotiation happens by exchanging MAuth messages, a
layer above the messenger, making a transition from unauthenticated to encrypted or signed awkward. (Notably, signing isn't supported here now either.)
- the messenger handshake exchanges feature bits without including them
in the authentication handshake, which means making a decision like "encrypt if it is supported" would not be not secure.The current messenger handshake does not lend itself to clean negotiation of optional features until feature bits are exchanged (insecurely) several steps along in the process, making extensions awkward. Although we could hack it to switch to a new (more secure) protocol once peers decide they both support it, it would be ugly, and would force us to support the legacy protocol indefinitely (as opposed to deprecating it after a few releases).
So, the current plan is:
1) Create a new messenger handshake protocol that addresses the flaws in the current approach (secure feature negotation, mon authentication in messenger layer). Marcus is doing some background research to identify what protocols we should model or use here. We cannot drop the basic properties of messenger (e.g., async message exhange) by switching to something RPC based, for example.
(We talked about whether just jumping into a Kerberos world wholesale makes sense or would help here, and decided that although we could do what cephx does with kerberos, doing so doesn't change any of the protocol pieces--and in fact krb5 would effectivel slot in as an alternative, pluggable auth mode next to cephx. As we go through this process we should verify that a native kerberos approach fits in properly.)
2) We will finish the long-awaited wip-addr refactor. This will provide:
- better typing of
entity_addr_twith a transport and/or protocol type,
so that we can distinguish between endpoints that speak the legacy vs new messenger protocol.- the ability to list multiple endpoints for daemons where currently we
have only one. This way each daemon can bind to two ports, one speaking legacy and one speaking v2. When encoding the addrvec for legacy clients, we would include only the legacy addr.3) The above works great for most daemons, but the monitors themselves also have to support both legacy and v2 connections. Conveniently, we also just got an IANA port assignment and need to transition to using that anyway. We can make monitors listen to legacy connections on 6789 and v2 connections on the new port 3300.
4) Finally, we can put all the new features in the new protocol. We want to support
auth_none(no validation or authentication), authentication only, authentication and signing (integrity but not secrecy), and full encryption.Notes from our call are on this etherpad:
Quoted 8 lines
http://pad.ceph.com/p/on-the-wire-encryption
The design for the new protocol (1) and work on the wip-addr refactor (2) can start now and proceed in parallel. Zhao is going to start with (2).
There are a few questions:
- Should we bother implementing v2 for SimpleMessenger? I think no.
I think we have to implement this for SimpleMessenger. I know we want to move to AsyncMessenger ASAP, but until we've resolved any top-line performance issues it won't be appropriate to deprecate the SimpleMessenger.
And unless we really are doing a whole new wire protocol that doesn't need to be in any way compatible with other implementations (like, say, the kernel clients), it'll make us a lot more confident that it is appropriately backwards-compatible and works correctly to have the AsyncMessenger and SimpleMessenger speaking it to each other. -Greg
Quoted 16 lines
- Should we work on native kerberos as an auth type at the same time? It would be nice to do this while desiging the v2 protocol to ensure that we don't box ourselves into a corner. OTOH, I don't think we have anyone to spare to do it and it's not really a priority. (We also don't want to make kerberos a dependency, so we can't/shouldn't abandon cephx.) If there is a new contributor who is interested in doing kerberos support, now would be the time to speak up.
Comments, questions welcome!
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Gregory Farnum
Quoted 3 lines
There are a few questions:
- Should we bother implementing v2 for SimpleMessenger? I think no.
I think we have to implement this for SimpleMessenger. I know we want to move to AsyncMessenger ASAP, but until we've resolved any top-line performance issues it won't be appropriate to deprecate the SimpleMessenger.
Quoted 5 lines
And unless we really are doing a whole new wire protocol that doesn't need to be in any way compatible with other implementations (like, say, the kernel clients), it'll make us a lot more confident that it is appropriately backwards-compatible and works correctly to have the AsyncMessenger and SimpleMessenger speaking it to each other.
Well, it won't be compatible at all--that's why the wip-addr and mon port change are part of the plan.
We'll need to keep SimpleMessenger around for along time, and we'll also need to keep the v1 protocol support around for a long time (probably a couple years at least) for the benefit of old clients. And there's no reason anybody *has* to switch to the new protocol unless they need the new features or improved security. If someone can't move to msg/async for stability/performance reasons, they can just keep using SimpleMessenger until they get resolved--that has to happen in the next cycle or two (vs the years before we remove the old code).
sage
On 06/05/2016, Sage Weil wrote:
[snip]
Quoted 4 lines
and we'll also need to keep the v1 protocol support around for a long time (probably a couple years at least) for the benefit of old clients. And there's no reason anybody *has* to switch to the new protocol unless they need the new features or improved security.
[snip]
I can understand not wanting to force people to take a performance hit. However, it sounded, from your writeup, like even without encryption the new auth mechanism would be an improvement on the old one. Once we do get it working, tested, and performant, I'd suggest we might want to force users' hand on the issue and announce that the old mechanism will be removed in some upcoming version, rather than waiting for users to rotate older clients out over time.
Signature · 3 lines
Senior Software Engineer Red Hat Storage, Ann Arbor, MI, US
IRC: Aemerson@{RedHat, OFTC, Freenode}
0x80F7544B90EDBFB9 E707 86BA 0C1B 62CC 152C 7C12 80F7 544B 90ED BFB9Quoted 8 lines · Adam C. Emerson
On 06/05/2016, Sage Weil wrote:
[snip]Quoted 4 lines
and we'll also need to keep the v1 protocol support around for a long time (probably a couple years at least) for the benefit of old clients. And there's no reason anybody *has* to switch to the new protocol unless they need the new features or improved security.
[snip]
Quoted 7 lines
I can understand not wanting to force people to take a performance hit. However, it sounded, from your writeup, like even without encryption the new auth mechanism would be an improvement on the old one. Once we do get it working, tested, and performant, I'd suggest we might want to force users' hand on the issue and announce that the old mechanism will be removed in some upcoming version, rather than waiting for users to rotate older clients out over time.
As soon as the new stuff is stable and performant, yeah, I think we should announce the old stuff is deprecated. But we will have to keep it around for a pretty long time to support existing kernels and clients. People still pretty frequently have dumpling or older clients talking to up-to-date clusters. Partly this is just infrastructure moving slowly, and partly it users not wanting to restart running VMs.
I would say at least 2 LTS releases, maybe longer...
sage
There is definitely lots of interest in securing the transport and making the entire protocol secure from end-to-end. Kerberos is a step up from cephx and has multi-vendor support. Though I would caution against writing to a particular KRB5 API (MIT vs Heimdal, etc). Consider kerberos over GSSAPI for more portability and a standardized API. If you are designing it from scratch, making the ceph side pluggable would also be good so it can be more adaptable if (or when) a more desirable auth/crypto system comes along.
Wyllys Ingersoll
Keeper Technology, LLC
Quoted 100 lines · Sage Weil
Hi all,
We had a call last night (Marcus, Haomai, Yehuda, our GSoC student Zhao, and me) to discuss on-the-wire encryption. The main concern was how the decision to encrypt would be wired in, so we spent most of an hour reviewing what the current auth handshake/negotiation code does and what our options were for changing it to securely support this.
The requirements were:
- the ability to securely encrypt sessions between new clients/servers
- the ability to also support unencrypted sessions between old clients
and new servers (for the transition period)
- tune the 'require' options to distinguish between clients and cluster
(mon/osd/mds) hosts.There are several problems with our current auth and cephx code that prevent a trivial solution (using the existing cephx session key to encrypt) from working:
- the mon auth negotiation happens by exchanging MAuth messages, a
layer above the messenger, making a transition from unauthenticated to encrypted or signed awkward. (Notably, signing isn't supported here now either.)
- the messenger handshake exchanges feature bits without including them
in the authentication handshake, which means making a decision like "encrypt if it is supported" would not be not secure.The current messenger handshake does not lend itself to clean negotiation of optional features until feature bits are exchanged (insecurely) several steps along in the process, making extensions awkward. Although we could hack it to switch to a new (more secure) protocol once peers decide they both support it, it would be ugly, and would force us to support the legacy protocol indefinitely (as opposed to deprecating it after a few releases).
So, the current plan is:
1) Create a new messenger handshake protocol that addresses the flaws in the current approach (secure feature negotation, mon authentication in messenger layer). Marcus is doing some background research to identify what protocols we should model or use here. We cannot drop the basic properties of messenger (e.g., async message exhange) by switching to something RPC based, for example.
(We talked about whether just jumping into a Kerberos world wholesale makes sense or would help here, and decided that although we could do what cephx does with kerberos, doing so doesn't change any of the protocol pieces--and in fact krb5 would effectivel slot in as an alternative, pluggable auth mode next to cephx. As we go through this process we should verify that a native kerberos approach fits in properly.)
2) We will finish the long-awaited wip-addr refactor. This will provide:
- better typing of
entity_addr_twith a transport and/or protocol type,
so that we can distinguish between endpoints that speak the legacy vs new messenger protocol.- the ability to list multiple endpoints for daemons where currently we
have only one. This way each daemon can bind to two ports, one speaking legacy and one speaking v2. When encoding the addrvec for legacy clients, we would include only the legacy addr.3) The above works great for most daemons, but the monitors themselves also have to support both legacy and v2 connections. Conveniently, we also just got an IANA port assignment and need to transition to using that anyway. We can make monitors listen to legacy connections on 6789 and v2 connections on the new port 3300.
4) Finally, we can put all the new features in the new protocol. We want to support
auth_none(no validation or authentication), authentication only, authentication and signing (integrity but not secrecy), and full encryption.Notes from our call are on this etherpad:
http://pad.ceph.com/p/on-the-wire-encryption
The design for the new protocol (1) and work on the wip-addr refactor (2) can start now and proceed in parallel. Zhao is going to start with (2).
There are a few questions:
- Should we bother implementing v2 for SimpleMessenger? I think no.
- Should we work on native kerberos as an auth type at the same time? It would be nice to do this while desiging the v2 protocol to ensure that we don't box ourselves into a corner. OTOH, I don't think we have anyone to spare to do it and it's not really a priority. (We also don't want to make kerberos a dependency, so we can't/shouldn't abandon cephx.) If there is a new contributor who is interested in doing kerberos support, now would be the time to speak up.
Comments, questions welcome!
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · Wyllys Ingersoll
Though I would caution
against writing to a particular KRB5 API (MIT vs Heimdal, etc).
This is off-topic, but I've worked on the Heimdal project a bit and I maintain the Heimdal packages in Fedora and EPEL, and I wouldn't recommend it for Ceph. Heimdal is nowhere near as actively developed as MIT. Debian is considering dropping it entirely because it has not seen a release in four years (https://bugs.debian.org/806274).
- Ken
Hi,
----- Original Message -----
Quoted 9 lines
From: "Sage Weil" <[email protected]>
To: [email protected]
Sent: Thursday, May 5, 2016 8:57:16 AM
Subject: on-the-wire encryption, addrs, and cephxHi all,
We had a call last night (Marcus, Haomai, Yehuda, our GSoC student Zhao, and me) to discuss on-the-wire encryption.
<snip>
Quoted 7 lines
(We talked about whether just jumping into a Kerberos world wholesale makes sense or would help here, and decided that although we could do what cephx does with kerberos, doing so doesn't change any of the protocol pieces--and in fact krb5 would effectivel slot in as an alternative, pluggable auth mode next to cephx. As we go through this process we should verify that a native kerberos approach fits in properly.)
<snip>
Quoted 2 lines
Comments, questions welcome!
Seems like this is a great start. I'm used to systems that emphasize Kerberos, and I'm glad we're revisiting where it covers or misses our requirements.
Matt
Quoted 3 lines
sage
--
Signature · 10 lines
Matt Benjamin Red Hat, Inc. 315 West Huron Street, Suite 140A Ann Arbor, Michigan 48103 http://www.redhat.com/en/technologies/storage tel. 734-707-0660 fax. 734-769-8938 cel. 734-216-5309