-
Notifications
You must be signed in to change notification settings - Fork 21
Signed Exchange Reporting #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@dcreager would love to hear your thoughts on this one. Arguably, it's pushing on the NEL boundaries, but I think the use case is critical for deploying SxG in the wild and conceptually fits well into NEL — it is addressing load failures. WDYT? |
Broadly speaking I think this is a good addition! I'll try to take a closer look tonight or tomorrow, my very rough initial thoughts are all along the lines of "can we integrate this into NEL more tightly?". For instance, do we need a new report type? Or can we just create We can also maybe reuse some of the report downgrading logic to handle the "hiding detailed error type" use case. Thoughts? |
Hmm, interesting. So we could..
@horo-t thoughts? |
Stop using
Does the downgrading logic mean this section "Origins with multiple IP addresses"? |
Signed Exchange report bodyIf we extend the existing body, the signed exchange report would be like this: To the distributor's end point.
To the publisher's end point.
I'm not 100% sure whether it is ok or not to send the IP address of distributor.example to the publisher's endpoint. Hiding detailed error typeI think this line
should be changed to this:
@igrigorik , @dcreager Does this match your idea? |
@horo-t overall, yeah that looks reasonable. With respect to #100 ... @dcreager what's your take on allowing report specific fields in the body, like what @horo-t suggesting in #100? That formulation opens up
|
Yeah I agree with this concern; I think @horo-t's latest draft on #100 (where it's a predefined schema) is a better stab at this. |
Although now that I think of it a bit more, maybe I don't agree as much... 😉 I think the current #100 muddies the waters a bit: I like the IDL definition of the new fields, but that new set of fields is specific to Signed Exchange responses, and so you could also argue that the IDL definition really belongs over in the SXG spec. I take your point about wanting to avoid a free-for-all with new unspecified fields in NEL reports. But for me, that concern is more about preventing user-agent implementors from adding unspecified fields. I'm less worried about downstream Web specs adding new fields, because that will at least go through some vetting process that allows us to raise concerns if we think they're getting out of hand. The key for me is that we want to disallow unspecified fields, and not that we want to require all fields to be specified specifically in the NEL spec. So what about the following:
|
(Also I apologize if that seems to contradict my earlier comment! I'm not trying to go back-and-forth, but I do think my more recent suggestion could be a better separation of concerns.) |
Incorporated dcreager's comment: w3c#99 (comment)
Incorporated dcreager's comment: w3c#99 (comment)
I updated #100 to 'Introduce a new algorithm "Deliver a network report"', and updated WICG/webpackage#374 to use the algorithm. |
@dcreager yep, makes sense. The mechanism you proposed makes sense to me. My only other constraint (or, "desire" is probably more apt) is that the payload is laid out in a predictable way. For example, if I'm implementing a collector or aggregator, I'd like to have a predictable path for baseline processing of any report, regardless of its type...
I think both of the above are maintained in the proposed setup, and |
As discussed at w3c/network-error-logging#99. Example report: { "type": "network-error", "url": "https://publisher.example/article.html", "age": 234, "user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) ...", "body": { "referrer": "https://aggregator.example/article.html", "sampling_fraction": 1, "server_ip": "123.122.121.120", // The IP address of distributor.example. "protocol": "http/1.1", "method": "GET", "status_code": 200, "elapsed_time": 1234, "phase": "sxg", "type": "sxg.failed", "sxg": { "outer_url": "https://distributor.example/publisher.example/article.html.sxg", "inner_url": "https://publisher.example/article.html", "cert_url": "https://distributor.example/publisher.example/cert" }, } }
@horo-t it looks like WICG/webpackage@af43527 landed support for reporting to distributor only, what about the publisher use case that you highlighted in your proposal? Are you planning to land that as well? |
Currently I don't have a plan to land the publisher side reporting in the short term. It is because there could be several privacy and security concerns in publishers side. |
Hmm.. I'd love to understand the potential concerns over surfacing the URL of the signed exchange. Any existing docs or threads that you can point me to, or maybe you have a short tl;dr top of mind? |
Sorry I don't have a concrete document. |
@horo-t makes sense, but I'm still murky on how a distributor URL might enable that. Is the answer, we don't know and hence we're erring on the side of safety, or do we have a concrete case in mind that we need to consider? |
If the aggregator has a link to the SXG which URL contains a TRACKING_ID, and the publisher can know the SXG's URL, the aggregator can send the TRACKING_ID to the publisher. |
(Redundantly posting this on all the issues where the tracking question came up.) |
What happens if cert url was a Data URL? Will it be always considered cross-origin to reporting origin? |
The report is not "downgraded" if the cert URL is a data URL. See the step 7 of "Queuing signed exchange report". |
For SRI (#155), it was observed that while reporting might be appropriate, it did not relate to the use of the network. This might not be as clear of an argument in this case (signed exchanges -- or rather web bundles -- are intended to provide a substitute for networking), but I thought it might be worth mentioning. However, the bigger point seems to be that this has been overtaken by events. It's more than 4 years since the last comment here and I believe that signed exchanges (again, web bundles really) have been largely abandoned. |
I want to extend Network Error Logging to support Signed Exchange.
Signed Exchange feature enables content publishers to sign their contents using their own private keys. User Agents (UAs) can trust the signed contents as if the contents are served from the publisher’s origins even if they are served from other distributors’ origins. Even if there is no network errors, UA may fail to load the signed content (example: the signature of the content has expired). This case is not covered by the Network Error Logging feature now. Both publishers and distributors can’t recognize the errors in the user’s environment. I want to extend Network Error Logging feature to enable both publishers and distributors to investigate the signed exchange loading errors such as certificate verification errors.
Distributor side reporting
A publisher (publisher.example) signed the article (https://publisher.example/article.html) as article.html.sxg. A distributor (distributor.example) is distributing the content at https://distributor.example/publisher.example/article.html.sxg and the certificate of publisher.example at https://distributor.example/publisher.example/cert.
If the distributor wants to investigate the signed exchange logs, the distributor sets the Report-To and NEL header in the HTTP response. This is same as the existing Network Error Logging feature.
Once UA receives the Report-To and NEL header, when UA failed to load (prefetch or navigation) the signed exchange content in the origin (https://distributor.example) because the signature has expired, UA should send the report to the end point https://report.distributor.example/.
Publisher side reporting
If the publisher wants to investigate the signed exchange logs, the publisher sets the Report-To and NEL in the signed response header of the signed exchange.
Same as distributor side reporting, UA should send the report to the end point https://report.publisher.example/ when the UA failed to navigate to the signed exchange content.
UAs must not send the report to the publisher when the UA loaded the signed exchange for prefetching, because prefetching signed exchange must be done in a privacy-preserving manner.
Error types
UA will expose the following error types.
"ok" is sent only when success_fraction of NEL header is set larger than 0.0.
The following detailed error types should be used only when the reporting origin (the distributor or the publisher) is same as the origin of cert-url of the signed exchange. See Hiding detailed error type section.
Hiding detailed error type
If the reporting origin (the distributor or the publisher) is different from the origin of cert url, UA must send only ok or failed. This is intended to avoid the leaking of cross-origin information in cert_url.
For example an evil attacker can do the port-scanning by checking whether the error type is cert_fetch_error or cert_parse_error if UA sends the detailed error types. Example:
The text was updated successfully, but these errors were encountered: