<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.9 -->

<!DOCTYPE rfc SYSTEM "../Tools/rfcbootstrap/rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc tocindent="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>

<rfc ipr="trust200902" docName="draft-nottingham-how-did-that-get-into-the-repo-00" category="std">

  <front>
    <title>The secret-token URI Scheme</title>

    <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
      <organization></organization>
      <address>
        <email>mnot@mnot.net</email>
        <uri>https://www.mnot.net/</uri>
      </address>
    </author>

    <date year="2018"/>

    <area>General</area>
    
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This document registers the “secret-token” URI scheme, to aid in the identification
of authentication tokens.</t>



    </abstract>


    <note title="Note to Readers">


<t><spanx style="emph">RFC EDITOR: please remove this section before publication</spanx></t>

<t>The issues list for this draft can be found at <eref target="https://github.com/mnot/I-D/labels/how-did-that-get-into-the-repo">https://github.com/mnot/I-D/labels/how-did-that-get-into-the-repo</eref>.</t>

<t>The most recent (often, unpublished) draft is at <eref target="https://mnot.github.io/I-D/how-did-that-get-into-the-repo/">https://mnot.github.io/I-D/how-did-that-get-into-the-repo/</eref>.</t>

<t>Recent changes are listed at <eref target="https://github.com/mnot/I-D/commits/gh-pages/how-did-that-get-into-the-repo">https://github.com/mnot/I-D/commits/gh-pages/how-did-that-get-into-the-repo</eref>.</t>

<t>See also the draft’s current status in the IETF datatracker, at
<eref target="https://datatracker.ietf.org/doc/draft-nottingham-how-did-that-get-into-the-repo/">https://datatracker.ietf.org/doc/draft-nottingham-how-did-that-get-into-the-repo/</eref>.</t>


    </note>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>It has become increasingly common to use bearer tokens as an authentication mechanism.</t>

<t>Unfortunately, the number of security incidents involving accidental disclosure of these tokens has also increased. For example, we now regularly hear about a developer committing an access token to a public source code repository, either because they didn’t realise it was included in the committed code, or because they didn’t realise the implications of its disclosure.</t>

<t>This specification registers the “secret-token” URI scheme to aid prevention of such accidental disclosures. When tokens are easier to unambiguously identify, they can trigger warnings in Continuous Integration systems, or be used in source code repositories themselves. They can also be scanned for separately.</t>

<t>For example, if cloud.example.net issues access tokens to its clients for later use, and it does so by formatting them as secret-token URIs, tokens that “leak” into places that they don’t belong are easier to identify. This could be through a variety of mechanisms; for example, if repo.example.com can be configured to refuse commits containing secret-token URIs, it helps its customers avoid accidental disclosures.</t>

<t>secret-token URIs are intended to aid in identification of generated secrets like API keys and similar tokens. They are not intended for use in controlled situations where ephemeral tokens are used, such as things ike CSRF tokens.</t>

<section anchor="notational-conventions" title="Notational Conventions">

<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as
shown here.</t>

<t>This document uses ABNF <xref target="RFC5234"/>, including by reference the following rules: ALPHA, DIGIT.</t>

</section>
</section>
<section anchor="the-secret-token-uri-scheme" title="The secret-token URI scheme">

<t>The secret-token URI scheme identifies a token that is intended to be a secret.</t>

<figure><artwork type="abnf"><![CDATA[
secret-token-URI    = secret-token-scheme ":" token
secret-token-scheme = "secret-token"
token               = 1*tchar
tchar               = ALPHA / DIGIT / "-" / "_" / "." / "~"
]]></artwork></figure>

