Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cert-expiry-check
Advanced tools
A module to check the expiry of SSL/TLS certs.
In it's most basic form, using the default configuration:
const CertExpiryCheck = require('cert-expiry-check');
const checker = new CertExpiryCheck();
checker.checkHosts([{
hostname: 'www.google.com'
}]).then((results) => {
console.log(results);
}).catch((e) => {
console.error(e); // bubbles up HTTP errors and invalid cert chains
});
Gives the following result:
[{
"host":{
"hostname":"www.google.com",
"port":443,
"alertWindowDays":30,
"headers":{
"User-Agent":"SSL Certificate Expiry Checker 0.1.0"
},
"method":"GET"
},
"details":{
"subject":{
"org":"Google Inc",
"commonName":"www.google.com",
"altName":"DNS:www.google.com"
},
"issuer":{
"org":"Google Inc",
"commonName":"Google Internet Authoritym G2"
}
},
"validFrom":"2016-05-18T10:59:02.000Z",
"validTo":"2016-08-10T10:46:00.000Z",
"expiry":{
"days":72,
"milliseconds":6198331472,
"isExpired":false,
"isInAlertWindow":false
}
}]
There are two types of configurations that can be performed, first the 'global' defaults used for all checked domains:
const checker = new CertExpiryCheck({
timeout: 5000, // timeout used for HTTPS connections
defaultPort: 443, // port used for all HTTPS connections
defaultAlertWindowDays: 30, // default alert window to use for near expiry certs
userAgent: 'SSL Certificate Expiry Checker 0.1.0' // default user agent to send with requests
});
Secondly, the per host configurations that override the defaults (above) for each host to check:
checker.checkHosts([{
hostname: 'www.google.com',
port: 443,
alertWindowDays: 30,
userAgent: 'SSL Certificate Expiry Checker 0.1.0'
}]).then((results) => {
console.log(results);
})
Note: There is currently no support for self-signed certs, as this was outside of the core use-case. Happy to accept pull requests for support however.
git clone https://github.com/Joe8Bit/cert-expiry-check
cd cert-expiry-check
npm install -g ava nyc eslint babel-eslint && npm install
npm test
All contributors agree to abide by the CODE_OF_CONDUCT.md
MIT
FAQs
A module to check the expiry of HTTPS certificates
We found that cert-expiry-check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.