{"id":2773,"date":"2019-04-08T19:39:42","date_gmt":"2019-04-08T14:09:42","guid":{"rendered":"https:\/\/www.idslogic.com\/blog\/?p=2773"},"modified":"2025-02-24T18:32:06","modified_gmt":"2025-02-24T13:02:06","slug":"how-to-configure-the-security-policies-and-http-response-headers","status":"publish","type":"post","link":"https:\/\/www.idslogic.com\/blog\/how-to-configure-the-security-policies-and-http-response-headers","title":{"rendered":"How to Configure the Security Policies and HTTP Response Headers"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\">In this section, we will show how to configure Sitefinity CMS that comes with a set of predefined security policies. The Web security module reads the configuration for each security policy and sets the value of the corresponding HTTP response headers. This feature is upgraded to\u00a0Sitefinity versions\u00a011.0 and above.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">When configuring the security policy for Sitefinity CMS website, you can define the\u00a0Content-Security-Policy HTTP response header for different types of content. The value of the\u00a0Content-Security-Policy\u00a0contains one or more directives that define the valid sources for each type of content. <\/span><\/p>\n<p><span style=\"font-size: 14pt;\">When setting the Content-Security-Policy HTTP header, Sitefinity backend stopped working, issuing some errors in the JavaScript console on the browser.<\/span><\/p>\n<p><span style=\"color: #008000; font-size: 18pt;\"><strong>Follow These Steps to Fetch Records that are Given Below:<\/strong><\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #800080;\"><strong>Step 1:<\/strong> <\/span>Go to the <span style=\"color: #000080;\"><strong>Administration &gt;&gt; Modules &amp; Services<\/strong><\/span> and check if the <span style=\"color: #000080;\"><strong>Web Security module<\/strong><\/span> is activated or deactivated. If the <span style=\"color: #000080;\"><strong>Web Security module<\/strong><\/span> is deactivated, then first activate this module, after that, follow these steps to configure external resources on the website.<\/span><\/p>\n<hr \/>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #800080;\"><strong>Step 2: <\/strong><\/span>Navigate\u00a0to <span style=\"color: #000080;\"><strong>Administration \u00bb Settings \u00bb Advanced \u00bb WebSecurity \u00bb HttpSecurityHeaders \u00bb Response Headers \u00bb Content-Security-Policy<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Your default configuration displays like this.<\/span><\/p>\n<figure id=\"attachment_2774\" aria-describedby=\"caption-attachment-2774\" style=\"width: 1337px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2774 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-2.png\" alt=\"step 2\" width=\"1337\" height=\"620\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-2.png 1337w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-2-300x139.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-2-768x356.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-2-1024x475.png 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-2-560x260.png 560w\" sizes=\"auto, (max-width: 1337px) 100vw, 1337px\" \/><figcaption id=\"caption-attachment-2774\" class=\"wp-caption-text\">Image Source: progress.com<\/figcaption><\/figure>\n<hr \/>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #800080;\"><strong>Step 3:<\/strong> <\/span>Now we have to implement a demo for an external image.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Image source in HTTP header value will display like this<span style=\"color: #000080;\"><strong> \u2018img-src &#8216;self\u2019<\/strong><\/span><\/span><\/p>\n<figure id=\"attachment_2775\" aria-describedby=\"caption-attachment-2775\" style=\"width: 1344px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2775 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-3.png\" alt=\"step 3\" width=\"1344\" height=\"620\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-3.png 1344w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-3-300x138.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-3-768x354.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-3-1024x472.png 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-3-560x258.png 560w\" sizes=\"auto, (max-width: 1344px) 100vw, 1344px\" \/><figcaption id=\"caption-attachment-2775\" class=\"wp-caption-text\">Source: progress.com<\/figcaption><\/figure>\n<hr \/>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #800080;\"><strong>Step 4:<\/strong> <\/span>Now check on Frontend, the images are not loaded properly because there are <span style=\"color: #000080;\"><strong><em>Content Security Policy directive: &#8220;img-src &#8216;self&#8217; error.<\/em><\/strong><\/span><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">To fix this error, please follow <span style=\"color: #000080;\"><strong>Step 5<\/strong><\/span> as given below:<\/span><\/p>\n<figure id=\"attachment_2776\" aria-describedby=\"caption-attachment-2776\" style=\"width: 1298px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2776 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-4.png\" alt=\"step 4\" width=\"1298\" height=\"560\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-4.png 1298w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-4-300x129.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-4-768x331.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-4-1024x442.png 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-4-560x242.png 560w\" sizes=\"auto, (max-width: 1298px) 100vw, 1298px\" \/><figcaption id=\"caption-attachment-2776\" class=\"wp-caption-text\">source progress.com<\/figcaption><\/figure>\n<hr \/>\n<p><span style=\"color: #800080;\"><strong><span style=\"font-size: 14pt;\">Step 5:<\/span><\/strong><\/span><span style=\"font-size: 14pt;\"> Navigate\u00a0to <span style=\"color: #000080;\"><strong>Administration \u00bb Settings \u00bb Advanced \u00bb WebSecurity \u00bb HttpSecurityHeaders \u00bb Response Headers \u00bb Content-Security-Policy<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Add the domain name <em>(like as:<\/em><span style=\"color: #000080;\"><strong><em> https:\/\/freeiconshop.com<\/em><\/strong><\/span><em>)<\/em> to the right after <span style=\"color: #000080;\"><strong><em>&#8220;img-src &#8216;self&#8217;<\/em><\/strong><\/span><\/span><\/p>\n<hr \/>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #800080;\"><strong>Step 6:<\/strong> <\/span>After adding the domain Image source in HTTP header value will display like this<\/span><\/p>\n<p><span style=\"font-size: 14pt; color: #000080;\"><strong>\u2018<\/strong><strong>img-src &#8216;self\u2019 https:\/\/freeiconshop.com\/ *<\/strong><\/span><\/p>\n<figure id=\"attachment_2777\" aria-describedby=\"caption-attachment-2777\" style=\"width: 1347px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2777 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-6.png\" alt=\"step 6\" width=\"1347\" height=\"597\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-6.png 1347w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-6-300x133.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-6-768x340.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-6-1024x454.png 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-6-560x248.png 560w\" sizes=\"auto, (max-width: 1347px) 100vw, 1347px\" \/><figcaption id=\"caption-attachment-2777\" class=\"wp-caption-text\">source: progress.com<\/figcaption><\/figure>\n<hr \/>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #800080;\"><strong>Step 7<\/strong>:<\/span> After Save changes in the HTTP header value images loaded perfectly.<\/span><\/p>\n<p><a href=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-9579 size-large\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7-1024x446.jpg\" alt=\"How-to-Configure-the-Security-Policies-and-HTTP-Response-Headers\" width=\"1024\" height=\"446\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7-1024x446.jpg 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7-300x131.jpg 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7-768x334.jpg 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7-560x244.jpg 560w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/04\/step-7.jpg 1279w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p style=\"box-shadow: 0 0 16px #cccccc; padding: 10px;\"><span style=\"font-size: 14pt;\"><span style=\"color: #000000;\"><strong>Also Read:<\/strong><\/span>\u00a0<a href=\"\/blog\/get-to-know-the-latest-features-of-sitefinity-11-2-release\"><span style=\"color: #ff0000;\">Get to Know the Latest Features of Sitefinity 11.2 Release<\/span><\/a><\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>Contributed By:<\/strong><\/span><\/p>\n<p>Arunodaya Kumar<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this section, we will show how to configure Sitefinity CMS that comes with a set of predefined security policies. The Web security module reads the configuration for each security policy and sets the value of the corresponding HTTP response&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2779,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[251],"tags":[799,798,226],"class_list":["post-2773","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sitefinity","tag-http-response-headers","tag-sitefinity-cms-security","tag-sitefinity-development"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/comments?post=2773"}],"version-history":[{"count":5,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2773\/revisions"}],"predecessor-version":[{"id":10681,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2773\/revisions\/10681"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/media\/2779"}],"wp:attachment":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/media?parent=2773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/categories?post=2773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/tags?post=2773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}