Skip to content

πŸ›‘ Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware

License

Notifications You must be signed in to change notification settings

Baroshem/nuxt-security

This branch is 1 commit ahead of, 51 commits behind main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2a8363a Β· Nov 30, 2024
Nov 22, 2024
May 31, 2024
Nov 29, 2024
Nov 19, 2024
Nov 30, 2024
Aug 9, 2024
Oct 6, 2022
Oct 6, 2022
Oct 19, 2023
Oct 26, 2023
Oct 17, 2023
Oct 17, 2023
Feb 17, 2024
Nov 30, 2024
Nov 4, 2022
Feb 28, 2023
Apr 3, 2024
Oct 26, 2023
Nov 30, 2024
May 4, 2024
Nov 22, 2024

Repository files navigation

nuxt-security

npm version npm downloads Github Actions CI License Nuxt

Nuxt Security

Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware.

This module works with Nuxt 3 only

Features

  • Security response headers (including CSP for SSG apps)
  • Request Size & Rate Limiters
  • Cross Site Scripting (XSS) Validation
  • Cross-Origin Resource Sharing (CORS) support
  • Hide X-Powered-By header and remove console loggers utils
  • [Optional] Allowed HTTP Methods, Basic Auth, CSRF

Usage

Install the module:

npx nuxi@latest module add security

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

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