<t>Note that characters outside the range allowed by tchar MUST be percent-encoded (<xref target="RFC3986"/>, Section 2.1.</t>

<t>When a token is both generated and presented for authentication, the entire URI MUST be used,
without changes.</t>

<t>For example, given the URI:</t>

<figure><artwork type="example"><![CDATA[
secret-token:E92FB7EB-D882-47A4-A265-A0B6135DC842%20foo
]]></artwork></figure>

<t>This string (character-for-character, case-sensitive) will both be issued by the token authority, and required for later access.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>This document registers the following value in the URI Scheme registry:</t>

<t><list style="symbols">
  <t>Scheme name: secret-token</t>
  <t>Status: permanent</t>
  <t>Applications / protocols that use this scheme: none yet</t>
  <t>Contact: iesg@iesg.org</t>
  <t>Change Controller: IESG</t>
  <t>References: [this document]</t>
</list></t>

</section>
<section anchor="security-considerations" title="Security Considerations">

<t>The token ABNF rule allows tokens as small as one character. This is not recommended practice; applications should evaluate their requirements for entropy and issue tokens correspondingly.</t>

<t>This URI scheme is intended to prevent accidental disclosure; it cannot prevent intentional disclosure.</t>

<t>If it is difficult to correctly handle secret material, or unclear as to what the appropriate handling is, users might choose to obfuscate their secret tokens in order to evade detection (for example, removing the URI scheme for storage). Clear guidelines and helpful tools are good mitigations here.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor="RFC2119" target='https://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference  anchor="RFC8174" target='https://www.rfc-editor.org/info/rfc8174'>
<front>
<title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
<author initials='B.' surname='Leiba' fullname='B. Leiba'><organization /></author>
<date year='2017' month='May' />
<abstract><t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='8174'/>
<seriesInfo name='DOI' value='10.17487/RFC8174'/>
</reference>



<reference  anchor="RFC5234" target='https://www.rfc-editor.org/info/rfc5234'>
<front>
<title>Augmented BNF for Syntax Specifications: ABNF</title>
<author initials='D.' surname='Crocker' fullname='D. Crocker' role='editor'><organization /></author>
<author initials='P.' surname='Overell' fullname='P. Overell'><organization /></author>
<date year='2008' month='January' />
<abstract><t>Internet technical specifications often need to define a formal syntax.  Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications.  The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power.  The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges.  This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='STD' value='68'/>
<seriesInfo name='RFC' value='5234'/>
<seriesInfo name='DOI' value='10.17487/RFC5234'/>
</reference>



<reference  anchor="RFC3986" target='https://www.rfc-editor.org/info/rfc3986'>
<front>
<title>Uniform Resource Identifier (URI): Generic Syntax</title>
<author initials='T.' surname='Berners-Lee' fullname='T. Berners-Lee'><organization /></author>
<author initials='R.' surname='Fielding' fullname='R. Fielding'><organization /></author>
<author initials='L.' surname='Masinter' fullname='L. Masinter'><organization /></author>
<date year='2005' month='January' />
<abstract><t>A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.  This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet.  The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier.  This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='STD' value='66'/>
<seriesInfo name='RFC' value='3986'/>
<seriesInfo name='DOI' value='10.17487/RFC3986'/>
</reference>




    </references>




  </back>

<!-- ##markdown-source:
H4sIAOEKdVsAA5VYa2/bOBb9zl/BdbGYtrDsxH2l6s5i3DxaA03STVIsFotB
QUu0REQitSQVr3cw/e17Lkk5dibTnQ0KWRLF+zj33AebZRnzyjcy5ze15E4W
VvrMm1up+ZerBb8uatlKJpZLK+9yVppCixYfl1asfKaN90pXtWiz2qyzUpWZ
r4XPKshQ2hs8yczKzmQHB6wUHhtnB4dHrMBtZewm586XjKnO5tzb3vnZwcHb
gxkTVoqcf5BaWtGwtbG3lTV9l7NbucFTmfOF9tJqqDkhQxhzXujyq2iMho6N
dKxTOf+nN8WY46J0KbUfc2est3LlcLdp0423qsBSYdpOpJsWH2NJ6UZp+TNj
ove1sTnjGeP4U9rl/HzCL7beh9cRmHNhbx+uGFsJrf4jvDI6D29kK1ST8xYA
/kSXCVwJC72F3bX3ncun0/V6PRlWp4xpY1vIuJMk4+rseHZ4+DYHenp1v8BY
lmVcLOEWvGHsplaOI2o9+cStrJQDcI4jMHy0G+1RCLcL4SbMuFAlPA0fKkJP
rVQRPGBmxQkRehff8CDBTaJyGCy/XtDFm69XUpTQx9hzGMxPTxY3l1c57xop
nIQ5rbmTUAEbYUsQtZTwRvKuXzZJ+nPyAkY410vHGzjA8UncFWjIC0H78LbX
JRee/2UAsFK+7pcThHRKOE4X2cm0EUvZuOn3+frXSVTaGkeoFQTeU7PyUo95
r4Nxrpbls2QALNlVG2KWdCsTtH5f3ZT0XUU1RS10BUeRA8FZ+b9dIsoq76ZV
nXUCe/+Ac9dSctE4E+IbnPjB8aK3lkxAMvneDdFfnN6ccSSvIErdSjuGPWxr
z87CREm/moDsUxBu+n9WiAAB0adVZdlIxp5QjltT9oEXjC08r4VDnOEt2KBB
XeEgutmElA0s5D1YtZSAziZOcmwBOx7wtZWEsnItdH6h9PG9RklqNuPgse7b
JSSA52AlMtJvSF/IAkLlzjR3UMxFEd+JhpfKFY1xPWKGXZABO5IBZHRAOpks
ywk/A3/lv0WLPBjzN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