policy

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyConfig

type BodyConfig struct {
	MaxReadBytes             int64
	MaxDecompressedBytes     int64
	StreamReadChunkSize      int
	SampleBytes              int
	SampleStrategy           SampleStrategy
	EnableCompressedAnalysis bool
	AnalyzeMethods           []string
	AnalyzeContentTypes      []string
}

type CharsetConfig

type CharsetConfig struct {
	MaxAnalyzeBytes             int
	EnableUnicodeScripts        bool
	EnableSuspiciousPattern     bool
	EnableConfusableDetection   bool
	EnableFormatSpecificMetrics bool
}

type ComplexityConfig

type ComplexityConfig struct {
	MaxJSONDepth          int
	MaxFields             int
	SupportedContentTypes []string
	EnableFormAnalysis    bool
	EnableMultipartMeta   bool
}

type Config

type Config struct {
	EnableEntropy     bool
	EnableFingerprint bool
	EnableComplexity  bool
	EnableCharset     bool

	Body        BodyConfig
	Fingerprint FingerprintConfig
	Complexity  ComplexityConfig
	Charset     CharsetConfig
}

func DefaultConfig

func DefaultConfig() Config

func NormalizeConfig

func NormalizeConfig(cfg Config) Config

type FingerprintConfig

type FingerprintConfig struct {
	Headers           []string
	IncludeIP         bool
	IncludeTLS        bool
	TrustProxy        bool
	ProxyHeaders      []string
	TrustedProxyCIDRs []string

	// When false, the result keeps only hashes/source metadata and omits raw normalized fields.
	ExposeFields  bool
	HashAlgorithm string
	HashVersion   string
}

type SampleStrategy

type SampleStrategy string
const (
	SampleStrategyHead     SampleStrategy = "head"
	SampleStrategyTail     SampleStrategy = "tail"
	SampleStrategyHeadTail SampleStrategy = "head_tail"
)

Jump to

Keyboard shortcuts

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