Subject: [IPsec] RFC4301, rfc7321bis and Manual keys

From: Tero Kivinen <[email-masked]>
Date: Wed, 7 Dec 2016 18:11:15 +0200

The RFC4301 requires support for manual keys (section 4.5), but I hope
nobody really uses them. The rfc7321bis provides mandatory to
implement algorithms for the IKEv2 use, and does not really
specifically cover manual keys cases, but it does not really say that
manual keyed SAs are out of scope either (like it does say for IKEv1). 

The issue is that some of the conformance logo documents actually do
require manual keys, and to gain those logos implementors need to add
support for manual keyed SAs even when nobody is really going to use
them (i.e., adding support for manual keys for android VPN client
seems little stupid).

On the other hand if you use the rfc7321bis requirements for also
manual keys, there is only one suggested cipher that can be used,
namely ENCR_AES_CBC.

None of the counter mode ciphers are safe to use with manual keys, and
for example RFC4106 (AES-GCM) requires using automated key management.
The RFC4309 (AES-CCM) says that it "should not be used with statically
configured keys", and that "MUST use fress keys". RFC7634
(Chacha20-poly1305) does not explictly say anything about manual keys,
but says it gets bitstring called KEYMAT from IKE...

If we assume rfc7431bis can be used with manual keys too, we need to
add some more text saying these ciphers cannot be used with manual
keys. 

Anyways, I think it should be time to mark manual keys as SHOULD NOT.
We had it in 4301 as MUST to implement as we assumed that it could be
used to fill in keying material from other source than IKE to the
IPsec architecture. I do not think that is really happening, I think
those other automated key management systems will also generate
dynamic keys, and are feeding them in using similar APIs we have for
IKEv2. Also manual keys were useful when doing initial IPsec testing
in interops, but I have not used them for that purposes in last
decade or so...

Perhaps we should add note to the rfc7431bis that manual keys SHOULD
NOT be used, and mark it as updating RFC4301?

Or should we have separate RFC stating that?

I do not want to change it to MUST NOT as that would require people to
remove parts of their implementations to stay complient, but on the
other hand I do not want people to wasting their time to implenting
interface to configure manual keys when nobody is going to use them.
-- 
[email-masked]

---

From: Russ Housley <[email-masked]>
Date: Wed, 7 Dec 2016 11:23:43 -0500

I can see that manual keys are helpful for debugging, but otherwise I think they SHOULD NOT be used.

Russ

On Dec 7, 2016, at 11:11 AM, Tero Kivinen <[email-masked]> wrote:

> _______________________________________________
> IPsec mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/ipsec

---

From: "Hu, Jun (Nokia - US)" <[email-masked]>
Date: Wed, 7 Dec 2016 19:31:51 +0000

OSPFv3 authentication (RFC4552) mandate to use manual key, the reason is OSPFv3 uses multicast. 
So I could see manual key IPsec could be needed in any multicast applications since group key management is not widely available 
For above reason, I think it should be "MAY" instead of "SHOULD NOT"

> -----Original Message-----
> From: IPsec [mailto:[email-masked]] On Behalf Of Tero Kivinen
> Sent: Wednesday, December 07, 2016 8:11 AM
> To: [email-masked]
> Subject: [IPsec] RFC4301, rfc7321bis and Manual keys
> 
> nobody really uses them. The rfc7321bis provides mandatory to implement
> algorithms for the IKEv2 use, and does not really specifically cover manual keys
> cases, but it does not really say that manual keyed SAs are out of scope either
> (like it does say for IKEv1).
> 
> The issue is that some of the conformance logo documents actually do require
> manual keys, and to gain those logos implementors need to add support for
> manual keyed SAs even when nobody is really going to use them (i.e., adding
> support for manual keys for android VPN client seems little stupid).
> 
> On the other hand if you use the rfc7321bis requirements for also manual keys,
> there is only one suggested cipher that can be used, namely ENCR_AES_CBC.
> 
> None of the counter mode ciphers are safe to use with manual keys, and for
> example RFC4106 (AES-GCM) requires using automated key management.
> (Chacha20-poly1305) does not explictly say anything about manual keys, but
> says it gets bitstring called KEYMAT from IKE...
> 
> If we assume rfc7431bis can be used with manual keys too, we need to add
> some more text saying these ciphers cannot be used with manual keys.
> 
> We had it in 4301 as MUST to implement as we assumed that it could be used
> to fill in keying material from other source than IKE to the IPsec architecture. I
> do not think that is really happening, I think those other automated key
> management systems will also generate dynamic keys, and are feeding them in
> using similar APIs we have for IKEv2. Also manual keys were useful when doing
> initial IPsec testing in interops, but I have not used them for that purposes in
> last decade or so...
> 
> Perhaps we should add note to the rfc7431bis that manual keys SHOULD NOT
> be used, and mark it as updating RFC4301?
> 
> remove parts of their implementations to stay complient, but on the other
> hand I do not want people to wasting their time to implenting interface to
> configure manual keys when nobody is going to use them.
> --
> [email-masked]
>

