https://github.com/codefresh-io/csp-server
A sample server that accepts Content Security Policy reports, and prints them to the console
https://github.com/codefresh-io/csp-server
Last synced: 8 months ago
JSON representation
A sample server that accepts Content Security Policy reports, and prints them to the console
- Host: GitHub
- URL: https://github.com/codefresh-io/csp-server
- Owner: codefresh-io
- License: apache-2.0
- Created: 2021-10-06T11:20:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-14T17:41:11.000Z (almost 4 years ago)
- Last Synced: 2025-04-25T14:59:41.668Z (about 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csp-server
A sample server that accepts Content Security Policy reports, and prints them to the console
## Usage
### On a local machine
```bash
node index.js
```
The server will listen to port `3000` by default (can be set by environment variable `PORT`) for incoming `Content-Security-Policy` [report information](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP#enabling_reporting)
### In a container
execute
```bash
docker build . -t csp-reporter
```
to build a server image, and then execute
```bash
doker run -p 3000:3000 csp-reporter
```
to start it up in a container.
Alternatively, you can just use our pre-built image:
```bash
docker run -p 3000:3000 quay.io/codefresh/csp-server
```