draft-ietf-lwig-minimal-esp-07.txt   draft-ietf-lwig-minimal-esp-08.txt 
Light-Weight Implementation Guidance (lwig) D.M. Migault Light-Weight Implementation Guidance (lwig) D.M. Migault
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Informational T.G. Guggemos Intended status: Informational T.G. Guggemos
Expires: 1 April 2022 LMU Munich Expires: 12 May 2022 LMU Munich
28 September 2021 8 November 2021
Minimal ESP Minimal IP Encapsulating Security Payload (ESP)
draft-ietf-lwig-minimal-esp-07 draft-ietf-lwig-minimal-esp-08
Abstract Abstract
This document describes a minimal IP Encapsulation Security Payload This document describes the minimal properties IP Encapsulating
(ESP) defined in RFC 4303. Its purpose is to enable implementation Security Payload (ESP) implementation needs to meet to remain
of ESP with a minimal set of options to remain compatible with ESP as interoperable with the standard RFC4303 ESP. Such a minimal version
described in RFC 4303. A minimal version of ESP is not intended to of ESP is not intended to become a replacement of the RFC 4303 ESP.
become a replacement of the RFC 4303 ESP. Instead, a minimal Instead, a minimal implementation is expected to be optimized for
implementation is expected to be optimized for constrained constrained environment while remaining interoperable with
environment while remaining interoperable with implementations of RFC implementations of RFC 4303 ESP. In addition, this document also
4303 ESP. In addition, this document also provides some provides some considerations to implement minimal ESP in a
considerations to implement minimal ESP in a constrained environment constrained environment which includes limiting the number of flash
which includes limiting the number of flash writes, handling frequent writes, handling frequent wakeup / sleep states, limiting wakeup
wakeup / sleep states, limiting wakeup time, or reducing the use of time, or reducing the use of random generation.
random generation.
This document does not update or modify RFC 4303, but provides a This document does not update or modify RFC 4303, but provides a
compact description of how to implement the minimal version of the compact description of how to implement the minimal version of the
protocol. RFC 4303 remains the authoritative description. protocol. RFC 4303 remains the authoritative description.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 1 April 2022. This Internet-Draft will expire on 12 May 2022.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 4, line 12 skipping to change at page 4, line 12
According to the [RFC4303], the SPI is a mandatory 32 bits field and According to the [RFC4303], the SPI is a mandatory 32 bits field and
is not allowed to be removed. is not allowed to be removed.
The SPI has a local significance to index the Security Association The SPI has a local significance to index the Security Association
(SA). From [RFC4301] section 4.1, nodes supporting only unicast (SA). From [RFC4301] section 4.1, nodes supporting only unicast
communications can index their SA only using the SPI. On the other communications can index their SA only using the SPI. On the other
hand, nodes supporting multicast communications must also use the IP hand, nodes supporting multicast communications must also use the IP
addresses and thus SA lookup needs to be performed using the longest addresses and thus SA lookup needs to be performed using the longest
match. match.
For nodes supporting only unicast communications, it is recommended For nodes supporting only unicast communications, this document
to index SA with the SPI only. The index may be based on the full 32 recommends to index SA with the SPI only. The index may be based on
bits of SPI or a subset of these bits. The node may require a the full 32 bits of SPI or a subset of these bits. The node may
combination of the SPI as well as other parameters (like the IP require a combination of the SPI as well as other parameters (like
address) to index the SA. the IP address) to index the SA.
Values 0-255 must not be used. As per section 2.1 of [RFC4303], Values 0-255 must not be used. As per section 2.1 of [RFC4303],
values 1-255 are reserved and 0 is only allowed to be used internally values 1-255 are reserved and 0 is only allowed to be used internally
and it must not be sent on the wire. and it must not be sent on the wire.
[RFC4303] does not require the SPI to be randomly generated over 32 [RFC4303] does not require the SPI to be randomly generated over 32
bits. However, this is the recommended way to generate SPIs as it bits. However, this is the recommended way to generate SPIs as it
provides some privacy benefits and avoids, for example, correlation provides some privacy benefits and avoids, for example, correlation
between ESP communications. To randomly generate a 32 bit SPI, the between ESP communications. To randomly generate a 32 bit SPI, the
node generates a random 32 bit valueand checks it does not fall in node generates a random 32 bit valueand checks it does not fall in
skipping to change at page 5, line 35 skipping to change at page 5, line 35
case the SPI would provide some information related to the case the SPI would provide some information related to the
application of the user. In addition, the device or application may application of the user. In addition, the device or application may
be associated with some vulnerabilities, in which case specific SPI be associated with some vulnerabilities, in which case specific SPI
values may be used by an attacker to discover vulnerabilities. values may be used by an attacker to discover vulnerabilities.
While the use of randomly generated SPIs may reduce the leakage or While the use of randomly generated SPIs may reduce the leakage or
privacy of security related information by ESP itself, these privacy of security related information by ESP itself, these
information may also be leaked otherwise. As a result, a privacy information may also be leaked otherwise. As a result, a privacy
analysis should consider at least the type of information as well the analysis should consider at least the type of information as well the
traffic pattern before determining non random SPI can be used. traffic pattern before determining non random SPI can be used.
Typically, temperature sensors, wind sensors, used outdoors do not Typically, temperature sensors, wind sensors, used outdoors may not
leak privacy sensitive information and mosty of its traffic is leak privacy sensitive information and most of its traffic is
expected to be outbound traffic. When used indoors, a sensor that expected to be outbound traffic. When used indoors, a sensor that
reports every minute an encrypted status of the door (closed or reports every minute an encrypted status of the door (closed or
opened) leaks truly little privacy sensitive information outside the opened) may leak truly little privacy sensitive information outside
local network. the local network. In both cases, if the state of the sensor doesn't
leak privacy info, a randomized SPI is not necessary.
3. Sequence Number(SN) (32 bit) 3. Sequence Number(SN) (32 bit)
According to [RFC4303], the Sequence Number (SN) is a mandatory 32 According to [RFC4303], the Sequence Number (SN) is a mandatory 32
bits field in the packet. bits field in the packet.
The SN is set by the sender so the receiver can implement anti-replay The SN is set by the sender so the receiver can implement anti-replay
protection. The SN is derived from any strictly increasing function protection. The SN is derived from any strictly increasing function
that guarantees: if packet B is sent after packet A, then SN of that guarantees: if packet B is sent after packet A, then SN of
packet B is strictly greater than the SN of packet A. packet B is strictly greater than the SN of packet A.
skipping to change at page 6, line 34 skipping to change at page 6, line 34
flash memory - that can be restored across sleeps. Storing flash memory - that can be restored across sleeps. Storing
information associated with the SA such as SN requires some read and information associated with the SA such as SN requires some read and
writing operation on a stable storage after each packet is sent as writing operation on a stable storage after each packet is sent as
opposed to SPI or keys that are only written at the creation of the opposed to SPI or keys that are only written at the creation of the
SA. Such operations are likely to wear out the flash, and slow down SA. Such operations are likely to wear out the flash, and slow down
the system greatly, as writing to flash is not as fast as reading. the system greatly, as writing to flash is not as fast as reading.
Their internal clocks/timers might not be very accurate, but they Their internal clocks/timers might not be very accurate, but they
should be enough to know that each time they wake up their time is should be enough to know that each time they wake up their time is
greater than what it was last time they woke up. Using time for SN greater than what it was last time they woke up. Using time for SN
would guarantee a strictly increasing function and avoid storing any would guarantee a strictly increasing function and avoid storing any
additional values or context related to the SN. When the use of a additional values or context related to the SN. Of course, one
clock is considered, one should take care that packets associated should only consider use of a clock to generate SNs if the
with a given SA are not sent with the same time value. Note however application will inherently ensure that no two packets with a given
that standard receivers are generally configured with incrementing SA are sent with the same time value. Note however that standard
counters and, if not appropriately configured, the use of a receivers are generally configured with incrementing counters and, if
significantly larger SN may result in the packet out of the not appropriately configured, the use of a significantly larger SN
receiver's windows and that packet being discarded. difference may result in the packet out of the receiver's windows and
that packet being discarded.
For inbound traffic, it is recommended that any receiver provides For inbound traffic, this document recommends that any receiver
anti-replay protection, and the size of the window depends on the provides anti-replay protection, and the size of the window depends
ability of the network to deliver packets out of order. As a result, on the ability of the network to deliver packets out of order. As a
in an environment where out of order packets is not possible the result, in an environment where out of order packets is not possible
window size can be set to one. However, while recommended, there are the window size can be set to one. However, while recommended, there
no requirements to implement an anti-replay protection mechanism are no requirements to implement an anti-replay protection mechanism
implemented by IPsec. Similarly to the SN the implementation of anti implemented by IPsec. Similarly to the SN the implementation of anti
replay protection may require the device to write the received SN for replay protection may require the device to write the received SN for
every packet, which may in some cases come with the same drawbacks as every packet, which may in some cases come with the same drawbacks as
those exposed for SN. As a result, some implementations may drop a those exposed for SN. As a result, some implementations may drop a
non required anti replay protection especially when the necessary non required anti replay protection especially when the necessary
resource involved overcomes the benefit of the mechanism. These resource involved overcomes the benefit of the mechanism. These
resources need also to balance that absence of anti-replay mechanism, resources need also to balance that absence of anti-replay mechanism,
may lead to unnecessary integrity check operations that might be may lead to unnecessary integrity check operations that might be
significantly more expensive as well. A typical example might significantly more expensive as well. A typical example might
consider an IoT device such as a temperature sensor that is sending a consider an IoT device such as a temperature sensor that is sending a
temperature every 60 seconds, and that receives an acknowledgment temperature every 60 seconds, and that receives an acknowledgment
from the receiver. In such cases, the ability to spoof and replay an from the receiver. In such cases, the ability to spoof and replay an
acknowledgement is of limited interest and may not justify the acknowledgement is of limited interest and might not justify the
implementation of an anti replay mechanism. Receiving peers may also implementation of an anti replay mechanism. Receiving peers may also
implement their own anti-replay mechanism. Typically, when the use ESP anti-replay mechanism adapted to a specific application.
sending peer is using SN based on time, anti-replay may be Typically, when the sending peer is using SN based on time, anti-
implemented by discarding any packets that present a SN whose value replay may be implemented by discarding any packets that present a SN
is too much in the past. Note that such mechanisms may consider whose value is too much in the past. Note that such mechanisms may
clock drifting in various ways in addition to acceptable delay consider clock drifting in various ways in addition to acceptable
induced by the network to avoid the anti replay windows rejecting delay induced by the network to avoid the anti replay windows
legitimate packets. When a packet is received at a regular time rejecting legitimate packets. When a packet is received at a regular
interval, some variant of time based mechanisms may not even use the time interval, some variant of time based mechanisms may not even use
value of the SN, but instead only consider the receiving time of the the value of the SN, but instead only consider the receiving time of
packet. the packet.
SN can be encoded over 32 bits or 64 bits - known as Extended SN can be encoded over 32 bits or 64 bits - known as Extended
Sequence Number (ESN). As per [RFC4303], the support of ESN is not Sequence Number (ESN). As per [RFC4303], the support of ESN is not
mandatory. The determination of the use of ESN is based on the mandatory. The determination of the use of ESN is based on the
largest possible value a SN can take over a session. When SN is largest possible value a SN can take over a session. When SN is
incremented for each packet, the number of packets sent over the incremented for each packet, the number of packets sent over the
lifetime of a session may be considered. However, when the SN is lifetime of a session may be considered. However, when the SN is
incremented differently - such as when time is used - the maximum incremented differently - such as when time is used - the maximum
value SN needs to be considered instead. Note that the limit of value SN needs to be considered instead. Note that the limit of
messages being sent is primarily determined by the security messages being sent is primarily determined by the security
associated with the key rather than the SN. The security of all data associated with the key rather than the SN. The security of all data
protected under a given key decreases slightly with each message and protected under a given key decreases slightly with each message and
a node must ensure the limit is not reached - even though the SN a node must ensure the limit is not reached - even though the SN
would permit it. Estimation of the maximum number of packets to be would permit it. Estimation of the maximum number of packets to be
sent by a node is always challenging and as such should be considered sent by a node is always challenging and as such should be considered
cautiously as nodes could be online for much more time than expected. cautiously as nodes could be online for much more time than expected.
Even for constrained devices, it is recommended to implement some Even for constrained devices, this document recommends to implement
rekey mechanisms (see Section 9). some rekey mechanisms (see Section 9).
4. Padding 4. Padding
The purpose of padding is to respect the 32 bit alignment of ESP or The purpose of padding is to respect the 32 bit alignment of ESP or
block size expected by an encryption transform - such as AES-CBC for block size expected by an encryption transform - such as AES-CBC for
example. ESP must have at least one padding byte Pad Length that example. ESP must have at least one padding byte Pad Length that
indicates the padding length. ESP padding bytes are generated by a indicates the padding length. ESP padding bytes are generated by a
succession of unsigned bytes starting with 1, 2, 3 with the last byte succession of unsigned bytes starting with 1, 2, 3 with the last byte
set to Pad Length, where Pad Length designates the length of the set to Pad Length, where Pad Length designates the length of the
padding bytes. padding bytes.
skipping to change at page 8, line 21 skipping to change at page 8, line 21
would typically be the case when the Data Payload is of fix size. would typically be the case when the Data Payload is of fix size.
ESP [RFC4303] also provides Traffic Flow Confidentiality (TFC) as a ESP [RFC4303] also provides Traffic Flow Confidentiality (TFC) as a
way to perform padding to hide traffic characteristics, which differs way to perform padding to hide traffic characteristics, which differs
from respecting a 32 bit alignment. TFC is not mandatory and must be from respecting a 32 bit alignment. TFC is not mandatory and must be
negotiated with the SA management protocol. TFC has not yet being negotiated with the SA management protocol. TFC has not yet being
widely adopted for standard ESP traffic. One possible reason is that widely adopted for standard ESP traffic. One possible reason is that
it requires to shape the traffic according to one traffic pattern it requires to shape the traffic according to one traffic pattern
that needs to be maintained. This is likely to require extra that needs to be maintained. This is likely to require extra
processing as well as providing a "well recognized" traffic shape processing as well as providing a "well recognized" traffic shape
which could end up being counterproductive. As such, it is NOT which could end up being counterproductive. As such, this document
recommended that minimal ESP implementation supports TFC. does not recommend that minimal ESP implementation supports TFC.
As a result, TFC cannot be enabled with minimal ESP, and As a result, TFC cannot be enabled with minimal ESP, and
communication protection that were relying on TFC will be more communication protection that were relying on TFC will be more
sensitive to traffic shaping. This could expose the application as sensitive to traffic shaping. This could expose the application as
well as the devices used to a passive monitoring attacker. Such well as the devices used to a passive monitoring attacker. Such
information could be used by the attacker in case a vulnerability is information could be used by the attacker in case a vulnerability is
disclosed on the specific device. In addition, some application use disclosed on the specific device. In addition, some application use
- such as health applications - may also reveal important privacy - such as health applications - may also reveal important privacy
oriented information. oriented information.
skipping to change at page 9, line 18 skipping to change at page 9, line 18
in the packet. Next header specifies the data contained in the in the packet. Next header specifies the data contained in the
payload as well as dummy packet, i.e. packets with the Next Header payload as well as dummy packet, i.e. packets with the Next Header
with a value 59 meaning "no next header". In addition, the Next with a value 59 meaning "no next header". In addition, the Next
Header may also carry an indication on how to process the packet Header may also carry an indication on how to process the packet
[I-D.nikander-esp-beet-mode]. [I-D.nikander-esp-beet-mode].
The ability to generate and receive dummy packets is required by The ability to generate and receive dummy packets is required by
[RFC4303]. For interoperability, a minimal ESP implementation must [RFC4303]. For interoperability, a minimal ESP implementation must
discard dummy packets without indicating an error. Note that such discard dummy packets without indicating an error. Note that such
recommendation only applies for nodes receiving packets, and that recommendation only applies for nodes receiving packets, and that
nodes designed to only send data may not implement this capability. nodes designed to only send data might not implement this capability.
As the generation of dummy packets is subject to local management and As the generation of dummy packets is subject to local management and
based on a per-SA basis, a minimal ESP implementation may not based on a per-SA basis, a minimal ESP implementation may not
generate such dummy packet. More especially, in constrained generate such dummy packet. More especially, in constrained
environment sending dummy packets may have too much impact on the environment sending dummy packets may have too much impact on the
device lifetime, and so may be avoided. On the other hand, device lifetime, and so may be avoided. On the other hand,
constrained nodes may be dedicated to specific applications, in which constrained nodes may be dedicated to specific applications, in which
case, traffic pattern may expose the application or the type of node. case, traffic pattern may expose the application or the type of node.
For these nodes, not sending dummy packet may have some privacy For these nodes, not sending dummy packet may have some privacy
implication that needs to be measured. However, for the same reasons implication that needs to be measured. However, for the same reasons
skipping to change at page 10, line 32 skipping to change at page 10, line 32
outdated ciphers). ESP can be used to authenticate only or to outdated ciphers). ESP can be used to authenticate only or to
encrypt the communication. In the latter case, authenticated encrypt the communication. In the latter case, authenticated
encryption must always be considered [RFC8221]. encryption must always be considered [RFC8221].
2. Resilience to nonce re-use: Some transforms -including AES-GCM - 2. Resilience to nonce re-use: Some transforms -including AES-GCM -
are very sensitive to nonce collision with a given key. While are very sensitive to nonce collision with a given key. While
the generation of the nonce may prevent such collision during a the generation of the nonce may prevent such collision during a
session, the mechanisms are unlikely to provide such protection session, the mechanisms are unlikely to provide such protection
across reboot. This causes an issue for devices that are across reboot. This causes an issue for devices that are
configured with a key. When the key is likely to be re-used configured with a key. When the key is likely to be re-used
across reboots, it is recommended to consider algorithms that are across reboots, this document recommends to consider algorithms
nonce misuse resistant such as, for example, AES-SIV [RFC5297], that are nonce misuse resistant such as, for example, AES-SIV
AES-GCM-SIV [RFC8452] or Deoxys-II [DeoxysII]. Note however that [RFC5297], AES-GCM-SIV [RFC8452] or Deoxys-II [DeoxysII]. Note
currently none of them has yet been defined for ESP. however that currently none of them has yet been defined for ESP.
3. Interoperability: Interoperability considers the encryption 3. Interoperability: Interoperability considers the encryption
algorithm transforms shared with the other nodes. Note that it algorithm transforms shared with the other nodes. Note that it
is not because an encryption algorithm transform is widely is not because an encryption algorithm transform is widely
deployed that it is secured. As a result, security should not be deployed that it is secured. As a result, security should not be
weakened for interoperability. [RFC8221] and successors consider weakened for interoperability. [RFC8221] and successors consider
the life cycle of encryption algorithm transforms sufficiently the life cycle of encryption algorithm transforms sufficiently
long to provide interoperability. Constrained devices may have long to provide interoperability. Constrained devices may have
limited interoperability requirements which makes possible to limited interoperability requirements which makes possible to
reduces the number of encryption algorithm transforms to reduces the number of encryption algorithm transforms to
skipping to change at page 11, line 47 skipping to change at page 11, line 47
document provided security recommendations and guidance over the document provided security recommendations and guidance over the
implementation choices for each field. implementation choices for each field.
The security of a communication provided by ESP is closely related to The security of a communication provided by ESP is closely related to
the security associated with the management of that key. This the security associated with the management of that key. This
usually includes mechanisms to prevent a nonce from repeating, for usually includes mechanisms to prevent a nonce from repeating, for
example. When a node is provisioned with a session key that is used example. When a node is provisioned with a session key that is used
across reboot, the implementer must ensure that the mechanisms put in across reboot, the implementer must ensure that the mechanisms put in
place remain valid across reboot as well. place remain valid across reboot as well.
It is recommended to use ESP in conjunction with key management This document recommends to use ESP in conjunction with key
protocols such as for example IKEv2 [RFC7296] or minimal IKEv2 management protocols such as for example IKEv2 [RFC7296] or minimal
[RFC7815]. Such mechanisms are responsible for negotiating fresh IKEv2 [RFC7815]. Such mechanisms are responsible for negotiating
session keys as well as prevent a session key being use beyond its fresh session keys as well as prevent a session key being use beyond
lifetime. When such mechanisms cannot be implemented and the session its lifetime. When such mechanisms cannot be implemented and the
key is, for example, provisioned, the nodes must ensure that keys are session key is, for example, provisioned, the nodes must ensure that
not used beyond their lifetime and that the appropriate use of the keys are not used beyond their lifetime and that the appropriate use
key remains across reboots - e.g. conditions on counters and nonces of the key remains across reboots - e.g. conditions on counters and
remains valid. nonces remains valid.
When a node generates its key or when random value such as nonces are When a node generates its key or when random value such as nonces are
generated, the random generation must follow [RFC4086]. In addition generated, the random generation must follow [RFC4086]. In addition
[SP-800-90A-Rev-1] provides appropriated guidance to build random [SP-800-90A-Rev-1] provides appropriated guidance to build random
generators based on deterministic random functions. generators based on deterministic random functions.
10. Acknowledgment 10. Acknowledgment
The authors would like to thank Daniel Palomares, Scott Fluhrer, Tero The authors would like to thank Daniel Palomares, Scott Fluhrer, Tero
Kivinen, Valery Smyslov, Yoav Nir, Michael Richardson, Thomas Peyrin Kivinen, Valery Smyslov, Yoav Nir, Michael Richardson, Thomas Peyrin,
and Eric Thormarker for their valuable comments. In particular Scott Eric Thormarker, Nancy Cam-Winget and Bob Briscoe for their valuable
Fluhrer suggested to include the rekey index in the SPI. Tero comments. In particular Scott Fluhrer suggested to include the rekey
Kivinen provided also multiple clarifications and examples of index in the SPI. Tero Kivinen provided also multiple clarifications
deployment ESP within constrained devices with their associated and examples of deployment ESP within constrained devices with their
optimizations. Thomas Peyrin Eric Thormarker and Scott Fluhrer associated optimizations. Thomas Peyrin Eric Thormarker and Scott
suggested and clarified the use of transform resilient to nonce Fluhrer suggested and clarified the use of transform resilient to
misuse. nonce misuse.
11. References 11. References
11.1. Normative References 11.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
 End of changes. 17 change blocks. 
76 lines changed or deleted 77 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/