• Stars
    star
    107
  • Rank 317,036 (Top 7 %)
  • Language
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cosign Github Action

cosign-installer GitHub Action

This action enables you to sign and verify container images using cosign. cosign-installer verifies the integrity of the cosign release during installation.

For a quick start guide on the usage of cosign, please refer to https://github.com/sigstore/cosign#quick-start. For available cosign releases, see https://github.com/sigstore/cosign/releases.

Usage

This action currently supports GitHub-provided Linux, macOS and Windows runners (self-hosted runners may not work).

Add the following entry to your Github workflow YAML file:

uses: sigstore/[email protected]
with:
  cosign-release: 'v2.2.2' # optional

Example using a pinned version:

jobs:
  example:
    runs-on: ubuntu-latest

    permissions: {}

    name: Install Cosign
    steps:
      - name: Install Cosign
        uses: sigstore/[email protected]
        with:
          cosign-release: 'v2.2.2'
      - name: Check install!
        run: cosign version

Example using the default version:

jobs:
  example:
    runs-on: ubuntu-latest

    permissions: {}

    name: Install Cosign
    steps:
      - name: Install Cosign
        uses: sigstore/[email protected]
      - name: Check install!
        run: cosign version

If you want to install cosign from its main version by using 'go install' under the hood, you can set 'cosign-release' as 'main'. Once you did that, cosign will be installed via 'go install' which means that please ensure that go is installed.

Example of installing cosign via go install:

jobs:
  example:
    runs-on: ubuntu-latest

    permissions: {}

    name: Install Cosign via go install
    steps:
      - name: Install go
        uses: actions/setup-go@v4
        with:
          go-version: '1.21'
          check-latest: true
      - name: Install Cosign
        uses: sigstore/[email protected]
        with:
          cosign-release: main
      - name: Check install!
        run: cosign version

This action does not need any GitHub permission to run, however, if your workflow needs to update, create or perform any action against your repository, then you should change the scope of the permission appropriately.

For example, if you are using the gcr.io as your registry to push the images you will need to give the write permission to the packages scope.

Example of a simple workflow:

jobs:
  build-image:
    runs-on: ubuntu-latest

    permissions:
      contents: read
      packages: write
      id-token: write # needed for signing the images with GitHub OIDC Token

    name: build-image
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 1

      - name: Install Cosign
        uses: sigstore/[email protected]

      - name: Set up QEMU
        uses: docker/[email protected]

      - name: Set up Docker Buildx
        uses: docker/[email protected]

      - name: Login to GitHub Container Registry
        uses: docker/[email protected]
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - id: docker_meta
        uses: docker/[email protected]
        with:
          images: ghcr.io/sigstore/sample-honk
          tags: type=sha,format=long

      - name: Build and Push container images
        uses: docker/[email protected]
        id: build-and-push
        with:
          platforms: linux/amd64,linux/arm/v7,linux/arm64
          push: true
          tags: ${{ steps.docker_meta.outputs.tags }}

      # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
      - name: Sign image with a key
        run: |
          images=""
          for tag in ${TAGS}; do
            images+="${tag}@${DIGEST} "
          done
          cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${images}
        env:
          TAGS: ${{ steps.docker_meta.outputs.tags }}
          COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
          COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
          DIGEST: ${{ steps.build-and-push.outputs.digest }}

      - name: Sign the images with GitHub OIDC Token
        env:
          DIGEST: ${{ steps.build-and-push.outputs.digest }}
          TAGS: ${{ steps.docker_meta.outputs.tags }}
        run: |
          images=""
          for tag in ${TAGS}; do
            images+="${tag}@${DIGEST} "
          done
          cosign sign --yes ${images}

Optional Inputs

The following optional inputs:

Input Description
cosign-release cosign version to use instead of the default.
install-dir directory to place the cosign binary into instead of the default ($HOME/.cosign).
use-sudo set to true if install-dir location requires sudo privs. Defaults to false.

Security

Should you discover any security issues, please refer to Sigstore's security process

More Repositories

1

cosign

Code signing and transparency for containers and binaries
Go
4,135
star
2

gitsign

Keyless Git signing using Sigstore
Go
910
star
3

rekor

Software Supply Chain Transparency Log
Go
838
star
4

