unsafeexec

package
v0.7.58-dev.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package unsafeexec is the data side of Unsafe Mode: the unsafe base image's command index, extras list and ambiguous list, read out of the pulled image and held to a grammar, and the placement of a manifest's declared commands through them.

Unsafe Mode lifts one check: this machine's exec catalogue (policy exec.packages) is not consulted. A client turns it on per compile by passing a *Data (compile.Inputs.Unsafe); no policy key and no `agentry run` flag does, so it never reaches a hosted run.

The data files are read from an image, so they are data, not code: every command name, package name, pip requirement and path is held to a grammar here, and one that fails is never placed. The exec image build (pkg/runner/gateway) then hands the placed values to its install script in files, never in a shell line.

Index

Constants

View Source
const (
	CommandsFile  = DataDir + "/commands.tsv"
	ExtrasFile    = DataDir + "/extras.tsv"
	AmbiguousFile = DataDir + "/ambiguous.tsv"
)

The files under DataDir.

View Source
const DataDir = "/etc/agentry/unsafe"

DataDir is where the unsafe base carries its data files (agentry-dockerimages build/agentry-unsafe-kali).

View Source
const RunnerCommand = "agentry-runner"

RunnerCommand is the runner binary's name in the exec image, its entrypoint: no declared command may be placed onto it.

Variables

This section is empty.

Functions

func CheckExtra

func CheckExtra(e spec.UnsafeExtra) error

CheckExtra holds one recipe to its kind's grammar.

func ValidBase

func ValidBase(ref string) error

ValidBase says whether an image reference is pinned by digest.

func ValidCommand

func ValidCommand(c string) bool

The grammars, for a caller that holds a plan's values to them again (pkg/runner/gateway, before a build).

func ValidLinkPath

func ValidLinkPath(p string) bool

func ValidPackage

func ValidPackage(p string) bool

func ValidPipSpec

func ValidPipSpec(s string) bool

Types

type Data

type Data struct {
	// Base is the base image, pinned by digest.
	Base string

	// Dropped counts the index and ambiguous rows refused by the grammar.
	Dropped int
	// contains filtered or unexported fields
}

Data is the unsafe base's placement data.

func Load

func Load(ctx context.Context, docker dockerx.Client, base string, logw io.Writer) (*Data, error)

Load reads the base's data from the image, pulling it first when this machine does not have it (turning Unsafe Mode on pulls it; a run finds it here).

func Parse

func Parse(base string, commands, extras, ambiguous []byte) (*Data, error)

Parse reads the three data files. An index or ambiguous row that fails the grammar is dropped and counted; an extras list that does not hold the closed recipe set is refused whole, because it is maintained by hand and a bad row is a mistake to fix, not a row to skip.

func (*Data) Place

func (d *Data) Place(commands []string) (packages []string, u spec.UnsafeExecSpec)

Place resolves the declared commands in this order: the extras list first, then the index. It never refuses: a command neither places, or one that is not a plain command name, is unplaced, with the packages that ship it when the index left it ambiguous. It returns the Kali packages to install (each placed command's, and each link extra's), sorted and deduplicated, and the Unsafe Mode part of the exec image spec.

Jump to

Keyboard shortcuts

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