Hi @Beltran, Julian Ricardo yes, there are ways to add custom security headers to CSR angular application deployed on Azure Webapp
Here's the recommended approach using the built-in capabilities of Azure Linux Web App:
1.Create a file named web.config
(or modify an existing one) in the root directory of your Angular application. This file will be used to configure IIS (Internet Information Services) on your Azure Web App.
2. Inside the web.config
file, add the following section to define your custom security headers:
<system.webServer>
<staticContent>
<mimeMaps>
<add fileExtension=".woff" mimeType="application/font-woff" />
<add fileExtension=".woff2" mimeType="application/font-woff2" />
</mimeMaps>
<headers>
<remove name="X-Powered-By" /> <add name="Content-Security-Policy" value="your-csp-policy-here" />
<add name="X-Content-Type-Options" value="nosniff" />
</headers>
</staticContent>
</system.webServer>
- Replace
your-csp-policy-here
with your actual Content-Security-Policy directive.
3. Deploy your updated application with the web.config
file to your Azure Linux Web App using your preferred deployment method (e.g., Git push, Azure DevOps pipeline)