server

package
v0.0.0-...-791930b Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MalwareScanDir = "/"
	HostMountDir   = "/fenced/mnt/host"
)

Functions

func DoScan

func DoScan(
	scanID string,
	hostMountPath string,
	ExtractorConfig cfg.Config,
	inactiveThreshold int,
	ScanMap *sync.Map,
	namespace,
	path, image, container string,
	yaraScanner *yara.Scanner, writeToFile func(res output.IOCFound, scanID string))

func RunGrpcServer

func RunGrpcServer(ctx context.Context,
	socketPath string,
	impl any,
	customImpl func(s grpc.ServiceRegistrar, impl any)) error

Types

type GRPCScannerServer

type GRPCScannerServer struct {
	HostMountPath, SocketPath string
	InactiveThreshold         int
	ExtractorConfig           cfg.Config
	YaraRules                 *yararules.YaraRules

	pb.UnimplementedAgentPluginServer
	pb.UnimplementedScannersServer
	ScanMap sync.Map
	// contains filtered or unexported fields
}

func NewGRPCScannerServer

func NewGRPCScannerServer(
	hostMoundPath, socketPath, rulesPath string,
	InactiveThreshold int,
	failOnCompileWarning bool,
	config cfg.Config, pluginName string,
) (*GRPCScannerServer, error)

func (*GRPCScannerServer) GetName

func (s *GRPCScannerServer) GetName(context.Context, *pb.Empty) (*pb.Name, error)

func (*GRPCScannerServer) GetUID

func (s *GRPCScannerServer) GetUID(context.Context, *pb.Empty) (*pb.Uid, error)

func (*GRPCScannerServer) ReportJobsStatus

func (s *GRPCScannerServer) ReportJobsStatus(context.Context, *pb.Empty) (*pb.JobReports, error)

func (*GRPCScannerServer) StopScan

type MalwareRPCServer

type MalwareRPCServer struct {
	*GRPCScannerServer
	pb.UnimplementedMalwareScannerServer
}

func (*MalwareRPCServer) FindMalwareInfo

func (s *MalwareRPCServer) FindMalwareInfo(c context.Context, r *pb.MalwareRequest) (*pb.MalwareResult, error)

Jump to

Keyboard shortcuts

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