Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

WSGI Middlewares for Web Application Security

Project description

https://travis-ci.org/dstufft/guard.png?branch=master https://coveralls.io/repos/dstufft/guard/badge.png?branch=master

Guard is a collection of generic WSGI middlewares and utilities for improving the security of a web application.

Content Security Policy

guard.ContentSecurityPolicy provides a WSGI middleware that can be used to provide a content security policy for a web application.

Usage

import guard, wsgi_app

# Default Policy
app = guard.ContentSecurityPolicy(wsgi_app.application)

# Custom Directives
app = guard.ContentSecurityPolicy(wsgi_app.application, {"img-src": ["*"]})

# Report Only
app = guard.ContentSecurityPolicy(wsgi_app.application, report_only=True)

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for guard, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size guard-1.0.1-py2.py3-none-any.whl (3.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size guard-1.0.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page