Features:
- Allow accessing an
IServiceProvider
when configuring aSecurityHeaderPolicyBuilder
#200
Fixes:
- Fix incorrect dependency on obsolete Microsoft.AspNetCore.Mvc.Razor package #205 (Thanks trejjam)
Breaking Changes:
- Remove ambient-light-sensor=() from
DefaultSecureDirectives()
for permissions policy #203 (Thanks damienbod!) - Update COOP, COEP, and CORP for
AddDefaultSecurityHeaders()
andAddDefaultApiSecurityHeaders()
#204 (Thanks damienbod!)
Features:
- Allow configuring "named" policies, and applying different policies to different endpoints #172, #173, #185
- Allow customizing the
HeaderPolicyCollection
just before it is applied, customizing per request #174, #185 - Make adding directives to
Content-Security-Policy
idempotent to avoid duplicates #169 - Add
AddDefaultApiSecurityHeaders()
for adding default headers to APIs #183, #184 - Add
AddPermissionsPolicyWithRecommendedDirectives()
andPermissionsPolicyBuilder.AddDefaultSecureDirectives()
for adding securePermissions-Policy
directives in bulk #183, #184 - NetEscapades.AspNetCore.SecurityHeaders now has an icon, thanks @khalidabuhakmeh! #195
Breaking Changes:
- Drop support for .NET Standard 2.0, raises minimum framework to .NET Core 3.1 #167, #171
- Removed "document header" functionality, in favour of always adding all headers #186
- Remove
X-XSS-Protection
from default headers and mark obsolete #168 - Add
cross-origin-opener-policy: same-origin
to default headers #184 - Mark
Feature-Policy
as obsolete #187 - Mark
Expect-CT
as obsolete #197 - Make nonce generation lazy on call to
HttpContext.GetNonce()
#198
Features:
- Allow adding multiple uris to CSP builder
AddFrameAncestors()
#179 - Add support for additional directives on
Permissions-Policy
header #177 (Thanks @Registeel!)
Features:
- Add support for
unsafe-hashes
onstyle
attributes, and inline event handlers #162 (Thanks @tiesmaster!)
Features:
- Add support for
Cross-Origin-Embedder-Policy: credentialless
#153 (Thanks RaceProUK!)
Bugfix:
- Fix documentation errors in
StyleSourceAttr
andStyleSourceElem
directives #152 (Thanks ThomasBjallas!)
Features:
- Add support for using both
'none'
and'report-sample'
in directives
Features:
- Add support for
script-src-attr
,script-src-elem
,style-src-attr
,style-src-elem
#139
Features:
- Apply "document" headers to
text/javascript
responses
Features:
- Add support for applying document headers (such as CSP) to all responses (#130)
- Add support for
unsafe-hashes
andwasm-unsafe-eval
(#125) - Add support for Report-To directive in Content-Security-Policy (#126)
- Add support for sandbox directive in Content-Security-Policy (#127)
- Add support for Reporting-Endpoints header (part of the Reporting API) (#128)
Bugfix:
- Document headers (such as CSP) are now applied to
application/javascript
in addition totext/html
(#130)
Bugfix:
- Fix
Cross-Origin-Embedder-Policy
(COEP) not being added to non-HTML requests
Bugfix:
- Fix
Cross-Origin-Resource-Policy
(CORP) not being added to non-HTML requests
Features:
- Added support for
Cross-Origin-Opener-Policy
(COOP),Cross-Origin-Embedder-Policy
(COEP) andCross-Origin-Resource-Policy
(CORP) (Thanks @jeremylindsayni!)
Features:
- Add support for creating custom CSP directives with
CspDirectiveBuilder
. Enables creating custom directives (for example unsupported, draft, directives) that require nonce or hash values
BugFix:
- Add missing
EncryptedMedia
directive to permissions policy (Thanks @jotoledo)
Features:
- Add support for
interest-cohort=()
inPermissions-Policy
directive (Thanks @jeremylindsayni!)
BugFix:
- Rename
AddFrameSource()
->AddFrameSrc()
for consistency, and deprecateAddFrameSource()
Features:
- Add support for
report-sample
instyle-src
directive for CSP (Thanks @jeremylindsayni!)
BugFix:
- Fix API inconsistencies between Permissions-Policy and Feature-Policy (Thanks @Rtalos!)
Features:
- Add support for
manifest-src
directive in CSP (Thanks @jotatoledo!) - Add support for
Permissions-Policy
(supersedesFeature-Policy
) (Thanks @Rtalos!)
Minor:
- Switch to standard MIT SPDX license
Features:
- Add support for
Expect-CT
header. Allows excluding domains that will not have theExpect-CT
header applied. By default, theExpect-CT
header will not be applied to localhost. It is also only applied to HTTPS requests - Add support for
worker-src
directive forContent-Security-Policy
header
Breaking Changes:
- Drop support for ASP.NET Core 1.x
- Add support for ASP.NET Core 3.0
Features:
- Add support for Nonce generation for
Content-Security-Policy
headers. See README.md for details - Add TagHelpers library for adding nonces and generating hashes for Razor elements.
- Allow using HSTS preload with
Strict-Transport-Security
- Allow excluding domains from
Strict-Transport-Security
. Similar to the MicrosoftHstsMiddleware
, you can skip applyingStrict-Transport-Security
to specific hosts
Breaking Changes:
- All obsolete classes have been removed.
- Many classes have changed namespace to better reflect their location in the project, and also to aid discovery. If you're using the recommended builders and extension methods, you should not have any build-time breaking changes, but the package is not runtime-compatible with previous versions
- The
Strict-Transport-Security
header is no longer applied tolocalhost
by default. Generally speaking, this isn't something you should do anyway. - The CSP classes have undergone significant refactoring to allow dynamic values per-request (i.e. nonces). This doesn't affect the main public API, but will impact you if you're working with the low-level infrastructure classes.