cspreport

package
v0.0.0-...-8fa2440 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2016 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package cspreport provides facilities for logging CSP and HPKP violation reports.

Index

Constants

This section is empty.

Variables

View Source
var Handler http.Handler

HTTP handler which logs CSP and HPKP reports.

View Source
var _, Log = xlog.New("web.cspreport")

Logger which generates CSP and HPKP reports.

Functions

This section is empty.

Types

type CSPReport

type CSPReport struct {
	Body struct {
		BlockedURI         string `json:"blocked-uri"`
		DocumentURI        string `json:"document-uri"`
		EffectiveDirective string `json:"effective-directive"`
		OriginalPolicy     string `json:"original-policy"`
		Referrer           string `json:"referrer"`
		StatusCode         int    `json:"status-code"`
		ViolatedDirective  string `json:"violated-directive"`

		SourceFile   string `json:"source-file"`
		LineNumber   int    `json:"line-number"`
		ColumnNumber int    `json:"column-number"`
	} `json:"csp-report"`
}

CSP report structure.

type PKPReport

type PKPReport struct {
	DateTime                  time.Time `json:"date-time"`
	Hostname                  string    `json:"hostname"`
	Port                      int       `json:"port"`
	EffectiveExpirationDate   time.Time `json:"effective-expiration-date"`
	IncludeSubdomains         bool      `json:"include-subdomains"`
	KnownPins                 []string  `json:"known-pins"`
	ServedCertificateChain    []string  `json:"served-certificate-chain"`
	ValidatedCertificateChain []string  `json:"validated-certificate-chain"`
}

HPKP report structure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL