headers

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

internal/analysis/passive/headers/analyzer.go

Index

Constants

View Source
const MinHstsMaxAge = 15552000

Defines the minimum acceptable HSTS max-age (6 months in seconds).

Variables

This section is empty.

Functions

This section is empty.

Types

type HeadersAnalyzer

type HeadersAnalyzer struct {
	core.BaseAnalyzer
}

HeadersAnalyzer is a passive analysis module that inspects HTTP response headers for security misconfigurations, missing protective headers, and information disclosure. It embeds `core.BaseAnalyzer` to satisfy the standard analyzer interface.

func NewHeadersAnalyzer

func NewHeadersAnalyzer() *HeadersAnalyzer

NewHeadersAnalyzer creates a new instance of the HeadersAnalyzer. It sets up the base analyzer with its name, description, and type.

func (*HeadersAnalyzer) Analyze

func (a *HeadersAnalyzer) Analyze(ctx context.Context, analysisCtx *core.AnalysisContext) error

Analyze is the main entry point for the header analysis. It extracts the HTTP response headers from the HAR artifact in the `AnalysisContext`, and then runs a series of checks for missing headers, weak configurations (like HSTS and CSP), and information disclosure.

Jump to

Keyboard shortcuts

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