Skip to content

Commit

Permalink
feat: add a -workflow-input option (#216)
Browse files Browse the repository at this point in the history
* update
  • Loading branch information
laurentsimon authored Aug 15, 2022
1 parent fc6a8e0 commit 5bb13ef
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 10 deletions.
42 changes: 35 additions & 7 deletions cli/slsa-verifier/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ import (
"fmt"
"io"
"os"
"strings"

serrors "github.com/slsa-framework/slsa-verifier/errors"
"github.com/slsa-framework/slsa-verifier/options"
"github.com/slsa-framework/slsa-verifier/verifiers"
)

type workflowInputs struct {
kv map[string]string
}

var (
provenancePath string
builderID string
Expand All @@ -21,13 +27,31 @@ var (
branch string
tag string
versiontag string
inputs workflowInputs
printProvenance bool
)

func experimentalEnabled() bool {
return os.Getenv("SLSA_VERIFIER_EXPERIMENTAL") == "1"
}

func (i *workflowInputs) String() string {
return fmt.Sprintf("%v", i.kv)
}

func (i *workflowInputs) Set(value string) error {
l := strings.Split(value, "=")
if len(l) != 2 {
return fmt.Errorf("%w: expected 'key=value' format, got '%s'", serrors.ErrorInvalidFormat, value)
}
i.kv[l[0]] = l[1]
return nil
}

func (i *workflowInputs) AsMap() map[string]string {
return i.kv
}

func main() {
if experimentalEnabled() {
flag.StringVar(&builderID, "builder-id", "", "EXPERIMENTAL: the unique builder ID who created the provenance")
Expand All @@ -42,6 +66,9 @@ func main() {
"[optional] expected version the binary was compiled from. Uses semantic version to match the tag")
flag.BoolVar(&printProvenance, "print-provenance", false,
"print the verified provenance to std out")
inputs.kv = make(map[string]string)
flag.Var(&inputs, "workflow-input",
"[optional] a workflow input provided by a user at trigger time in the format 'key=value'. (Only for 'workflow_dispatch' events).")
flag.Parse()

if provenancePath == "" || artifactPath == "" || source == "" {
Expand Down Expand Up @@ -71,7 +98,7 @@ func main() {
}

verifiedProvenance, _, err := runVerify(artifactPath, provenancePath, source,
pbranch, pbuilderID, ptag, pversiontag)
pbranch, pbuilderID, ptag, pversiontag, inputs.AsMap())
if err != nil {
fmt.Fprintf(os.Stderr, "FAILED: SLSA verification failed: %v\n", err)
os.Exit(2)
Expand All @@ -95,7 +122,7 @@ func isFlagPassed(name string) bool {
}

func runVerify(artifactPath, provenancePath, source string,
branch, builderID, ptag, pversiontag *string,
branch, builderID, ptag, pversiontag *string, inputs map[string]string,
) ([]byte, string, error) {
f, err := os.Open(artifactPath)
if err != nil {
Expand All @@ -115,11 +142,12 @@ func runVerify(artifactPath, provenancePath, source string,
artifactHash := hex.EncodeToString(h.Sum(nil))

provenanceOpts := &options.ProvenanceOpts{
ExpectedSourceURI: source,
ExpectedBranch: branch,
ExpectedDigest: artifactHash,
ExpectedVersionedTag: pversiontag,
ExpectedTag: ptag,
ExpectedSourceURI: source,
ExpectedBranch: branch,
ExpectedDigest: artifactHash,
ExpectedVersionedTag: pversiontag,
ExpectedTag: ptag,
ExpectedWorkflowInputs: inputs,
}

builderOpts := &options.BuilderOpts{
Expand Down
41 changes: 39 additions & 2 deletions cli/slsa-verifier/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func Test_runVerify(t *testing.T) {
pversiontag *string
pbuilderID *string
builderID string
inputs map[string]string
err error
// noversion is a special case where we are not testing all builder versions
// for example, testdata for the builder at head in trusted repo workflows
Expand Down Expand Up @@ -383,7 +384,7 @@ func Test_runVerify(t *testing.T) {
err: serrors.ErrorNoValidRekorEntries,
noversion: true,
},
// annotated tags.
// Annotated tags.
{
name: "annotated tag",
artifact: "annotated-tag",
Expand All @@ -400,6 +401,42 @@ func Test_runVerify(t *testing.T) {
err: serrors.ErrorMismatchBranch,
noversion: true,
},
// Workflow inputs.
{
name: "workflow inputs match",
artifact: "workflow-inputs",
source: "github.com/laurentsimon/slsa-on-github-test",
inputs: map[string]string{
"release_version": "v1.2.3",
"some_bool": "true",
"some_integer": "123",
},
noversion: true,
},
{
name: "workflow inputs missing field",
artifact: "workflow-inputs",
source: "github.com/laurentsimon/slsa-on-github-test",
inputs: map[string]string{
"release_version": "v1.2.3",
"some_bool": "true",
"missing_field": "123",
},
err: serrors.ErrorMismatchWorkflowInputs,
noversion: true,
},
{
name: "workflow inputs mismatch",
artifact: "workflow-inputs",
source: "github.com/laurentsimon/slsa-on-github-test",
inputs: map[string]string{
"release_version": "v1.2.3",
"some_bool": "true",
"some_integer": "321",
},
err: serrors.ErrorMismatchWorkflowInputs,
noversion: true,
},
// Regression test of sharded UUID.
{
name: "regression: sharded uuids",
Expand Down Expand Up @@ -458,7 +495,7 @@ func Test_runVerify(t *testing.T) {
_, builderID, err := runVerify(artifactPath,
provenancePath,
tt.source, tt.pbranch, tt.pbuilderID,
tt.ptag, tt.pversiontag)
tt.ptag, tt.pversiontag, tt.inputs)

if !errCmp(err, tt.err) {
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
Expand Down
1 change: 1 addition & 0 deletions cli/slsa-verifier/testdata/workflow-inputs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
artifact1
1 change: 1 addition & 0 deletions cli/slsa-verifier/testdata/workflow-inputs.intoto.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"payloadType":"application/vnd.in-toto+json","payload":"eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjAuMSIsInByZWRpY2F0ZVR5cGUiOiJodHRwczovL3Nsc2EuZGV2L3Byb3ZlbmFuY2UvdjAuMiIsInN1YmplY3QiOlt7Im5hbWUiOiJhcnRpZmFjdDEiLCJkaWdlc3QiOnsic2hhMjU2IjoiNDgyY2U4YzhmN2U4NjdkYTNhM2MwNWE5YWVlNjM3NzAzZTE3NDcwZWQxY2Y4ODJhOWU1YjQwNWU4ZjgyNjE5ZCJ9fSx7Im5hbWUiOiJhcnRpZmFjdDIiLCJkaWdlc3QiOnsic2hhMjU2IjoiODljZmM2OTU0ZTg4YjJmOTJhN2MyODc5ZDllYjA4NWM0MmYzYzcwNjVkMDEyYTUwNjZmNDUwZGJ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GDvzABBAQWU0xTQSBn\nZW5lcmljIGdlbmVyYXRvcjAdBgorBgEEAYO/MAEGBA9yZWZzL2hlYWRzL21haW4w\nOQYKKwYBBAGDvzABAQQraHR0cHM6Ly90b2tlbi5hY3Rpb25zLmdpdGh1YnVzZXJj\nb250ZW50LmNvbTA2BgorBgEEAYO/MAEDBCg0NjZjMTEzZWQzZDVhYzc1NjgxNzRk\nNGI2YWQ2YmI2YTgwZTE1M2IyMAoGCCqGSM49BAMDA2gAMGUCMQCx4+iMpFBvnFV9\nX6goGjQfdgliPcNa4cdd2K0nmrn79cOpslyzcJLAlL/qSYsGlocCMC/P/gL2B16i\nMp6YQZUiSMwzUohrr7V3nJsMPcLgETGyiZoR3UijZG74FobZ/+3pCw==\n-----END CERTIFICATE-----\n"}]}
2 changes: 2 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var (
ErrorMismatchBranch = errors.New("branch used to generate the binary does not match provenance")
ErrorMismatchBuilderID = errors.New("builderID does not match provenance")
ErrorMismatchSource = errors.New("source used to generate the binary does not match provenance")
ErrorMismatchWorkflowInputs = errors.New("workflow input does not match")
ErrorMalformedURI = errors.New("URI is malformed")
ErrorMismatchTag = errors.New("tag used to generate the binary does not match provenance")
ErrorMismatchVersionedTag = errors.New("tag used to generate the binary does not match provenance")
Expand All @@ -18,4 +19,5 @@ var (
ErrorNoValidRekorEntries = errors.New("could not find a matching valid signature entry")
ErrorVerifierNotSupported = errors.New("no verifier support the builder")
ErrorNotSupported = errors.New("not supported")
ErrorInvalidFormat = errors.New("invalid format")
)
3 changes: 3 additions & 0 deletions options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ type ProvenanceOpts struct {

// ExpectedBuilderID is the expected builder ID.
ExpectedBuilderID string

// ExpectedWorkflowInputs is a map of key=value inputs.
ExpectedWorkflowInputs map[string]string
}

// BuildOpts are the options for checking the builder.
Expand Down
Loading

0 comments on commit 5bb13ef

Please sign in to comment.