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

improve Key Management documentation following MarkdownLint - MD014 #218

Merged
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
6 changes: 3 additions & 3 deletions content/en/key_management/hardware-based-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
and the [go-piv](https://github.com/go-piv/piv-go) library, which is not included in the standard release. Use `make cosign-pivkey-pkcs11key`, or `go build -tags=pivkey,pkcs11key ./cmd/cosign`, to build `cosign` with support for hardware tokens.

---
**NOTE**

Check failure on line 13 in content/en/key_management/hardware-based-tokens.md

View workflow job for this annotation

GitHub Actions / markdownlint

Emphasis used instead of a heading

content/en/key_management/hardware-based-tokens.md:13 MD036/no-emphasis-as-heading/no-emphasis-as-header Emphasis used instead of a heading [Context: "NOTE"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md036.md

Cosign's hardware token support requires `libpcsclite` on platforms other than Windows and OSX.
See [`go-piv`'s installation instructions for your platform.](https://github.com/go-piv/piv-go#installation)
Expand All @@ -22,8 +22,8 @@
The following exmamples use this image:

```shell
$ IMAGE=gcr.io/user-vmtest2/demo
$ IMAGE_DIGEST=$IMAGE@sha256:410a07f17151ffffb513f942a01748dfdb921de915ea6427d61d60b0357c1dcd
IMAGE=gcr.io/user-vmtest2/demo
IMAGE_DIGEST=$IMAGE@sha256:410a07f17151ffffb513f942a01748dfdb921de915ea6427d61d60b0357c1dcd
```

## Quick Start
Expand Down Expand Up @@ -176,7 +176,7 @@
**WARNING**: These tests will destroy any keys on your device.

```shell
$ go test ./test -tags=resetyubikey,e2e -count=1
go test ./test -tags=resetyubikey,e2e -count=1
```

**WARNING**: These tests will destroy any keys on your device.
Expand Down
18 changes: 9 additions & 9 deletions content/en/key_management/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
For example:

```shell
$ cosign generate-key-pair --kms <some provider>://<some key>
cosign generate-key-pair --kms <some provider>://<some key>
```

The public key can be retrieved with:
Expand All @@ -38,8 +38,8 @@
For the following examples, we have:

```shell
$ IMAGE=gcr.io/user/demo
$ IMAGE_DIGEST=$IMAGE@sha256:410a07f17151ffffb513f942a01748dfdb921de915ea6427d61d60b0357c1dcd
IMAGE=gcr.io/user/demo
IMAGE_DIGEST=$IMAGE@sha256:410a07f17151ffffb513f942a01748dfdb921de915ea6427d61d60b0357c1dcd
```

To sign and verify using a key managed by a KMS provider, you can pass a provider-specific URI to the `--key` command:
Expand All @@ -62,8 +62,8 @@
You can also export the public key and verify against that file:

```shell
$ cosign public-key --key <some provider>://<some key> > kms.pub
$ cosign verify --key kms.pub $IMAGE_DIGEST
cosign public-key --key <some provider>://<some key> > kms.pub
cosign verify --key kms.pub $IMAGE_DIGEST
```

## Providers
Expand Down Expand Up @@ -115,7 +115,7 @@

GCP KMS keys can be used in `cosign` for signing and verification.

The URI format for GCP KMS is:

Check failure on line 118 in content/en/key_management/overview.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

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

```shell
gcpkms://projects/$PROJECT/locations/$LOCATION/keyRings/$KEYRING/cryptoKeys/$KEY/versions/$KEY_VERSION
Expand Down Expand Up @@ -211,13 +211,13 @@
After running it:

```shell
$ export VAULT_ADDR=http://localhost:8200
$ export VAULT_TOKEN=testtoken
$ vault secrets enable transit
export VAULT_ADDR=http://localhost:8200
export VAULT_TOKEN=testtoken
vault secrets enable transit
```

If you enabled `transit` secret engine at different path with the use of `-path` flag (i.e., `$ vault secrets enable -path="someotherpath" transit`), you can use `TRANSIT_SECRET_ENGINE_PATH` environment variable to specify this path while generating a key pair like the following:

```shell
$ TRANSIT_SECRET_ENGINE_PATH="someotherpath" cosign generate-key-pair --kms hashivault://testkey
TRANSIT_SECRET_ENGINE_PATH="someotherpath" cosign generate-key-pair --kms hashivault://testkey
```
4 changes: 2 additions & 2 deletions content/en/key_management/signing_with_self-managed_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
weight: 505
---

To generate a key pair in Cosign, run `cosign generate-key-pair`. You'll be interactively prompted to provide a password.
To generate a key pair in Cosign, run `cosign generate-key-pair`. You'll be interactively prompted to provide a password.

```shell
$ cosign generate-key-pair
Expand All @@ -15,7 +15,7 @@
Public key written to cosign.pub
```

Alternatively, you can use the `COSIGN_PASSWORD` environment variable to provide one.

Check failure on line 18 in content/en/key_management/signing_with_self-managed_keys.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/key_management/signing_with_self-managed_keys.md:18:86 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

*Note:* Cosign supports RSA, ECDSA, and ED25519 keys. For RSA, Cosign only supports RSA PKCS#1.5 padded keys.

Expand All @@ -24,7 +24,7 @@
To generate keys using a KMS provider, you can use the `cosign generate-key-pair` command with the `--kms` flag.

```shell
$ cosign generate-key-pair --kms <some provider>://<some key>
cosign generate-key-pair --kms <some provider>://<some key>
```

Read more about this in the [key management overview](/key_management/overview/).
Expand Down
Loading