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

Adding information on sigstore-go #345

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 11 additions & 0 deletions content/en/language_clients/go/_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
type: docs
title: "Go"
description: "Go Language Client"
lead: "Go Language Client"
date: 2024-10-06T08:49:15+00:00
lastmod: 2024-10-06T08:49:15+00:00
draft: false
images: []
weight: 60
---
73 changes: 73 additions & 0 deletions content/en/language_clients/go/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
type: docs
category: Go
title: Go Client Overview
weight: 5
---

[`sigstore-go`](https://pkg.go.dev/github.com/sigstore/sigstore-go) is the Go language client for Sigstore.

[Cosign](../../cosign/signing/overview.md) is a command line utility that is used to sign software artifacts and verify signatures using Sigstore and is also written in Go. `sigstore-go` is a lighter weight tool and boasts the following benefits:
hayleycd marked this conversation as resolved.
Show resolved Hide resolved

- Friendly API for integrating Go code with Sigstore
- Smaller dependency tree
- Focuses on newly specified data structures in [sigstore/protobuf-specs](https://github.com/sigstore/protobuf-specs)
- Perfect for simple signing and verififcation tasks

`sigstore-go` is currently in beta.

Check failure on line 17 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/language_clients/go/overview.md:17:36 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

## Features

- Signing and verification of [Sigstore bundles](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto)
- Verification of raw Sigstore signatures
- Signing and verifying with a Timestamp Authority (TSA)
- Online and offline signing and verifying with Rekor (Artifact Transparency Log)
- Structured verification results including certificate metadata
- TUF support
- Verification support for custom [trusted root](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_trustroot.proto)
- Basic CLI

## Installation

### Main CLI installation

`sigstore-go` requires Go 1.21 or greater. The package is tested with Go 1.23.

Check failure on line 34 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/language_clients/go/overview.md:34:79 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

To compile/install the CLI, clone [`sigstore-go`](https://github.com/sigstore/sigstore-go) and run.

Check failure on line 36 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/language_clients/go/overview.md:36:100 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 3] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

```console
make install
```

Check failure on line 40 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Fenced code blocks should be surrounded by blank lines

content/en/language_clients/go/overview.md:40 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md031.md
Alternatively, you can use `go run cmd/sigstore-go/main.go` to access the CLI, as show in the [example](#cli-example).

Check failure on line 41 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/language_clients/go/overview.md:41:119 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

## Example

### CLI example

The following is an example of using the sigstore-go CLI to verify a signature.

Check failure on line 47 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/language_clients/go/overview.md:47:80 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

```console
go run cmd/sigstore-go/main.go \
-artifact-digest 76176ffa33808b54602c7c35de5c6e9a4deb96066dba6533f50ac234f4f1f4c6b3527515dc17c06fbe2860030f410eee69ea20079bd3a2c6f3dcf3b329b10751 \
-artifact-digest-algorithm sha512 \
-expectedIssuer https://token.actions.githubusercontent.com \
-expectedSAN https://github.com/sigstore/sigstore-js/.github/workflows/release.yml@refs/heads/main \
examples/bundle-provenance.json
Verification successful!
{
"version": 20230823,
"statement": {
"_type": "https://in-toto.io/Statement/v0.1",
"predicateType": "https://slsa.dev/provenance/v0.2",
"subject": ...
},
...
}
```

Check failure on line 66 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Fenced code blocks should be surrounded by blank lines

content/en/language_clients/go/overview.md:66 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md031.md
### Additional examples

Check failure on line 67 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Headings should be surrounded by blank lines

content/en/language_clients/go/overview.md:67 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### Additional examples"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md022.md

Additional examples are available in the [project documentation](https://github.com/sigstore/sigstore-go#sigstore-go).

Check failure on line 69 in content/en/language_clients/go/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/language_clients/go/overview.md:69:119 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

- [Signing example](https://github.com/sigstore/sigstore-go/blob/main/docs/signing.md#examples)
- [Verifying example](https://github.com/sigstore/sigstore-go/blob/main/docs/verification.md#verification-using-sigstore-go)
- [OCI image verifying example](https://github.com/sigstore/sigstore-go/blob/main/docs/oci-image-verification.md#example-of-oci-image-verification-using-sigstore-go)
2 changes: 1 addition & 1 deletion content/en/language_clients/language_client_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Sigstore has clients for the following language ecosystems:
- [Ruby](https://github.com/sigstore/sigstore-ruby#sigstore)
- [JavaScript](https://github.com/sigstore/sigstore-js#sigstore-js---)
- [Java](https://github.com/sigstore/sigstore-java#sigstore-java)
- [Go](https://github.com/sigstore/sigstore-go#sigstore-go)
- [Go](../go/overview)

Language client documentation is hosted in the individual project repositories. Project summaries are currently being added to the main Sigstore documentation.
Loading