GithubHelp home page GithubHelp logo

dns-caa's Introduction

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: []
}

dns-caa's People

Contributors

fschaeffler avatar

Watchers

 avatar

dns-caa's Issues

Subdomain support

Given these records:

example.com           IN CAA 0 issue "ca1.com"
subdomain.example.com IN CAA 0 issue "ca2.com"

and the following DNSCAA.getDnsCaa query

'subdomain.example.com'

the result should be

{
	issue: [ 'ca2.com' ],
	issuewild: []
}

CAA records can be overridden on subdomain level. LetsEncrypt also supports this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.