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

Fix #194 - Add CAA test #1624

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Fix #194 - Add CAA test #1624

wants to merge 11 commits into from

Conversation

mxsasha
Copy link
Collaborator

@mxsasha mxsasha commented Jan 20, 2025

https://caatestsuite.com/ has useful test cases.

Key references:

@mxsasha mxsasha self-assigned this Jan 20, 2025
@mxsasha mxsasha added the new test These issues suggest a new (sub)test that is currently not part of internet.nl label Jan 20, 2025
@mxsasha mxsasha linked an issue Jan 20, 2025 that may be closed by this pull request
@bwbroersma
Copy link
Collaborator

bwbroersma commented Jan 20, 2025

Should check at least syntax, although maybe CAA even protects if it's invalid?

Regarding the Let's Encrypt IP certificates I notices this comment:

CAA in rDNS is a possibility, but has some challenges with how CAA "tree climbing" works, especially for IPv6. There was an IETF LAMPS draft a while ago using that idea, and it's possible that design work could continue.

But this is not a problem, since internet.nl does not allow checking of ip address resources, only host names.

¹ RFC 8657 - Certification Authority Authorization (CAA) Record Extensions for Account URI and Automatic Certificate Management Environment (ACME) Method Binding

@mxsasha mxsasha added this to the v1.10 milestone Jan 22, 2025
@mxsasha mxsasha force-pushed the caatest branch 3 times, most recently from 30ebaab to da925e0 Compare February 12, 2025 11:28
@mxsasha
Copy link
Collaborator Author

mxsasha commented Feb 12, 2025

This is progressing well. The experiment of using ABNF as a basis for the parser is good and we should keep doing this. It just reduces errors and manual work. The error message in case of a mismatch with the grammar will point the user to the character, so they have something to go on.

Current implementation

  • We retrieve all CAA records for the domain under test, further up the tree if needed.
  • If there are no CAA records, the rest result is bad.
  • We parse all CAA records. If any have a format error, the test result is bad.
  • Otherwise, the test result is good.

The tech table displays translatable messages in a similar way as securitytxt - you can see them in the updated translations files for now. We have a message for having found a CAA (and on which domain), for not found, and specific error messages where possible.

Rationale for bad test result on parse errors

Some areas of CAA are fail-mostly-secure. If someone messes up their issue property, they probably just can't get certificates. That would typically lead to loud errors from either certificate expiration monitoring or, failing that, actual expiry. Much preferred to an unauthorised certificate being issued somewhere. Therefore, I'd prefer people configure
a bad issue than none. However, for properties like iodef this does not apply: if you misconfigure it, you miss out on reporting, which creates a risk. Therefore, we should not allow misconfigured iodef - they indicate that the user may be assuming that they get reports, but won't. Let's be consistent and just require correct syntax.

Second argument: the first argument is about security, but we're not a security tool, we are a standards compliance tool. Misconfigured CAAs are not standards compliant, therefore we must not accept them.

Next questions for us to decide

  1. What should our requirements be, other than the current "have 1 or more CAA records, which pass a syntax check"? Should we require at least an issue*? Or at least issue or issuewild?
  2. Email addresses are mentioned for the iodef and contactemail properties. For iodef, there is no definition of what an email address is. For contactemail, the spec refers to RFC6532 section 3.2, which is actually a patch on the grammar from two previous RFCs. It was starting to get complicated. Both checks at this time accept anything with an @.
  3. This is currently under certificate tests, both in the job scheduling and frontend, but it doesn't fit: all those other tasks are run once for each web server IP. CAA is on a domain level. Maybe it fits better under DNSSEC? The only category that evaluates the domain. Other than for email, where authenticity does the same.
  4. Do we want separate content for web and mail? E.g. explain the need for CAA differently, or the meaning of a bad verdict? I feel it's excessive, web and mail can use the same explanation.
  5. How detailed do we want to get in error messages? Currently we do not distinguish whether iodef value is invalid because it's an FTP URL, or an HTTPS URL without a netloc. I think that level of granularity is out of our scope. The translations file diffs show which error messages we have now.
  6. Should we follow errata 7139? Current status is "reported". I am leaning to yes, as it makes things clearer.

@mxsasha
Copy link
Collaborator Author

mxsasha commented Feb 18, 2025

Discussion from meeting:

  • we should require issue and perhaps also issuewild.
  • For email syntax, see what we do for DMARC. Does urlparse check email address?
  • For accounturi/validationmethods we stick to validating syntax. We do not require it, until we start doing it ourselves.
  • For mail we should actually look at MX hostnames for the domain.
  • For web, try to keep it under certs in the UI, but run the test once per domain.
  • This means slightly separate content for web and mail.
  • We are implementing errata 7139 as it is only a label change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new test These issues suggest a new (sub)test that is currently not part of internet.nl
Development

Successfully merging this pull request may close these issues.

Test domains for CAA record [website test]
2 participants