Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-pledge

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pledge

OpenBSD's pledge(2) extension for node.js

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

node-pledge

Bindings for for OpenBSD's pledge(2)

What?

pledge(2) allows a process to ratchet down the privileges it requires to run, if it attempts to access a privilege it has pledged to not use, it will be killed by the kernel.

Example Usage

Install via npm:

npm install --save node-pledge
var http = require('http');
var pledge = require('node-pledge');

pledge.init("stdio rpath wpath ioctl");

console.log("stuff");

// try to do something with http (will cause the kernel to kill node)
http.get("http://www.google.com/", function(res) {
  console.log(res);
}).on('error', function(e) {
  console.log(e);
});

Output:

node stuff.js
stuff
Abort trap (core dumped) 

Line from dmesg(8):

node(24353): sysctl 6: 4 17 0 0 3 0
node(24353): syscall 202 ""

This is an expirement!

Use at your own risk! It will ONLY work on OpenBSD!

Keywords

FAQs

Package last updated on 24 Aug 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc