Closed viccuad closed 7 months ago
Seems to be caused by https://github.com/sigstore/sigstore-rs/issues/338
This needs: a. Patched awslabs/touch: https://github.com/viccuad/tough/tree/patch-edcsa, see compare
b. Either use a [patch.crates-io]
approach:
c. Or consume manually:
d. Releases for kwctl and policy-server.
Trying approach b, [patch.crates-io]
is not reasonable.
The patch.crates.io
Rust feature doesn't support crate features nor default features. We need to consume awslabs/touch with the http
feature enabled.
One can't set it as default, hence one needs to remove the feature and hardcode it (same for awslabs/touch, awslabs/tough-ssm as they expect that http
feature) (tried here).
Still, doing that means patching sigstore-rs to not consume awslabs/tought with the feature, and that brings the same problem again.
Simpler to fork the dependency chain, approach c.
Consumed the pointed forks above in policy-fetcher, policy-evaluator, kwctl, and the upstream tough fix seems to be incomplete.
Moving to blocked.
When running
kwctl verify
as follows, mirroring a failure shown on integration tests in CI, I get:This happens for test policy
registry://ghcr.io/kubewarden/tests/capabilities-psp:v0.1.9
and GAregistry://ghcr.io/kubewarden/policies/capabilities-psp:v0.1.15
Full output:
Click me
```console $ kwctl --version kwctl 1.11.0-rc5 Use the `info` command to display system information. $ kwctl verify --verification-config-path verification-config.yml registry://ghcr.io/kubewarden/tests/capabilities-psp:v0.1.9 2024-03-20T10:36:23.248610Z WARN kwctl: Cannot fetch TUF repository: TufError(ParseMetadata { role: Root, source: Error("unknown variant `ecdsa`, expected one of `rsa`, `ed25519`, `ecdsa-sha2-nistp256`", line: 9, column: 22), backtrace: Backtrace(()) }) 2024-03-20T10:36:23.248644Z WARN policy_fetcher::verify: Sigstore Verifier created without Fulcio data: keyless signatures are going to be discarded because they cannot be verified 2024-03-20T10:36:23.248649Z WARN policy_fetcher::verify: Sigstore Verifier created without Rekor data: transparency log data won't be used 2024-03-20T10:36:23.248652Z WARN policy_fetcher::verify: Sigstore capabilities are going to be limited 2024-03-20T10:36:23.248656Z INFO sigstore::cosign::client_builder: Rekor public key not provided. Rekor integration disabled 2024-03-20T10:36:23.248660Z INFO sigstore::cosign::client_builder: No Fulcio cert has been provided. Fulcio integration disabled 2024-03-20T10:36:25.214557Z INFO sigstore::cosign::signature_layers: Ignoring bundle, rekor public key not provided to verification client bundle="{\"SignedEntryTimestamp\":\"MEUCIQCTsSmCHAnPYzjENHAUceoUqqjzNYyamfmXfmtjwszsDwIgHxzHN5c476RJZfS5xy6k7e1NiwUvqkr2w+Kd9u6/f2c=\",\"Payload\":{\"body\":\"eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiIwODFlZDJjYzJhYTZhYjA1YTQ0MzFkNDM1ZTNkNWViOGVhMzFjYTJjNTZiNjQwNDM4NGQxMjRjMmMwYWNkYzcxIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FVUNJQk5JQ1Q3ZGtoVkNHd3ZyTk45RlZPRVhQWUxyWVA0elRaSGpqVHRVazVZTkFpRUE1SkxmS1NSK05XUUZlUytXbjE3aFl3eTNML2lFSFpod0dNS3AzV1VkSWxvPSIsInB1YmxpY0tleSI6eyJjb250ZW50IjoiTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUlRWRU5EUVhNclowRjNTVUpCWjBsVlFVNUZlVzR4WjJKWVFVdFJVR0ZYVW5CUVIxTmxNMDVGTjIxbmQwTm5XVWxMYjFwSmVtb3dSVUYzVFhjS1MycEZWazFDVFVkQk1WVkZRMmhOVFdNeWJHNWpNMUoyWTIxVmRWcEhWakpOVWtWM1JIZFpSRlpSVVVSRmQyaDZZVmRrZW1SSE9YbGFWRUZsUm5jd2VRcE5ha0Y0VFdwamVFNTZVWGROZW14aFJuY3dlVTFxUVhoTmFtTjRUbnBWZDAxNmFHRk5RazE0UlZSQlVFSm5UbFpDUVc5VVEwaE9jRm96VGpCaU0wcHNDazFHYTNkRmQxbElTMjlhU1hwcU1FTkJVVmxK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FOVhSbXRaTWxFeFdUSlplazVxVVhkYVZFMDFXa2RXYTAxVWEzZFplbGw1VFVSclIwTnBjMGNLUVZGUlFtYzNPSGRCVVVWRlN6Sm9NR1JJUW5wUGFUaDJaRWM1Y2xwWE5IVlpWMDR3WVZjNWRXTjVOVzVoV0ZKdlpGZEtNV015Vm5sWk1qbDFaRWRXZFFwa1F6VnFZakl3ZDAxQldVdExkMWxDUWtGSFJIWjZRVUpDVVZGcFlUTldhVnBZWkdoamJWSnNZbWs1YWxsWVFtaFpiV3h6WVZoU2NGcFlUWFJqU0U1M0NreFlRblppUjJ4cVpWUkJTMEpuWjNGb2EycFBVRkZSUkVGM1RtOUJSRUpzUVdwRlFXeG9ia0UzTDJGWGVVaGtTMFEwY1ZKbWRHWm5hRmh4U1ZoQ1NWWUtaV2d5VFZWTWFrOU5aRVpLWmxOU2MzSjVPWGRpZVdsNlFpdHRlWGgxZG1SMFpEaE1RV3BDWVhsS2JVY3pLekYzT0VOcE9HVldOMFZoWmtWUVZ6TnlNd3BPT1VsSlJ6QnZTVmhTYjNRMlRWazNWVTVUUTNsQ2NHTmFTMUJqTXpZd2VsbGxPSG8xTjJzOUNpMHRMUzB0UlU1RUlFTkZVbFJKUmtsRFFWUkZMUzB0TFMwSyJ9fX19\",\"integratedTime\":1643305239,\"logIndex\":1181814,\"logID\":\"c0d23d6ad406973f9559f3ba2d1ca01f84147d8ffc5b8445c224f98b9591801d\"}}" 2024-03-20T10:36:25.214765Z INFO sigstore::cosign::signature_layers: Ignoring certificate annotation reason="fulcio certificates not provided" Error: Policy registry://ghcr.io/kubewarden/tests/capabilities-psp:v0.1.9 cannot be validated Image verification failed: missing signatures The following constraints were not satisfied: kind: githubAction owner: kubewarden repo: null annotations: null Stack backtrace: 0: anyhow::error::The
verification-config.yml
is straight fromkwctl scaffold verification-config > verification-config.yml
:Note:
While this makes image verification fail in kwctl and policy-server, we fail-closed, meaning that even if images are correctly signed, Kubewarden will fail the image verification and report "Image verification failed: missing signatures".