Skip to content

Pact Web Extensions SecurityHeaderExtensions UseCspWithPactDefaults(Microsoft AspNetCore Builder IApplicationBuilder)

welshronaldo edited this page May 30, 2022 · 6 revisions

SecurityHeaderExtensions.UseCspWithPactDefaults(IApplicationBuilder) Method

Adds CSP with:

  • Restrictive Feature Policy
  • Allowed Google services (Analytics, Fonts, Recaptcha)
  • No reporting
  • Script Nonces
  • Everything else sensibly restrictive
    Should be good for most simple-but-secure sites
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCspWithPactDefaults(this Microsoft.AspNetCore.Builder.IApplicationBuilder app);

Parameters

app Microsoft.AspNetCore.Builder.IApplicationBuilder

Returns

Microsoft.AspNetCore.Builder.IApplicationBuilder

Clone this wiki locally