Content Security Policy CSP
What is Content Security Policy?
Content Security Policy is internet security standard to prevent the known attack like Cross-site scripting XSS, click hijacking and code injection. For example like, if your visiting website is http://www.example.com then you only able to access the data come from http://www.example.com, others URL or script and CDN like http://google.com/jquery.js also will be blocked.
Beside that, it also contain some inline script <button onclick="testing()">Click Me!</button> will also be blocked. unless you do some configuration on the header.
In short, it will do the following:
1) Whitelist to tell the client (Normally is Browser) what's allowed and what is not allowed.
2) Learn what directives are available
3) Learn the keywords they take
4) Inline code and eval () are considered harmful
5) Report Policy violations to your server before enforcing them.
How to implement Content Security Policy (CSP)?
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Content-Security-Policy" value="default-src 'self';" />
</customHeaders>
</httpProtocol>
</system.webServer>
Besides the value default-src, there are various more directives references.
base-urirestricts the URLs that can appear in a page's<base>element.child-srclists the URLs for workers and embedded frame contents. For example:child-src https://youtube.comwould enable embedding videos from YouTube but not from other origins. Use this in place of the deprecated directiveframe-src.connect-srclimits the origins that you can connect to (via XHR, WebSockets, and EventSource).font-srcspecifies the origins that can serve web fonts. Google's web fonts could be enabled viafont-src https://themes.googleusercontent.com.form-actionlists valid endpoints for submission from<form>tags.frame-ancestorsspecifies the sources that can embed the current page. This directive applies to<frame>,<iframe>,<embed>, and<applet>tags. This directive can't be used in<meta>tags and applies only to non-HTML resources.frame-srcdeprecated. Usechild-srcinstead.img-srcdefines the origins from which images can be loaded.media-srcrestricts the origins allowed to deliver video and audio.object-srcallows control over Flash and other plugins.plugin-typeslimits the kinds of plugins a page may invoke.report-urispecifies a URL where a browser will send reports when a content security policy is violated. This directive can't be used in<meta>tags.style-srcisscript-src's counterpart for stylesheets.upgrade-insecure-requestsinstructs user agents to rewrite URL schemes, changing HTTP to HTTPS. This directive is for websites with large numbers of old URL's that need to be rewritten.
Content Security Policy Csp >>>>> Download Now
ReplyDelete>>>>> Download Full
Content Security Policy Csp >>>>> Download LINK
>>>>> Download Now
Content Security Policy Csp >>>>> Download Full
>>>>> Download LINK WS