1
0
mirror of synced 2026-10-29 01:59:38 +03:00
Commit Graph

812 Commits

Author SHA1 Message Date
Zach Steindler
21f74b1ec3 Add protobuf bundle support to triangulate
Signed-off-by: Zach Steindler <steiza@github.com>
2026-01-26 10:52:41 -05:00
Tuomo Tanskanen
c5717cb886 Allow --local-image with --new-bundle-format for v2 and v3 signatures (#4626)
* Allow --local-image with --new-bundle-format for v2 signatures

Remove the mutual exclusivity constraint between --local-image and
--new-bundle-format flags in verify and verify-attestation commands.
This enables verification of v2-signed images saved as local OCI layouts
when using cosign v3.

Add HasLocalBundles() function that auto-detects the signature format
by checking for dev.sigstore.cosign/bundle annotations in the local
OCI layout. If no bundles are found (v2 attached signatures), the
verification falls back to v2 mode automatically.

This mirrors the existing auto-detection pattern used for registry-based
verification via GetBundles().

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>

* Add tests for local image format auto-detection

Add unit tests for HasLocalBundles() and HasLocalAttestationBundles()
functions covering v2 signatures, v3 bundles, and edge cases.

Add e2e test TestSaveLoadAutoDetectFormat to verify the auto-detection
works correctly for both v2 attached signatures and v3 bundles.

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>

* Enable full local verification of v3 sigstore bundles

Add GetLocalBundles() and verifyLocalImageAttestationsSigstoreBundle()
to support verifying v3 bundles directly from local OCI layouts.

Refactors hasLocalSigstoreBundles() to getLocalBundleDescriptors() for
reuse, and updates VerifyLocalImageAttestations() to use the new v3
verification path when NewBundleFormat is true.

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>

* Add tests for local v3 bundle verification

Add unit tests for GetLocalBundles() covering valid layouts, missing
blobs, and error cases. Update e2e test to verify v3 bundles directly
from local OCI layout without registry round-trip.

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>

---------

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>
2026-01-23 15:53:20 -05:00
Dor Tambour
96debc1443 Add empty predicate to cosign sign when payload type is application/vnd.in-toto+json (#4635)
Signed-off-by: dortam888 <dortam888@gmail.com>
2026-01-14 15:46:14 -05:00
Colleen Murphy
0d142fb3ea Add origin key for ctfe trusted root
Static CT, like Rekor v2, needs the origin string of the log server to
create a verifier, so include it when generating the trusted root.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2026-01-12 16:26:15 -08:00
Bob Callaway
f924c89254 Optimize cosign tree performance by caching digest resolution (#4612)
Reuse the digest obtained from SignedEntity instead of re-resolving it
in subsequent calls to AttestationTag, SignatureTag, SBOMTag, and
Referrers. This eliminates redundant manifest fetches and improves
performance

Signed-off-by: Bob Callaway <bcallaway@google.com>
2026-01-06 07:58:44 -08:00
Hayden
d8f7d86aea Don't require a trusted root to verify offline with a key (#4613)
When signing offline using a key and opting out of Rekor, contents from
the TUF repo are not fetched because they aren't needed. Similarly with
verification, TUF shouldn't be required when no service roots are
needed, which is true when a) a public key is provided, b) Rekor is
skipped via flag, and c) timestamp verification is skipped via a flag.

Note that this affects the old bundle format verification path,
which allows for services to be skipped via flags. When a new bundle
format is provided, users will not be required to include a trusted root
if the above 3 conditions are satisfied.

