-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
835 - Keyless Support for SBOM Attestations #910
Conversation
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
6050fad
to
659e1da
Compare
Benchmark Test ResultsBenchmark results from the latest changes vs base branch
|
* main: (31 commits) reduce noise of log output (#976) add version info and remove double config call (#977) Rename syft-id to package-id (#970) update to cyclonedx-go 0.5.2 (#971) refactor command package to remove globals and add dependency injection fix: #953 Derive language from pURL - https://github.com/anchore/syft… (#957) Fix typo in CPE-parsing error (#966) Preserve syft IDs on SBOM decode (#963) Update GitHub format package_url and correlator (#961) Ensure SPDXIDs are valid (#955) Auto-PR needs to run go mod tidy (#958) Add workflow for automatic PR for new stereoscope updates (#954) Minor readme update to correct format information (#948) Update spdx22json to only take uppercase checksum algorithm (#946) add additional vendors for springframework (#945) Add digest property to parent and nested java package metadata (#941) Update write permissions and log into ghcr.io for release (#942) Retry auth URL lookup without docker credentialhelper workaround (#939) Ensure that all cyclonedx components have bom-refs (#914) Additionally publish docker images to GHCR (#934) ... Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
ecdbf62
to
4d302eb
Compare
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
4d302eb
to
ebc96d3
Compare
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
cmd/syft/cli/attest/attest.go
Outdated
return nil, err | ||
} | ||
|
||
log.Infof("tlog entry created with index: %v", *entry.LogIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should this be debug? or if it's worthy information, should this information be elevated to the ETUI with upload progress (even if infinite spinner)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @luhring on this one. I'm on the fence about including this in the default output. I'll demote it to debug for now, but if we come up with a good reason in this thread to why it should stick around I can elevate it into the ETUI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does cosign show this? I don't remember for sure but I thought it does — since it's a convenient way to find the Rekor entry that was just created (i.e. after you run this, you can use a Rekor client to just to a lookup by index)
cmd/syft/cli/attest/attest.go
Outdated
if err != nil { | ||
return err | ||
} | ||
|
||
bus.Publish(partybus.Event{ | ||
Type: event.Exit, | ||
Value: func() error { | ||
_, err := os.Stdout.Write(signedPayload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're uploading should we be outputting the signed payload to the screen? or suppress this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still be publishing the payload to the screen on upload so the user is able to inspect what was uploaded, but I can also see how suppressing is gives a cleaner execution and we don't pollute the screen since payloads are large and noticeably indecipherable on first glance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @luhring for input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah no strong opinion, but I think I'd lean toward not outputting it for now for the "clean feel" reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed output on upload
cmd/syft/cli/options/fulcio.go
Outdated
"github.com/spf13/viper" | ||
) | ||
|
||
const DefaultFulcioURL = "https://fulcio.sigstore.dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this can be unexported
cmd/syft/cli/options/fulcio.go
Outdated
"identity token to use for certificate from fulcio") | ||
|
||
cmd.Flags().BoolVar(&o.InsecureSkipFulcioVerify, "insecure-skip-verify", false, | ||
"skip verifying fulcio published to the SCT (this should only be used for testing).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the SCT? The docs should probably reflect the full name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I used SCT incorrectly here so double good call out.
SCT is “Signed Certificate Timestamp”. We need this flag so that we don't have to setup a root CA for fulcio during testing. Fulcio returns a “Signed Certificate Timestamp”.
See here if you want the deep dive:
https://blog.chainguard.dev/a-fulcio-deep-dive/
cmd/syft/cli/attest/attest.go
Outdated
} | ||
|
||
sv, err := sign.SignerFromKeyOpts(ctx, "", "", ko) | ||
sv, err := sign.SignerFromKeyOpts(ctx, "", "", *ko) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should nil check ko
first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's small so I updated it to pass by value instead of pointer here.
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
* main: feat: add initial dotnet-support (#951) unblock timeout for power-user select CLI tests (#985) golang cataloger - main module version as is (#986) Fix `github-json` output option (#967) read Go main module version as is - (devel) (#981) reduce logging severity for non-Go binaries (#983) golang.org/x/crypto upgrade (#979)
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
Summary:
Update the
syft attest
command to use the cosign keyless workflow.Users should be able to run
syft attest -o syft-json alpine:latest
and generate anIn-Toto
Attestation serialized as aDSSE
envelope defined here, which is signed bygithub
,google
, or microsoft OIDC providers. They should only be able to UPLOAD attestation for images they own.Users in this case will not have to bring their own key. Instead, ephemeral keys and certificates will be generated and signed automatically by the
fulcio
root CA. These signatures are then stored in therekor
transparency log which provides an attestation as to when the signature was created. The new feature supports Oauth flows through the browser. Device flows have not been tested and will be updated in follow up PR.To test the new functionality on this branch you can run:
go run cmd/syft/main.go attest -o syft-json <IMAGE YOU HAVE WRITE ACCESS TO>
COSIGN_EXPERIMENTAL=1 cosign verify-attestation <IMAGE YOU HAVE WRITE ACCESS TO>
Documentation
Signed-off-by: Christopher Phillips christopher.phillips@anchore.com