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

Baseline CLI reference for subsequent PRs on changes #171

Merged
merged 4 commits into from
Jul 1, 2022
Merged
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
233 changes: 233 additions & 0 deletions specs/notation-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
# Notation CLI

The following spec outlines the notation CLI.
The CLI commands are what's currently available in [notation v0.7.1-alpha.1](https://github.com/notaryproject/notation/releases/tag/v0.7.1-alpha.1). The CLI experience in alpha.1 does not represent the final user experience, and CLI commands may have breaking changes before RC release as the CLI experience is finalized.

## Table of Contents
- [notation](#notation)
- [sign](#sign): Signs artifacts
- [verify](#verify): Verifies OCI Artifacts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Sign command just says "Sign artifacts", and verifies says "Verifies OCI artifacts". Is that on purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just copy pasted what the cli currently has. So, yeah, bug that should be changed.
This PR is what exists to be modified.

- [push](#push): Push signature to remote
- [pull](#pull): Pull signatures from remote
- [list](#list): List signatures from remote
- [certificate](#certificate): Manage certificates used for verification
- [key](#key): Manage keys used for signing
- [cache](#cache): Manage signature cache
- [plugin](#plugin): Manage KMS plugins

## notation

```bash
notation help
NAME:
notation - Notation - Notary V2

USAGE:
notation [global options] command [command options] [arguments...]

VERSION:
0.0.0-SNAPSHOT-17c7607

AUTHOR:
CNCF Notary Project

COMMANDS:
sign Signs artifacts
verify Verifies OCI Artifacts
push Push signature to remote
pull Pull signatures from remote
list, ls List signatures from remote
certificate, cert Manage certificates used for verification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we decided to manage certificates using the trust policy defnition, should we drop
certificate and key

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also considering this usecase for local file with passpharse should we possibly have --passpharse as an option for sign. Are we planning to include sub command options for the CLI here?
notaryproject/roadmap#46

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to think through the initial experience and production experiences here.
What is the user experience to get started?
What is the user experience to add remote signed keys?
What is the user experience to add certs for verification?

Today, this can be accomplished with some straight-forward commands.
What will this experience look like in RC1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notation cert add is an alpha 1 command created before trust store and trust policy spec was finalized, and is not compatible with the spec. RC1 implements spec which uses trust store and trust policy instead of a global certificate list in config.json. This cert add command needs rename/changes along with possibly new commands to manage trust policy, which are currently not in scope for for RC1 release. RC1 is prioritizing core functionality, sign & verify commands, over usability of other features. We may update some other commands like key add or plugin list as part of ongoing work, but these are not blockers for RC1 release. Users can accomplish these scenarios by manually editing trust store, trust policy, config.json/signingkeys.json . We plan to add/update commands post RC1 and before GA release.

See examples here for how this needs to be configured for RC1 - trust store , trust policy.

key Manage keys used for signing
cache Manage signature cache
plugin Manage KMS plugins
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--help, -h show help (default: false)
--version, -v print the version (default: false)
```

## sign

```console
notation sign --help
NAME:
notation sign - Signs artifacts

USAGE:
notation sign [command options] <reference>

OPTIONS:
--key value, -k value signing key name
--key-file value signing key file
--cert-file value signing certificate file
--timestamp value, -t value timestamp the signed signature via the remote TSA
--expiry value, -e value expire duration (default: 0s)
--reference value, -r value original reference
--local, -l reference is a local file (default: false)
--output value, -o value write signature to a specific path
--push push after successful signing (default: true)
--push-reference value different remote to store signature
--username value, -u value username for generic remote access [$NOTATION_USERNAME]
--password value, -p value password for generic remote access [$NOTATION_PASSWORD]
--plain-http remote access via plain HTTP (default: false)
--media-type value specify the media type of the manifest read from file or stdin (default: "application/vnd.docker.distribution.manifest.v2+json")
--help, -h show help (default: false)
```

## verify

```console
notation verify --help
NAME:
notation verify - Verifies OCI Artifacts

USAGE:
notation verify [command options] <reference>

OPTIONS:
--signature value, -s value, -f value signature files (accepts multiple inputs)
--cert value, -c value certificate names for verification (accepts multiple inputs)
--cert-file value certificate files for verification (accepts multiple inputs)
--pull pull remote signatures before verification (default: true)
--local, -l reference is a local file (default: false)
--username value, -u value username for generic remote access [$NOTATION_USERNAME]
--password value, -p value password for generic remote access [$NOTATION_PASSWORD]
--plain-http remote access via plain HTTP (default: false)
--media-type value specify the media type of the manifest read from file or stdin (default: "application/vnd.docker.distribution.manifest.v2+json")
--help, -h show help (default: false)
```

## push

```console
notation push --help
NAME:
notation push - Push signature to remote

USAGE:
notation push [command options] <reference>

OPTIONS:
--signature value, -s value, -f value signature files (accepts multiple inputs)
--username value, -u value username for generic remote access [$NOTATION_USERNAME]
--password value, -p value password for generic remote access [$NOTATION_PASSWORD]
--plain-http remote access via plain HTTP (default: false)
--help, -h show help (default: false)
```

## pull

```console
notation pull --help
NAME:
notation pull - Pull signatures from remote

USAGE:
notation pull [command options] <reference>

OPTIONS:
--strict pull the signature without lookup the manifest (default: false)
--output value, -o value write signature to a specific path
--username value, -u value username for generic remote access [$NOTATION_USERNAME]
--password value, -p value password for generic remote access [$NOTATION_PASSWORD]
--plain-http remote access via plain HTTP (default: false)
--help, -h show help (default: false)
```

## list

```console
notation list --help
NAME:
notation list - List signatures from remote

USAGE:
notation list [command options] <reference>

OPTIONS:
--username value, -u value username for generic remote access [$NOTATION_USERNAME]
--password value, -p value password for generic remote access [$NOTATION_PASSWORD]
--plain-http remote access via plain HTTP (default: false)
--help, -h show help (default: false)
```

## certificate

```console
notation certificate --help
NAME:
notation certificate - Manage certificates used for verification

USAGE:
notation certificate command [command options] [arguments...]

COMMANDS:
add Add certificate to verification list
list, ls List certificates used for verification
remove, rm Remove certificate from the verification list
generate-test Generates a test RSA key and a corresponding self-signed certificate
help, h Shows a list of commands or help for one command

OPTIONS:
--help, -h show help (default: false)
```

## key

```console
notation key --help
NAME:
notation key - Manage keys used for signing

USAGE:
notation key command [command options] [arguments...]

COMMANDS:
add Add key to signing key list
update, set Update key in signing key list
list, ls List keys used for signing
remove, rm Remove key from signing key list
help, h Shows a list of commands or help for one command

OPTIONS:
--help, -h show help (default: false)
```
## cache

```console
notation cache --help
NAME:
notation cache - Manage signature cache

USAGE:
notation cache command [command options] [arguments...]

COMMANDS:
list, ls List signatures in cache
prune Prune signature from cache
remove, rm Remove signature from cache
help, h Shows a list of commands or help for one command

OPTIONS:
--help, -h show help (default: false)
```

## plugin

```console
notation plugin --help
NAME:
notation plugin - Manage plugins

USAGE:
notation plugin command [command options] [arguments...]

COMMANDS:
list List registered plugins
help, h Shows a list of commands or help for one command

OPTIONS:
--help, -h show help (default: false)
```