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

nuxt-security

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-security

🛡 Security Module for Nuxt based on OWASP Top 10 and Helmet

  • 0.14.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
decreased by-42.18%
Maintainers
1
Weekly downloads
 
Created
Source

nuxt-security

nuxt-security

npm version npm downloads Github Actions CI License Nuxt

Security module for Nuxt based on OWASP Top 10 and helmet that adds security response headers, protection middlewares, CORS, and more.

Features

  • Nuxt 3 ready
  • Security response headers
  • Content Security Policy (CSP) for SSG apps
  • Request Size & Rate Limiters
  • Cross Site Scripting (XSS) Validation
  • Cross-Origin Resource Sharing (CORS) support
  • [Optional] Allowed HTTP Methods, Basic Auth, CSRF

Usage

Install the module:

npm i -D nuxt-security
yarn add -D nuxt-security
pnpm add -D nuxt-security

Add the module in the modules array in nuxt.config.ts:

export default defineNuxtConfig({
  modules: ["nuxt-security"],
})

And that's it! The module will now register route rules and server middlewares globally so that your application will be more secured.

Static site generation (SSG)

This module is meant to work with SSR apps, but you can also use this module in SSG apps where you will get a Content Security Policy (CSP) support via <meta http-equiv> tag. You can find more about configuring Content Security Policy (CSP) here.

Configuration

You can pass configuration to the module in the nuxt.config.ts like following:

export default defineNuxtConfig({
  modules: ["nuxt-security"],
  security: {
    // options
  }
})

For all available configuration options check out the docs.

Development

  • Run yarn dev:prepare to generate type stubs.
  • Use yarn dev to start playground in development mode.

License

MIT License

Keywords

FAQs

Package last updated on 19 Jul 2023

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