silverwind / caa Goto Github PK
View Code? Open in Web Editor NEWrfc6844-conform CAA record lookup and validation
License: BSD 2-Clause "Simplified" License
rfc6844-conform CAA record lookup and validation
License: BSD 2-Clause "Simplified" License
Currently the module is in devDependencies
so is inlined into the vite build.
Depends on vitejs/vite#14674.
There is some interesting behavior of how CNAME and CAA records can interact that I do not think is correctly handled in this library. This is made more confusing because this relationship was changed in an errata: https://www.rfc-editor.org/errata/eid5065
The relevant bit of that errata to this issue is:
Thus, when a search at node X returns a CNAME record, the CA will
follow the CNAME record chain to its target. If the target label
contains a CAA record, it is returned.
Otherwise, the CA continues the search at the parent of node X. <----- This line
Given this hypothetical DNS setup:
hosting-provider.com
A: 1.2.3.4
CAA: (unset)
client-domain.com
A: 9.8.7.6
CAA: issue "pki.goog"
www.client-domain.com
CNAME: hosting-provider.com
If I use this library like this:
await caa.matches('www.client-domain.com', 'letsencrypt.org');
this library will return true
- but it really should be returning false
(Lets Encrypt, for example, will not issue a certificate for www.client-domain.com
when the DNS setup is like this.)
What this library does:
www.client-domain.com
hosting-provider.com
hosting-provider.com
www.client-domain.com
caas.length
is empty, and returns true in caa.matches()
What I think the correct behavior is:
www.client-domain.com
hosting-provider.com
hosting-provider.com
client-domain.com
issue "pki.goog"
as CAA recordcaa.matches()
compares pki.goog
against lets-encrypt.org
and returns false.From rfc8659:
account.example.com CAA 0 issue "ca1.example.net; account=230123"
I'm noticing some odd behaviour with the handling of CAA records for alias targets where only one of the records is returned instead of all of the records.
Given this hypothetical configuration:
alpha.domain.example
CNAME: bravo.example
CAA: (unset)
bravo.example
A: 1.2.3.4
CAA: issue "amazon.com"
CAA: issue "comodoca.com"
CAA: issue "letsencrypt.org"
Executing the following:
await caa.matches('alpha.domain.example', 'letsencrypt.org');
The library returns false
, instead of true
. Debugging a bit, executing:
await caa('alpha.domain.example');
returns [{flags: 0, tag: 'issue', value: 'amazon.com', issuerCritical: false}]
.
I believe this section of code (https://github.com/silverwind/caa/blob/master/index.js#L126-L130) returns too eagerly and just returns after one match instead of filtering the list to all matches.
Hi,
Great plugin! :) Any chance that I can return the plain text record as well? In addition to the parsed object. I'd like to use an option or something to acces for example string:
0 issuewild "letsencrypt.org" 0 issue "letsencrypt.org" 0 iodef "mailto:[email protected]"
in addition to the object.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.