Skip to content

manual signing blob from github workflow #4706

@salrashid123

Description

@salrashid123

I'm trying to use cosign to manually sign-blob from within a github workflow using bazel:

the version of cosign in bazel v3.0.4/cosign-linux-amd64 and i want to do the signing entirely within the bazel target

Using a raw -key works but if i use the keyless, i'm not sure what i need to set in the -signing-config file.

I know why its not working now is because the signing-config i'm using points to sigstore as the provider.

Any pointers to what values should i use for github workflow?

genrule(
    name = "sign_binary",
    srcs = [":server_linux_amd64",":server_linux_arm64", "//certs:import-cosign.key","//certs:signing_config.json","//certs:signing_config.v0.2.json"],
    outs = ["server_linux_amd64.sig","server_linux_arm64.sig"],
    tools = ["@cosign_binary//file"],
    cmd = """
        ## using local cosign cert and key and no tlog upload
        export COSIGN_PASSWORD=""
        $(location @cosign_binary//file) sign-blob --key $(location //certs:import-cosign.key) --signing-config $(location //certs:signing_config.json) --bundle $(location server_linux_amd64.sig) $(location :server_linux_amd64)

        ## using keyless and upload
        #export COSIGN_EXPERIMENTAL=1
        #$(location @cosign_binary//file) sign-blob --yes --signing-config $(location //certs:signing_config.v0.2.json) --bundle $(location server_linux_amd64.sig) $(location :server_linux_amd64)
    """,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions