detector

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(secret string) string

Fingerprint computes a SHA-256 hash of a secret for deduplication purposes. This allows identifying the same secret across different locations without storing the actual value.

Types

type AIServiceDetector

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

AIServiceDetector detects API keys for various AI services

func NewAIServiceDetector

func NewAIServiceDetector() *AIServiceDetector

NewAIServiceDetector creates a new AI service API key detector

func (*AIServiceDetector) Detect

func (d *AIServiceDetector) Detect(content string, ctx *models.DetectionContext) []models.Finding

Detect scans content for AI service API keys and returns findings

func (*AIServiceDetector) Name

func (d *AIServiceDetector) Name() string

Name returns the detector name

type CloudCredentialsDetector

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

CloudCredentialsDetector detects cloud provider credentials (AWS, GCP, Azure)

func NewCloudCredentialsDetector

func NewCloudCredentialsDetector() *CloudCredentialsDetector

NewCloudCredentialsDetector creates a new cloud credentials detector

func (*CloudCredentialsDetector) Detect

Detect scans content for cloud provider credentials and returns findings

func (*CloudCredentialsDetector) Name

func (d *CloudCredentialsDetector) Name() string

Name returns the detector name

type Detector

type Detector interface {
	// Name returns the detector name (e.g., "github-pat", "aws-access-key")
	Name() string

	// Detect scans the input text and returns findings if secrets are detected
	// The context parameter provides probe-specific metadata about where the content came from
	Detect(content string, ctx *models.DetectionContext) []models.Finding
}

Detector defines the interface for secret/credential detectors

type GenericAPIKeyDetector

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

GenericAPIKeyDetector detects generic API keys and high-entropy secrets

func NewGenericAPIKeyDetector

func NewGenericAPIKeyDetector() *GenericAPIKeyDetector

NewGenericAPIKeyDetector creates a new generic API key detector

func (*GenericAPIKeyDetector) Detect

Detect scans content for generic API keys and returns findings

func (*GenericAPIKeyDetector) Name

func (d *GenericAPIKeyDetector) Name() string

Name returns the detector name

type GitHubTokenDetector

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

GitHubTokenDetector detects various GitHub token types

func NewGitHubPATDetector

func NewGitHubPATDetector() *GitHubTokenDetector

NewGitHubPATDetector creates a new GitHub token detector

func (*GitHubTokenDetector) Detect

func (d *GitHubTokenDetector) Detect(content string, ctx *models.DetectionContext) []models.Finding

Detect scans content for GitHub tokens and returns findings

func (*GitHubTokenDetector) Name

func (d *GitHubTokenDetector) Name() string

Name returns the detector name

type HTTPAuthDetector

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

HTTPAuthDetector detects HTTP authentication credentials in various contexts

func NewHTTPAuthDetector

func NewHTTPAuthDetector() *HTTPAuthDetector

NewHTTPAuthDetector creates a new HTTP authentication detector

func (*HTTPAuthDetector) Detect

func (d *HTTPAuthDetector) Detect(content string, ctx *models.DetectionContext) []models.Finding

Detect scans content for HTTP authentication credentials and returns findings

func (*HTTPAuthDetector) Name

func (d *HTTPAuthDetector) Name() string

Name returns the detector name

type JWTDetector

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

JWTDetector detects JWT tokens in various contexts

func NewJWTDetector

func NewJWTDetector() *JWTDetector

NewJWTDetector creates a new JWT detector

func (*JWTDetector) Detect

func (d *JWTDetector) Detect(content string, ctx *models.DetectionContext) []models.Finding

Detect scans content for JWT tokens and returns findings

func (*JWTDetector) Name

func (d *JWTDetector) Name() string

Name returns the detector name

type NPMTokenDetector

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

NPMTokenDetector detects various NPM and Yarn authentication tokens

func NewNPMTokenDetector

func NewNPMTokenDetector() *NPMTokenDetector

NewNPMTokenDetector creates a new NPM token detector

func (*NPMTokenDetector) Detect

func (d *NPMTokenDetector) Detect(content string, ctx *models.DetectionContext) []models.Finding

Detect scans content for NPM/Yarn tokens and returns findings

func (*NPMTokenDetector) Name

func (d *NPMTokenDetector) Name() string

Name returns the detector name

type Registry

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

Registry manages all registered detectors

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new detector registry

func (*Registry) DetectAll

func (r *Registry) DetectAll(content string, ctx *models.DetectionContext) []models.Finding

DetectAll runs all registered detectors against the content The context parameter provides probe-specific metadata that gets included in findings

func (*Registry) GetDetectors

func (r *Registry) GetDetectors() []Detector

GetDetectors returns all registered detectors

func (*Registry) Register

func (r *Registry) Register(d Detector)

Register adds a detector to the registry

type SSHPrivateKeyDetector

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

SSHPrivateKeyDetector detects SSH private keys in content

func NewSSHPrivateKeyDetector

func NewSSHPrivateKeyDetector() *SSHPrivateKeyDetector

NewSSHPrivateKeyDetector creates a new SSH private key detector

func (*SSHPrivateKeyDetector) Detect

Detect scans content for SSH private keys and returns findings

func (*SSHPrivateKeyDetector) Name

func (d *SSHPrivateKeyDetector) Name() string

Name returns the detector name

Jump to

Keyboard shortcuts

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