Documentation
¶
Overview ¶
Package security provides path validation, input sanitization, and shell metacharacter detection.
Index ¶
- Variables
- func ErrInputContainsShellMetacharacters(input string) error
- func ErrInvalidInput(input string) error
- func ErrPathContainsDangerousPattern(path string) error
- func ErrPathContainsNullByte(path string) error
- func ErrPathContainsShellMetacharacters(path string) error
- func ErrPathDoesNotMatchPattern(path string) error
- func ValidateConfigPath(path string) error
- func ValidateInput(input string, pattern *regexp.Regexp) error
- func ValidatePath(path string) error
- func ValidatePathWithPattern(path string, pattern *regexp.Regexp) error
- func ValidateSSHKeyPath(path string) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyPath = errors.New("empty path")
)
Path validation errors.
Functions ¶
func ErrInputContainsShellMetacharacters ¶
ErrInputContainsShellMetacharacters returns an error for input containing shell metacharacters.
func ErrInvalidInput ¶
ErrInvalidInput returns an error for input that fails validation checks.
func ErrPathContainsDangerousPattern ¶
ErrPathContainsDangerousPattern returns an error for a path containing dangerous traversal or injection patterns.
func ErrPathContainsNullByte ¶
ErrPathContainsNullByte returns an error for a path containing a null byte.
func ErrPathContainsShellMetacharacters ¶
ErrPathContainsShellMetacharacters returns an error for a path containing shell metacharacters.
func ErrPathDoesNotMatchPattern ¶
ErrPathDoesNotMatchPattern returns an error for a path that does not match the required validation pattern.
func ValidateConfigPath ¶
ValidateConfigPath validates paths used for configuration files.
func ValidateInput ¶
ValidateInput validates input for command injection prevention.
func ValidatePath ¶
ValidatePath validates a file path for security.
func ValidatePathWithPattern ¶
ValidatePathWithPattern validates a path against a specific pattern.
func ValidateSSHKeyPath ¶
ValidateSSHKeyPath validates SSH key file paths.
Types ¶
This section is empty.