5

Adding Security Headers for Azure CDN Content With Azure Engine Rules...

 3 years ago
source link: https://www.irisclasson.com/2020/08/20/adding-security-headers-for-azure-cdn-content-with-azure-engine-rules/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Adding Security Headers for Azure CDN Content With Azure Engine Rules

2020-08-20 19:49 folder [Azure]  

label Azure  

OBS! This post shows how to create rules for Azure CDN Standard from Microsoft. Although there are some differences between the different CDN products that Azure has, rule creation is similar across the board. [Read more in the docs] (https://docs.microsoft.com/en-us/azure/cdn/cdn-verizon-premium-rules-engine-reference)

A few days ago, I shared on Twitter that I had improved the performance for my site, and Ben McCallum kindly sent the result for a wider screening of my site, including security headers. The Mozilla security headers screening came me an F, and I confirmed by using another site made by a friend of mine, Scott Helmer. My site is served using an Azure CDN (Azure CDN Standard from Microsoft), and the security headers can be set using the Rules Engine.

Adding Security Headers for Azure CDN Content With Azure Engine Rules

Create a new Rule, add an appropriate condition, for example ‘Request URL = Any’, and add an action for each header that you want to append. At the time of writing you can only have 3 Actions per Rule, and no more than 5 rules, including the global rule. For each action choose ‘Modify Response Header’, set Action to Append, and then header name and value. The value has a 128 char limit.

To scan your site you can use Bens site, Blip which gives an overview for several metrics including security, performance and accessibility, or Scott Helmers site that focuses on security headers and gives a detailed result. I’ve use both sites, as well as the built-in Lighthouse tool in Chrome Dev Tools.

Happy coding!

Comments

Leave a comment (via email)

Last modified on 2020-08-20

Next
SQL Error 10713 a MERGE Statement Must Be Terminated by a Semi Colon
Previous
Jest Snapshot Tests With Custom Serializer for Cloudformation Template Tests

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK