Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
acme-dns-01-cloudflare
Advanced tools
Cloudflare DNS for Let's Encrypt / ACME dns-01 challenges with Greenlock.js and ACME.js
Cloudflare DNS + Let's Encrypt. This module handles ACME dns-01 challenges, compatible with Greenlock.js and ACME.js. It passes acme-dns-01-test.
npm install acme-dns-01-cloudflare --save
Whilst you can use a global API key and email to generate certs, we heavily encourage that you use a Cloudflare API token for increased security.
From your Cloudflare Profile page, create an API Token with the following permissions:
Unfortunately at this time, there is no way to acquire the com.cloudflare.api.account.zone.list
permission needed to list zones without giving the key Zone: Read
access to all zones. Further discussion of this can be found here and hopefully there'll be a better solution in the future.
The resulting API token should look something like this:
First, create an instance of the library with your Cloudflare API credentials or an API token. See the instructions above for more information.
const acmeDnsCloudflare = require('acme-dns-01-cloudflare');
const cloudflareDns01 = new acmeDnsCloudflare({
token: 'xxxxxx',
verifyPropagation: true,
verbose: true // log propagation delays and other debug information
});
Other options include waitFor
and retries
which control the number of propagation retries, and delay between retries. You probably won't need to tweak these unless you're seeing regular DNS related failures.
Then you can use it with any compatible ACME library, such as Greenlock.js or ACME.js.
See the Greenlock.js documentation for more information.
const Greenlock = require('greenlock');
const pkg = require('./package.json');
const greenlock = Greenlock.create({
packageAgent: pkg.name + '/' + pkg.version,
configDir: "./store",
maintainerEmail: "example@example.com"
});
greenlock.manager.defaults({
agreeToTerms: true,
subscriberEmail: "example@example.com",
store: {
module: "greenlock-store-fs",
basePath: "./store/certs"
},
challenges: {
"dns-01": cloudflareDns01
}
});
greenlock.add({
subject: "example.com",
altnames: ["example.com", "www.example.com"]
}).then(function(){
console.log("SUCCESS");
}).catch(console.error);
The example below uses the greenlock-store-fs
module to write these certs to disk for demonstration.
const Greenlock = require('greenlock'),
greenlockStore = require('greenlock-store-fs');
const store = greenlockStore.create({
configDir: './store/certs',
debug: true
});
const greenlock = Greenlock.create({
server: 'https://acme-staging-v02.api.letsencrypt.org/directory',
store: store,
challenges: {
'dns-01': cloudflareDns01
},
challengeType: 'dns-01',
debug: true
});
greenlock.register({
domains: ['example.com'],
email: 'example@example.com',
agreeTos: true,
rsaKeySize: 2048,
debug: true
}).then(() => {
console.log('SUCCESS');
}).catch((err) => {
console.error(err);
});
// TODO
# CLOUDFLARE_TOKEN or both CLOUDFLARE_EMAIL and CLOUDFLARE_APIKEY env vars must be set, as well as DOMAIN
node ./test.js
[1.2.5] - 2021-05-04
FAQs
Cloudflare DNS for Let's Encrypt / ACME dns-01 challenges with Greenlock.js and ACME.js
The npm package acme-dns-01-cloudflare receives a total of 229 weekly downloads. As such, acme-dns-01-cloudflare popularity was classified as not popular.
We found that acme-dns-01-cloudflare demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.