remediation

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package remediation implements the application service for remediation groups (RFC-015): grouping findings by the fix that resolves them and resolving a whole group in one action.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkResolver

type BulkResolver interface {
	BulkUpdateFindingsStatus(ctx context.Context, tenantID string, input finding.BulkUpdateStatusInput) (*finding.BulkUpdateResult, error)
}

BulkResolver is the slice of the finding service the group resolve needs.

type GroupService

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

GroupService lists remediation groups and resolves a whole group at once.

func NewGroupService

func NewGroupService(keys remediationdom.KeyRepository, resolver BulkResolver, guard Guard, log *logger.Logger) *GroupService

NewGroupService constructs the service. guard may be nil (no abuse gate).

func (*GroupService) ListGroups

func (s *GroupService) ListGroups(ctx context.Context, tenantID shared.ID) ([]remediationdom.Group, error)

ListGroups returns the tenant's remediation groups over its open findings.

func (*GroupService) ResolveGroup

func (s *GroupService) ResolveGroup(ctx context.Context, tenantID shared.ID, in ResolveGroupInput) (*finding.BulkUpdateResult, error)

ResolveGroup transitions every open, non-pentest finding in a group to the requested status, reusing the finding bulk path (and its Jira sync + activity) behind the bulk abuse-guard. Defaults to fix_applied ("patched, pending verification") so the next rescan can confirm and flip to resolved.

type Guard

type Guard interface {
	CheckBulk(ctx context.Context, tenantID shared.ID, size int, operatorApproved bool) error
}

Guard is the abuse-guard slice (size ceiling + hourly budget) applied before a bulk resolve.

type KeyApplier

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

KeyApplier derives each finding's remediation group key and upserts it into the side-table. Implements ingest.RemediationKeyApplier. Best-effort — a failed key never blocks ingest.

func NewKeyApplier

func NewKeyApplier(repo remediationdom.KeyRepository, log *logger.Logger) *KeyApplier

NewKeyApplier constructs a KeyApplier.

func (*KeyApplier) ApplyBatch

func (a *KeyApplier) ApplyBatch(ctx context.Context, tenantID shared.ID, findings []*vulnerability.Finding) error

ApplyBatch derives and upserts a remediation key for each groupable finding. Ungroupable findings (no shared fix signal) are skipped.

type ResolveGroupInput

type ResolveGroupInput struct {
	Key        string
	Status     string // fix_applied (default) or resolved
	Resolution string
	ActorID    string
	// HasVerifyPermission mirrors the single-finding direct-resolve guard.
	HasVerifyPermission bool
	// OperatorApproved lets an over-ceiling bulk through the abuse guard.
	OperatorApproved bool
}

ResolveGroupInput parameterizes a group resolve.

Jump to

Keyboard shortcuts

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