{"id":137,"date":"2022-04-12T15:11:03","date_gmt":"2022-04-12T15:11:03","guid":{"rendered":"https:\/\/chamankumar.co.uk\/blog\/?p=137"},"modified":"2022-04-12T15:13:48","modified_gmt":"2022-04-12T15:13:48","slug":"server-security-headers","status":"publish","type":"post","link":"https:\/\/chamankumar.co.uk\/blog\/uncategorized\/server-security-headers","title":{"rendered":"Server security headers"},"content":{"rendered":"\n<p>Added to .htaccess file on 20i<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) lets a website tell browsers that it should only be accessed using HTTPS, instead of using HTTP.\n# The 'max-age' is the time in days you want the warning to be cached for, the below (5184000) would set that to a default of 60 days.\n# Be aware that if you set this header, the site will only ever load over HTTPS.\nHeader set Strict-Transport-Security \"max-age=5184000; includeSubDomains; preload\"<\/code><\/pre>\n\n\n\n<p>And<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># CORS (Cross-Origin Resource Sharing) is the site is trying to use a mechanism that uses special HTTP headers that tells the browser that the site is requesting access to resources from a different origin\/domain\n# Apache (the webserver software we utilise) supports CORS out of the box but for security reasons requires a .htaccess rule to add CORS to the HTTP header. The following rule can be added to allow CORS.\nHeader set Access-Control-Allow-Origin \"https:\/\/devonccg.nhs.uk\"<\/code><\/pre>\n\n\n\n<p>In 20i security headers admin<\/p>\n\n\n\n<h4>Content-Security-Policy<\/h4>\n\n\n\n<p>This response header allows web site administrators to control resources the user agent is allowed to load for a given page. Ie only these sources are allowed in iframe content.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>frame-src https:\/\/devonccg.nhs.uk\/ https:\/\/intranet.devonccg.nhs.uk\/ https:\/\/api-bridge.azurewebsites.net\/ https:\/\/www.googletagmanager.com https:\/\/*.google.com https:\/\/www.youtube.com https:\/\/googleads.g.doubleclick.net  https:\/\/plus.browsealoud.com\/<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Added to .htaccess file on 20i And In 20i security headers admin Content-Security-Policy This response header allows web site administrators to control resources the user agent is allowed to load for a given page. Ie only these sources are allowed in iframe content.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":3,"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chamankumar.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}