varscan

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package varscan finds exact stored secret values in working-tree or staged text without retaining unsanitized snippets.

Index

Constants

View Source
const (
	// MaxFileSize is the largest file scanned.
	MaxFileSize = 10 << 20
	// MaxFindingsPerFile bounds output for a single file.
	MaxFindingsPerFile = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	File     string `json:"file"`
	Line     int    `json:"line"`
	Column   int    `json:"column"`
	Key      string `json:"key"`
	Snippet  string `json:"snippet"`
	Code     string `json:"code"`
	Severity string `json:"severity"`
}

type Options

type Options struct {
	Paths  []string
	Staged bool
}

type Result

type Result struct {
	Complete    bool         `json:"complete"`
	Findings    []Finding    `json:"findings"`
	Skipped     []Skip       `json:"skipped"`
	Truncations []Truncation `json:"truncations"`
}

func Scan

func Scan(ctx context.Context, vars []vault.Variable, opts Options) (Result, error)

Scan snapshots candidates from vars and scans the selected content source.

type Skip

type Skip struct {
	File   string `json:"file,omitempty"`
	Key    string `json:"key,omitempty"`
	Reason string `json:"reason"`
}

type Truncation

type Truncation struct {
	File  string `json:"file"`
	Limit int    `json:"limit"`
}

Jump to

Keyboard shortcuts

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