Commit Graph

257 Commits

Author SHA1 Message Date
Mend Renovate
be04b2a04c fix(deps): update module github.com/in-toto/in-toto-golang to v0.6.0 (#468)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-02-06 08:52:55 -06:00
asraa
fec5b6a7b5 refactor: generalize provenance out of predicate type info (#463)
* refactor: generalize provenance out of predicate type info

Signed-off-by: Asra Ali <asraa@google.com>
2023-02-03 23:30:23 +00:00
asraa
362bd1a331 feat: add offline bundle signature verification (#457)
* feat: add bundle signature verification

Signed-off-by: Asra Ali <asraa@google.com>
2023-02-03 09:31:40 -06:00
Mend Renovate
0af383c2bd chore(deps): update golang:1.19 docker digest to bb9811f (#261)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-30 05:50:04 -08:00
Mend Renovate
9578b3838e chore(deps): update github-actions (#460)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-30 05:33:14 -08:00
Mend Renovate
3c012d278e chore(deps): update npm dev (#459)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-30 05:23:26 -08:00
Pedro Nacht
5deacad765 ci: Ensure all version references are up-to-date prior to release (#447)
* Create references.sh

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

* WIP: check docs in pre-submits

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

* Clean up

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

* Fix based on comments

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

* Add instructions to RELEASE.md

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

* Check references match version in PR body

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>

---------

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2023-01-27 23:12:37 +00:00
asraa
2444233891 test: add builder id tests for short form (#455)
Signed-off-by: Asra Ali <asraa@google.com>

Signed-off-by: Asra Ali <asraa@google.com>
2023-01-26 09:35:22 -06:00
asraa
bcd23c945e chore: enable some Go linters (#456)
* enable deadcode

Signed-off-by: Asra Ali <asraa@google.com>

* enable unconvert

Signed-off-by: Asra Ali <asraa@google.com>

* enable thelper

Signed-off-by: Asra Ali <asraa@google.com>

* enable stylecheck

Signed-off-by: Asra Ali <asraa@google.com>

* enable misspell

Signed-off-by: Asra Ali <asraa@google.com>

* enable gocritic

Signed-off-by: Asra Ali <asraa@google.com>

* enable godot

Signed-off-by: Asra Ali <asraa@google.com>

* enable staticcheck

Signed-off-by: Asra Ali <asraa@google.com>

* address experimental deadcode

Signed-off-by: Asra Ali <asraa@google.com>

Signed-off-by: Asra Ali <asraa@google.com>
2023-01-25 19:51:10 +00:00
Mend Renovate
5eea7c5537 chore(deps): update github/codeql-action action to v2.1.39 (#452)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: asraa <asraa@google.com>
2023-01-25 15:59:45 +00:00
Mend Renovate
b0c071b496 fix(deps): update go (#453)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-25 09:52:35 -06:00
asraa
703fca0fbc test: add v1.4.0 build tests for gha_go gha_generic and gha_generic_container (#439)
* test: add v1.4.0 build tests for gha_go gha_generic and gha_generic_container

Signed-off-by: Asra Ali <asraa@google.com>

* gitignore oops

Signed-off-by: Asra Ali <asraa@google.com>

Signed-off-by: Asra Ali <asraa@google.com>
2023-01-17 16:40:09 +00:00
Mend Renovate
fb8ab2af45 chore(deps): update npm dev (#445)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-16 05:51:13 +00:00
Mend Renovate
71e72f0a1f chore(deps): update github/codeql-action action to v2.1.38 (#444)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-16 10:37:41 +09:00
Ian Lewis
1da39d7e06 ci: Add javascript to CodeQL analysis (#413)
Signed-off-by: Ian Lewis <ianlewis@google.com>

Signed-off-by: Ian Lewis <ianlewis@google.com>
2023-01-11 10:21:11 -06:00
Ian Lewis
771f842244 docs: Add instructions for GHA container generator (#438)
Signed-off-by: Ian Lewis <ianlewis@google.com>
2023-01-11 11:34:50 +09:00
Mend Renovate
b06fbf5b04 chore(deps): update github-actions (#436)
* chore(deps): update github-actions

Signed-off-by: Renovate Bot <bot@renovateapp.com>

* Use tag for actions/upload-artifact

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: asraa <asraa@google.com>
2023-01-09 15:28:47 +00:00
Mend Renovate
257c370894 chore(deps): update dependency prettier to v2.8.2 (#437)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-09 09:19:17 -06:00
Shunsuke Suzuki
325f12aabf chore: release assets for multiple platforms (#434)
* chore: release assets for multiple platforms

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>

* ci: release assets for windows and macOS

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>

* ci: add configuration files for macOS and windows

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>

* ci: remove a workflow job `if-failed`

This job is unneeded anymore.

https://github.com/slsa-framework/slsa-verifier/pull/434#discussion_r1063427948

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>

* ci: move configuration files to a directory `.slsa-goreleaser`

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>
Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2023-01-07 00:56:30 +00:00
Shunsuke Suzuki
a4d4074bf6 ci: fix a deprecation warning (#435)
> args
> The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>

Signed-off-by: Shunsuke Suzuki <suzuki.shunsuke.1989@gmail.com>
2023-01-06 08:14:29 -06:00
Ian Lewis
452dcfac5f ci: Add large file pre-submit check (#433)
Signed-off-by: Ian Lewis <ianlewis@google.com>
2023-01-06 09:29:13 +09:00
asraa
844ae349df fix: remove accidental checked in binary (#432)
Signed-off-by: Asra Ali <asraa@google.com>
2023-01-06 08:06:43 +09:00
asraa
bad943298a ci: add verifier e2e presubmit that runs CLI at main (#430)
* ci: add verifier e2e presubmit that runs CLI at main

Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
2023-01-05 16:02:54 +00:00
Mend Renovate
71a4b4d2bb chore(deps): update npm dev (#428)
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-01-05 02:25:41 +00:00
asraa
dabf59b6dd fix: fix exit status on command executione errors (#429)
Signed-off-by: Asra Ali <asraa@google.com>

Signed-off-by: Asra Ali <asraa@google.com>
2023-01-04 10:34:51 -06:00
Mend Renovate
652ec10cf9 chore(deps): update ossf/scorecard-action action to v2.1.2 (#417)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: asraa <asraa@google.com>
2023-01-03 20:16:07 +00:00
Mihai Maruseac
a72569a87a fix: Use Run instead of RunE to handle usage/errors (#424)
* Use `Run` instead of `RunE` to handle usage/errors

We want to only display the usage message if there is an error in the
parsing of arguments. Once the arguments are parsed and we invoke the
internal implementation the usage message should not be displayed
anymore, regardless of what internal error gets returned. Fortunately,
the fix is easy.

Tested:

* passing scenario:
```
[...]$ slsa-verifier verify-artifact \
       --provenance-path multiple.intoto.jsonl \
       --source-uri github.com/example/repo fib
Verified signature against tlog entry index 9712459 at URL: ...
Verified build using builder ...
Verifying artifact fib: PASSED

PASSED: Verified SLSA provenance
```

* failing scenario with missing artifact file:
```
[...]$ slsa-verifier verify-artifact \
       --provenance-path multiple.intoto.jsonl \
       --source-uri github.com/example/repo fibs
Verifying artifact fibs: FAILED: open fibs: no such file or directory

FAILED: SLSA verification failed: open fibs: no such file or directory
```

* failing scenario with invalid artifact:
```
[...]$ slsa-verifier verify-artifact \
       --provenance-path multiple.intoto.jsonl \
       --source-uri github.com/example/repo multiple.intoto.jsonl
Verified signature against tlog entry index 9712459 at URL: ...
Verifying artifact multiple.intoto.jsonl: FAILED: expected hash ...

FAILED: SLSA verification failed: expected hash ...
```

* failing scenario due to invalid usage (missing required arguments):
```
[...]$ slsa-verifier verify-artifact \
       --provenance-path multiple.intoto.jsonl
Usage:
  slsa-verifier verify-artifact [flags] artifact [artifact..]

Flags:
      --build-workflow-input map[]    [optional] a workflow input provided by a user at trigger time in the format 'key=value'. (Only for 'workflow_dispatch' events on GitHub Actions). (default map[])
      --builder-id string             [optional] the unique builder ID who created the provenance
  -h, --help                          help for verify-artifact
      --print-provenance              [optional] print the verified provenance to stdout
      --provenance-path string        path to a provenance file
      --source-branch string          [optional] expected branch the binary was compiled from
      --source-tag string             [optional] expected tag the binary was compiled from
      --source-uri string             expected source repository that should have produced the binary, e.g. github.com/some/repo
      --source-versioned-tag string   [optional] expected version the binary was compiled from. Uses semantic version to match the tag

required flag(s) "source-uri" not set
exit status 1
```

Fixes #307

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Handle the same fix in image verification

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* go fmt

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
2023-01-03 14:08:01 -06:00
Mihai Maruseac
17463c02b3 fix: Expect at least one artifact in verification (#426)
* fix: Expect at least one artifact in verification

Fixes #425 introduces by #419

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* go fmt

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
2022-12-29 13:05:10 -08:00
Mihai Maruseac
e20f3cc7a3 feat: Verify all artifacts passed in cmdline (#419)
* Remove limit of number of artifacts to verify

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Update short description

Mention that we support multiple artifacts as long as they come from the
same provenance.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Verify all artifacts passed in cmdline

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Remove header of verify step output

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Format the `cobra.Command.Use` argument

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Don't return a slice of builderIDs.

Since all images should come from the same provenance file, there's an
invariant that we will always get exactly one builderID. So, no need to
return a slice of them.

Just to preempt the case when the invariant would be broken, add a
specific check.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Change existing tests to support multiple artifacts.

No new tests added, just changing table test data type.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* [nfc] Format test file

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Change test to allow passing multiple artifacts.

For now, just allow passing the entire array of artifacts to command
line / arguments. The functionality should still be the same.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Fix typo

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Fix path to test artifacts

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Allow different provenance path

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Try 2 artifacts from existing testdata

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Add more tests for multiple artifacts

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Add failing test

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Fix artifact and error

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Add final test: no artifact match

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* Update README.md

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
2022-12-29 09:56:57 -08:00
asraa
19030f3b12 ci: add git sign off to renovate-bot (#420)
Signed-off-by: Asra Ali <asraa@google.com>

Signed-off-by: Asra Ali <asraa@google.com>
2022-12-28 15:27:47 -06:00
Mihai Maruseac
8279f4bf4c Enhance help message (#418)
One part that is missing in the output if invocation is wrong is that
there is no indication that user has to pass path to a file
(artifact/image).

The remaining potential errors from #173 are handled via #231.

Found while looking at #174.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
2022-12-28 14:24:04 -06:00
Mend Renovate
82cb42fb20 chore(deps): update dependency @types/node to v18.11.17 (#416) 2022-12-18 09:56:35 +09:00
Mend Renovate
5fd4ee25c1 chore(deps): update github-actions (#414)
Co-authored-by: Ian Lewis <ianlewis@google.com>
2022-12-17 07:11:23 +00:00
Mend Renovate
a88e26b866 chore(deps): update npm dev (#415) 2022-12-17 16:04:09 +09:00
Mend Renovate
b1aad15c35 chore(deps): update npm dev (#383)
Co-authored-by: Ian Lewis <ianlewis@google.com>
2022-12-16 00:41:58 +00:00
Mend Renovate
b40d88c1e7 chore(deps): update github-actions (#384)
Co-authored-by: Ian Lewis <ianlewis@google.com>
2022-12-15 01:59:36 +00:00
Mend Renovate
e8c3438638 fix(deps): update go (#386)
Co-authored-by: Ian Lewis <ianlewis@google.com>
2022-12-15 01:39:54 +00:00
Ian Lewis
f439833d5e Add regression build tag (#400)
Signed-off-by: Ian Lewis <ianlewis@google.com>
2022-12-15 01:25:04 +00:00
Ian Lewis
1dffc4b135 Use github.token to create issues (#412)
Signed-off-by: Ian Lewis <ianlewis@google.com>

Signed-off-by: Ian Lewis <ianlewis@google.com>
2022-12-14 17:09:42 -08:00
laurentsimon
f0aec773a6 update (#410)
Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
2022-12-14 14:34:54 -08:00
laurentsimon
41d551cd45 update (#408)
Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
2022-12-14 18:42:59 +00:00
laurentsimon
552cfc411d fix: token permission in Installer scheduled tests (#407)
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
2022-12-14 10:02:28 -08:00
asraa
0bd7a542b4 docs: update docs for release v2.0.1 (#403)
Signed-off-by: Asra Ali <asraa@google.com>

Signed-off-by: Asra Ali <asraa@google.com>
2022-12-14 16:11:34 +00:00
Ian Lewis
8510abc10f Add codeowners (#401)
Signed-off-by: Ian Lewis <ianlewis@google.com>
2022-12-14 03:05:04 +00:00
laurentsimon
b4257ed6bf Update schedule.installer.yml (#404)
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
2022-12-14 11:49:20 +09:00
laurentsimon
53b3aebdb9 feat: scheduled tests for installer Action (#398)
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* Update .github/workflows/schedule.installer.yml

Co-authored-by: Ian Lewis <ianlewis@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
Co-authored-by: Ian Lewis <ianlewis@google.com>
2022-12-14 01:37:23 +00:00
laurentsimon
a43888265e fix: command in installer Action (#396)
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>
v2.0.1
2022-12-08 22:32:57 +00:00
laurentsimon
901c5f7901 update (#394)
Signed-off-by: laurentsimon <laurentsimon@google.com>
2022-12-06 15:16:10 -06:00
laurentsimon
4cba39a15a feat: Add env variable to facilitate CI tests of Action installer (#393)
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

* update

Signed-off-by: laurentsimon <laurentsimon@google.com>

Signed-off-by: laurentsimon <laurentsimon@google.com>
2022-12-06 20:25:47 +00:00
laurentsimon
477ac0d88e fix: show version in version command (#392)
* update

Signed-off-by: laurentsimon <laurentsimon@google.com>
2022-12-06 20:13:35 +00:00