fulcio

Sigstore OIDC PKI
Go
609
star
5

sigstore

Common go library shared across sigstore services and clients
Go
435
star
6

sigstore-python

A Sigstore client for Python
Python
214
star
7

sigstore-rs

An experimental Rust crate for sigstore
Rust
156
star
8

sigstore-js

Code-signing for npm packages
TypeScript
149
star
9

policy-controller

Sigstore Policy Controller - an admission controller that can be used to enforce policy on a Kubernetes cluster based on verifiable supply-chain metadata from cosign
Go
120
star
10

model-transparency

Supply chain security for ML
Python
97
star
11

k8s-manifest-sigstore

kubectl plugin for signing Kubernetes manifest YAML files with sigstore
Go
77
star
12

root-signing

Go
77
star
13

cosign-gatekeeper-provider

๐Ÿ”ฎ โœˆ๏ธ to integrate OPA Gatekeeper's new ExternalData feature with cosign to determine whether the images are valid by verifying their signatures
Go
74
star
14

docs

Sigstore documentation
HTML
62
star
15

helm-charts

Helm charts for sigstore project
Smarty
61
star
16

helm-sigstore

Plugin for Helm to integrate the sigstore ecosystem
Go
57
star
17

scaffolding

Stuff to make standing up sigstore (esp. for testing) easier for e2e/integration testing.
HCL
55
star
18

timestamp-authority

RFC3161 Timestamp Authority
Go
53
star
19

gh-action-sigstore-python

A GitHub Action for sigstore-python
Python
44
star
20

community

General sigstore community repo
36
star
21

sigstore-go

Go library for Sigstore signing and verification
Go
34
star
22

sigstore-java

java clients for sigstore
Java
34
star
23

friends

Sigstore user stories
29
star
24

sigstore-website

Codebase for sigstore.dev
Vue
26
star
25

rekor-search-ui

Search Rekor for entries
TypeScript
23
star
26

protobuf-specs

Protocol Buffer specifications
Rust
21
star
27

rekor-monitor

Log monitor for Rekor to verify immutability and monitor entries
Go
21
star
28

sget

Go
21
star
29

rekor-operator

K8S Operator for Rekor
Go
20
star
30

sget-rs

sget is a keyless safe script retrieval and execution tool
Rust
18
star
31

sigstore-go-archived

Go library for Sigstore signing and verification
Go
16
star
32

sigstore-maven-plugin

sigstore maven plugin
Java
16
star
33

rekor-server

Cryptographic, immutable, append only software release ledger.
Go
11
star
34

rekorctl

Rekor swiss army knife
Go
9
star
35

ruby-sigstore

Rubygems sigstore signing plugin
Ruby
9
star
36

sigstore-git-verifier

A Github Action to verify that new commits are present in the sigstore transparency log.
Shell
8
star
37

TSC

sigstore Technical Steering Committee
7
star
38

sigstore-conformance

Conformance testing for Sigstore clients
Python
7
star
39

sigstore.github.io

Rekor website
Sass
7
star
40

sigstore-maven

sigstore maven plugin
Java
7
star
41

examples

Repository to store various monitors for upstream release sites
Python
6
star
42

sigstore-blog

Codebase for sigstore.dev
CSS
6
star
43

homebrew-tap

Sigstore Homebrew Tap
Ruby
5
star
44

sigstore-project-template

cookiecutter template for sigstore projects
5
star
45

sig-clients

Home of the clients SIG
5
star
46

github-sync

Pulumi GitHub Sync for sigstore
Go
4
star
47

sigstore-helm-operator

Helm based operator for the sigstore project
Smarty
4
star
48

sigstore-devops-tools

Tools & services used to help in the development flow of sigstore
Go
4
star
49

.github

Default community health files for the Sigstore organization.
4
star
50

sigstore-probers

Probers for sigstore infrastructure
Go
3
star
51

root-signing-staging

Staging TUF repository for Sigstore trust root
3
star
52

root-signing-practice

Root TUF Key Signing
Go
3
star
53

rekor-ansible

Ansible role to deploy the Rekor signature transparency log
2
star
54

sigstore-installer

1
star
55

fish-food

Lua
1
star
56

sig-public-good-operations

Home of the public good operations SIG
1
star