Linchakin

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

 May 15, 2022     No comments   

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"]
}
};
  • Note: blockedDomains holds precedence over allowedDomains.
  • i.e., requests checked against blockedDomains first then allowedDomains.

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 violationEvent

{
"violationtType": "Outbound Request",
"message": "Outbound request to 'www.malicious.com' violates declared 'Resource Access Policy (RAP)'.",
"policy": {
"outBoundRequest" : {
"blockedDomains" : ["*.123.com", "stats.abc.com", 'xyz.com'],
"allowedDomains" : ["*.domdog.io"]
}
}

Integrating with Sentry

Sample callbackFunction to integrate with Sentry

var callbackFunction = function (violationEvent) {
var e = new Error();
e.name = 'Resource Access Policy Violation';
e.message = JSON.stringify(violationEvent);
Sentry.captureException(e);


}

Screenshot from Sentry dashboard

Features

  • Attack Monitoring
    • Outbound Network Calls
  • Attack Blocking
    • Outbound Network Calls

Roadmap

  • Attack Monitoring
    • Command Execution
    • File Calls
  • Attack Blocking
    • Command Execution
    • File Calls
  • Vulnerability Scanner

Authors

  • Lavakumar Kuppan
  • Sukesh Pappu

License

Apache License 2.0

Adblock test (Why?)


You may be interested in:
>> Is a Chromebook worth replacing a Windows laptop?
>> Find out in detail the outstanding features of Google Pixel 4a
>> Top 7 best earbuds you should not miss

Related Posts:
>> Recognizing 12 Basic Body Shapes To Choose Better Clothes
>>Ranking the 10 most used smart technology devices
>> Top 5+ Best E-readers: Compact & Convenient Pen
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook

Related Posts:

  • Yes, Samsung Is Swapping SSD Parts TooByZhiye Liu According to a new report, Samsung has been caught swapping parts on its 970 Evo Plus SSDs.Samsung is the latest SSD vendor to be caught with its hand in the cookie jar. A Chinese YouTuber is claiming Samsung has swapped components on its 97… Read More
  • AMD 64-Core EPYC 'Milan-X' Listed For More Than $10,000ByAnton Shilov AMD's EPYC 7773X 'Milan-X' listed by retailer.AMD is expected to release its EPYC 7003-series processors with 3D V-Cache later this year, but a major retailer listed one of the CPUs on i… Read More
  • How To Perform An SEO Audit Using Google Search Console Have you completed optimizing your website? Are you sure that it will run as per Google SEO recommendations? There could be a possibility that your … Read More
  • A Unique Interaction: Learning the Code of Dancing Fingerprints @anitaflejterUltimate Tango School of Dance Argentine Tango dance academy located in Medford, MA. Where tango is taught as a philosophy… Read More
  • adalanche - Active Directory ACL Visualizer and ExplorerTags: API Documentation, Access, Active Directory, Analysis, Binary, LDAP, Linux, Max, Memory, Parameter, Reverse, Takeover, Windows, pwned, Adalanche… Read More
Newer Post Older Post Home

0 Comments:

Post a Comment


Copyright © 2025 Linchakin | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates