baseline

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FailureInventoryAbsent = "inventory_absent"
	FailurePreSpawn        = "pre_spawn"
	FailurePostSpawn       = "post_spawn"
)

Variables

This section is empty.

Functions

func ClassifyWindowsImage

func ClassifyWindowsImage(major, minor, build uint32, productType byte) (string, error)

ClassifyWindowsImage maps the native Windows version tuple to one of the product images named by the runtime manifest. It deliberately rejects Windows 10 clients: a successful run there is not evidence for Windows 11.

func EnforceCleanupCompleted

func EnforceCleanupCompleted(result CleanupResult, fatal func(string)) bool

func GenerateTLSFixture

func GenerateTLSFixture(arch string) ([]byte, error)

func RuntimeManifestDigest

func RuntimeManifestDigest() string

func SHA256Hex

func SHA256Hex(contents []byte) string

func ValidateFailureTrace

func ValidateFailureTrace(manifest RunManifest, evidence TraceEvidence) error

Types

type CleanupResult

type CleanupResult struct {
	Completed      bool
	WaitError      error
	TerminateError error
	CloseJobError  error
	KillError      error
}

func CleanupWithWatchdog

func CleanupWithWatchdog(done <-chan error, deadline <-chan time.Time, terminate, closeJob, kill func() error) CleanupResult

type RunManifest

type RunManifest struct {
	SchemaVersion         int                `json:"schema_version"`
	RunNonce              string             `json:"run_nonce"`
	SourceRevision        string             `json:"source_revision"`
	Platform              RunPlatform        `json:"platform"`
	TokenInventorySHA256  string             `json:"token_inventory_sha256"`
	RuntimeManifestSHA256 string             `json:"runtime_manifest_sha256"`
	MatrixSHA256          string             `json:"matrix_sha256"`
	ExactTokenGatePassed  bool               `json:"exact_token_gate_passed"`
	Runtimes              []RuntimeExecution `json:"runtimes"`
	Collector             TraceCollector     `json:"collector"`
	RawTracePath          string             `json:"raw_trace_path"`
	RawTraceSHA256        string             `json:"raw_trace_sha256"`
	StartedUTC            string             `json:"started_utc"`
	FinishedUTC           string             `json:"finished_utc"`
}

func FinalizeRunManifest

func FinalizeRunManifest(invocation RunManifest, collector TraceCollector, rawTracePath string) (RunManifest, error)

func LoadRunManifest

func LoadRunManifest(path string) (RunManifest, error)

type RunPlatform

type RunPlatform struct {
	WindowsBuild string `json:"windows_build"`
	Architecture string `json:"architecture"`
	Filesystem   string `json:"filesystem"`
}

type RuntimeExecution

type RuntimeExecution struct {
	Name             string   `json:"name"`
	ExecutablePath   string   `json:"executable_path"`
	ObjectIdentity   string   `json:"object_identity"`
	ExecutableSHA256 string   `json:"executable_sha256"`
	PID              int      `json:"pid"`
	Status           string   `json:"status"`
	ExitCode         int      `json:"exit_code"`
	Diagnostic       string   `json:"diagnostic"`
	FailureKind      string   `json:"failure_kind,omitempty"`
	CallerPID        int      `json:"caller_pid,omitempty"`
	AttemptID        string   `json:"attempt_id,omitempty"`
	LookupEvidence   []string `json:"lookup_evidence,omitempty"`
	Win32Error       string   `json:"win32_error,omitempty"`
}

type RuntimeManifest

type RuntimeManifest struct {
	SchemaVersion   int           `json:"schema_version"`
	SupportedImages []string      `json:"supported_images"`
	Required        []RuntimeSpec `json:"required"`
	InventoryOnly   []RuntimeSpec `json:"inventory_only"`
}

func LoadRuntimeManifest

func LoadRuntimeManifest() (RuntimeManifest, error)

func (RuntimeManifest) RequireExactly

func (m RuntimeManifest) RequireExactly(want []string) error

func (RuntimeManifest) SupportsImage

func (m RuntimeManifest) SupportsImage(image string) bool

SupportsImage reports whether the product image is explicitly in scope for this runtime manifest.

type RuntimeSpec

type RuntimeSpec struct {
	Name       string   `json:"name"`
	Resolver   string   `json:"resolver"`
	Candidates []string `json:"candidates,omitempty"`
	Args       []string `json:"args,omitempty"`
	Mode       string   `json:"mode,omitempty"`
	NewConsole bool     `json:"new_console,omitempty"`
}

type TLSFixtureInfo

type TLSFixtureInfo struct {
	Machine        uint16
	EntryPointRVA  uint32
	CallbackVA     uint64
	CallbackMarker string
	MainMarker     string
}

func InspectTLSFixture

func InspectTLSFixture(file *pe.File) (TLSFixtureInfo, error)

type TraceCase

type TraceCase struct {
	Runtime           RuntimeExecution `json:"runtime"`
	Complete          bool             `json:"complete"`
	CapturedPIDs      []int            `json:"captured_pids"`
	CapturedNonce     string           `json:"captured_nonce"`
	CapturedAttemptID string           `json:"captured_attempt_id"`
	Events            []TraceEvent     `json:"events,omitempty"`
	Denials           []TraceDenial    `json:"denials"`
}

type TraceCollector

type TraceCollector struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Command string `json:"command"`
}

type TraceDenial

type TraceDenial struct {
	EventID         string `json:"event_id"`
	PID             int    `json:"pid"`
	Operation       string `json:"operation"`
	RequestedAccess string `json:"requested_access"`
	ObjectPath      string `json:"object_path"`
	ObjectIdentity  string `json:"object_identity"`
	Owner           string `json:"owner"`
	DACL            string `json:"dacl"`
}

type TraceEvent

type TraceEvent struct {
	PID             int    `json:"pid"`
	EventID         string `json:"event_id"`
	Sequence        uint64 `json:"sequence"`
	TimestampUTC    string `json:"timestamp_utc"`
	RunNonce        string `json:"run_nonce"`
	AttemptID       string `json:"attempt_id"`
	Operation       string `json:"operation"`
	Result          string `json:"result"`
	Path            string `json:"path"`
	RequestedAccess string `json:"requested_access"`
}

type TraceEvidence

type TraceEvidence struct {
	SchemaVersion int         `json:"schema_version"`
	Run           RunManifest `json:"run"`
	Cases         []TraceCase `json:"cases"`
}

func LoadTraceEvidence

func LoadTraceEvidence(path string) (TraceEvidence, error)

Jump to

Keyboard shortcuts

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