Socket
Socket
Sign inDemoInstall

@risingstack/protect

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @risingstack/protect

The purpose of this module is to provide out-of-box, proactive protection for common security problems, like SQL injection attacks or XSS attacks.


Version published
Maintainers
1
Created

Readme

Source

Protect by RisingStack

The purpose of this module is to provide out-of-box, proactive protection for common security problems, like SQL injection attacks or XSS attacks.

protect by risingstack

Once the module recognizes an attack pattern, it won't let the request go through.

Basic usage

npm i @risingstack/protect --save
With Express
const protect = require('@risingstack/protect')
const express = require('express')

const app = express()

app.use(protect.express.sqlInjection())
app.use(protect.express.xss())

API

protect.express.sqlInjection([options])

Returns an Express middleware, which checks for SQL injections.

  • options.body: if this options is set (true), the middleware will check for request bodies as well
    • default: false
    • prerequisite: you must have the body-parser module used before adding the protect middleware
  • options.loggerFunction: you can provide a logger function for the middleware to log attacks
    • default: noop
protect.express.xss([options])

Returns an Express middleware, which checks for XSS attacks.

  • options.body: if this options is set (true), the middleware will check for request bodies
    • default: false
    • prerequisite: you must have the body-parser module used before adding the protect middleware
  • options.loggerFunction: you can provide a logger function for the middleware to log attacks
    • default: noop

Keywords

FAQs

Last updated on 14 May 2017

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