Re: [DNSOP] RFC 9460: ServiceParamKey for web integrity

2023-11-28 Thread Ray Bellis




On 28/11/2023 12:25, Ben Schwartz wrote:


I think DNS is simply the wrong tool for this job.


+lots

Ray

___
DNSOP mailing list
DNSOP@ietf.org
https://www.ietf.org/mailman/listinfo/dnsop


Re: [DNSOP] RFC 9460: ServiceParamKey for web integrity

2023-11-28 Thread James Addison
On Tue, Nov 28, 2023 at 12:25 PM Ben Schwartz  wrote:
>
> Using DNS in this way is particularly operationally challenging because DNS 
> is "eventually consistent".  DNS TTLs are routinely "stretched" by resolvers 
> and clients: even short-lived records can take many hours to reach 100% 
> effective rollout.  In the "B" proposal, every HTTP content update could be 
> blocked for hours or days waiting on DNS, with no way for the server operator 
> to know when it is finally safe to make the change.

Yes, this is difficult - the TTL for the integrity records (whether a
dedicated RR type, or associated with the HTTPS RR type) would likely
be short due to these concerns.  And we might also want the homepage
HTTP response cache time to be even shorter than that, so that cached
content is more likely to be expunged before the transitional
two-digest (used during content changes) is reduced to the single,
most-recent fresh digest.

I fully admit that I'm not practically or theoretically competent in
the area of DNS propagation, but am somewhat aware of the problems.
That means that I would like (or will prepare) a pathological test
case to help figure out whether the spec behaves correctly under
further constraints, what edge cases and mitigations could exist, or
whether the approach is entirely unviable.

> I think DNS is simply the wrong tool for this job.  The most direct solution 
> I've thought of involves a new X.509 OID for "HTTP content auditor" and a 
> signature from the auditor on every returned resource, but that's off-topic 
> for this working group.  You might also want to review the Mirror Protocol, 
> which solves a different variant of this problem: 
> https://datatracker.ietf.org/doc/draft-group-privacypass-consistency-mirror/.

Thanks again - I'll read some more into those alternatives.  If
possible I would like a solution that is backwards-compatible (despite
the lack of integrity guarantees for legacy web clients), however I'm
open to opting-in to forward-looking solutions too.

>
> 
> From: James Addison 
> Sent: Tuesday, November 28, 2023 6:51 AM
> To: Ben Schwartz 
> Cc: dnsop@ietf.org 
> Subject: Re: [DNSOP] RFC 9460: ServiceParamKey for web integrity
>
> !---|
>   This Message Is From an Untrusted Sender
>   You have not previously corresponded with this sender.
> |---!
>
> Hi Ben,
>
> Thanks for your response.  Please find some comments inline, with one
> intra-line edit from your message, annotated with pipe symbols.
>
> On Tue, Nov 28, 2023 at 3:35 AM Ben Schwartz  wrote:
> >
> > Hi James,
> >
> > RFC 9460 is quite flexible, and its IANA registration procedures are 
> > relatively open, so there are few barriers to attempting a specification 
> > like you describe.|
>
> Thanks - I'd like to be able to participate.  The intended goal is to
> find existing mechanisms to provide high integrity assurance for
> delivery of a static single-page HTML web application to clients -- or
> to explore what those mechanisms could be if they do not yet exist.
>
> >  |However, I do not think it would be a wise approach, for several reasons:
> >
> > HTTP is not normally used to serve a single resource per origin.
>
> Acknowledged - I don't have an on-topic response for this, although I
> do believe that integrity within websites (and I admit that is not all
> HTTP services) could be enhanced, and am aware of one[1] such request
> for the W3C SRI spec.
>
> > HTTP resources admit a variety of representations, resulting in distinct 
> > digest values.
>
> This is certainly true in a number of situations - dynamic websites
> and differing character set encodings spring to mind.  Despite that I
> think that there are cases where it is valuable to deliver static
> content with high integrity.  Doing so can align well with client
> implementation simplicity and cache hit rates.
>
> > The security offered by this feature would be extremely limited in the 
> > common case where DNSSEC is not applied end-to-end.
>
> The proposal should allow some limited tampering of webserver
> responses to be detected in the absence of DNSSEC, but I agree that
> adding DNSSEC provides stronger guarantees.
>
> > Deploying this feature would be operationally challenging if the content 
> > can ever change, because of the need to perform coordinated updates to HTTP 
> > content and DNS records.
>
> The deployment mechanism that I use currently -- a TXT record where
> the character string is prefixed with an uppercase B -- involves two
> invocations of the openssl command (one dgst, one base64) and then
> entry of the resulting hash into DNS.  For software development
> lifecycles that include automation, I do not believe that it should be
> onerous to optionally publish one or two digest values into DNS,
> although I also do not think that the specification should constr

