Socket
Socket
Sign inDemoInstall

express-blacklist

Package Overview
Dependencies
7
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-blacklist

Express middleware that rejects requests listed on blacklist


Version published
Weekly downloads
85
decreased by-15%
Maintainers
1
Install size
36.6 kB
Created
Weekly downloads
 

Readme

Source

express-blacklist

NodeJS Express middleware that rejects incoming traffic from a pre-defined source (blacklist file)

Usage

$ npm install express-blacklist

Setting up your express server with express-blacklist support

var blacklist = require('express-blacklist');

app.use(blacklist.blockRequests('blacklist.txt'));

blacklist.txt should look like this (list of IP addresses):

192.168.1.200
192.168.17.193
192.168.65.76
192.168.232.89

Integrate express-blacklist with express-defend

You might want to do this if you want to detect and reject malicious traffic on your site, when an attacker tries to find XSS or Path traversal security issues on your site.

var expressDefend = require('express-defend');
var blacklist = require('express-blacklist');

app.use(blacklist.blockRequests('blacklist.txt'));
app.use(expressDefend.protect({ 
    maxAttempts: 5, 
    dropSuspiciousRequest: true, 
    logFile: 'suspicious.log', 
    onMaxAttemptsReached: function(ipAddress, url){
        blacklist.addAddress(ipAddress);
    } 
}));

Keywords

FAQs

Last updated on 23 Jun 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc