1.2.3 • Published 3 months ago

zsyp v1.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
3 months ago

NPM version Build Status Dependency Status

zsyp

CSP violation reports logger. Zsyp is a simple standalone web service that parses CPS violation reports and stores them in MongoDB collection.

Install

npm install --global zsyp

Environment

Zsyp is using dotenv and by default reads its environment from /etc/default/zsyp

  • ZSYP_PORT - port number on which, defaults to 3090
  • ZSYP_DB - mongo URI connection string, defaults to mongodb://localhost/zsyp
  • ZSYP_DOMAINS - domain name or a regular expression used to filter CSP violation reports - can be left empty in which case all reports for all domains are logged

Report format

{
  "from": {
    "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS...",   // User-Agent string
    "browser": {                                       // browser brand and version
      "name": "Safari", 
      "version": "13"
    },
    "os": {                                            // operating system info
      "name": "Mac OS X",
      "version": "10"
    },
    "ip": "1.2.3.4"                                    // originator IP address 
  },
  "csp-report": {                                      // original CSP report
    "document-uri": "https://example.com/page",
    "referrer": "https://example.com/",
    "violated-directive": "...",
    "effective-directive": "...",
    "original-policy": "...",
    "blocked-uri": "",
    "status-code": 0,
    "source-file": "..."
  }
}

Logger

Reports are stored in csp collection. If you want to use capped collection create it manually before running zsyp.

db.createCollection( "csp", { capped: true, size: 100000 } );

License

MIT © Damian Krzeminski

1.2.3

3 months ago

1.2.0

2 years ago

1.1.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.0.1

2 years ago

1.0.0

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago