probe

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 15 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 ALI CLI credential and chat files

func NewAICliProbe

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

NewAICliProbe creates a new AI CLI credentials probe

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)

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)

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)

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 GHProbe

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

GHProbe checks for GitHub CLI authentication

func NewGHProbe

func NewGHProbe(config models.ProbeSettings) *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

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

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)

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)

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 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)

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)

Jump to

Keyboard shortcuts

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