Lombiq Helpful Libraries - ASP.NET Core Libraries - Security
July 8, 2024 ยท View on GitHub
Content-Security-Policy
ApplicationBuilderExtensions: Contains theAddContentSecurityPolicyHeaderextension method to add a middleware that provides theContent-Security-Policyheader.CdnContentSecurityPolicyProvider: An optional policy provider that permits additional CDN host names for thescript-scrandstyle-srcdirectives.ContentSecurityPolicyDirectives: TheContent-Security-Policydirective names that are defined in the W3C recommendation and some common values.EmbeddedMediaContentSecurityPolicyProvider: An optional policy provider that permits additional host names used by usual media embedding sources (like YouTube) for theframe-scrdirective.IContentSecurityPolicyProvider: Interface for services that update the dictionary that will be turned into theContent-Security-Policyheader value.ServiceCollectionExtensions: Extensions methods forIServiceCollection, e.g.AddContentSecurityPolicyProvider()is a shortcut to registerIContentSecurityPolicyProviderin dependency injection.XWidgetsContentSecurityPolicyProvider: An optional content security policy provider that provides configuration to allow the usage of X (Twitter) social widgets.
There is a similar section for security extensions related to Orchard Core here.
These extensions provide additional security and can resolve issues reported by the ZAP security scanner.