Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fschaeffler/dns-caa
NPM-package for checking for the DNS CAA
https://github.com/fschaeffler/dns-caa
Last synced: 25 days ago
JSON representation
NPM-package for checking for the DNS CAA
- Host: GitHub
- URL: https://github.com/fschaeffler/dns-caa
- Owner: fschaeffler
- License: mit
- Created: 2018-04-18T12:02:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-18T12:20:27.000Z (almost 7 years ago)
- Last Synced: 2024-12-23T20:24:22.914Z (29 days ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DNS CAA
This npm-packages checks for the existance of the security-feature DNS CAA.
## Installation
`npm install dns-caa --save`
## Usage
- when the term `issue` is being used, it's a single domain certificates.
- when the term `issuewild` is being used, it's for wildcard certficates### DNSCAA.getDnsCaa = async function (domain, dnsServer = '8.8.8.8')
```
const DNSCAA = require('dns-caa');let _getGoogleDnsCaa = async function () {
let checkResult = await DNSCAA.getDnsCaa('google.com');
console.log(checkResult);
};let _getGoogleDnsCaaDnsServer = async function () {
let checkResult = await DNSCAA.getDnsCaa('google.com', 8.8.4.4);
console.log(checkResult);
};// retrieve DNS-CAA for google.com via the default DNS-Server 8.8.8.8
_getGoogleDnsCaa();// retrieve DNS-CAA for google.com from DNS-Server 8.8.4.4
_getGoogleDnsCaa();```
output:
```
{
issue: [ 'pki.goog' ],
issuewild: []
}
```### DNSCAA.validate = async function (domain, expectedCAAs, dnsServer = '8.8.8.8')
```
const DNSCAA = require('dns-caa');let _getGoogleValidation = async function () {
let checkResult = await DNSCAA.validate('google.com', {issue: ['google.de', 'pki.goog']});
console.log(checkResult);
};// check fi google.com has the entries google.de and pki.goog as valid CAA-records
_getGoogleValidation();
```output:
```
{
hasDnsCaa: true,
issue: [
{ caa: 'google.de', exists: false },
{ caa: 'pki.goog', exists: true }
],
issuewild: []
}
```