probe

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPermissionFixMessage

func GetPermissionFixMessage(filePath string) string

GetPermissionFixMessage returns a platform-appropriate message for fixing file permissions.

func IsNullDevice

func IsNullDevice(path string) bool

IsNullDevice checks if a path refers to the null device on any platform. On Unix: /dev/null On Windows: nul, NUL, C:\nul, \\.\nul, etc. This function detects both Unix and Windows null device patterns regardless of the current platform, because config files may be shared across systems.

Types

type AICliProbe

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

AICliProbe checks AI CLI credential and chat files

func NewAICliProbe

func NewAICliProbe(config models.ProbeSettings, registry *detector.Registry) *AICliProbe

NewAICliProbe creates a new AI CLI credentials probe. Accepts an optional flag "max_file_size" (int, in bytes) to override the default 1 MB file size limit for AI CLI files.

func (*AICliProbe) Execute

func (p *AICliProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the AI cli probe

func (*AICliProbe) IsEnabled

func (p *AICliProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*AICliProbe) Name

func (p *AICliProbe) Name() string

Name returns the probe name

func (*AICliProbe) SetFileIndex

func (p *AICliProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*AICliProbe) SetFingerprintSalt added in v0.4.0

func (p *AICliProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type CloudProbe

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

CloudProbe checks cloud provider credential files

func NewCloudProbe

func NewCloudProbe(config models.ProbeSettings, registry *detector.Registry) *CloudProbe

NewCloudProbe creates a new cloud credentials probe

func (*CloudProbe) Execute

func (p *CloudProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the cloud probe

func (*CloudProbe) IsEnabled

func (p *CloudProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*CloudProbe) Name

func (p *CloudProbe) Name() string

Name returns the probe name

func (*CloudProbe) SetFileIndex

func (p *CloudProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*CloudProbe) SetFingerprintSalt added in v0.4.0

func (p *CloudProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type EnvProbe

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

EnvProbe checks environment variables for security issues

func NewEnvProbe

func NewEnvProbe(config models.ProbeSettings, registry *detector.Registry) *EnvProbe

NewEnvProbe creates a new environment variable probe

func (*EnvProbe) Execute

func (p *EnvProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the environment variable probe

func (*EnvProbe) IsEnabled

func (p *EnvProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*EnvProbe) Name

func (p *EnvProbe) Name() string

Name returns the probe name

func (*EnvProbe) SetFileIndex

func (p *EnvProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*EnvProbe) SetFingerprintSalt added in v0.4.0

func (p *EnvProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type FileIndexAware

type FileIndexAware interface {
	// SetFileIndex provides the file index to the probe
	SetFileIndex(index *fileindex.FileIndex)
}

FileIndexAware is an optional interface that probes can implement to receive the pre-built file index before execution

type FingerprintSaltAware added in v0.4.0

type FingerprintSaltAware interface {
	// SetFingerprintSalt provides the fingerprint salt to the probe
	SetFingerprintSalt(salt string)
}

FingerprintSaltAware is an optional interface that probes can implement to receive the machine-specific fingerprint salt before execution

type GHProbe

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

GHProbe checks for GitHub CLI authentication

func NewGHProbe

func NewGHProbe(config models.ProbeSettings, registry *detector.Registry) *GHProbe

NewGHProbe creates a new GitHub CLI probe

func (*GHProbe) Execute

func (p *GHProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the GitHub CLI probe

func (*GHProbe) IsEnabled

func (p *GHProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*GHProbe) Name

func (p *GHProbe) Name() string

Name returns the probe name

func (*GHProbe) SetFingerprintSalt added in v0.6.0

func (p *GHProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type GitProbe

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

GitProbe checks Git configuration for security issues

func NewGitProbe

func NewGitProbe(config models.ProbeSettings, registry *detector.Registry) *GitProbe

NewGitProbe creates a new Git probe

func (*GitProbe) Execute

func (p *GitProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the Git probe

func (*GitProbe) IsEnabled

func (p *GitProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*GitProbe) Name

func (p *GitProbe) Name() string

Name returns the probe name

func (*GitProbe) SetFileIndex added in v0.6.0

func (p *GitProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*GitProbe) SetFingerprintSalt added in v0.4.0

func (p *GitProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type JetBrainsProbe

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

JetBrainsProbe checks JetBrains project files for secrets

func NewJetBrainsProbe

func NewJetBrainsProbe(config models.ProbeSettings, registry *detector.Registry) *JetBrainsProbe

NewJetBrainsProbe creates a new JetBrains probe

func (*JetBrainsProbe) Execute

func (p *JetBrainsProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the JetBrains probe

func (*JetBrainsProbe) IsEnabled

func (p *JetBrainsProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*JetBrainsProbe) Name

func (p *JetBrainsProbe) Name() string

Name returns the probe name

func (*JetBrainsProbe) SetFileIndex

func (p *JetBrainsProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*JetBrainsProbe) SetFingerprintSalt added in v0.4.0

func (p *JetBrainsProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type NPMProbe

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

NPMProbe checks NPM and Yarn configuration for security issues

func NewNPMProbe

func NewNPMProbe(config models.ProbeSettings, registry *detector.Registry) *NPMProbe

NewNPMProbe creates a new NPM probe

func (*NPMProbe) Execute

func (p *NPMProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the NPM probe

func (*NPMProbe) IsEnabled

func (p *NPMProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*NPMProbe) Name

func (p *NPMProbe) Name() string

Name returns the probe name

func (*NPMProbe) SetFileIndex

func (p *NPMProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*NPMProbe) SetFingerprintSalt added in v0.4.0

func (p *NPMProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type Probe

type Probe interface {
	// Name returns the name of the probe (e.g., "git", "ssh", "npm")
	Name() string

	// Execute runs the probe and returns findings
	Execute(ctx context.Context) ([]models.Finding, error)

	// IsEnabled returns whether the probe is enabled
	IsEnabled() bool
}

Probe defines the interface that all probes must implement

type PyPIProbe added in v0.6.0

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

PyPIProbe checks PyPI and pip configuration for security issues

func NewPyPIProbe added in v0.6.0

func NewPyPIProbe(config models.ProbeSettings, registry *detector.Registry) *PyPIProbe

NewPyPIProbe creates a new PyPI probe

func (*PyPIProbe) Execute added in v0.6.0

func (p *PyPIProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the PyPI probe

func (*PyPIProbe) IsEnabled added in v0.6.0

func (p *PyPIProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*PyPIProbe) Name added in v0.6.0

func (p *PyPIProbe) Name() string

Name returns the probe name

func (*PyPIProbe) SetFileIndex added in v0.6.0

func (p *PyPIProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*PyPIProbe) SetFingerprintSalt added in v0.6.0

func (p *PyPIProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type Result

type Result struct {
	ProbeName string
	Findings  []models.Finding
	Error     error
}

Result represents the output of a probe execution

type SSHProbe

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

SSHProbe checks SSH configuration and key security

func NewSSHProbe

func NewSSHProbe(config models.ProbeSettings, registry *detector.Registry) *SSHProbe

NewSSHProbe creates a new SSH probe

func (*SSHProbe) Execute

func (p *SSHProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the SSH probe

func (*SSHProbe) IsEnabled

func (p *SSHProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*SSHProbe) Name

func (p *SSHProbe) Name() string

Name returns the probe name

func (*SSHProbe) SetFileIndex

func (p *SSHProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*SSHProbe) SetFingerprintSalt added in v0.4.0

func (p *SSHProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type ShellHistoryProbe

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

ShellHistoryProbe checks shell history files for secrets

func NewShellHistoryProbe

func NewShellHistoryProbe(config models.ProbeSettings, registry *detector.Registry) *ShellHistoryProbe

NewShellHistoryProbe creates a new shell history probe

func (*ShellHistoryProbe) Execute

func (p *ShellHistoryProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the shell history probe

func (*ShellHistoryProbe) IsEnabled

func (p *ShellHistoryProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*ShellHistoryProbe) Name

func (p *ShellHistoryProbe) Name() string

Name returns the probe name

func (*ShellHistoryProbe) SetFileIndex

func (p *ShellHistoryProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*ShellHistoryProbe) SetFingerprintSalt added in v0.4.0

func (p *ShellHistoryProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

type WireGuardProbe added in v0.6.0

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

WireGuardProbe checks WireGuard VPN configuration files for exposed private keys

func NewWireGuardProbe added in v0.6.0

func NewWireGuardProbe(config models.ProbeSettings, registry *detector.Registry) *WireGuardProbe

NewWireGuardProbe creates a new WireGuard probe

func (*WireGuardProbe) Execute added in v0.6.0

func (p *WireGuardProbe) Execute(ctx context.Context) ([]models.Finding, error)

Execute runs the WireGuard probe

func (*WireGuardProbe) IsEnabled added in v0.6.0

func (p *WireGuardProbe) IsEnabled() bool

IsEnabled returns whether the probe is enabled

func (*WireGuardProbe) Name added in v0.6.0

func (p *WireGuardProbe) Name() string

Name returns the probe name

func (*WireGuardProbe) SetFileIndex added in v0.6.0

func (p *WireGuardProbe) SetFileIndex(index *fileindex.FileIndex)

SetFileIndex sets the file index for this probe (implements FileIndexAware)

func (*WireGuardProbe) SetFingerprintSalt added in v0.6.0

func (p *WireGuardProbe) SetFingerprintSalt(salt string)

SetFingerprintSalt sets the fingerprint salt on the detector registry (implements FingerprintSaltAware)

Jump to

Keyboard shortcuts

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