executor

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

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

Go to latest
Published: May 21, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package executor provides command execution for the usulnet agent.

Package executor provides Docker options converters from protocol parameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler func(ctx context.Context, cmd *protocol.Command) *protocol.CommandResult

CommandHandler processes a specific command type.

type ContainerScanData

type ContainerScanData struct {
	ContainerID   string              `json:"container_id"`
	ContainerName string              `json:"container_name"`
	Image         string              `json:"image"`
	InspectData   types.ContainerJSON `json:"inspect_data"`
}

ContainerScanData contains the inspect data needed by the master for scanning. This implements Option B from the architecture: agent sends inspect data, master runs the actual security analysis (lighter agent footprint).

type Executor

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

Executor handles command execution on the agent.

func New

func New(dockerClient *docker.Client, log *logger.Logger) *Executor

New creates a new executor.

func (*Executor) Execute

Execute executes a command and returns the result.

type SecurityScanRequest

type SecurityScanRequest struct {
	ContainerID string `json:"container_id,omitempty"`
	ScanAll     bool   `json:"scan_all,omitempty"`
	IncludeCVE  bool   `json:"include_cve,omitempty"`
}

SecurityScanRequest represents a request to scan containers on the agent.

type SecurityScanResponse

type SecurityScanResponse struct {
	Scans    []ContainerScanData `json:"scans"`
	Warnings []string            `json:"warnings,omitempty"`
}

SecurityScanResponse represents the response from a security scan.

Jump to

Keyboard shortcuts

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