attackpath

package
v0.1.8 Latest Latest
Warning

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

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

Documentation

Overview

Package attackpath assembles tenant-scoped attack paths from existing records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder writes producer-owned finding attribution. It never guesses from finding prose.

func NewRecorder

func NewRecorder(assets ports.AssetRepository, store ports.AttackPathStore, engagements ports.EngagementRepository) (*Recorder, error)

func (*Recorder) AssetIDByKey

func (r *Recorder) AssetIDByKey(ctx context.Context, tenantID shared.ID, kind asset.Kind, key string) (shared.ID, error)

func (*Recorder) InheritedAssetID

func (r *Recorder) InheritedAssetID(ctx context.Context, engagementID shared.ID, findingIDs []shared.ID) (shared.ID, error)

InheritedAssetID returns an asset only when every referenced finding has exactly one common binding.

func (*Recorder) Record

func (r *Recorder) Record(ctx context.Context, engagementID, assetID, producer, provenance shared.ID, confidence asset.EdgeConfidence, findingIDs []shared.ID) error

Record replaces this producer's complete observation after its canonical findings are persisted.

func (*Recorder) RecordTargets

func (r *Recorder) RecordTargets(ctx context.Context, engagementID, assetID, producer, provenance shared.ID, confidence asset.EdgeConfidence, targets []ap.FindingTarget) error

RecordTargets replaces this producer's complete observation after its typed targets are persisted.

func (*Recorder) ValidateAsset

func (r *Recorder) ValidateAsset(ctx context.Context, engagementID, assetID shared.ID) error

ValidateAsset proves that assetID belongs to the finding's engagement tenant.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service computes paths on demand; it never persists or executes a path.

func NewService

func NewService(assets ports.AssetRepository, bindings ports.AttackPathStore, findings ports.FindingRepository, imported ports.ImportedFindingStore, judgments ports.JudgmentStore, engagements ports.EngagementRepository, limits ap.Limits) (*Service, error)

func (*Service) Query

func (s *Service) Query(ctx context.Context, tenantID shared.ID, query ap.Query) (ap.Result, error)

Jump to

Keyboard shortcuts

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