---

From: Paul Wouters <[email-masked]>
Date: Wed, 7 Dec 2016 16:41:30 -0500 (EST)

> For above reason, I think it should be "MAY" instead of "SHOULD NOT"

Reading that RFC, it is really cracking on all sides. You even need to
use the same SPIs and ENC keys for inbound and outbound SA's. I really
don't think this is a very well thought out use case for IPsec.

Are people actually deploying this?

How long are these static SPIs/keys used for? forever?

I don't think we need to take those requirements into consideration. If
anything, someone needs to update RFC4552 to allow for a more modern use
of IKEv2 and multicast (RFC5374)

>> nobody really uses them.

I have hoped that for many years. And like Transport Mode and IPCOMP,
these things refuse to die. Anyways, we are not updating 4301, so I
think this part is out of scope, but:

>> The rfc7321bis provides mandatory to implement

I guess 7321 should have had a note about manual keying in it, and it
does not. We can surely add a note about manual keying.

>> support for manual keys for android VPN client seems little stupid).

7321bis should not change the requirement for manual keying. It should
only talk about algorithms.

>> Anyways, I think it should be time to mark manual keys as SHOULD NOT.

While I agree, I don't think 7321bis should do that.

How about a new section between section 2 and 3:

Manual Keying

Manual Keying should not be used as it is inherently dangerous. Without
any keying protocol, it does not offer Perfect Forward Secrecy
protection. Deployments tend to never be reconfigured with fresh session
keys. It also fails to scale and keeping SPI's unique amongst many servers
is impractical. This document was written for deploying ESP/AH using IKE
(RFC7298) and assumes that keying happens using IKEv2.

If manual keying is used anyway, ENCR_AES_CBC MUST be used, and
ENCR_AES_CCM, ENCR_AES_GCM and ENCR_CHACHA20_POLY1305 MUST NOT
be used as these algorithms require IKE.

[note the first "should not" is in lower case in purpose, so we don't
  actually need to update 4301]

>> Or should we have separate RFC stating that?

draft-ietf-thisallmust-diedieidie-manualkeying-transportmode-ipcomp :)

Seriously though, I don't think writing a document like that will change
anything. And at least on Linux, the ip xfrm command allows for manual
keying and therefor assist with testing, but the IKE daemons (libreswan,
strongswan and openswan) do not support manual keying anymore.

Paul

---

From: Timothy Carlin <[email-masked]>
Date: Wed, 7 Dec 2016 17:00:53 -0500

Hello  All,

I have some comments inline.

On Wed, Dec 7, 2016 at 4:41 PM, Paul Wouters <[email-masked]> wrote:

>> So I could see manual key IPsec could be needed in any multicast
>> applications since group key management is not widely available
The NIST USGv6 Profile current mandates RFC4552 and as such manual keys.

>>> require
>>> for
>>> but
I agree with the sentiment that Manual Keys should be avoided.  However for
the conformance logo documents it would be helpful to have RFC2119 language
to point to when setting the requirements for testing.

Tim Carlin
UNH-IOL

---

From: "Hu, Jun (Nokia - US)" <[email-masked]>
Date: Wed, 7 Dec 2016 22:11:51 +0000

