fingerprint

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package `fingerprint` reads `metadata` and calculate the JA3, JA4, HTTP2 fingerprints, etc.

It also implements `header_injector` interface from package `reverseproxy`, which allows passing fingerprints to the backend through the forwarding request headers.

Index

Constants

This section is empty.

Variables

View Source
var (
	VerboseLogs bool
	Logger      *log.Logger
)

Functions

func JA3Fingerprint

func JA3Fingerprint(data *metadata.Metadata) (string, error)

JA3Fingerprint is a FingerprintFunc

func JA4Fingerprint

func JA4Fingerprint(data *metadata.Metadata) (string, error)

JA4Fingerprint is a FingerprintFunc

func RegisterDurationMetric added in v0.4.0

func RegisterDurationMetric(registry *prometheus.Registry, buckets []float64, prefix string)

Types

type FingerprintFunc

type FingerprintFunc func(*metadata.Metadata) (string, error)

type FingerprintHeaderInjector

type FingerprintHeaderInjector struct {
	HeaderName                       string
	FingerprintFunc                  FingerprintFunc
	FingerprintDurationSucceedMetric prometheus.Observer
	FingerprintDurationErrorMetric   prometheus.Observer
}

FingerprintHeaderInjector implements reverseproxy.HeaderInjector

func NewFingerprintHeaderInjector

func NewFingerprintHeaderInjector(headerName string, fingerprintFunc FingerprintFunc) *FingerprintHeaderInjector

func (*FingerprintHeaderInjector) GetHeaderName

func (i *FingerprintHeaderInjector) GetHeaderName() string

func (*FingerprintHeaderInjector) GetHeaderValue

func (i *FingerprintHeaderInjector) GetHeaderValue(req *http.Request) (string, error)

type HTTP2FingerprintParam added in v1.2.0

type HTTP2FingerprintParam struct {
	MaxPriorityFrames uint
}

func (*HTTP2FingerprintParam) HTTP2Fingerprint added in v1.2.0

func (p *HTTP2FingerprintParam) HTTP2Fingerprint(data *metadata.Metadata) (string, error)

HTTP2Fingerprint is a FingerprintFunc, it creates Akamai HTTP2 fingerprints as the suggested format: S[;]|WU|P[,]#|PS[,]

Jump to

Keyboard shortcuts

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