Documentation
¶
Index ¶
- Constants
- func CasesEqual(a, b []cases.Case) bool
- func CasesEqualWithOrder(a, b []cases.Case, order []string) bool
- func ComputeCaseDigest(list []cases.Case, order []string, algorithm string) (string, error)
- func ComputeFindingsDigest(list []findings.Finding, order []string, algorithm string) (string, error)
- func CreateArtifact(path string, manifest Manifest, files map[string][]byte) error
- func CreateArtifactWithContext(ctx context.Context, path string, manifest Manifest, files map[string][]byte) error
- func LoadCases(path string) ([]cases.Case, error)
- func LoadCasesWithContext(ctx context.Context, path string) ([]cases.Case, error)
- func OrderCases(list []cases.Case, order []string) []cases.Case
- func OrderFindings(list []findings.Finding, order []string) []findings.Finding
- func SanitizeBody(body []byte) []byte
- func SanitizeCookieValue(value string) string
- func SanitizeHeaders(input map[string][]string) map[string][]string
- func WriteCases(path string, list []cases.Case, opts ...WriteCasesOption) error
- func WriteCasesWithContext(ctx context.Context, path string, list []cases.Case, opts ...WriteCasesOption) error
- func WriteFindings(path string, list []findings.Finding) error
- func WriteFindingsWithContext(ctx context.Context, path string, list []findings.Finding) error
- func WriteFlows(path string, flows []FlowRecord) error
- func WriteFlowsWithContext(ctx context.Context, path string, flows []FlowRecord) error
- type CookieRecord
- type DNSRecord
- type FlowRecord
- type Manifest
- type PluginInfo
- type Provenance
- type RateLimitRecord
- type ResponseRecord
- type RobotsRecord
- type RunnerInfo
- type TLSRecord
- type WriteCasesOption
Constants ¶
const ManifestVersion = "1.1"
ManifestVersion captures the schema version for replay artefact manifests.
Variables ¶
This section is empty.
Functions ¶
func CasesEqual ¶
CasesEqual compares two case slices after normalising ordering.
func CasesEqualWithOrder ¶
CasesEqualWithOrder compares two case slices using the provided ordering when supplied.
func ComputeCaseDigest ¶
ComputeCaseDigest renders the provided cases and returns a deterministic digest.
func ComputeFindingsDigest ¶
func ComputeFindingsDigest(list []findings.Finding, order []string, algorithm string) (string, error)
ComputeFindingsDigest renders the findings and returns a deterministic digest.
func CreateArtifact ¶
CreateArtifact writes the replay manifest and referenced files to a gzipped tarball.
func CreateArtifactWithContext ¶
func CreateArtifactWithContext(ctx context.Context, path string, manifest Manifest, files map[string][]byte) error
CreateArtifactWithContext writes the replay manifest and referenced files to a gzipped tarball using the provided context for tracing.
func LoadCasesWithContext ¶
LoadCasesWithContext reads cases from a JSON file using the provided context for tracing.
func OrderCases ¶
OrderCases clones and reorders the provided cases using the supplied ordering.
func OrderFindings ¶
OrderFindings clones and reorders the findings according to the provided sequence.
func SanitizeBody ¶
SanitizeBody redacts common credential tokens from HTTP bodies.
func SanitizeCookieValue ¶
SanitizeCookieValue hashes cookie values to avoid leaking secrets.
func SanitizeHeaders ¶
SanitizeHeaders redacts sensitive header values.
func WriteCases ¶
func WriteCases(path string, list []cases.Case, opts ...WriteCasesOption) error
WriteCases writes the provided cases to disk using deterministic encoding.
func WriteCasesWithContext ¶
func WriteCasesWithContext(ctx context.Context, path string, list []cases.Case, opts ...WriteCasesOption) error
WriteCasesWithContext writes cases using the provided context for tracing.
func WriteFindings ¶
WriteFindings persists the findings to a JSONL file using deterministic ordering.
func WriteFindingsWithContext ¶
WriteFindingsWithContext writes findings using the provided context for tracing.
func WriteFlows ¶
func WriteFlows(path string, flows []FlowRecord) error
WriteFlows persists the provided flow records as JSONL.
func WriteFlowsWithContext ¶
func WriteFlowsWithContext(ctx context.Context, path string, flows []FlowRecord) error
WriteFlowsWithContext persists flow records using the provided context for tracing.
Types ¶
type CookieRecord ¶
type CookieRecord struct {
Domain string `json:"domain"`
Name string `json:"name"`
Value string `json:"value"`
}
CookieRecord stores sanitised cookie values observed during the run.
type FlowRecord ¶
type FlowRecord struct {
ID string `json:"id"`
Sequence uint64 `json:"sequence"`
Type string `json:"type"`
TimestampUnix int64 `json:"timestamp_unix"`
SanitizedBase64 string `json:"sanitized_base64,omitempty"`
RawBodyBytes int `json:"raw_body_bytes,omitempty"`
RawBodyCaptured int `json:"raw_body_captured,omitempty"`
SanitizedRedacted bool `json:"sanitized_redacted,omitempty"`
}
FlowRecord captures a sanitized proxy flow suitable for replay. TimestampUnix is recorded in seconds since the Unix epoch to keep the log compact.
func LoadFlows ¶
func LoadFlows(path string) ([]FlowRecord, error)
LoadFlows reads flow records from a JSONL file.
func LoadFlowsWithContext ¶
func LoadFlowsWithContext(ctx context.Context, path string) ([]FlowRecord, error)
LoadFlowsWithContext reads flow records from a JSONL file using the provided context for tracing.
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
CreatedAt time.Time `json:"created_at"`
Seeds map[string]int64 `json:"seeds,omitempty"`
DNS []DNSRecord `json:"dns,omitempty"`
TLS []TLSRecord `json:"tls,omitempty"`
Robots []RobotsRecord `json:"robots,omitempty"`
RateLimits []RateLimitRecord `json:"rate_limits,omitempty"`
Cookies []CookieRecord `json:"cookies,omitempty"`
Responses []ResponseRecord `json:"responses,omitempty"`
FlowsFile string `json:"flows_file,omitempty"`
Runner RunnerInfo `json:"runner"`
Plugins []PluginInfo `json:"plugins"`
FindingsFile string `json:"findings_file"`
FindingOrder []string `json:"finding_order,omitempty"`
CasesFile string `json:"cases_file"`
CaseOrder []string `json:"case_order,omitempty"`
CaseTimestamp time.Time `json:"case_timestamp"`
Provenance []Provenance `json:"provenance,omitempty"`
}
Manifest describes the metadata captured for a replayable pipeline run.
func ExtractArtifact ¶
ExtractArtifact expands the artefact under the destination directory and returns the manifest.
func (*Manifest) Normalize ¶
func (m *Manifest) Normalize()
Normalize enforces deterministic ordering across manifest collections so that serialised artefacts remain stable for replay comparisons.
func (Manifest) ProvenanceByScope ¶
func (m Manifest) ProvenanceByScope(scope string) (Provenance, bool)
ProvenanceByScope retrieves the provenance record for the provided scope.
type PluginInfo ¶
type PluginInfo struct {
Name string `json:"name"`
Version string `json:"version"`
ManifestPath string `json:"manifest_path"`
Signature string `json:"signature"`
SHA256 string `json:"sha256"`
}
PluginInfo stores the manifest and signature metadata for a plugin.
type Provenance ¶
type Provenance struct {
Scope string `json:"scope"`
Algorithm string `json:"algorithm"`
Digest string `json:"digest"`
}
Provenance captures pre-computed digests for artefact components.
type RateLimitRecord ¶
RateLimitRecord captures observed rate limiting headers.
type ResponseRecord ¶
type ResponseRecord struct {
RequestURL string `json:"request_url"`
Method string `json:"method"`
Status int `json:"status"`
Headers map[string][]string `json:"headers,omitempty"`
BodyFile string `json:"body_file,omitempty"`
}
ResponseRecord references a sanitised HTTP response body.
type RobotsRecord ¶
RobotsRecord stores the contents of robots.txt for a host.
type RunnerInfo ¶
type RunnerInfo struct {
CtlVersion string `json:"0xgenctl_version"`
DaemonVersion string `json:"0xgend_version"`
GoVersion string `json:"go_version,omitempty"`
OS string `json:"os,omitempty"`
Arch string `json:"arch,omitempty"`
}
RunnerInfo records the versions of the primary executables.
func DefaultRunnerInfo ¶
func DefaultRunnerInfo() RunnerInfo
DefaultRunnerInfo returns a baseline RunnerInfo populated from the runtime.
type TLSRecord ¶
type TLSRecord struct {
Host string `json:"host"`
JA3 string `json:"ja3,omitempty"`
JA3Hash string `json:"ja3_hash,omitempty"`
NegotiatedALPN string `json:"negotiated_alpn,omitempty"`
OfferedALPN []string `json:"offered_alpn,omitempty"`
}
TLSRecord stores observed TLS fingerprinting and ALPN negotiation metadata.
type WriteCasesOption ¶
type WriteCasesOption func(*writeCasesConfig)
WriteCasesOption configures optional behaviour when writing cases.
func WithCaseOrder ¶
func WithCaseOrder(order []string) WriteCasesOption
WithCaseOrder preserves the provided ordering when serialising cases.