Skip to content

Commit

Permalink
Merge pull request #212 from Baroshem/chore/1.0.0-rc.1
Browse files Browse the repository at this point in the history
Chore/1.0.0 rc.1
  • Loading branch information
Baroshem authored Oct 18, 2023
2 parents 8dc3c47 + a9e85b5 commit ee8d413
Show file tree
Hide file tree
Showing 98 changed files with 11,200 additions and 9,121 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: ci
on:
push:
branches:
- main
- 'main'
- '**-rc.**'
- 'renovate/**'
pull_request:
branches:
- main

jobs:
ci:
Expand Down
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[![nuxt-security](https://nuxt-security.vercel.app/preview.png)](https://nuxt-security.vercel.app)

# nuxt-security

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

> Security module for Nuxt based on [OWASP Top 10](https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html#nodejs-security-cheat-sheet) and [helmet](https://helmetjs.github.io/) that adds security response headers, protection middlewares, CORS, and more.
# 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
- [📖  Read the documentation](https://nuxt-security.vercel.app)
- [👾  Playground](https://stackblitz.com/github/baroshem/nuxt-security?file=.stackblitz%2Fnuxt.config.ts)
- [ Intro video](https://www.youtube.com/watch?v=8ac30Py8Ses)
- [👾  Playground](https://nuxt-security.vercel.app/playground)

## Features

- Nuxt 3 ready
- Security response headers
- Content Security Policy (CSP) for SSG apps
- 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:

```sh
npm i -D nuxt-security
yarn add -D nuxt-security
pnpm add -D nuxt-security
npm i -D nuxt-security@rc
yarn add -D nuxt-security@rc
pnpm add -D nuxt-security@rc
```

Add the module in the `modules` array in `nuxt.config.ts`:
Expand All @@ -44,10 +44,6 @@ export default defineNuxtConfig({

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](https://nuxt-security.vercel.app/security/headers#content-security-policy).

## Configuration

You can pass configuration to the module in the `nuxt.config.ts` like following:
Expand Down
12 changes: 12 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
*.iml
.idea
*.log*
.nuxt
.vscode
.DS_Store
coverage
dist
sw.*
.env
.output
1 change: 1 addition & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
41 changes: 41 additions & 0 deletions docs/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export default defineAppConfig({
github: {
owner: 'Baroshem',
repo: 'nuxt-security',
branch: 'main'
},
docus: {
title: 'Nuxt Security',
description: '🛡️ Security Module for Nuxt based on HTTP Headers and Middleware',
image: '/preview.jpg',
url: 'https://nuxt-security.vercel.app',
socials: {
twitter: 'jacobandrewsky',
github: 'baroshem/nuxt-security',
nuxt: {
label: 'Nuxt',
icon: 'simple-icons:nuxtdotjs',
href: 'https://nuxt.com'
}
},
aside: {
level: 1
},
github: {
dir: 'docs/content',
root: 'docs/content',
edit: true,
releases: true,
owner: 'baroshem',
repo: 'nuxt-security',
branch: 'main'
},
cover: {
src: '/preview.png',
alt: 'Security Module for Nuxt based on HTTP Headers and Middleware'
},
header: {
logo: true
}
}
})
Loading

1 comment on commit ee8d413

@vercel
Copy link

@vercel vercel bot commented on ee8d413 Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nuxt-security – ./

nuxt-security-git-main-baroshem.vercel.app
nuxt-security-baroshem.vercel.app
nuxt-security.vercel.app

Please sign in to comment.