Re: [DNSOP] RFC 9460: ServiceParamKey for web integrity

2023-11-28 Thread Ben Schwartz
Using DNS in this way is particularly operationally challenging because DNS is 
"eventually consistent".  DNS TTLs are routinely "stretched" by resolvers and 
clients: even short-lived records can take many hours to reach 100% effective 
rollout.  In the "B" proposal, every HTTP content update could be blocked for 
hours or days waiting on DNS, with no way for the server operator to know when 
it is finally safe to make the change.

I think DNS is simply the wrong tool for this job.  The most direct solution 
I've thought of involves a new X.509 OID for "HTTP content auditor" and a 
signature from the auditor on every returned resource, but that's off-topic for 
this working group.  You might also want to review the Mirror Protocol, which 
solves a different variant of this problem: 
https://datatracker.ietf.org/doc/draft-group-privacypass-consistency-mirror/.

--Ben Schwartz


From: James Addison 
Sent: Tuesday, November 28, 2023 6:51 AM
To: Ben Schwartz 
Cc: dnsop@ietf.org 
Subject: Re: [DNSOP] RFC 9460: ServiceParamKey for web integrity

!---|
  This Message Is From an Untrusted Sender
  You have not previously corresponded with this sender.
|---!

Hi Ben,

Thanks for your response.  Please find some comments inline, with one
intra-line edit from your message, annotated with pipe symbols.

On Tue, Nov 28, 2023 at 3:35 AM Ben Schwartz  wrote:
>
> Hi James,
>
> RFC 9460 is quite flexible, and its IANA registration procedures are 
> relatively open, so there are few barriers to attempting a specification like 
> you describe.|

Thanks - I'd like to be able to participate.  The intended goal is to
find existing mechanisms to provide high integrity assurance for
delivery of a static single-page HTML web application to clients -- or
to explore what those mechanisms could be if they do not yet exist.

>  |However, I do not think it would be a wise approach, for several reasons:
>
> HTTP is not normally used to serve a single resource per origin.

Acknowledged - I don't have an on-topic response for this, although I
do believe that integrity within websites (and I admit that is not all
HTTP services) could be enhanced, and am aware of one[1] such request
for the W3C SRI spec.

> HTTP resources admit a variety of representations, resulting in distinct 
> digest values.

This is certainly true in a number of situations - dynamic websites
and differing character set encodings spring to mind.  Despite that I
think that there are cases where it is valuable to deliver static
content with high integrity.  Doing so can align well with client
implementation simplicity and cache hit rates.

> The security offered by this feature would be extremely limited in the common 
> case where DNSSEC is not applied end-to-end.

The proposal should allow some limited tampering of webserver
responses to be detected in the absence of DNSSEC, but I agree that
adding DNSSEC provides stronger guarantees.

> Deploying this feature would be operationally challenging if the content can 
> ever change, because of the need to perform coordinated updates to HTTP 
> content and DNS records.

The deployment mechanism that I use currently -- a TXT record where
the character string is prefixed with an uppercase B -- involves two
invocations of the openssl command (one dgst, one base64) and then
entry of the resulting hash into DNS.  For software development
lifecycles that include automation, I do not believe that it should be
onerous to optionally publish one or two digest values into DNS,
although I also do not think that the specification should constrain
the record update procedure.

> Resource integrity is most valuable when the resource digest is held by a 
> party who is not the resource publisher, in order to prevent the publisher 
> from substituting a malicious resource.  However, in this design, the 
> resource publisher (i.e. the origin) also controls the DNS records on its own 
> zone.

Agreed, although I think it should be acceptable (despite perhaps
appearing less trustworthy) for both entities to be the same.

To further improve integrity (outside of the scope of either the DNS
or SRI specifications) it could make sense to allow independent
parties to rebuild the deployed web resource content from its source
code (perhaps retrieved from yet another entity) -- to verify that all
three of the DNS-published digest, the digest calculated from the
fetched resource, and the digest calculated after building the web
application entrypoint page from source have the same value (this is
similar to the idea of reproducible builds).

[1] - https://github.com/w3c/webappsec/issues/497

