exposurebridge

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: GPL-3.0 Imports: 6 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 exposurebridge promotes internal findings that represent an EXPOSURE rather than a code vulnerability into the Exposure Register (the exposure event store), so they show up in the Exposures view continuously — realizing the CTEM Discovery "exposure ≠ vulnerability" principle. Two projections:

  • secret-scan findings (gitleaks, trufflehog, ...) → credential_leaked events, so a hardcoded secret is tracked continuously, not only when a breach dump is manually imported;
  • misconfiguration findings (IaC/CSPM: Checkov, Tfsec, cloud posture) → misconfiguration events.

Both are typed projections over existing findings that reuse the exposure domain + repository and mirror the dedupe/reactivate behavior of the credential-import service — NOT a separate event table.

The provenance is labeled distinctly: these events carry discovery_source="secret_scan" and source="secret_scan", which is NOT the same as an externally-leaked credential imported from a breach feed (those keep their import source string). An in-repo hardcoded secret and an externally-leaked credential are both credential_leaked events, but the discovery channel is preserved so the UI/reporting can tell them apart.

It reuses the exposure domain + repository and mirrors the dedupe/reactivate behavior of the credential-import service (see internal/app/integration/credential_import.go): a re-scan finding the same secret updates the existing event's last_seen (reactivating it if it was resolved) instead of creating a duplicate. The raw secret value is never persisted — only the finding's already-masked value is carried.

Index

Constants

View Source
const SourceMisconfigScan = "misconfig_scan"

SourceMisconfigScan is the provenance label for exposures projected from misconfiguration findings (IaC/CSPM: Checkov, Tfsec, Trivy config, cloud posture). A misconfiguration is an exposure that is NOT a CVE — the CTEM Discovery "exposure ≠ vulnerability" principle — so it belongs in the Exposure Register alongside leaked credentials.

View Source
const SourceSecretScan = "secret_scan"

SourceSecretScan is the provenance label carried on both the exposure event source column and the discovery_source detail. It marks the event as an INTERNAL secret-scan discovery, distinct from an external breach import.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

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

Bridge promotes secret-scan findings into exposure events. It is best-effort: a failure here must never fail finding ingest.

func NewBridge

func NewBridge(
	exposureRepo exposure.Repository,
	historyRepo exposure.StateHistoryRepository,
	log *logger.Logger,
) *Bridge

NewBridge creates a Bridge. historyRepo may be nil (state-change history is then simply not recorded).

func (*Bridge) ApplyBatch

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

ApplyBatch bridges every secret-scan and misconfiguration finding in the batch into the exposure store as first-class Exposure Register rows. Findings that are neither are ignored. Per-finding failures are logged and skipped; the method never returns an error so it cannot abort ingest.

Jump to

Keyboard shortcuts

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