Skip to content
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

Evaluate Canonical value of security.txt ? #772

Closed
baknu opened this issue Oct 20, 2022 · 9 comments · Fixed by #959
Closed

Evaluate Canonical value of security.txt ? #772

baknu opened this issue Oct 20, 2022 · 9 comments · Fixed by #959

Comments

@baknu
Copy link
Contributor

baknu commented Oct 20, 2022

Currently we do not check the value of the Canonical fields, because we find that its meaning is unclear in the security.txt specification. The latter is only the case when redirects are involved.

This issue is to get more clearity on its meaning when redirects are invloved, and also to discuss if and how we can add a check for this.

Note 1: Clarification question was already asked on securitytxt/security-txt#217
Note 2: The sectxt parser now uses the following interpretation: ""Web URI where security.txt is located must match with a 'Canonical' field. In case of redirecting either the first or last web URI of the redirect chain must match.""

@baknu baknu added this to the v1.7 milestone Oct 21, 2022
@WKobes
Copy link
Contributor

WKobes commented Jan 30, 2023

For the Dutch government this could also identify incorrect redirects.

E.g. https://www.rijksoverheid.nl/.well-known/security.txt would fail because the Canonical URL is https://www.ncsc.nl/.well-known/security.txt

@mxsasha mxsasha modified the milestones: v1.7, v1.8 Mar 7, 2023
@mxsasha
Copy link
Collaborator

mxsasha commented Apr 11, 2023

If we finally want to do this, we first need to make a final decision on what we see as the requirements for Canonical. We've been pingponging on this for months now :)

@mxsasha
Copy link
Collaborator

mxsasha commented Apr 18, 2023

Final decision:

  • If a (or multiple) Canonical field is present, regardless of signature, the last URL in the redirect chain must be listed in a Canonical field, including query string if present.
  • If the file is signed, one or more Canonical fields must be present - already tested.

@mxsasha
Copy link
Collaborator

mxsasha commented Apr 26, 2023

#959 adds this and also updates the dependency to 0.8.3.

@baknu we need new labels for errors no_canonical_match, no_csaf_file and multiple_csaf_fields and probably need to update the test description.

As before, DTC's wording does not have to match ours, we only use the same error code. Our interpretation of no_canonical_match is different from DTC, so we definitely should not reuse their error message text there. But I also think their proposed texts for CSAF are not very clear.

@mxsasha mxsasha reopened this Apr 26, 2023
@mxsasha mxsasha added the done label Apr 26, 2023
mxsasha added a commit that referenced this issue Apr 28, 2023
mxsasha added a commit that referenced this issue Apr 28, 2023
@mxsasha mxsasha removed their assignment Jun 6, 2023
@mxsasha
Copy link
Collaborator

mxsasha commented Jun 8, 2023

There's a bug here: when testing for internet.nl the found_url is https://internet.nl:443/.well-known/security.txt. This then does not match Canonical. May be a side effect from changing HTTP clients.

@baknu
Copy link
Contributor Author

baknu commented Oct 7, 2023

@mxsasha It seems better to wait and do this when we upgrade to the upcoming sectxt version 0.9.1 (see #1046). Right?

@baknu baknu added the question label Oct 7, 2023
@baknu baknu removed this from the v1.8 milestone Oct 7, 2023
@baknu baknu added this to the v1.9 milestone Oct 7, 2023
@mxsasha
Copy link
Collaborator

mxsasha commented Oct 9, 2023

@mxsasha It seems better to wait and do this when we upgrade to the upcoming sectxt version 0.9.1 (see #1046). Right?

The canonical check is already done. The code is merged, we are upgraded to 0.8.3 in #959 and the bug I mentioned on June 8th is fixed. Only content is pending, included in https://github.com/internetstandards/Internet.nl_content/pull/41

@baknu baknu modified the milestones: v1.9, v1.8 Oct 10, 2023
@baknu
Copy link
Contributor Author

baknu commented Oct 11, 2023

@mxsasha: Content is ready. Could you check? Thanks.

@baknu
Copy link
Contributor Author

baknu commented Oct 26, 2023

Processed feedback from @mxsasha

@baknu baknu closed this as completed Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment