Coder Social home page Coder Social logo

dlferro / nuxt-security Goto Github PK

View Code? Open in Web Editor NEW

This project forked from baroshem/nuxt-security

0.0 0.0 0.0 2.76 MB

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

Home Page: https://nuxt-security.vercel.app/

License: MIT License

TypeScript 98.67% Vue 1.33%

nuxt-security's Introduction

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

nuxt-security's People

Contributors

0xflotus avatar alexbidenko avatar baroshem avatar csprance avatar damianglowala avatar danielroe avatar droutin avatar insomnius avatar intevel avatar kouts avatar kyranet avatar lanluartes avatar mubaidr avatar pi0 avatar runyasak avatar tmlmt avatar tresko avatar trijpstra-fourlights avatar tristan971 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.