> From: Paul Wouters [mailto:[email-masked]]
> Sent: Wednesday, December 07, 2016 1:42 PM
> To: Hu, Jun (Nokia - US) <[email-masked]>
> Cc: Tero Kivinen <[email-masked]>; [email-masked]
> Subject: Re: [IPsec] RFC4301, rfc7321bis and Manual keys
> 
> > applications since group key management is not widely available For above
> reason, I think it should be "MAY" instead of "SHOULD NOT"
> 
> Reading that RFC, it is really cracking on all sides. You even need to use the
> same SPIs and ENC keys for inbound and outbound SA's. I really don't think this
> is a very well thought out use case for IPsec.
> 
> I don't think we need to take those requirements into consideration. If anything,
> someone needs to update RFC4552 to allow for a more modern use of IKEv2
> and multicast (RFC5374)
> 
[HJ] OSPFv3 has been implemented on almost all IPv6 capable enterprise/carrier level  routers for long time, and as only standard auth method, RFC4552 was also implemented along with OSPFv3;
So I think I could say RFC4552 has been already deployed widely for long time,
We can't ignore this just because manual key is less secure; in fact using IKEv2 and RFC5374 is almost impractical for a IGP routing protocol, because when deployed, OSPFv3 is an part of network routing infrastructure; adding IKEv2 and RFC5374 not only add lots additional complexity to the routing plane (it gona be a non-starter already for many people), but also using RFC5374 require to use a central key server, it means the key server need to be reachable before OSPFv3 is up and running, which might not be feasible;

---

From: <[email-masked]>
Date: Thu, 8 Dec 2016 01:34:31 +0000

On Dec 7, 2016, at 5:00 PM, Timothy Carlin <[email-masked]<mailto:[email-masked]>> wrote:

Hello  All,

On Wed, Dec 7, 2016 at 4:41 PM, Paul Wouters <[email-masked]<mailto:[email-masked]>> wrote:
...

Yes, that's PRECISELY the issue.  Presumably NIST put it into the profile because manual keys are mentioned in the RFC, not realizing how bad an error that is.

...

I agree with the sentiment that Manual Keys should be avoided.  However for the conformance logo documents it would be helpful to have RFC2119 language to point to when setting the requirements for testing.

That is the main reason I argued for MUST NOT.

By way of illustration: in an IPSec-enabled product I work on, we implemented manual keying only to be able to pass the USGv6 tests.  The manual states that the feature [sic] exists only for that reason and that manual keys should never be used.  When we submitted the product for Common Criteria evaluation, the evaluators told us we needed to strengthen that statement, so it now says that manual keys "exist only because of certification requirements and must never be used".

This is clearly absurd.  A feature in a security protocol that has always  been known to be a hazard to security needs to be removed.  It's been far too long already.

paul

---

From: Michael Richardson <[email-masked]>
Date: Wed, 07 Dec 2016 21:45:43 -0500

> think they SHOULD NOT be used.

Exactly. I would like to have a SHOULD provide an interface (without which, I
can't determine why I can't interoperate with product FOO), but I agree with
Tero, I really don't want logos/etc. to be dependant on it.

    >> NOT be used, and mark it as updating RFC4301?

Yes.

    >> interface to configure manual keys when nobody is going to use them.

I would like people to document an interface, but I have no desire to expose
it to users.  In your Android example, I'm perfectly happy with having a
shell and a netlink/pfkey socket as the "interface".

--
Michael Richardson <[email-masked]>, Sandelman Software Works
 -= IPv6 IoT consulting =-

---

From: Tero Kivinen <[email-masked]>
Date: Thu, 8 Dec 2016 14:41:06 +0200

> be used as these algorithms require IKE.

I think that kind of addition the rfc7321bis would be in order. Can
you add that text and resubmit?

>   actually need to update 4301]

Perhaps not using word "should" is better. Something like "Manual
Keying is not to be used as ...". Then we do not need to explain why
it is not uppercase SHOULD...

> strongswan and openswan) do not support manual keying anymore.

Now seeing that there is things that require manual keys and which
might be in use, I agree that we do not want to delay rfc7321bis
because of this, and I think adding just the not above is correct
solution.

Then we might start new draft like you proposed and make that to
update RFC4301, and that draft can then provide more text how to fix
those protocols using manual keying...
-- 
[email-masked]