integrations

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package integrations connects Scout to its sibling tools, Pulse (observability) and Sentinel (runtime defense). Both are optional and auto-detected: Scout is fully useful with neither present. These clients talk to operator-configured sibling services, never to scan targets, so they do not go through the scan guard.

Index

Constants

View Source
const (
	DefaultPulseTestRuns = "/pulse/api/test-runs"
	DefaultSentinelScore = "/sentinel/api/security-score"
)

Paths on the sibling services. The Pulse path is from Scout's project description; both are overridable in config to match a deployment.

Variables

This section is empty.

Functions

func CombinedScore

func CombinedScore(exposure, runtime float64) float64

CombinedScore merges Scout's exposure score (how exposed the app is, from a scan, 0-100 where higher is safer) with Sentinel's runtime defense score (how well it defends at runtime, 0-100). The result is the geometric mean, so a weakness on either side pulls the combined number down and neither side can mask the other. A runtime score <= 0 means "unknown": the exposure score is returned unchanged.

Types

type Dispatcher

type Dispatcher struct {
	Pulse    *Pulse
	Sentinel *Sentinel
	Store    storage.Store
	Logger   *slog.Logger
	Timeout  time.Duration
}

Dispatcher registers finished scans with any detected siblings.

func (*Dispatcher) Active

func (d *Dispatcher) Active() bool

Active reports whether any sibling is configured.

func (*Dispatcher) Run

func (d *Dispatcher) Run(ctx context.Context, bus *engine.Bus)

Run detects siblings once, then forwards each finished, stored scan to the ones that are present, until ctx ends.

type Pulse

type Pulse struct {
	BaseURL string
	Path    string
	Token   string
	HTTP    doer
	// contains filtered or unexported fields
}

Pulse registers scans with Pulse so they appear as bands on its charts.

func NewPulse

func NewPulse(baseURL, path, token string) *Pulse

NewPulse returns a Pulse client.

func (*Pulse) Available

func (p *Pulse) Available() bool

Available reports whether Pulse was detected.

func (*Pulse) Detect

func (p *Pulse) Detect(ctx context.Context) bool

Detect probes Pulse and remembers the result.

func (*Pulse) RegisterScan

func (p *Pulse) RegisterScan(ctx context.Context, ref ScanRef) error

RegisterScan tells Pulse about a finished scan.

type ScanRef

type ScanRef struct {
	ID         string           `json:"id"`
	Target     string           `json:"target"`
	TargetURL  string           `json:"target_url,omitempty"`
	Env        core.Environment `json:"environment"`
	Mode       string           `json:"mode"`
	Grade      string           `json:"grade"`
	Score      float64          `json:"score"`
	Findings   int              `json:"findings"`
	StartedAt  string           `json:"started_at"`
	FinishedAt string           `json:"finished_at"`
}

ScanRef is the minimal, non-sensitive description of a scan shared with a sibling. It never carries findings' evidence.

func RefOf

func RefOf(sc core.ScanResult) ScanRef

RefOf builds a ScanRef from a scan result.

type Sentinel

type Sentinel struct {
	BaseURL string
	Path    string
	Token   string
	HTTP    doer
	// contains filtered or unexported fields
}

Sentinel receives Scout's exposure score to combine with its runtime defense score.

func NewSentinel

func NewSentinel(baseURL, path, token string) *Sentinel

NewSentinel returns a Sentinel client.

func (*Sentinel) Available

func (s *Sentinel) Available() bool

Available reports whether Sentinel was detected.

func (*Sentinel) Detect

func (s *Sentinel) Detect(ctx context.Context) bool

Detect probes Sentinel and remembers the result.

func (*Sentinel) PushScore

func (s *Sentinel) PushScore(ctx context.Context, ref ScanRef) error

PushScore sends Scout's exposure score for a target to Sentinel.

Jump to

Keyboard shortcuts

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