slsa

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SlsaSourceLevel1         SlsaSourceLevel = "SLSA_SOURCE_LEVEL_1"
	SlsaSourceLevel2         SlsaSourceLevel = "SLSA_SOURCE_LEVEL_2"
	SlsaSourceLevel3         SlsaSourceLevel = "SLSA_SOURCE_LEVEL_3"
	SlsaSourceLevel4         SlsaSourceLevel = "SLSA_SOURCE_LEVEL_4"
	ContinuityEnforced       ControlName     = "CONTINUITY_ENFORCED"
	ProvenanceAvailable      ControlName     = "PROVENANCE_AVAILABLE"
	ReviewEnforced           ControlName     = "REVIEW_ENFORCED"
	TagHygiene               ControlName     = "TAG_HYGIENE"
	PolicyAvailable          ControlName     = "POLICY_AVAILABLE"
	SourceBranchesAnnotation                 = "source_branches"
	SourceRefsAnnotation                     = "source_refs"
	AllowedOrgPropPrefix                     = "ORG_SOURCE_"

	// Control lifecycle states
	StateNotEnabled ControlState = "not_enabled"
	StateInProgress ControlState = "in_progress"
	StateActive     ControlState = "active"
)

Variables

AllLevelControls lists all the SLSA controls managed by sourcetool

Functions

func ControlNamesToStrings

func ControlNamesToStrings(controlNames []ControlName) []string

func EarlierTime

func EarlierTime(time1, time2 time.Time) time.Time

func IsLevelHigherOrEqualTo

func IsLevelHigherOrEqualTo(level1, level2 SlsaSourceLevel) bool

func IsSlsaSourceLevel

func IsSlsaSourceLevel(control ControlName) bool

Types

type ControlName

type ControlName string

func GetRequiredControlsForLevel

func GetRequiredControlsForLevel(level SlsaSourceLevel) []ControlName

Returns the list of control names that must be set for the given slsa level.

func (ControlName) String

func (c ControlName) String() string

type ControlRecommendedAction

type ControlRecommendedAction struct {
	Message string
	Command string
}

ControlRecommendedAction captures the recommended action to complete a control's implementation.

type ControlSetStatus

type ControlSetStatus struct {
	RepoUri  string
	Branch   string
	Time     time.Time
	Controls []ControlStatus
}

ControlSetStatus is a snapshot of the status of SLSA controls in a branch at a point in time.

func NewControlSetStatus

func NewControlSetStatus() *ControlSetStatus

NewControlStatus returns a new control status object initialized with all existing controls in not_enabled state.

func (*ControlSetStatus) GetActiveControls

func (cs *ControlSetStatus) GetActiveControls() *Controls

GetActiveControls returns a Controls collection with all the controls which are active in the set.

func (*ControlSetStatus) SetControlState

func (cs *ControlSetStatus) SetControlState(ctrlName ControlName, state ControlState)

SetControlState sets the state of a control in the set by name.

type ControlState

type ControlState string

type ControlStatus

type ControlStatus struct {
	Name              ControlName
	State             ControlState `json:"control_state"`
	Since             *time.Time   `json:"since,omitempty"`
	Message           string
	RecommendedAction *ControlRecommendedAction
}

ControlStatus captures the status of a control as seen from a VCS system

type Controls

type Controls []*provenance.Control

func (*Controls) AddControl

func (controls *Controls) AddControl(newControls ...*provenance.Control)

Adds the control to the list. Ignores nil controls. Does not check for duplicate controls.

func (*Controls) AreControlsAvailable

func (controls *Controls) AreControlsAvailable(names []ControlName) bool

func (*Controls) GetControl

func (controls *Controls) GetControl(name ControlName) *provenance.Control

Gets the control with the corresponding name, returns nil if not found.

func (*Controls) Names

func (controls *Controls) Names() []ControlName

Returns the names of the controls.

type SlsaSourceLevel

type SlsaSourceLevel ControlName

type SourceVerifiedLevels

type SourceVerifiedLevels []ControlName

These can be any string, not just SlsaLevels

Jump to

Keyboard shortcuts

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