Simon,
Thanks for responding.
In both cases the request was the home page url.
Why would there ever be a case where the CSP would be different than the CSP I coded into my application.
The Curl samples below are indicating a redirect to login.microsoft.online because I am using Microsoft Identity Platform to authenticate the use.
Do I need to disable authentication for the purpose of the PEN test? (I didn't have to do that last year)
I haven't enabled any scripts in Zap.
These are the headers that I specified in my app (C#, Core8, Blazor)
app.Use(async (context, next) =>
{
context.Response.Headers.Append("X-Frame-Options", "SAMEORIGIN");
context.Response.Headers.Append("X-XSS-Protection", "1; mode=block");
context.Response.Headers.Append("X-Content-Type-Options", "nosniff");
context.Response.Headers.Append("Arr-Disable-Session-Affinity", "True");
context.Response.Headers.Append(
"Content-Security-Policy",
"base-uri 'self'; " +
"block-all-mixed-content;" +
"default-src 'self'
https://app.powerbi.com; " +
"img-src 'self'; " +
"script-src 'self'
code.jquery.com; " +
"style-src 'self'
https://cdn.jsdelivr.net; " +
"font-src 'self'
https://cdn.jsdelivr.net data:; " +
"frame-src 'self'
https://app.powerbi.com; " +
"frame-ancestors 'self'
https://app.powerbi.com;" +
"upgrade-insecure-requests;" +
"connect-src 'self';");
await next();
});
When you look at the response header when I inspected my deployed app - this is the CSP.
I don't understand why Zap is somehow changing the CSP. That was not the case when I used Zap last year. (Sorry, I can't tell you what version that was).
I ran the same curl command on my app that was developed with Core 6 and I see the same redirect but I also see the X-Frame-Option and the Content-Security-Policy.