skbkontur/frontreport

Name: frontreport

Owner: Kontur

Description: Simple frontend logging collector written in Go

Created: 2016-11-03 14:47:36.0

Updated: 2018-02-15 08:56:13.0

Pushed: 2018-02-13 08:54:40.0

Homepage: null

Size: 137

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Go Report Card Join the chat at https://gitter.im/frontreport/frontreport

What is this tool for?

Frontreport is useful only if you have an existing infrastructure for backend log aggregation. For example, we use ELK stack with RabbitMQ as a broker on top. So, your logging infrastructure may look like this:

Backend application ? Logstash ? RabbitMQ ? Elastic RabbitMQ River ? Elastic ? Kibana

You may want to reuse this infrastructure to collect frontend logs from browsers of your visitors. So, you need to replace Logstash in the above scheme with something fast that can validate incoming JSON and manage high load by batching documents.

Frontreport does all that. Resulting architecture is something like the following:

Browser ? Frontreport ? RabbitMQ ? Elastic RabbitMQ River ? Elastic ? Kibana

See code for details or ask us on Gitter.

Usage
e:
ontreport [OPTIONS]

ication Options:
, --port=                port to listen (default: 8888) [$FRONTREPORT_PORT]
, --amqp=                AMQP connection string (default: amqp://guest:guest@localhost:5672/) [$FRONTREPORT_AMQP]
, --service-whitelist=   allow reports only from this comma-separated list of services (allows all if not specified) [$FRONTREPORT_SERVICE_WHITELIST]
, --domain-whitelist=    allow CORS requests only from this comma-separated list of domains (allows all if not specified) [$FRONTREPORT_DOMAIN_WHITELIST]
, --sourcemap-whitelist= trusted sourcemap pattern (regular expression), trust localhost only if not specified (default: ^(http|https)://localhost/) [$FRONTREPORT_SOURCEMAP_WHITELIST]
, --logfile=             log file name (writes to stdout if not specified) [$FRONTREPORT_LOGFILE]
, --graphite=            Graphite connection string for internal metrics [$FRONTREPORT_GRAPHITE]
, --graphite-prefix=     prefix for Graphite metrics [$FRONTREPORT_GRAPHITE_PREFIX]
, --version              print version and exit

 Options:
, --help                 Show this help message
What can you collect from browsers?
  1. CSP violation reports. CSP stands for Content Security Policy. Send reports to /csp, /csp/, /_reports/csp or basically any URL that contains substring csp.
  2. HPKP violation reports. HPKP stands for HTTP Public Key Pinning. URL must contain substring pkp.
  3. StacktraceJS reports. StacktraceJS is a JS library that collects unified stacktrace reports from any browser. URL must contain substring stacktracejs.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.