Re: [stir] "iat" value to use during PASSPorT construction

Chris Wendt <chris-ietf@chriswendt.net> Thu, 17 May 2018 23:40 UTC

Return-Path: <chris-ietf@chriswendt.net>
X-Original-To: stir@ietfa.amsl.com
Delivered-To: stir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 08BAA124205 for <stir@ietfa.amsl.com>; Thu, 17 May 2018 16:40:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.608
X-Spam-Level:
X-Spam-Status: No, score=-2.608 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=chriswendt-net.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CIskwm9z-on5 for <stir@ietfa.amsl.com>; Thu, 17 May 2018 16:40:23 -0700 (PDT)
Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CA2DF120454 for <stir@ietf.org>; Thu, 17 May 2018 16:40:22 -0700 (PDT)
Received: by mail-qk0-x236.google.com with SMTP id b39-v6so5078331qkb.5 for <stir@ietf.org>; Thu, 17 May 2018 16:40:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chriswendt-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=jTMO82rOOJWXsh6WlGgaaalGEJgxzSwla4yHlSDPxhs=; b=tVlBvrwQhLgeCfEFsdbuCxpAbYgMDQ0YnslelIwRlw1V1YSmb8BB/gH2VCRdZcpCpH ziGQHTwFK8TN2/g+ZrdQt0znv1Tkb91rO4LTOkkn7nUy4cinsdCHT7BGsy+szSxt5AFf LCpcWiEMERWx5ksZ/eGUawykFBp5hsEf62gvn6oMLedsmg7CVE7LA32av8aBn1pn6RRz YeEmZA4PwHrmS31BMCkgnkcU2Hvn/WhLYRdXTaNmQ+XT8VXzI8QkRZGmBLWfvodd+y4V Yh5N1Msk08hTvD4Mw5KY/xVjWH49K4iJBZHIaluClwqGMS2J4ysIEkaxxPFUB7Tw/NdP JEOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=jTMO82rOOJWXsh6WlGgaaalGEJgxzSwla4yHlSDPxhs=; b=Sgv4X24omyvZOnVcoASo+PRrPE6ONtwRNvvpjsy/0J2HfDno99CkuN6gAEvTPFBCFI QZ+cJQ/IxWuD2Hhy43/Eoo2YYlYpdQ6OLmrpwUMU3mB4wNj3tz6So4lwEvPjnre2LIX6 v+rPhWdC4VqyRBm0BjRjMx0bWpwsvQbVPioiDCfEzktguKnUUUJz+ipwVzXKSAEMP3om tchoEgfquieAYjTv+yivbR7gzUzkGgE2MOGICUMrynRBPAUXgCFZxNlFFbhXjVDGHap4 3IY71lToOtAVhUbwhGQ0vGAviAYX8CQl3uCGib/kdEhE10taj/szGfKJ/I0phoZTBFSA eajA==
X-Gm-Message-State: ALKqPwcwZvIsqtItllcBMzGy0f4o8/KHrMxEJIjmvbRH58wQdlMacCBt EQH1azsRhRUMC02WR9AG64U+tQ==
X-Google-Smtp-Source: AB8JxZrdjFMZRuoFkDkTPprQepK1PNGYagFK7TS+LRhmQSM5h+0rzB77VgJk/xloCwT/FIP90HTNRQ==
X-Received: by 2002:a37:d78c:: with SMTP id t12-v6mr7291249qkt.148.1526600421940; Thu, 17 May 2018 16:40:21 -0700 (PDT)
Received: from ?IPv6:2600:380:401b:5efd:449:d95b:40e3:b3cc? ([2600:380:401b:5efd:449:d95b:40e3:b3cc]) by smtp.gmail.com with ESMTPSA id 42-v6sm4499766qte.41.2018.05.17.16.40.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 16:40:20 -0700 (PDT)
From: Chris Wendt <chris-ietf@chriswendt.net>
Message-Id: <68AF4FFB-083B-4361-BB9C-EACC739EE947@chriswendt.net>
Content-Type: multipart/alternative; boundary="Apple-Mail=_CABFCC3E-CE0D-4D9E-994A-75F4E4FE5FD6"
Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\))
Date: Thu, 17 May 2018 19:40:14 -0400
In-Reply-To: <CY4PR03MB3160BF48B904086AEDD5C933A5910@CY4PR03MB3160.namprd03.prod.outlook.com>
Cc: "stir@ietf.org" <stir@ietf.org>
To: "Asveren, Tolga" <tasveren@rbbn.com>
References: <CY4PR03MB3160EE4F4502CCF974B070CFA59C0@CY4PR03MB3160.namprd03.prod.outlook.com> <05192EB8-97F5-4AF5-B415-1A9ECB6514B9@chriswendt.net> <CY4PR03MB316056821A803CC7FF80505AA5930@CY4PR03MB3160.namprd03.prod.outlook.com> <CY4PR03MB3160BF48B904086AEDD5C933A5910@CY4PR03MB3160.namprd03.prod.outlook.com>
X-Mailer: Apple Mail (2.3445.6.18)
Archived-At: <https://mailarchive.ietf.org/arch/msg/stir/cQPbvkxQiNuYWY9LoPW3LRIfGoA>
Subject: Re: [stir] "iat" value to use during PASSPorT construction
X-BeenThere: stir@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Secure Telephone Identity Revisited <stir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/stir>, <mailto:stir-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/stir/>
List-Post: <mailto:stir@ietf.org>
List-Help: <mailto:stir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/stir>, <mailto:stir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 17 May 2018 23:40:27 -0000

