HTTP                                                              K. Oku
Internet-Draft                                                J. Iyengar
Intended status: Informational                                    Fastly
Expires: 14 February 2022                                 13 August 2021


                         Self-Tracing for HTTP
                   draft-kazuho-httpbis-selftrace-00

Abstract

   This document registers a "Well-Known URI" for exposing state of an
   HTTP connection to the peer using formats such as qlog schema [QLOG].

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on 14 February 2022.

Copyright Notice

   Copyright (c) 2021 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Simplified BSD License text
   as described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Simplified BSD License.







Oku & Iyengar           Expires 14 February 2022                [Page 1]


Internet-Draft            Self-Tracing for HTTP              August 2021


Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Notational Conventions  . . . . . . . . . . . . . . . . .   2
   2.  The Self-Trace Well-Known URI . . . . . . . . . . . . . . . .   2
   3.  Security Considerations . . . . . . . . . . . . . . . . . . .   3
     3.1.  Cross-Origin Attacks  . . . . . . . . . . . . . . . . . .   3
     3.2.  Coalescing Proxy Acting as Client . . . . . . . . . . . .   3
     3.3.  Connections Serving Multiple Origins  . . . . . . . . . .   3
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   4
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   4
     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   4
     5.2.  Informative References  . . . . . . . . . . . . . . . . .   4
   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   5
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   5

1.  Introduction

   One challenge regarding HTTP ([HTTP]) performance or stability
   analysis is obtaining the sender-side trace of connections.  End-
   users of HTTP who face issues do not have access to the server-side
   traces.  It is also difficult for server-side operators to retain
   enough amount of fine-grained traces that they can consult when their
   end-users report issues.  Also, there are privacy concerns regarding
   retaining fine-grained traces.

   This challenge can be overcome if the server exposes the trace of
   each HTTP connection on that same connection.  When users experience
   issues, they can report to the server operators with the traces that
   they obtained on the HTTP connections that suffered.  The privacy
   concern is mitigated as the users will be submitting the trace
   actively.

1.1.  Notational Conventions

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].

2.  The Self-Trace Well-Known URI

   When a server receives a GET request at the Self-Trace Well-Known
   URI, it starts streaming event information that occur on the
   connection on which that request was received.

   Note however that, depending on the type of the trace being
   collected, sending chunks of a trace might cause additonal events
   that in turn generate more chunks that have to be sent.  To prevent



Oku & Iyengar           Expires 14 February 2022                [Page 2]


Internet-Draft            Self-Tracing for HTTP              August 2021


   this infinite feedback loop, a server SHOULD suspend the transmission
   of self-trace when the self-trace becomes the only HTTP request being
   inflight on an HTTP connection.  When a new HTTP request is opened on
   the same HTTP connection, the server can resume the transmission of
   the trace.

3.  Security Considerations

3.1.  Cross-Origin Attacks

   To prevent cross-origin attacks, web browser access to the self-trace
   MUST be resticted to the same origin [FETCH].

3.2.  Coalescing Proxy Acting as Client

   When a forward proxy that coalesces HTTP requests from multiple end-
   clients connect to an HTTP server that can serve the self-trace, and
   if one of the end-clients request the self-trace, the provided trace
   might contain information regarding requests bein issued by other
   end-clients.

   To prevent this attack, servers SHOULD serve self-trace only when
   HTTPS is being used.  The assumption here is that when HTTPS is being
   used, end-clients are directly connected to the server.

3.3.  Connections Serving Multiple Origins

   Sometimes, reverse proxies are configured as such that one HTTP
   connection can be used for serving multiple origins maintained by
   different entities (e.g., CDN using an X.509 certificate that
   contains multiple customers).  In such deployments, a malicious
   origin might use a script running on a web browser to fetch the self-
   trace that conains traffic information related to other origins
   colocated, then upload the fetched trace to extract information.

   To prevent such attacks, reverse proxies used for forwarding HTTP
   requests to multiple origins belonging to different entities SHOULD
   do either of the following:

   *  Serve self-trace only from an origin maintained by the operator of
      the reverse proxy.

   *  Serve self-trace during only when requests for one origin is
      inflight on a given connection.







Oku & Iyengar           Expires 14 February 2022                [Page 3]


Internet-Draft            Self-Tracing for HTTP              August 2021


4.  IANA Considerations

   This specification registers the following value in the "Well-Known
   URIs" registry established by [RFC5785]:

   URI suffix: self-trace

   Change controller: IETF

   Specification document(s): this document

   Related information: N/A

5.  References

5.1.  Normative References

   [HTTP]     Fielding, R. T., Nottingham, M., and J. Reschke,
              "HTTP/1.1", Work in Progress, Internet-Draft, draft-ietf-
              httpbis-messaging-17, 25 July 2021,
              <https://www.ietf.org/archive/id/draft-ietf-httpbis-
              messaging-17.txt>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC5785]  Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known
              Uniform Resource Identifiers (URIs)", RFC 5785,
              DOI 10.17487/RFC5785, April 2010,
              <https://www.rfc-editor.org/info/rfc5785>.

5.2.  Informative References

   [FETCH]    WHATWG, "Fetch - Living Standard", n.d.,
              <https://fetch.spec.whatwg.org>.

   [I-D.benfield-http2-debug-state]
              Benfield, C. and B. Fitzpatrick, "HTTP/2 Implementation
              Debug State", Work in Progress, Internet-Draft, draft-
              benfield-http2-debug-state-01, 10 August 2016,
              <https://www.ietf.org/archive/id/draft-benfield-http2-
              debug-state-01.txt>.







Oku & Iyengar           Expires 14 February 2022                [Page 4]


Internet-Draft            Self-Tracing for HTTP              August 2021


   [QLOG]     Marx, R., Niccolini, L., and M. Seemann, "Main logging
              schema for qlog", Work in Progress, Internet-Draft, draft-
              ietf-quic-qlog-main-schema-00, 10 June 2021,
              <https://www.ietf.org/archive/id/draft-ietf-quic-qlog-
              main-schema-00.txt>.

Appendix A.  Acknowledgements

   In [I-D.benfield-http2-debug-state], Cory Benfield presented the idea
   of exposing a snapshot of an HTTP connection to the client.  The key
   difference from that proposal is that this specification defines a
   way to "stream" the states as they change.

Authors' Addresses

   Kazuho Oku
   Fastly

   Email: kazuhooku@gmail.com


   Jana Iyengar
   Fastly

   Email: jri.ietf@gmail.com


























Oku & Iyengar           Expires 14 February 2022                [Page 5]