Skip to main content

Security

CSP and CORS

·527 words·3 mins
What is CSP # CSP stands for Content Security Policy and it is a security mechanism that helps to protect or mitigate some common attacks such as XSS (Cross-site scripting). It can be set by means of a Content-Security-Policy HTTP header or using an HTML meta tag. HTTP header: Content-Security-Policy: policy HTML Meta tag: <meta http-equiv="Content-Security-Policy" content="policy"> A policy describes a set of directives, each composed of the area in which the rule is applied and the rule itself. The policy directive default-src 'self' says to load all content from the site’s origin, while if we want to load content from the site and from another trusted domain, the policy would be Content-Security-Policy: default-src 'self' *.trusted.com.

Security Headers on Static Websites

·604 words·3 mins
When I started this blog, I evaluated many options: blogging platform vs static-generated website self-hosted vs hosted solutions costs and many more. I ended up trying to build something very simple, consisting of a static website hosted on GitHub Pages. With this solution, I have been able to cut the cost of any hosting solution, since, being a dev, I am quite comfortable writing in a text editor. But soon some problems arose.