Kali Linux

NodeSecurityShield : A Developer And Security Engineer Friendly Package For Securing NodeJS Applications

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 (RAP)

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.

Installation

Install Node Security Shield using npm

npm install nodesecurityshield

Usage

// 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.”)
}

Integrating with Sentry

Sample resourceAccessPolicyto integrate with Sentry

const resourceAccessPolicy = {
“reportUriHosts” : [“ingest.sentry.io”],
“outBoundRequest” : {
“blockedDomains” : [“.123.com”, “stats.abc.com”, ‘xyz.com’], “allowedDomains” : [“.domdog.io”]
}
};

Features

  • Attack Monitoring
    • Outbound Network Calls
  • Attack Blocking
    • Outbound Network Calls
R K

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

1 week ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

2 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

3 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

3 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

3 weeks ago