New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

securitytxt-middleware

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

securitytxt-middleware

Express middleware to provide interface for Security Vulnerability Disclosure

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

SecurityTxt

Express middleware to provide interface for Security Vulnerability Disclosure security.txt

The middleware is base on the (draft-foudil-securitytxt-09)[https://tools.ietf.org/html/draft-foudil-securitytxt-09]

Install

npm install securitytxt-middleware --save

Usage

const express = require('express');
const securityTxtMiddleware = require('securitytxt-middleware')
const app = express();
const port = 3000;

const securityTxtConfig = {
  Contact: 'mailto:security@website.com',
  Encryption: 'https://website.com/sign.pgp',
  Anknowledgments: 'https://website.com/thank-you.html',
  'Preferred-Languages': 'en',
  Policy: 'https://website.com/policy.html',
}

const securityTxtPath = './security.txt';

// object with key:value
app.use('/.well-known/security.txt', securityTxtMiddleware(securityTxtConfig))

// path to file to read and send
app.use('/.well-known/security_file.txt', securityTxtMiddleware(securityTxtPath))

app.get('/', (req, res) => res.send('Hello World!'));

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`));

There are two types of argument that the middleware could accept

  • Object
  • Path to file

Keywords

express

FAQs

Package last updated on 17 Apr 2020

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