integritymonitor

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeFileMismatch int = iota + 1
	ErrTypeNewFile
	ErrTypeFileDeleted
)
View Source
const (
	IntegrityMessageNewFileFound = "new file found"
	IntegrityMessageFileDeleted  = "file deleted"
	IntegrityMessageFileMismatch = "file content mismatch"
	IntegrityMessageUnknownErr   = "unknown integrity error"
)
View Source
const DefaultHashSize = 128

Variables

This section is empty.

Functions

func CalculateAndWriteHashes

func CalculateAndWriteHashes() error

CalculateAndWriteHashes calculates file hashes of a given directory and store them as a file for further usage.

func CheckIntegrity

func CheckIntegrity(ctx context.Context, log *logrus.Logger, processName string, monitoringDirectories []string,
	deploymentData *k8s.DeploymentData, kubeClient *k8s.KubeClient) error

func GetProcessPath

func GetProcessPath(procName string, path string) (string, error)

func HashDir

func HashDir(rootPath, pathToMonitor, alg string) []worker.FileHash

HashDir calculates file hashes of a given directory

func ParseMonitoringOpts

func ParseMonitoringOpts(opts string) (map[string][]string, error)

Types

type IntegrityError

type IntegrityError struct {
	Type int
	Path string
	Hash string
}

func (*IntegrityError) Error

func (e *IntegrityError) Error() string

Jump to

Keyboard shortcuts

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