Documentation
¶
Index ¶
- Constants
- Variables
- type Backend
- func (b *Backend) CheckWorkflowFork(r *models.Repository) error
- func (b *Backend) ConfigureControls(r *models.Repository, branches []*models.Branch, ...) error
- func (b *Backend) ControlConfigurationDescr(branch *models.Branch, config models.ControlConfiguration) string
- func (b *Backend) ControlPrecheck(r *models.Repository, branches []*models.Branch, ...) (ok bool, remediationMessage string, remediateFn models.ControlPreRemediationFn, ...)
- func (b *Backend) CreateRepoRuleset(r *models.Repository, branches []*models.Branch) error
- func (b *Backend) CreateTagRuleset(r *models.Repository) error
- func (b *Backend) CreateWorkflowPR(r *models.Repository, branches []*models.Branch) (*models.PullRequest, error)
- func (b *Backend) FindWorkflowPR(ctx context.Context, r *models.Repository) (*models.PullRequest, error)
- func (b *Backend) GetBranchControls(ctx context.Context, branch *models.Branch) (*slsa.ControlSet, error)
- func (b *Backend) GetBranchControlsAtCommit(ctx context.Context, branch *models.Branch, commit *models.Commit) (*slsa.ControlSet, error)
- func (b *Backend) GetDefaultBranch(ctx context.Context, repo *models.Repository) (*models.Branch, error)
- func (b *Backend) GetLatestActionsTag() (tag, digest string, err error)
- func (b *Backend) GetLatestCommit(ctx context.Context, r *models.Repository, branch *models.Branch) (*models.Commit, error)
- func (b *Backend) GetPreviousCommit(ctx context.Context, branch *models.Branch, commit *models.Commit) (*models.Commit, error)
- func (b *Backend) GetRevisionCommit(ctx context.Context, repo *models.Repository, rev models.Revision) (*models.Commit, error)
- func (b *Backend) GetTagControls(ctx context.Context, branch *models.Branch, tag *models.Tag) (*slsa.ControlSet, error)
- type Options
Constants ¶
const ( ActionsOrg = "slsa-framework" ActionsRepo = "source-actions" )
Variables ¶
var InherentControls = slsa.ControlNameSet{ slsa.SLSA_SOURCE_ORG_SCS, slsa.SLSA_SOURCE_ORG_ACCESS_CONTROL, slsa.SLSA_SOURCE_SCS_REPO_ID, slsa.SLSA_SOURCE_SCS_REVISION_ID, slsa.SLSA_SOURCE_SCS_DIFF_DISPLAY, slsa.SLSA_SOURCE_SCS_HISTORY, slsa.SLSA_SOURCE_SCS_IDENTITY, }
InherentControls are the controls that are always true because we are in git and/org GitHub.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
Options *models.BackendOptions
// contains filtered or unexported fields
}
Backend implemets the GitHub sourcetool backend
func New ¶
func New(options *models.BackendOptions) *Backend
func (*Backend) CheckWorkflowFork ¶
func (b *Backend) CheckWorkflowFork(r *models.Repository) error
CheckWorkflowFork verifies that the user has a fork of the repository we are configuring.
func (*Backend) ConfigureControls ¶
func (b *Backend) ConfigureControls(r *models.Repository, branches []*models.Branch, configs []models.ControlConfiguration) error
ConfigureControls configure the SLSA controls in the repository
func (*Backend) ControlConfigurationDescr ¶
func (*Backend) ControlPrecheck ¶
func (b *Backend) ControlPrecheck( r *models.Repository, branches []*models.Branch, config models.ControlConfiguration, ) (ok bool, remediationMessage string, remediateFn models.ControlPreRemediationFn, err error)
ControlPrecheck checks if the prerequisites to enable the controls are OK
func (*Backend) CreateRepoRuleset ¶
func (*Backend) CreateTagRuleset ¶
func (b *Backend) CreateTagRuleset(r *models.Repository) error
func (*Backend) CreateWorkflowPR ¶
func (b *Backend) CreateWorkflowPR(r *models.Repository, branches []*models.Branch) (*models.PullRequest, error)
CreateWorkflowPR creates the pull request to add the provenance workflow to the specified repository.
func (*Backend) FindWorkflowPR ¶
func (b *Backend) FindWorkflowPR(ctx context.Context, r *models.Repository) (*models.PullRequest, error)
func (*Backend) GetBranchControls ¶
func (*Backend) GetBranchControlsAtCommit ¶
func (b *Backend) GetBranchControlsAtCommit(ctx context.Context, branch *models.Branch, commit *models.Commit) (*slsa.ControlSet, error)
GetBranchControlsAtCommit
func (*Backend) GetDefaultBranch ¶ added in v0.7.0
func (b *Backend) GetDefaultBranch(ctx context.Context, repo *models.Repository) (*models.Branch, error)
GetDefaultBranch returns the default branch
func (*Backend) GetLatestActionsTag ¶ added in v0.7.0
GetLatestActionsTag queries GitHub and fetches the latest tag and digest of the slsa-framework/source-actions repository.
func (*Backend) GetLatestCommit ¶
func (b *Backend) GetLatestCommit(ctx context.Context, r *models.Repository, branch *models.Branch) (*models.Commit, error)
GetLatestCommit returns the latest commit from a branch
func (*Backend) GetPreviousCommit ¶ added in v0.7.0
func (b *Backend) GetPreviousCommit(ctx context.Context, branch *models.Branch, commit *models.Commit) (*models.Commit, error)
GetPreviousCommit takes a commit in