There is a bunch of philosophical ratholes we could go down here, but the “issuance” of a JWT i don’t believe is strictly meant to correspond to the “exact” time that the JWT is constructed.  My understanding is that it is meant to represent the time the token is valid in the context of the application and the claims you are making for that application. 
In the context of STIR, the initiation of the INVITE and the corresponding signing of that INVITE should occur in a very small time delta, whether it happens on the same device or between the SIP UE and a network element receiving that INVITE shortly later.  I believe this scenario is completely appropriate within the scope of the definition of “issuance” time.

> On May 17, 2018, at 3:46 PM, Asveren, Tolga <tasveren@rbbn.com> wrote:
> 
> To add a bit more color:
>  
> The following is the most authoritative specification regarding “iat” generation in general IMHO:
>  
> RFC7519 JSON Web Token (JWT)
>  
> 4.1.6 <>.  "iat" (Issued At) Claim
> 
>  
>    The "iat" (issued at) claim identifies the time at which the JWT was
>    issued.  This claim can be used to determine the age of the JWT.  Its
>    value MUST be a number containing a NumericDate value.  Use of this
>    claim is OPTIONAL.
>  
> This text clearly states that “iat” is for the generation time of JWS.
>  
>  
> So, I think both RFC8224/8225 need to be updated to prevent any ambiguity and be completely consistent with RFC7519.
>  
>  
> Thanks,
> Tolga
>  
> From: Asveren, Tolga 
> Sent: Tuesday, May 15, 2018 1:33 PM
> To: Chris Wendt <chris-ietf@chriswendt.net>
> Cc: stir@ietf.org
> Subject: RE: [stir] "iat" value to use during PASSPorT construction
>  
> Ideally specifications should have a firm stand on the scope of “iat” IMHO. Ambiguity is something to avoid even if the immediately envisioned use cases could function with both interpretations (and honestly I even doubt that let alone the impact on future extensions/new claim types). 
>  
> As I already indicated, what makes sense to me is that it for the “JSW”, not for the session therefore “current time” instead of Date needs to be used.
>  
> And as a side question: Is there really a practical concern regarding full-form being longer than the compact form? Are the extra few hundreds of octets really something causing heartburn considering that media associated with a session usually would require several magnitudes more?
>  
> Thanks,
> Tolga
>  
> From: Chris Wendt <chris-ietf@chriswendt.net <mailto:chris-ietf@chriswendt.net>> 
> Sent: Monday, May 14, 2018 10:31 AM
> To: Asveren, Tolga <tasveren@rbbn.com <mailto:tasveren@rbbn.com>>
> Cc: stir@ietf.org <mailto:stir@ietf.org>
> Subject: Re: [stir] "iat" value to use during PASSPorT construction
>  
> NOTICE: This email was received from an EXTERNAL sender
> 
> Hi Tolga,
>  
> I think the 60sec recommendation is a default, however, i think once we get more operational experience to see what the delta offsets of time typically are, we will have a better sense of what value to use and whether to move to a smaller time window or not.  This should in general be considered local policy what you believe is an acceptable time window. You may also want to implement secondary TDOS/replay attack types of protection to help here as well and not solely depend on “iat” freshness within that short time window.
>  
> In regards to the other part of your question, 8224 is saying to use the PASSporT “iat” to correspond to the DATE value of the SIP.  The assumption is that the PASSporT is being created at/close to the initiation of the INVITE.  I think whether you interpret that as taking the DATE and setting it exactly to the “iat” or if you are generating a PASSporT “iat” as a specifically 8225 compliant function in isolation, either will generally work if you are using full form of passport.  From what i’m personally aware of, most implementations are following the former vs the latter.
>  
> -Chris
>  
>  
> 
> On May 14, 2018, at 5:17 AM, Asveren, Tolga <tasveren@rbbn.com <mailto:tasveren@rbbn.com>> wrote:
>  
> RFC 8224 has the following in Section “4.1 PASSPorT Construction”:
>  
>       Third, the JSON key "iat" MUST appear.  The authentication service
>       SHOULD set the value of "iat" to an encoding of the value of the
>       SIP Date header field as a JSON NumericDate (as UNIX time, per
>       [RFC7519], Section 2), though an authentication service MAY set
>       the value of "iat" to its own current clock time.  If the
>       authentication service uses its own clock time, then the use of
>       the full form of PASSporT is REQUIRED.  In either case, the
>       authentication service MUST NOT generate a PASSporT for a SIP
>       request if the Date header is outside of its local policy for
>       freshness (sixty seconds is RECOMMENDED).
>  
> RFC 8225 has the following in Section “5.1.1 “iat” (Issued At) Claim”:
>  
>    The JSON claim MUST include the "iat" (Issued At) claim ([RFC7519],
>    Section 4.1.6).  As defined, the "iat" claim should be set to the
>    date and time of issuance of the JWT and MUST indicate the date and
>    time of the origination of the personal communications.  The time
>    value should be of the NumericDate format as defined in [RFC7519],
>    Section 2.  This is included for securing the token against replay
>    and cut-and-paste attacks, as explained further in Section 10
>    ("Security Considerations").
>  
> i- I see some conflict in RFC8225 text. It is mentioned that “iat” should be set based on issuance of JWT (which would be when PASSPorT is constructed). OTOH, it is also stated that it MUST indicate the date and time of the origination of the personal communication. The former seems to be  the right approach as what we would like to protect against cut-and-paste attacks is the PASSPorT in the context of a particular communication session. Coupling of PASSPorT with the communication session is provided through “orig”/”dest”. “iat” should be set to the time of generation of PASSPorT IMHO. RFC8244 text seems to be O.K. if one accepts this interpretation as it has the notion of “local policy for freshness”. The recommended value is on the very high end (anything more than a few seconds is too much in practice IMHO) but it is at least not mandating use of 60s.
>  
> ii- Aren’t there legitimate cases where a communication session continues for some period of time and then due to change in its nature requires addition of PASSPorT, e.g. first there is an announcement/interaction with an automated system (which may last several minutes) and then the called-party is contacted during which PASSPorT is added (because, for example, organizational boundaries are crossed and there is a need to validate calling-party identity). For such cases there could be a legitimate and major discrepancy between Date and “current time”. This is another argument in favor of considering “iat” as corresponding to PASSPorT generation rather than start of communication session IMHO. There could eb many other scenarios where similar discrepancy legitimately happens especially if one considers non-base claim types, e.g.. “div”.
>  
> So, the bottom line is I would like to get people’s opinion about whether “iat” should pertain to the start of communication session or to the creation of PASSPorT.
>  
>  
> Thanks,
> Tolga
>  
>  
> _______________________________________________
> stir mailing list
> stir@ietf.org <mailto:stir@ietf.org>
> https://www.ietf.org/mailman/listinfo/stir <https://www.ietf.org/mailman/listinfo/stir>