A library to generate CSP headers from HAR files
Project description
har2csp
har2csp is a command-line tool that generates Content Security Policy (CSP) headers from HTTP Archive (HAR) files. It analyzes the network requests in the HAR file and generates CSP directives that allow those requests, helping you to create a CSP for your website that doesn't break anything.
Installation
pip install har2csp
Usage
har2csp [-h] [-s SELF_URL] har_file_path
Positional Arguments
har_file_path: The path to the HAR file to generate CSP directives from.
Optional Arguments
-h, --help: Show a help message and exit.-s SELF_URL, --self-url SELF_URL: The URL of the website that the HAR file was recorded from. Any requests to this URL will be ignored when generating the CSP directives.
Example
har2csp -s https://www.example.com example.har
This command will generate CSP directives from example.har, ignoring any requests to https://www.example.com. The directives will be printed to the console.
License
This project is licensed under the terms of the Apache 2.0 Licence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file har2csp-1.0.0.tar.gz.
File metadata
- Download URL: har2csp-1.0.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3793e6f3aedc49921adf39d306902550cf8f7105ed39c31942c25c4ebeef1ae
|
|
| MD5 |
563b3ac4100c8880d2629defc747bb53
|
|
| BLAKE2b-256 |
db9cf6827ca35f9763f88fbec3e4a5a80d867ce79efcfb21fc78aa6f4b7925cd
|
File details
Details for the file har2csp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: har2csp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b75f3587dab39c1a3334f7a14fe21f9e7e7c4956059350ddbe8e417f7b2a14
|
|
| MD5 |
ac0407ff763dd425796fa72f570decb7
|
|
| BLAKE2b-256 |
b0a4b7452ff35801b176786a2e23eb3bcfefdfc2daeddc96d4832edf9197c150
|