Skip to content

Commit

Permalink
add csp rules
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyguitar committed Sep 13, 2018
1 parent a57b63f commit 02348c3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ def find_key(token):
return os.environ.get("ACME_KEY_{}".format(n))


csp = {"default-src": ["*", "'unsafe-inline'", "'unsafe-eval'"]}
csp = {
"default-src": ["'self'", "github.com", "*.readthedocs.org"],
"style-src": ["'self'", "unsafe-inline", "'unsafe-inline'"],
"script-src": [
"'self'",
"*.cloudflare.com",
"'unsafe-inline'",
"'unsafe-eval'",
],
"img-src": "*",
"frame-src": "ghbtns.com",
}
app = Flask(__name__)
app.config["SECRET_KEY"] = os.urandom(16)
csrf = SeaSurf(app)
Expand Down

0 comments on commit 02348c3

Please sign in to comment.