Fixes #4550

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
2026-01-06 08:58:56 -05:00
Hayden
246945e6cb Support default services for trusted-root and signing-config creation (#4592)
When a client doesn't want to use a default service like Rekor while
still using the public instance, a client would need to retrieve the
signing configuration or trusted root, remove the tlog sections, and
provide that to the sign/verify command. This first step can now be
skipped by using --with-default-services and --no-<service> to omit it
from the configuration file. This will provide a better user experience
while maintaining the unified configuration interface between clients.

Ref: https://github.com/docker/actions-toolkit/issues/901

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2026-01-05 08:55:11 -08:00
Sherine Khoury
901b44d659 4554: Closes 4554 - Add warning when --output* is used (#4556)
* 4554: Fix 4554 - Add warning when --output* is used

Signed-off-by: sherine-k <skhoury@redhat.com>

* Move warning display logic for --output-* flags to LoadTrustedMaterialAndSigningConfig

Signed-off-by: sherine-k <skhoury@redhat.com>

---------

Signed-off-by: sherine-k <skhoury@redhat.com>
2025-12-08 15:28:15 -08:00
Zach Steindler
dc8ad5e825 Protobuf bundle support for subcommand clean (#4539)
---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-12-05 16:13:01 -05:00
Aaron Lew
b2102aafda Add staging flag to initialize with staging TUF metadata
Signed-off-by: Aaron Lew <64337293+aaronlew02@users.noreply.github.com>
2025-12-05 13:08:24 -08:00
Zach Steindler
1e49088b9a Updating sign-blob to also support signing with a certificate (#4547)
---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-12-03 09:38:24 -05:00
Zach Steindler
4e3042ceba Protobuf bundle support for subcommands save and load (#4538)
* Adding support for new bundles stored with OCI referrers to save and load

---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-11-25 07:16:59 -05:00
Colleen Murphy
7981e233cc Fix cert attachment for new bundle with signing config
Without this change, if an image is signed with `--certificate` and also
using signing config and the new bundle format (the defaults), the logic
routes to sigstore-go signing which does not natively understand signing
with a cert that is not issued by Fulcio. This means that only the
public key is uploaded to the bundle, so the image cannot be verified
using the certificate. This change ensures the certificate is passed
through to the bundle if it is provided with `sign`, `attest`, and
`attest-blob` . The `sign-blob` command does not support
`--certificate`.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-11-24 09:17:34 -08:00
Colleen Murphy
0cf496efd6 Fix OCI verification with local cert - old bundle
`SigVerifier` is set on `CheckOpts` no matter whether the verifying
material is a public key or a certificate. The `keyBytes` function used
for comparing the verifier object was incorrectly assuming that
`SigVerifier` being non-nil meant that a local certificate was not
present and was returning the certificate's public key instead of the
certificate. This change fixes the function to check for a certificate
before returning the bytes from the public key.

It is also possible to provide a public key as an argument when a
certificate is in the signature bundle. It does not make sense to try to
provide both, but this has been allowed and asserted in
verify_blob_test.go. In this case, the comparer should ensure that the
certificate and public key are related to each other. The alternative is
to disallow providing a key as a command argument when a certificate is
present in the signature, but this could be considered a breaking
change.

This change only applies to verifying images using the old signature
format. For the new bundle format, the certificate verification goes
through a different path.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-11-24 09:17:34 -08:00
Hayden
b51a7c2a25 Deprecate tlog-upload flag (#4458)
* Deprecate tlog-upload flag

Clients that don't want to use a transparency log should provide a
signing config without tlog service instances rather than use this flag.
This will also throw an error when a client uses this flag when a
signing config will be used, since Cosign/sigstore-go ignores this flag
and we don't want a user to unexpectedly upload to the public instance.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Refactor TR and SC initialization into common method

The one difference between sign/attest and sign/attest-blob is whether a
bundle output flag is present, so the error message has been adjusted.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Fix e2e test, better error message

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

---------

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-11-14 11:50:40 -08:00
Noel Georgi
6eecec74d2 fix: Use signal context for sign cli package.
Use proper context passing for `sign` cli package.

Fixes: #4506

Signed-off-by: Noel Georgi <git@frezbo.dev>
2025-11-12 13:09:04 -08:00
Colleen Murphy
ee3d9fe1c5 Fix signing/verifying annotations for new bundle
Without this change, when the new bundle format is used, annotations
were not being added to the payload, nor were they being checked during
verification, but were still being reported as verified. This also had a
side effect of the annotations not appearing in the verification output.
This change fixes the issue by passing through the annotations to the
statement builder during signing, and using a different in-toto
`Statement` type to parse annotations from the statement during
verification, as well as actually calling the claims verifier.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-11-04 09:54:07 -08:00
Zach Steindler
0f1bf8394c Add support to download and attach for protobuf bundles (#4477)
---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-11-04 10:48:11 -05:00
Riccardo Schirone
8e7e0571a0 Add --signing-algorithm flag (#3497)
* cmd/cosign: add --signing-algorithm flag

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* fix getHashFunction to use signingAlgorithm

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* cmd/cosign: set default ko.SigningAlgorithm

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* cmd/cosign: set default ko.SigningAlgorithm 2

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* Validate signing-algorithm immediately

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* Use GetDefaultLoadOptions function

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* Update documentation

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* use v3

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* Disable ed25519ph

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* Fix doc

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* Fix getHashAlgorithm to have a default value for SigningAlgorithm

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

* fix unused argument

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>

---------

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>
2025-11-02 20:11:29 -08:00
Colleen Murphy
0b4362b15e Refactor signcommon bundle helpers
Use a common options struct for WriteBundle and
WriteNewBundleWithSigningConfig to reduce the number of arguments in
each function.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-10-29 16:58:55 -07:00
Colleen Murphy
4a2caf9f74 Add --bundle and fix --upload for new bundle
Without this change, --upload=false was not respected with the new
bundle format. It also would not have made sense because there was no
way to output the bundle locally. This change adds a flag
--bundle so that the bundle can be created on disk without
attaching it to the image, and also passes through the Upload parameter
to bypass uploading it if desired.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-10-29 16:58:55 -07:00
Colleen Murphy
d470294ce6 Pass insecure registry flags through to referrers
Also updates the registry tests to use TUF so that they can be re-used
for both the legacy format and protobuf bundle format.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-10-27 14:05:20 -07:00
Zach Steindler
3c5b34b615 Add protobuf bundle support for tree subcommand (#4491)
* Add protobuf bundle support for tree subcommand

---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-10-24 15:40:13 -04:00
Joonas Bergius
1861d595ce Remove stale embed import (#4492)
Signed-off-by: Joonas Bergius <joonas@defenseunicorns.com>
2025-10-24 11:53:42 -04:00
Emily Zheng
f9a9a0b805 Support multiple container identities
With this change, cosign sign can be run only once when an image
has multiple pull references.

Closes #4330

Signed-off-by: Emily Zheng <yuzheng@redhat.com>
2025-10-22 13:14:02 -07:00
Alex Pyrgiotis
ae3eecb2c4 Remove --out flag from cosign initialize (#4462)
Remove any mention of the `--out` flag from the `cosign initialize`
command, since it's no longer used.

Signed-off-by: Alex Pyrgiotis <apyrgio@gmail.com>
2025-10-16 10:54:09 -07:00
Hayden
aab0126a88 Deprecate offline flag (#4457)
The offline flag is misleading and is a no-op with the new Cosign v3
defaults. The flag's purpose was to prevent a client from falling back
to verifying an artifact's inclusion in Rekor when a proof failed to
verify. Most users thought offline verification forced the client to not
make any network requests - a very reasonable assumption, but with TUF,
network requests are a part of verification if the local TUF metadata
has expired.

I've updated the README as well, though we need to make a far more
comprehensive pass over the documentation since it's out of date given
our new trusted-root/bundle flags.

Fixes #4454

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-10-13 21:02:19 +00:00
Colleen Murphy
b529ddf789 Deduplicate code in sign/attest* and verify* commands (#4449)
* Deduplicate key/token handling in sign commands

Move the nearly identical code for parsing key options and creating a
key pair and token out of attest, attest-blob, sign, and sign-blob, and
into a common helper package. Move functions that had been shared out of
sign.go into the helper package too so that other commands do not have
to import the sign command package.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Deduplicate signer-verifier creation

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Deduplicate timestamp retrieval

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Deduplicate rekor upload

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Deduplicate bundle compilation

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Move OCI parsing function to signcommon

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Make flag compatibility checking consistent

Move flag checks when --new-bundle-format is used to a common helper
module and have all four verify commands use it. Remove redundant flag
checker code.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Remove duplicate certs setting

RootCerts and IntermediateCerts are already set on CheckOpts during
loadCertsKeylessVerification.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Move loading key to common

Move the setting of SigVerifier based on the key ref, key slot, or cert
and cert chain, to the common file.

For verifying blobs and blob attestations with a certificate instead of
a key, we return the cert which is used directly in the options list for
verification. For images, the cert and cert chain must be validated and
then unpacked into the SigVerifier, where the cosign Verify* functions
check its validity by extracting it from the verifier.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Deduplicate TUF v1 fetch and rekor client setup

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Deduplicate trusted material setting

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Move common functions to common.go

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

---------

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-10-13 13:35:20 -07:00
Hayden
925c965ff0 Cache signing config when calling initialize (#4456)
When calling cosign initialize, the client will cache the trusted root file
if available. This PR adds support for caching the signing config as
well. The public-good instance's TUF repo includes this file. Private
deployments likely don't use this file, so like with the trusted root,
Cosign will print a warning rather than fail initialization.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-10-13 18:07:22 +00:00
Colleen Murphy
9fee551d08 Update rekor-tiles version path
The rekor-tiles package is starting at version 2.0. There are no
interface changes with this version change.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
2025-10-09 14:57:30 -07:00
Hayden
479a0c128b Fetch service URLs from the TUF PGI signing config by default (#4428)
* Fetch service URLs from the TUF PGI signing config by default

This will also use sigstore-go's signing API by default.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Fetch service URLs from the TUF PGI signing config by default

This will also use sigstore-go's signing API by default.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

---------

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
Co-authored-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-10-07 08:52:47 -07:00
Hayden
8e3a787545 Bump module version to v3 for Cosign v3.0 (#4427)
Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
Co-authored-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-09-26 13:31:26 -07:00
Zach Steindler
8d756cf2bd Partially populate the output of cosign verify when working with new bundles (#4416)
* Implement container image context in verify command
* Use conformance on main for now (waiting for new release)

---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-09-25 09:03:26 -04:00
Zach Steindler
b952363fb2 Default to using the new protobuf format (#4318)
* Default to using the new protobuf format

---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-09-16 13:31:06 -04:00
Hayden
37fbfc7018 Require exclusively a SigningConfig or service URLs when signing (#4403)
A signing config is a source of truth for the service URLs. We will
disallow specifying multiple sources of truth for service URLs if the
default values are overridden.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-09-12 12:49:02 -07:00
Hayden
b1acaeb92c Add a terminal spinner while signing with sigstore-go (#4402)
Recording signatures to Rekor v2 can take up to 10 seconds. We want to
avoid someone killing the process while waiting for a response from
Rekor, otherwise the user will have to re-sign the artifact.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-09-12 09:33:44 -07:00
Hayden
11163ae7d8 Bump sigstore-go, support alternative hash algorithms with keys (#4386)
* Bump sigstore-go, support alternative hash algorithms with keys

sigstore-go now handles non-ECDSA-P-256 signatures with Rekor v2. To
support verification, we also need a way to provide alternative hash
algorithms to the default SHA-256. cosign verify already had a flag for
this, so I added the flag to all verify commands. In the future, when we
are only processing bundles, we can lookup the default hash algorithm
given the key.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* lint fmt

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Drop support for Fulcio with ed25519ph key

We've chosen to not support this in sigstore-go, so we'll also remove
this from Cosign. This is a niche edge case where a user provides an
ed25519 key or algorithm and requests a cert and logs it to Rekor. We'll
revisit this if there's demand or when we support the prehash variant in
Fulcio.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

---------

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
Co-authored-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-09-11 08:32:25 -07:00
Hayden
a2cbedabcc Add support for SigningConfig in sign/attest (#4371)
* Add support for SigningConfig in sign/attest

This will indirectly add support for signing with Rekor v2, since
signing will be handled by sigstore-go rather than Cosign.

This also brings sign/attest up to par with sign-blob/attest-blob with
respect to signing with a key and providing a trusted root when
providing a signing config.

This feature is gated behind one of two signing config flags, which in a
later version of Cosign will be flipped to on by default.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Address review comments

--signing-config and --use-signing-config are now mutually exclusive.

TrustedMaterial and SigningConfig are set in the same line as fetching
the trusted root and signing config.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

---------

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-09-04 13:32:50 -07:00
Hayden
59b9930775 Support self-managed keys when signing with sigstore-go (#4368)
* Support self-managed keys when signing with sigstore-go

This creates a wrapper around the Keypair interface when a
SignerVerifier is provided for signing with KMS or any other provided
keys. This also retains support for --issue-certificate to request a
certificate for a managed key.

Fixes #4327

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Add issue-certificate flags to attest and attest-blob

This is for uniformity with sign/sign-blob.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Refactor SignerFromKeyOpts to split Fulcio signer into its own method

Now, we can generate a SignerVerifier from a provided key without
mandating that we also request a Fulcio certificate when
"issue-certificate" is provided.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

* Use default options to load key material

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>

---------

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-09-03 12:21:29 -07:00
Riccardo Schirone
b36644f793 Remove SHA256 assumption in sign-blob/verify-blob (#4050)
Use sigstore/sigstore signature.LoadSignerVerifierFromPrivateKey to load default verifiers given a private key.

Signed-off-by: Riccardo Schirone <riccardo.schirone@trailofbits.com>
2025-09-02 15:00:46 -07:00
Hayden
fd5fcfbf07 Break import cycle with e2e build tag (#4370)
When developing locally, with the e2e build tag set, there's an import
cycle. test/helpers.go imports "cmd/cosign/cli/verify", which imports
"test" in test files in the verify package. This change breaks the
import cycle by moving certificate utilities to an internal test
directory.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-08-28 11:42:30 -07:00
Hayden
b6ce93da38 Update conformance test binary for signing config (#4367)
The signing config will now be provided on the sign path to test Rekor
v2, along with the trusted root for verifying bundles on the sign path.

This also adds support for providing a trusted root with
sign-blob/attest-blob. Currently, you can either provide just the CT log
key or we'll fetch the trusted root from the initialized TUF repo. Since
we are providing the trusted root for staging during signing now, this
PR also lets the user provide the trusted root they'll use for verifying
during signing.

Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
2025-08-27 09:45:05 -07:00
Zach Steindler
3a2e07606b Don't load content from TUF if trusted root path is specified (#4347)
That way cosign verify-attestation can work in offline environments.

Signed-off-by: Zach Steindler <steiza@github.com>
2025-08-18 10:34:59 -07:00
Zach Steindler
a2a8ca3686 Fixes to cosign sign / verify for the new bundle format (#4346)
* Fixes to cosign sign / verify for the new bundle format

Signed-off-by: Zach Steindler <steiza@github.com>

* Update function signature to pass crypto.PublicKey directly

Signed-off-by: Zach Steindler <steiza@github.com>

---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-08-13 21:08:20 +00:00
Zach Steindler
0ac382ac71 Have cosign sign support bundle format (#4316)
---------

Signed-off-by: Zach Steindler <steiza@github.com>
2025-08-07 14:41:10 -04:00
Hayden
f011b93a85 Add support for SigningConfig for sign-blob/attest-blob, support Rekor v2 (#4319)
* Refactor fetching an ID token into its own package

This will allow these functions to be reused by other parts of the
codebase, and eventually we can move these into an external package for
use by other libraries.

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>

* Add support for SigningConfig for sign-blob/attest-blob

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>

* Refactor identity token retrieval into its own method

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>

* Disallow self-managed keys with a signing config temporarily

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>

---------

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
Co-authored-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
2025-08-07 09:20:58 -07:00
Hayden
f8e6db50ec Verify subject with bundle only when checking claims (#4320)
Previously, when --check-claims was set to false and a bundle in the new
format was provided, we'd still try to check the in-toto subject digest
and algorithm. These values weren't being set since they were
conditioned on checking claims. Now, we skip digest verification if
check-claims is false with a new bundle.

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
2025-08-04 12:53:29 -07:00
Zach Steindler
fc4b1a2600 Add to attest-blob the ability to supply a complete in-toto statement, and add to verify-blob-attestation the ability to verify with just a digest (#4306)
* Add support for attesting with complete statement

---------

Signed-off-by: Cody Soyland <codysoyland@github.com>
Signed-off-by: Zach Steindler <steiza@github.com>
Co-authored-by: Cody Soyland <codysoyland@github.com>
2025-07-25 16:47:12 -04:00
Hayden
488ef8ceed Add signing-config create command (#4280)
This introduces a new command `cosign signing-config create` to generate
a SigningConfig message. This will first be used by our testing
infrastructure to create a SigningConfig, and then by users adopting the
bundle format in Cosign v2 and eventually as a requirement for v3 when
signing with private deployments.

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
2025-07-17 12:56:47 -07:00
Hayden
722207e005 Allow multiple services to be specified for trusted-root create (#4285)
This provides the same API as in the new `cosign signing-config create`
command from #4280. To avoid this being a breaking change, the previous
flags will still be supported, but will be removed in Cosign v3.

Fixes #4282

Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
2025-07-16 13:54:49 -07:00