Skip to content
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

chore: update cosign versions #82

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions cosign/private/versions.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,123 @@
"Mirrored versions/integrity hashes of cosign binaries"

COSIGN_VERSIONS = {
"v2.0.0": {
"darwin-amd64": "sha256-0sj8DttCoel0XaHEOikozuBE87ihuN9kCIo4TH5vW10=",
"darwin-arm64": "sha256-nXgh4cBdpLB1E3KcsA0QcMmpUzLGbZD6WT7XfYxyyio=",
"linux-amd64": "sha256-FppTWUxDfVP/xAG5EbfnDUU/Wiwflusqc2809jVsTys=",
"linux-arm": "sha256-GJ1WyZRt7NqicuHcy0euZACeo5rAJ0z+oAUHuay4d8k=",
"linux-arm64": "sha256-gTLLL7maTGC6jgOweeEkYsJwcwKKXQjAfs2mcoTgyI0=",
"linux-ppc64le": "sha256-pc9EPIyO0QjjAqZk3j4urYWb1gCEj/VgVTcsFxzZ/HE=",
"linux-s390x": "sha256-uCbPdb85GKw5wU3fH8ew4bFSqF5i1Vrd6CLtfdAA850=",
},
"v1.13.1": {
"darwin-amd64": "sha256-HRZLix/P7x4YcNgJ7buYYq/VmVyrY2h6RAuEzKVoDs8=",
"darwin-arm64": "sha256-Ar74eJFr4Ej9fc90IQVjn1Nwalm1sD9OTqzMAdBbx6s=",
"linux-amd64": "sha256-pQZRpntCcU1vGmbrZ3O/IU2srjIfBDI8CIX2pDMFH5U=",
"linux-arm": "sha256-7cJNSUWac/VOeIaKNUDh5URSrSMoxm4euovNePzTSfw=",
"linux-arm64": "sha256-p6eaUsd0fiwhVUytRgDmxxMMBCkBfdJY+cVY2Vf6kJA=",
"linux-ppc64le": "sha256-nLdLKRXzi2zGtPtJOLFtWLVznQD3NyJGkLkdIH5qqAU=",
"linux-s390x": "sha256-bKPRc5kQuw98zlfJ6/RLb+/WbgeBCtDlBtYiz4WvE08=",
},
"v1.13.0": {
"darwin-amd64": "sha256-h8Twy6siLCNaRG+GdbzumyeYxT7QAwH0RYJZpl28aag=",
"darwin-arm64": "sha256-i5X4Ua8t5N33sPXY8oP4fLtKhypPM2eqzaumfkkQSOY=",
"linux-amd64": "sha256-Rdu43X2fd+sBDAkd6jkdpxcw3yUS2fsbZc1AE2ruV54=",
"linux-arm": "sha256-rQ+v98bq20bMmQD/ze5WgWMN4KiQ0gPecTYJV769om4=",
"linux-arm64": "sha256-lQ452+fhgmA9XVnZ4qdugE1dSbufsbV3UQywvH/Vpqk=",
"linux-ppc64le": "sha256-vNIvrXqbZHpwt2ptcegQWaZKKq8Um6C2NW77pAwC4a8=",
"linux-s390x": "sha256-dCWscvJmCDXDYzrybYSo0Jo6tvTTVGvmpFgC1VJ8qCQ=",
},
"v1.12.1": {
"darwin-amd64": "sha256-h6fpOxU52Yj+/g0A/VpaDgLvQ/X5d8KnARcMUCoXmA0=",
"darwin-arm64": "sha256-Qbxp2unwb1jo5hRGkHt+U6TbQe80GyNRctN0XJN/F3c=",
"linux-amd64": "sha256-sw/cfZqrJGvC9qdg7Y7/BjvTeTU4kwLJY8BwGOXUihI=",
"linux-arm": "sha256-qYl7wrFZFf865qUSHZCmVn1DBOMd99sVRR9bS2xopG8=",
"linux-arm64": "sha256-2bqFEtjdbMBbLGJtLi7JZt0kxfitO0ea6atgZsjZ3rc=",
"linux-ppc64le": "sha256-M3lrNyZHtQOl+txhsnflaXp/VBGSxlGFBcRoLgKH1vI=",
"linux-s390x": "sha256-HpHkLiHNPDGkcuAuVqYA6Giz+cpYFXB6U5RoKlIJcZ0=",
},
"v1.12.0": {
"darwin-amd64": "sha256-SdVSpmMiEBUXW/M9vXvc25W9dHY/48zgy2BGKFFGHTs=",
"darwin-arm64": "sha256-uE3MeAkDHMSiMLTTAuVXNSVs4dvPMmt6sDKmsPDjpB0=",
"linux-amd64": "sha256-KQNDXv1vrgw2U0LjSJOj33EbkpIFysOFyb7/upRLJsc=",
"linux-arm": "sha256-Fmoh9sSQTrJnNz+6EvVF+/GiJa+VgrOfhdQRR5RlISE=",
"linux-arm64": "sha256-j6n4MBRMUtKc7IPaiOBZK6OIwGpYVvKOxNX0dOfEFXM=",
"linux-ppc64le": "sha256-TtKpgFccRMOYgupRS6PXojDpk1XVuZDEbHwVfTX28mg=",
"linux-s390x": "sha256-Xhh9OBj9UzOtun6EAJLIL96jrv0eRgxrDWHJtfLhtLE=",
},
"v1.11.1": {
"darwin-amd64": "sha256-orWqPYLPhFwTfT2imqwzVXdnV1ln7IaD1nPvbAEWgD0=",
"darwin-arm64": "sha256-2ewdHdcipcxi7OjsCDKtoGRfSNPUuIWIdNjK2WoVvyo=",
"linux-amd64": "sha256-TZ5Kjnm3FAObJy74muKbxFsy5YW2AQpbkEjaFNk8/V8=",
"linux-arm": "sha256-hWjGvK/g3CMMdWVKwrXUN5pyc43xN3uVzQ1I4/HXvB0=",
"linux-arm64": "sha256-n7i0lO20uVyqm4ItKRBGDkCxa8kLlHeiryvPugu5mC8=",
"linux-ppc64le": "sha256-RaZW93QIrgvUD7QBjQ2bdfnX0ElmJ7IyxJM5XFg2Ln8=",
"linux-s390x": "sha256-2t1GhB0N1ENIJr/qV10V7MYj4vhjiqh/oVt2UNPuQIM=",
},
"v1.11.0": {
"darwin-amd64": "sha256-auoeNXQYt0fSiAxksXo2qUo1ydnlYfmHb7vKx/V4wfk=",
"darwin-arm64": "sha256-/qQi3o9e9WoScMWot8If+p4BEyw3mNUMi/6tWAtEhLg=",
"linux-amd64": "sha256-4gUlP9NKAQcIRTa7AwtzwcUjDAOsGvKTG0DytAtD9tc=",
"linux-arm": "sha256-gaJ+f627xRox904DVDGAiHaJI9Gj8QdhR4XBx7CtTww=",
"linux-arm64": "sha256-F44eZhCuiOfrxDeUbg+gEoKnRQZXCez5P5u42LtTSGo=",
"linux-ppc64le": "sha256-TTHNfz1l7IDxkZhsh/L3K+Fs+4CJ/PNVEtCXSnxP8/I=",
"linux-s390x": "sha256-Dwzf+lCRxjuau8wfOh4KeRmo/RDyNctL7HA0GukarFs=",
},
"v1.10.1": {
"darwin-amd64": "sha256-4qlPR4UqhrTryX35avHBjn3sHLhGJQeEzzgNXaaSRQI=",
"darwin-arm64": "sha256-AtYW5JnHE9w5GuYTZkpVjiFZg4ENSsCn0pJWfjUSwFc=",
"linux-amd64": "sha256-7W9uueG6kTL2Nvxi5NKhcd23ZD3HEToA90YUqvylOio=",
"linux-arm": "sha256-/+iA6ofnDoHIiwEZBLt0zHJQK74Vl+QM4R/n5e5KJUc=",
"linux-arm64": "sha256-2e6ieAAIjAQ3kGXVzl8yWjsjlMCHJfN5uz7S44NGxLU=",
"linux-ppc64le": "sha256-F2BQasOquIFC3AdI/4QEdGsMzMcUVFBkuygsrPgkkVY=",
"linux-s390x": "sha256-H1ExS/4o5ijIjHgG6ukSustrGGY1Yf0Xh1z8cyGhPnU=",
},
"v1.10.0": {
"darwin-amd64": "sha256-Sc85DL+84gR/Ejp3k89KjNDTKmul0mD6DjKC6ipmPig=",
"darwin-arm64": "sha256-avS/oR4+f81aKjoQgaUBrLdcwrt6PS3DgasaqgbRGYI=",
"linux-amd64": "sha256-H1CCW7IHCYqdrCPDQhUeRB3Amlk9dwfBcquxFwGs5As=",
"linux-arm": "sha256-TPSh1962gbgf/RZJJnedhe291woiTzzp65ylR3E4+Gs=",
"linux-arm64": "sha256-47QlRDEMDLdIPDXc4ZpQPmjmK1HfEf80FFGuH0GAI60=",
"linux-ppc64le": "sha256-AHBPeQHXEgVnPCLOEtIx+SZ4MrVDNB9rGwRukrg21q8=",
"linux-s390x": "sha256-wceGyzRQxOwpkWf+3R63Bay1/i19WTj2BNQ5IoFFHQw=",
},
"v1.9.0": {
"darwin-amd64": "sha256-hKYDUD+EPuDqGzlNaFwiGxkpCarMkxLQWnCbD6sYS0c=",
"darwin-arm64": "sha256-bYG4B7hHv/FFRXO8jd/buVtN8t+7zFv5HpPNUmqffZM=",
"linux-amd64": "sha256-R+JZajjmGbcuc2/Rce7qra9r0i1uh6dnszkWioe2J2E=",
"linux-arm": "sha256-U0EMH0Ct7ZURtVEgRHkLRUtM32gjO+7kkIKGi3XnjFs=",
"linux-arm64": "sha256-q9fsEW3X55gPCOZ9LHR4rhzcl633eK/3bYpzepCGcNg=",
"linux-ppc64le": "sha256-EHTPWtyhMr0v9PNUr7EwONm7sjonJ5Ew/QFDfx7/qkU=",
"linux-s390x": "sha256-flxzTWT/1oR5/ZChWlU1jiO1MSOLLP/njalTQNIEFXw=",
},
"v1.8.0": {
"darwin-amd64": "sha256-eOoLu72FHH57QHx7eExYV3Cb5eaAvne0SzLX5xZpW0E=",
"darwin-arm64": "sha256-UOFRriQuZjtRqhCanXSEnz4jWot9Myk/uA14T/zrgH8=",
"linux-amd64": "sha256-VoKtWgJipLUYg8dtITTwNvLFrAsePujze3ikXiluCfY=",
"linux-arm": "sha256-NQT1/1fciuulCKluJhj4AK83nTcKTIbWJsXWn/W1Ijc=",
"linux-arm64": "sha256-KF2oAUPIRIO+6SRx8ls28DENfihoh0HTfO7sUyFKGDs=",
"linux-ppc64le": "sha256-8uAj3wGKj+ifMEhFETqElelazFNYH+qNKdTTFG+CWkk=",
"linux-s390x": "sha256-LIMs/929Nj2elqkF1nHSndFsTaPOWfL2zLpQ2Cxt/5g=",
},
"v1.7.2": {
"darwin-amd64": "sha256-+rjyxPhwWkxP0syXhWIT4dC4bVsXB6Oe3EYrmwWv5/s=",
"darwin-arm64": "sha256-baurwAAaaV8DqlqXEnANfuF2M3XF6X/CVE8RqI6+nVs=",
"linux-amd64": "sha256-gPgPPvW53tkqo5qd2OAo9blCo7aWTyTEezXn9uTRiQc=",
"linux-arm": "sha256-dt1mavOjFi/i0a19XupQ8cBMu61laNzVUpo37fZUpy0=",
"linux-arm64": "sha256-JEgjHmveE3IqrXoXrAB4nRh2FaJMf4JzknPqWJpCyUs=",
"linux-ppc64le": "sha256-n/5GS5JMY6kaAniKKRJi1zeqObOmlKEUTaV64YEzkzg=",
"linux-s390x": "sha256-qoH/IFpT+cBzFs/BKTTWyFI/eIJ9fLBLnEX7VTGY7Vk=",
},
"v1.7.1": {
"darwin-amd64": "sha256-+bWYpcf1cfHM/RaK6pDBAi3FP07pmX9tWKqfOw2wSn8=",
"darwin-arm64": "sha256-skJ5mLQ8PbPddzsSf0/BfjxVNT0MasSkw/3/kwnOkS8=",
"linux-amd64": "sha256-LtRgzMG6RPEO+YwZyv3a1bUZllnIo15LmyBAASrhsjU=",
"linux-arm": "sha256-3J1vJ3aTPPGRPqrlOtrRSsRIrAoJaQxJexA0qTUiL2U=",
"linux-arm64": "sha256-HK8mbPJ4JeoQCBNjdG4DS28k2g44R11N2tcWLsvSBp0=",
"linux-ppc64le": "sha256-VnS+/m9a26PsKKg1EvLCqY179LSjztLs206f92ujAg8=",
"linux-s390x": "sha256-zlxvEbW2ipWzYbPg5T0PenE21G3QpEq36Skb/isNE9Q=",
},
"v1.6.0": {
"darwin-amd64": "sha256-/P8XqU+4pQmMm5tiPi4ZDMTTxHxPXo2/dbcqVqh0shk=",
"darwin-arm64": "sha256-5Z+0mjzAOtu4Hb0vXNYgb+CUec27dCbN0bIqr5FFu7w=",
Expand All @@ -10,4 +127,13 @@ COSIGN_VERSIONS = {
"linux-ppc64le": "sha256-Do6Fc7PUfxpAhvocpDTjpq1LZUs8AIaYIQYnmH7gPMw=",
"linux-s390x": "sha256-53+ZFZljoXRuvYGoGaxfgb2oJyUGCqesr8PbTXRnb68=",
},
"v1.5.2": {
"darwin-amd64": "sha256-mRw/lh+QGux1pAaKwsMEa9WrNtAMum3b8jG10BI8g78=",
"darwin-arm64": "sha256-1s61I1i2ngLdwhlNR89Vh+jEiFqqC527mPCQJBCtwq4=",
"linux-amd64": "sha256-CAwLoQZ00pCfs7S4Z7ECrvoCGVnt8mlsjMG6COgkvMs=",
"linux-arm": "sha256-BS/Bg/XxFJhPIpLq06PeqIgG1bjJauZXDFOKot3LZvw=",
"linux-arm64": "sha256-m3VRqHHxS0wninhXwsx9k2a5Iu2aTHM4f1B6slz+xGM=",
"linux-ppc64le": "sha256-LgXoy/PZdCXQfGDZwcyRCggGqY5PPFIALyGwLICqRpM=",
"linux-s390x": "sha256-VSLn82b7h1qtOPox6cw5sGwJTZxX1WJ8MEadC/oBN5Y=",
},
}
3 changes: 3 additions & 0 deletions examples/sign/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sh_test(
name = "test",
srcs = ["test.bash"],
args = [
"$(JQ_BIN)",
"$(CRANE_BIN)",
"$(COSIGN_BIN)",
"$(LAUNCHER_WRAPPER)",
Expand All @@ -38,6 +39,7 @@ sh_test(
data = [
":image",
":sign",
"@jq_toolchains//:resolved_toolchain",
"@oci_cosign_toolchains//:current_toolchain",
"@oci_crane_toolchains//:current_toolchain",
"@oci_zot_toolchains//:current_toolchain",
Expand All @@ -46,5 +48,6 @@ sh_test(
"@oci_zot_toolchains//:current_toolchain",
"@oci_cosign_toolchains//:current_toolchain",
"@oci_crane_toolchains//:current_toolchain",
"@jq_toolchains//:resolved_toolchain",
],
)
20 changes: 13 additions & 7 deletions examples/sign/test.bash
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
#!/usr/bin/env bash
set -o pipefail -o errexit -o nounset

readonly CRANE="${1/external\//../}"
readonly COSIGN="${2/external\//../}"
readonly REGISTRY_LAUNCHER="${3/external\//../}"
readonly IMAGE_SIGNER="$4"
readonly IMAGE="$5"
export HOME="$TEST_TMPDIR"

readonly JQ="${1/external\//../}"
readonly CRANE="${2/external\//../}"
readonly COSIGN="${3/external\//../}"
readonly REGISTRY_LAUNCHER="${4/external\//../}"
readonly IMAGE_SIGNER="$5"
readonly IMAGE="$6"

# Launch a registry instance at a random port
source "${REGISTRY_LAUNCHER}"
REGISTRY=$(start_registry $TEST_TMPDIR $TEST_TMPDIR/output.log)
echo "Registry is running at ${REGISTRY}"

readonly REPOSITORY="${REGISTRY}/local"
readonly DIGEST=$("$JQ" -r '.manifests[0].digest' "$IMAGE/index.json")

# TODO: make this test sign by digest once https://github.com/sigstore/cosign/issues/1905 is fixed.
"${CRANE}" push "${IMAGE}" "${REPOSITORY}@${DIGEST}"

# Create key-pair
COSIGN_PASSWORD=123 "${COSIGN}" generate-key-pair

# Sign the image at remote registry
COSIGN_PASSWORD=123 "${IMAGE_SIGNER}" --repository="${REPOSITORY}" --key=cosign.key

echo "y" | COSIGN_PASSWORD=123 "${IMAGE_SIGNER}" --repository="${REPOSITORY}" --key=cosign.key

# Now push the image
REF=$(mktemp)
Expand Down
25 changes: 12 additions & 13 deletions scripts/mirror_releases_cosign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
set -o errexit -o nounset -o pipefail

JQ_FILTER=\
'map(
{
"key": .tag_name,
"value": .assets
| map(select((.name | contains("cosign-")) and (.name | contains(".") | not) and (.name | contains("key") | not) ))
| map({
"key": .name,
"value": .browser_download_url
})
| from_entries
}
'map(select(.name | contains("-rc") | not)) | map(
{
"key": .tag_name,
"value": .assets
| map(select((.name | contains("cosign-")) and (.name | contains(".") | not) and (.name | contains("key") | not) ))
| map({
"key": .name,
"value": .browser_download_url
})
| from_entries
}
) | from_entries'

REPOSITORY=${1:-"sigstore/cosign"}


# We need v1.6.0 because of https://github.com/sigstore/cosign/pull/1616. remove once https://github.com/sigstore/cosign/pull/2288 lands
VERSIONS=$(curl --silent -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$REPOSITORY/releases?per_page=1&page=12" | jq "$JQ_FILTER")
VERSIONS=$(curl --silent -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$REPOSITORY/releases?per_page=20" | jq "$JQ_FILTER")


# Replace URLs with their hash
Expand Down