Code Monkey home page Code Monkey logo

csp-tester's Introduction

CSP Tester

Test your Content-Security-Policy using this simple python application to check if a .html page renders correctly given a certain Content Security Policy The original repo can be found here

What is the point of using Content-Security-Policies in your headers?

The use of Content Security Policy Serves as a very good counter measure to Cross-Site-Scripting. You can learn more about Cross Site Scripting here.

Content Security Policy allows your browser to restrict the running of different javascript which is received by the client. Some of which might be malicious.

For more information on Content Security Policy, you can visit here

Quick start

  1. Clone the application to a directory
  2. Run the server.py file

The default index_page will be run and you can visit your page at http://localhost:3000

Check your console to see which javascript has been executed.

Config file information

Option Description Possible values Remarks
https Loads the webpage in HTTP or HTTPS True or False Decides if the webpage is rendered in HTTP or HTTPS. In the case of HTTPS, the certificate will be automatically generated and will be self signed
host The host to be hosted on localhost or other domains It will be localhost by default. You can also set it to 0.0.0.0 to make it discoverable at the ip address of the machine to your local network
port Port that the website is listening on Integer between 1 and 65535 Some operating systems block lower number ports so take that into account when choosing a port. The default port value is 3000
debug Debug mode True or false False by default. This decides if the flask server runs in debug mode or note
csp The Content Security Policy that you want to set Any valid CSP value The CSP will be appended to the header of the reponses which are sent to the client.

Additional information

Some useful tools

A tool to scan and rate the CSP of your domain

CSP Evaluator allows developers and security experts to check if a Content Security Policy (CSP). Also provides sample safe and unsafe Content-Security-Policies

Tech stack

  1. Flask
  2. Configparser

csp-tester's People

Contributors

jh123x avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.