-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/cross origin embedder policy (#164)
* Added support for Cross-Origin-Embedder-Policy (COEP) header. * Added documentation page for Cross-Origin-Embedder-Policy (COEP) header * Fixed typo in Cross-Origin-Opener-Policy (COOP) * Minor version bump * Ran solution-wide formatting fix * Added check mark for COEP header in the Included Headers section of docs * Added all headers (as of 9.7.1) to the Readme files * Updated the repo root level changelog * Updated the docs level changelog --------- Co-authored-by: Jamie Taylor <jamie.taylor@rjj-software.co.uk>
- Loading branch information
1 parent
cc7b291
commit 1a8e56f
Showing
18 changed files
with
341 additions
and
51 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Cross-Origin-Opener-Policy | ||
nav_order: 10 | ||
parent: Configuration | ||
layout: page | ||
--- | ||
|
||
The Mozilla Developer Network describes the Cross-Origin-Embedder-Policy (COEP) header like this: | ||
|
||
{: .quote } | ||
> The HTTP Cross-Origin-Embedder-Policy (COEP) response header configures embedding cross-origin resources into the document. | ||
> | ||
> source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy | ||
A COEP header can be added in one of two ways, either using the default middleware options: | ||
|
||
```csharp | ||
app.UseSecureHeadersMiddleware(); | ||
``` | ||
|
||
The above adds the COEP header with a `require-corp` value. | ||
|
||
Or by creating an instance of the `SecureHeadersMiddlewareBuilder` class using the following code: | ||
|
||
```csharp | ||
var customConfig = SecureHeadersMiddlewareBuilder | ||
.CreateBuilder() | ||
.UseCrossOriginResourcePolicy() | ||
.UseCrossOriginEmbedderPolicy() | ||
.Build(); | ||
|
||
app.UseSecureHeadersMiddleware(customConfig); | ||
``` | ||
|
||
{: .warning } | ||
> It is important to note that the recommended value for this header requires the presence of the | ||
> [Cross-Origin-Resource-Policy (CORP) header](https://gaprogman.github.io/OwaspHeaders.Core/configuration/Cross-Origin-Resource-Policy/) | ||
> in order to work. | ||
> As such, if you add the COEP header without the CORP header, OwaspHeaders.Core will raise an ArgumentException. | ||
The above adds the COEP header with a `require-corp` value. | ||
|
||
## Full Options | ||
|
||
The COEP header object (known internally as `CrossOriginEmbedderPolicy`) has the following options: | ||
|
||
- enum: `CrossOriginEmbedderOptions` | ||
|
||
The values available for the `CrossOriginEmbedderOptions` enum are: | ||
|
||
- `UnsafeNoneValue` | ||
- `RequireCorp` | ||
|
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
Oops, something went wrong.