commandrun

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Name    = "command-run"
	Type    = "https://witness.dev/attestations/command-run/v0.1"
	RunType = attestation.ExecuteRunType
)
View Source
const (
	MAX_PATH_LEN = 4096
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRun

type CommandRun struct {
	Cmd       []string      `json:"cmd"`
	Stdout    string        `json:"stdout,omitempty"`
	Stderr    string        `json:"stderr,omitempty"`
	ExitCode  int           `json:"exitcode"`
	Processes []ProcessInfo `json:"processes,omitempty"`
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *CommandRun

func (*CommandRun) Attest

func (*CommandRun) Data added in v0.4.0

func (rc *CommandRun) Data() *CommandRun

func (*CommandRun) Name

func (rc *CommandRun) Name() string

func (*CommandRun) RunType

func (rc *CommandRun) RunType() attestation.RunType

func (*CommandRun) Schema added in v0.4.0

func (a *CommandRun) Schema() *jsonschema.Schema

func (*CommandRun) Type

func (rc *CommandRun) Type() string

type CommandRunAttestor added in v0.4.0

type CommandRunAttestor interface {
	// Attestor
	Name() string
	Type() string
	RunType() attestation.RunType
	Attest(ctx *attestation.AttestationContext) error
	Data() *CommandRun
}

type Option

type Option func(*CommandRun)

func WithCommand

func WithCommand(cmd []string) Option

func WithEnvironmentBlockList

func WithEnvironmentBlockList(blockList map[string]struct{}) Option

func WithMaterials

func WithMaterials(materials map[string]cryptoutil.DigestSet) Option

func WithSilent

func WithSilent(silent bool) Option

func WithTracing

func WithTracing(enabled bool) Option

type ProcessInfo

type ProcessInfo struct {
	Program          string                          `json:"program,omitempty"`
	ProcessID        int                             `json:"processid"`
	ParentPID        int                             `json:"parentpid"`
	ProgramDigest    cryptoutil.DigestSet            `json:"programdigest,omitempty"`
	Comm             string                          `json:"comm,omitempty"`
	Cmdline          string                          `json:"cmdline,omitempty"`
	ExeDigest        cryptoutil.DigestSet            `json:"exedigest,omitempty"`
	OpenedFiles      map[string]cryptoutil.DigestSet `json:"openedfiles,omitempty"`
	Environ          string                          `json:"environ,omitempty"`
	SpecBypassIsVuln bool                            `json:"specbypassisvuln,omitempty"`
}

Jump to

Keyboard shortcuts

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