Documentation
¶
Overview ¶
Package gitguard provides security checks for environment files and git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePreCommitHook ¶
func GeneratePreCommitHook() string
GeneratePreCommitHook returns the content of a pre-commit hook script.
func InstallHook ¶
InstallHook installs the pre-commit hook in the given git repository.
Types ¶
type Finding ¶
type Finding struct {
Type string `json:"type"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Pattern string `json:"pattern,omitempty"`
Message string `json:"message"`
Severity string `json:"severity"`
}
Finding represents a security finding.
func CheckGitignore ¶
CheckGitignore checks if the given env file is listed in .gitignore.
func ScanForSecrets ¶
func ScanForSecrets(filePath string, patterns []SecretPattern) ([]Finding, error)
ScanForSecrets scans a file for common secret patterns.
type SecretPattern ¶
SecretPattern represents a pattern for detecting secrets.
func DefaultPatterns ¶
func DefaultPatterns() []SecretPattern
DefaultPatterns returns the built-in secret detection patterns.
Click to show internal directories.
Click to hide internal directories.