NodeSecurityShield is a Developer and Security Engineer friendly package for Securing NodeJS Applications.
Inspired by the log4J vulnerability (CVE-2021-44228) which can be exploited because an application can make arbitrary network calls.
We felt there is an need for an application to declare what privileges it can have so that exploitation of such vulnerabilities becomes harder.
To achieve this, NSS (Node Security Shield) has Resource Access Policy.
Resource Access Policy is similar to CSP(Content Security Policy).
It lets the developer/security engineer declare what resources an application should access. And Node Security Shield will enforce it.
Install Node Security Shield using npm
npm install nodesecurityshield
// Require Node Security Shield
let nodeSecurityShield = require(‘nodesecurityshield’);
// Enable Attack Monitoring and/or Blocking
nodeSecurityShield.enableAttackMonitoring(resourceAccessPolicy ,callbackFunction);
Sample resourceAccessPolicy
const resourceAccessPolicy = {
“outBoundRequest” : {
“blockedDomains” : [“.123.com”, “stats.abc.com”, ‘xyz.com’], “allowedDomains” : [“.domdog.io”]
}
};
Sample callbackFunction for Attack Monitoring
var callbackFunction = function (violationEvent) {
console.log(violationEvent);
}
Sample callbackFunction for Attack Blocking
var callbackFunction = function (violationEvent) {
throw new Error(“Request Blocked. It violates declared Resource Access Policy.”)
}
Sample resourceAccessPolicyto integrate with Sentry
const resourceAccessPolicy = {
“reportUriHosts” : [“ingest.sentry.io”],
“outBoundRequest” : {
“blockedDomains” : [“.123.com”, “stats.abc.com”, ‘xyz.com’], “allowedDomains” : [“.domdog.io”]
}
};
Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…
This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…
GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…
Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…
The free and open-source security platform SecHub, provides a central API to test software with…
Don't worry if there are any bugs in the tool, we will try to fix…