-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,084 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
docs/content/1.documentation/2.headers/10.xDNSPrefetchControl.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# X-DNS-Prefetch-Control | ||
|
||
:badge[Enabled]{type="success"} Smaller but still important security response headers. | ||
|
||
--- | ||
|
||
:ellipsis{right=0px width=75% blur=150px} | ||
|
||
The X-DNS-Prefetch-Control HTTP response header controls DNS prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as URLs for items referenced by the document, including images, CSS, JavaScript, and so forth. This prefetching is performed in the background, so that the DNS is likely to have been resolved by the time the referenced items are needed. This reduces latency when the user clicks a link. | ||
|
||
::alert{type="info"} | ||
ℹ Read more about this header [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control). | ||
:: | ||
|
||
## Usage | ||
|
||
This header is enabled by default but you can change its behavior like following. | ||
|
||
```ts | ||
export default defineNuxtConfig({ | ||
// Global | ||
security: { | ||
headers: { | ||
xDNSPrefetchControl: <OPTIONS>, | ||
}, | ||
}, | ||
|
||
// Per route | ||
routeRules: { | ||
'/custom-route': { | ||
headers: { | ||
'X-DNS-Prefetch-Control': <OPTIONS> | ||
}, | ||
} | ||
} | ||
}) | ||
``` | ||
|
||
You can also disable this header by `xDNSPrefetchControl: false`. | ||
|
||
## Default value | ||
|
||
By default, Nuxt Security will set following value for this header. | ||
|
||
```http | ||
X-DNS-Prefetch-Control: off | ||
``` | ||
|
||
## Available values | ||
|
||
The `xDNSPrefetchControl` header can be configured with following values. | ||
|
||
```ts | ||
xDNSPrefetchControl: 'on' | 'off' | false; | ||
``` | ||
|
||
### `on` | ||
|
||
Enables DNS prefetching. This is what browsers do, if they support the feature, when this header is not present | ||
|
||
### `off` | ||
|
||
Disables DNS prefetching. This is useful if you don't control the link on the pages, or know that you don't want to leak information to these domains. |
59 changes: 59 additions & 0 deletions
59
docs/content/1.documentation/2.headers/11.xDownloadOptions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# X-Download-Options | ||
|
||
:badge[Enabled]{type="success"} Instruct Internet Explorer to not open a downloaded file directly. | ||
|
||
--- | ||
|
||
:ellipsis{right=0px width=75% blur=150px} | ||
|
||
The X-Download-Options HTTP header has only one option: X-Download-Options: noopen. This is for Internet Explorer from version 8 on to instruct the browser not to open a download directly in the browser but instead to provide only the Save option. The user has to first save it and then open it in an application. | ||
|
||
::alert{type="info"} | ||
ℹ Read more about this header [here](https://webtechsurvey.com/response-header/x-download-options). | ||
:: | ||
|
||
## Usage | ||
|
||
This header is enabled by default but you can change its behavior like following. | ||
|
||
```ts | ||
export default defineNuxtConfig({ | ||
// Global | ||
security: { | ||
headers: { | ||
xDownloadOptions: <OPTIONS>, | ||
}, | ||
}, | ||
|
||
// Per route | ||
routeRules: { | ||
'/custom-route': { | ||
headers: { | ||
'X-Download-Options': <OPTIONS> | ||
}, | ||
} | ||
} | ||
}) | ||
``` | ||
|
||
You can also disable this header by `xDownloadOptions: false`. | ||
|
||
## Default value | ||
|
||
By default, Nuxt Security will set following value for this header. | ||
|
||
```http | ||
X-Download-Options: noopen | ||
``` | ||
|
||
## Available values | ||
|
||
The `xDownloadOptions` header can be configured with following values. | ||
|
||
```ts | ||
xDownloadOptions: 'noopen' | false; | ||
``` | ||
|
||
### `noopen` | ||
|
||
When this directive is used, the user can still save and open the file, but this way the malicious code will be prevented from running on our website. Though it will run on the user’s file system. |
63 changes: 63 additions & 0 deletions
63
docs/content/1.documentation/2.headers/12.xFrameOptions.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# X-Frame-Options | ||
|
||
:badge[Enabled]{type="success"} Smaller but still important security response headers. | ||
|
||
--- | ||
|
||
:ellipsis{right=0px width=75% blur=150px} | ||
|
||
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a `<frame>`, `<iframe>`, `<embed>` or `<object>`. Sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites. | ||
|
||
::alert{type="info"} | ||
ℹ Read more about this header [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options). | ||
:: | ||
|
||
## Usage | ||
|
||
This header is enabled by default but you can change its behavior like following. | ||
|
||
```ts | ||
export default defineNuxtConfig({ | ||
// Global | ||
security: { | ||
headers: { | ||
xFrameOptions: <OPTIONS>, | ||
}, | ||
}, | ||
|
||
// Per route | ||
routeRules: { | ||
'/custom-route': { | ||
headers: { | ||
'X-Frame-Options': <OPTIONS> | ||
}, | ||
} | ||
} | ||
}) | ||
``` | ||
|
||
You can also disable this header by `xFrameOptions: false`. | ||
|
||
## Default value | ||
|
||
By default, Nuxt Security will set following value for this header. | ||
|
||
```http | ||
X-Frame-Options: SAMEORIGIN | ||
``` | ||
|
||
## Available values | ||
|
||
The `xFrameOptions` header can be configured with following values. | ||
|
||
```ts | ||
xFrameOptions: 'DENY' | 'SAMEORIGIN' | false; | ||
``` | ||
|
||
### `DENY` | ||
|
||
The page cannot be displayed in a frame, regardless of the site attempting to do so. | ||
|
||
### `SAMEORIGIN` | ||
|
||
The page can only be displayed if all ancestor frames are same origin to the page itself. |
Oops, something went wrong.