{ "info": { "author": "Gian Ortiz", "author_email": "brksgian@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# NGINX Content-Security-Policy header generator\n\n[![Build Status](https://travis-ci.com/GianOrtiz/nginxcsp.svg?branch=master)](https://travis-ci.com/GianOrtiz/nginxcsp) [![Coverage Status](https://coveralls.io/repos/github/GianOrtiz/nginxcsp/badge.svg?branch=master)](https://coveralls.io/github/GianOrtiz/nginxcsp?branch=master)\n\nThis tool will generate `Content-Security-Policy` headers for a NGINX configuration file from import domains in HTML files.\n\n## Usage\n\nTo generate `Content-Security-Policy` headers from HTML files in a path you can use the following command:\n\n```\nnginxcsp /path/to/html/files --out /path/to/nginx.conf --override\n```\n\nthe command will generate `Content-Security-Policy`, `X-Content-Security-Policy` and `X-WebKit-CSP` headers for all `server` blocks of your `nginx.conf` file and remove the past ones. The headers will be generate from the tags in your html files, for example if you have an HTML file with the tag `` you would get the header `Content-Security-Policy \"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudfare.com; img-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self'; object-src 'self'\"`.\n\nIf you would like to create only the `Content-Security-Policy` header you can use the flag `--csp`, the same applies for `X-Content-Security-Policy` with `--xcsp` and for `X-WebKit-CSP` with `--xwebkit`.\n\nYou can get all the usage help using `nginxcsp -h`:\n\n```\nusage: nginxcsp html_path\n\nSearch content loading sources in HTML files and Content-Security-Policy\nheaders automatically.\n\npositional arguments:\n html_path the path of the HTML files\n\noptional arguments:\n -h, --help show this help message and exit\n --out OUT NGINX configuration file to output the generated\n headers\n --server_name SERVER_NAME\n the server_name in the NGINX server block to add CSP\n headers\n --port PORT the port from \"listen {port}\" line in a NGINX server\n block to add CSP headers\n --override flag to override the headers in the out file\n --csp flag to generate only the Content-Security-Policy\n header\n --xcsp flag to generate only the X-Content-Security-Policy\n header\n --xwebkit flag to generate only the X-WebKit-CSP header\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GianOrtiz/nginxcsp", "keywords": "nginx config security", "license": "", "maintainer": "", "maintainer_email": "", "name": "nginxcsp", "package_url": "https://pypi.org/project/nginxcsp/", "platform": "", "project_url": "https://pypi.org/project/nginxcsp/", "project_urls": { "Homepage": "https://github.com/GianOrtiz/nginxcsp", "Source Code": "https://github.com/GianOrtiz/nginxcsp" }, "release_url": "https://pypi.org/project/nginxcsp/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Generate NGINX Content-Security-Policy headers from HTML files", "version": "0.1.0" }, "last_serial": 5624320, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "09984a72309918ae48ee4218a6ad8db8", "sha256": "cc4af13a9a974bec1b481f49f1c18bf966cdf93d761a80f2ae10ee2c75b9bb28" }, "downloads": -1, "filename": "nginxcsp-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "09984a72309918ae48ee4218a6ad8db8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16651, "upload_time": "2019-08-02T13:43:25", "url": "https://files.pythonhosted.org/packages/5b/6a/d6e862288ecc9a2bb436129e662f6f9092b13a4430dacfe104f83f1e3714/nginxcsp-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c18c5573ab996c2e1c3218ffde3d44c", "sha256": "432b65ac50710257db0f49b575057b25552d016e55d67cbcbda1445a4be6f2d9" }, "downloads": -1, "filename": "nginxcsp-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2c18c5573ab996c2e1c3218ffde3d44c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10765, "upload_time": "2019-08-02T13:43:28", "url": "https://files.pythonhosted.org/packages/88/bc/4aba3450102ad196b9871626451f8601cbccc746b729ec91a93eedab65e5/nginxcsp-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09984a72309918ae48ee4218a6ad8db8", "sha256": "cc4af13a9a974bec1b481f49f1c18bf966cdf93d761a80f2ae10ee2c75b9bb28" }, "downloads": -1, "filename": "nginxcsp-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "09984a72309918ae48ee4218a6ad8db8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16651, "upload_time": "2019-08-02T13:43:25", "url": "https://files.pythonhosted.org/packages/5b/6a/d6e862288ecc9a2bb436129e662f6f9092b13a4430dacfe104f83f1e3714/nginxcsp-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c18c5573ab996c2e1c3218ffde3d44c", "sha256": "432b65ac50710257db0f49b575057b25552d016e55d67cbcbda1445a4be6f2d9" }, "downloads": -1, "filename": "nginxcsp-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2c18c5573ab996c2e1c3218ffde3d44c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10765, "upload_time": "2019-08-02T13:43:28", "url": "https://files.pythonhosted.org/packages/88/bc/4aba3450102ad196b9871626451f8601cbccc746b729ec91a93eedab65e5/nginxcsp-0.1.0.tar.gz" } ] }