liveBook · Manning

Content-Security-Policy

Content Security Policy is a web security standard that lets a site specify browser-enforced rules restricting the sources and forms of content a document may load or execute.

How 2 Manning books explain it

Building Web APIs with ASP.NET Core

A content security policy is a browser-enforced security policy that restricts the sources and forms of content a web page may load or execute.

How it is used
Protects a deployed web API by restricting content browsers load or execute.
How deep it goes
Shows middleware configuration and a nonce-based exception, but defers detailed treatment of security-header settings.
Examples
Tests a deployed /cod/test endpoint, inspects a browser-console violation, and updates the policy and script with a matching nonce.
What you can do after
Operate/configure it in ASP.NET Core middleware and diagnose a blocked inline script with the browser console.

Read how Building Web APIs with ASP.NET Core explains Content-Security-Policy →

Grokking Web Application Security

A content security policy is a web security standard that specifies permitted sources and execution rules for resources loaded by a web page.

How it is used
Limits permitted resource loading and framing to reduce XSS and clickjacking risk.
How deep it goes
Explains header and meta delivery, source directives, inline-script tradeoffs, and framing rules without browser internals.
Examples
Uses Express and meta-tag policies, an injected comment script, and frame-ancestors policy variants.
What you can do after
Apply it via HTTP headers or meta tags to restrict resources, block inline scripts, and control framing.

Read how Grokking Web Application Security explains Content-Security-Policy →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.