Posted - 07/26/2024 : 07:30:33
We have been running with the below in web.config for over 8 months and have not seen any issues.
Just make sure 'unsafe-inline' is always in the CSP since there are many onClick() JavaScript functions used across the site. It lowers the overall security, but sometimes you need it for the website to function. I had to use this in a personal website using the EJS templating engine in the past because the alternative to onClick() was too timely to implement.
<httpProtocol> <customHeaders> <add name="Strict-Transport-Security" value="max-age=86400; includeSubDomains; preload" /> <add name="X-XSS-Protection" value="1; mode=block" /> <add name="X-Frame-Options" value="DENY" /> </customHeaders> </httpProtocol> <security> <requestFiltering removeServerHeader="true" /> </security>
|