[snip]
> 
> From: DNSOP  on behalf of James Addison 
> 
> Sent: Wednesday, November 22, 2023 12:52 PM
> To: dnsop@ietf.org 
> Subject: [DNSOP] RFC 9460: ServiceParamKey for we

Re: [DNSOP] RFC 9460: ServiceParamKey for web integrity

2023-11-28 Thread James Addison
Hi Ben,

Thanks for your response.  Please find some comments inline, with one
intra-line edit from your message, annotated with pipe symbols.

On Tue, Nov 28, 2023 at 3:35 AM Ben Schwartz  wrote:
>
> Hi James,
>
> RFC 9460 is quite flexible, and its IANA registration procedures are 
> relatively open, so there are few barriers to attempting a specification like 
> you describe.|

Thanks - I'd like to be able to participate.  The intended goal is to
find existing mechanisms to provide high integrity assurance for
delivery of a static single-page HTML web application to clients -- or
to explore what those mechanisms could be if they do not yet exist.

>  |However, I do not think it would be a wise approach, for several reasons:
>
> HTTP is not normally used to serve a single resource per origin.

Acknowledged - I don't have an on-topic response for this, although I
do believe that integrity within websites (and I admit that is not all
HTTP services) could be enhanced, and am aware of one[1] such request
for the W3C SRI spec.

> HTTP resources admit a variety of representations, resulting in distinct 
> digest values.

This is certainly true in a number of situations - dynamic websites
and differing character set encodings spring to mind.  Despite that I
think that there are cases where it is valuable to deliver static
content with high integrity.  Doing so can align well with client
implementation simplicity and cache hit rates.

> The security offered by this feature would be extremely limited in the common 
> case where DNSSEC is not applied end-to-end.

The proposal should allow some limited tampering of webserver
responses to be detected in the absence of DNSSEC, but I agree that
adding DNSSEC provides stronger guarantees.

> Deploying this feature would be operationally challenging if the content can 
> ever change, because of the need to perform coordinated updates to HTTP 
> content and DNS records.

The deployment mechanism that I use currently -- a TXT record where
the character string is prefixed with an uppercase B -- involves two
invocations of the openssl command (one dgst, one base64) and then
entry of the resulting hash into DNS.  For software development
lifecycles that include automation, I do not believe that it should be
onerous to optionally publish one or two digest values into DNS,
although I also do not think that the specification should constrain
the record update procedure.

> Resource integrity is most valuable when the resource digest is held by a 
> party who is not the resource publisher, in order to prevent the publisher 
> from substituting a malicious resource.  However, in this design, the 
> resource publisher (i.e. the origin) also controls the DNS records on its own 
> zone.

Agreed, although I think it should be acceptable (despite perhaps
appearing less trustworthy) for both entities to be the same.

To further improve integrity (outside of the scope of either the DNS
or SRI specifications) it could make sense to allow independent
parties to rebuild the deployed web resource content from its source
code (perhaps retrieved from yet another entity) -- to verify that all
three of the DNS-published digest, the digest calculated from the
fetched resource, and the digest calculated after building the web
application entrypoint page from source have the same value (this is
similar to the idea of reproducible builds).

[1] - https://github.com/w3c/webappsec/issues/497

[snip]
> 
> From: DNSOP  on behalf of James Addison 
> 
> Sent: Wednesday, November 22, 2023 12:52 PM
> To: dnsop@ietf.org 
> Subject: [DNSOP] RFC 9460: ServiceParamKey for web integrity
>
> !---|
>   This Message Is From an Untrusted Sender
>   You have not previously corresponded with this sender.
> |---!
>
> Hello,
>
> This is a follow-up / redirection from a discussion thread[1] on the
> dnsext mailing list regarding a proposal for an additional DNS RR
> type.  Feedback received there indicates that instead of a distinct
> record type, a ServiceParamKey for use with the RFC 9460 HTTPS record
> type could potentially cater to the requirements.
>
> In short summary of the previous thread: the request is for addition
> of an integrity record, in a similar or identical format to that
> specified by W3C HTML SubResource Integrity specification[2], to be
> available alongside existing A/ records for domains containing
> webservers.  The contents of the record would be used by web browser
> clients to validate whether the response they receive from an initial
> request to the root URI path from any of the hosts in the domain
> matches an expected hash value.
>
> The motivation of the request is to provide an optional
> out-of-HTTP-band integrity check for web clients that download a
> single-page web application from a fixed  URI path on a domain name.
>