In this activity, you will configure Content Security Policy (CSP) headers to prevent unauthorized scripts from executing.
Scenario:
Your API is returning a webpage that has a Cross-Site Scripting (XSS) bug. We cannot fix the code bug right now, so we must block the attack at the Browser Level.
An attacker is trying to load: <script src="http://evil.com/hack.js">.
Your Task
Update the get_security_headers function:
Add a new key: "Content-Security-Policy".
Set the value to: "default-src 'self'".
This instructs the browser to only trust scripts coming from your own domain.
Why Headers?
Modern security is often about "Defense in Depth". Even if your code has bugs, good headers can prevent the bugs from being exploited.