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

doc: update quick start for verifying using ts/tp #82

Merged
merged 7 commits into from
Nov 9, 2022

Conversation

yizha1
Copy link
Contributor

@yizha1 yizha1 commented Oct 31, 2022

Update quick start document for verifying using trust store and trust policy

Signed-off-by: Yi Zha [email protected]

@yizha1 yizha1 self-assigned this Oct 31, 2022
@netlify
Copy link

netlify bot commented Oct 31, 2022

Deploy Preview for notarydev failed.

Name Link
🔨 Latest commit 4e8df03
🔍 Latest deploy log https://app.netlify.com/sites/notarydev/deploys/6364f2849c61e5000cf36fc0

Copy link
Collaborator

@zr-msft zr-msft left a comment

Choose a reason for hiding this comment

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

blocked on errors to complete smoke test of the doc

@yizha1 yizha1 requested a review from zr-msft November 2, 2022 07:38
@yizha1 yizha1 requested review from FeynmanZhou and zr-msft and removed request for zr-msft November 2, 2022 07:39
dtzar
dtzar previously approved these changes Nov 2, 2022
Copy link
Contributor

@dtzar dtzar left a comment

Choose a reason for hiding this comment

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

Didn't test the workflow but looks good with just a couple suggestions.

"trustPolicies": [
{
"name": "wabbit-networks-images",
"registryScopes": [ "$REPO" ],

Choose a reason for hiding this comment

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

This should be explicit. Is it the registry? Is it the repo minus an image? Does someone have to specify this for every image they want to validate?

Choose a reason for hiding this comment

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

For what it's worth, with the current version I had to include the image specifically:

cat <<EOF > $HOME/.config/notation/trustpolicy.json
{
    "version": "1.0",
    "trustPolicies": [
        {
            "name": "upstream",
            "registryScopes": [ "upstream.azurecr.io/oss/fluxcd/flux" ],
            "signatureVerification": {
                "level" : "strict" 
            },
            "trustStores": [ "ca:trust" ],
            "trustedIdentities": [
                "*"
            ]
        }
    ]
}
EOF

If I omitted "flux" I ended up getting errors:

ERROR: artifact "upstream.azurecr.io/oss/fluxcd/flux@sha256:0f9ad5df470963f959bb3e0b7abe60e9b4011a636e566a06e883ed7b3812dbc4" has no applicable trust policy

Signature verification failed for all the 0 signatures associated with digest: sha256:0f9ad5df470963f959bb3e0b7abe60e9b4011a636e566a06e883ed7b3812dbc4

Error: artifact "upstream.azurecr.io/oss/fluxcd/flux@sha256:0f9ad5df470963f959bb3e0b7abe60e9b4011a636e566a06e883ed7b3812dbc4" has no applicable trust policy

You should allow wild cards here or something. From an end user perspective if I have to build a trust policy that includes every image I want to validate, that becomes an issue when I build any additional images and is a cumbersome experience.

Copy link
Contributor

Choose a reason for hiding this comment

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

upstream.azurecr.io/* should work and ["$REPOSITORY/*"] should be in the example

Choose a reason for hiding this comment

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

I’ll give that a try!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the spec, the repository URI MUST NOT contain the asterisk character *. You can just use ["*"] as a global scope for a quick start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the additional clarification. So in summary:

Option 1: Trust everything Option 2: enumerate every image you will verify?

@jeremyrickard , you can specify a repo, then all the artifacts under the repo will be verified against the policy. For example, you have images under repo localhost:5000/net-monitor

  • localhost:5000/net-monitor:v1
  • localhost:5000/net-monitor:v2
  • localhost:5000/net-monitor:v3

you just need to specify localhost:5000/net-monitor for registryScopes parameter.

Copy link
Contributor Author

@yizha1 yizha1 Nov 3, 2022

Choose a reason for hiding this comment

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

Copy link

@jeremyrickard jeremyrickard Nov 3, 2022

Choose a reason for hiding this comment

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

I was talking more about:

localhost:5000/my-service/microservice-1:v1
localhost:5000/my-service/microservice-2:v1
localhost:5000/my-service/microservice-3:v1
localhost:5000/my-service/microservice-4:v1

I would need to explicitly add those. It's fine that things are called out in that spec, but there should be a little more detail (imo) on the quick start about this. People are going to read this and if you expect them to click through to other pages for crucial information for anything more I think you'll lose people.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @jeremyrickard. Does the following configuration work for you? Or you think it is still too much to configure many repositories.

"registryScopes": [
              "localhost:5000/my-service/microservice-1",
              "localhost:5000/my-service/microservice-2",
              "localhost:5000/my-service/microservice-3",
              "localhost:5000/my-service/microservice-4"
            ],

Copy link
Contributor

Choose a reason for hiding this comment

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

@yizha1 - yes this is far too much work! We need to add a backlog item to support all images coming from a registry.

@yizha1 yizha1 requested review from dtzar, zr-msft and jeremyrickard and removed request for zr-msft November 3, 2022 03:37
@yizha1 yizha1 requested review from dtzar and removed request for jeremyrickard November 3, 2022 06:24

**IMPORTANT**: Self-signed certificates should be used for development purposes only and should not be used in production environments.

The following command generates a test key and a self-signed X.509 certificate under the `$HOME/.config/notation/localkeys` directory. The test key is set as a default signing key using `--default` flag. The self-signed certificate is added to a named trust store `wabbit-networks.io` of type `ca`.
Copy link
Member

@FeynmanZhou FeynmanZhou Nov 3, 2022

Choose a reason for hiding this comment

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

If we use $HOME/.config/notation/localkeys here, I suggest adding a prerequisite at the beginning of this doc to claiming that this Quick Start is using a Linux environment as an example. Since this path is different per OS.

Copy link
Member

Choose a reason for hiding this comment

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

We can also add an inner link to another document that introduces the path when it is merged into the website.

Copy link
Member

@FeynmanZhou FeynmanZhou left a comment

Choose a reason for hiding this comment

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

Please see my comments above. Thanks!

@yizha1 yizha1 requested review from priteshbandi, FeynmanZhou and zr-msft and removed request for zr-msft November 4, 2022 11:09
@dtzar dtzar merged commit cb0264f into notaryproject:main Nov 9, 2022
@chalin
Copy link
Collaborator

chalin commented Nov 9, 2022

The build for this PR was failing, but it was still merged so now the main production build is broken, see: https://app.netlify.com/sites/notarydev/deploys/636b1cd5300a5300084d80b4. That means, as you probably know, that the site won't deploy anymore until the build is fixed. /cc @nate-double-u

It seems that this PR has two broken links, that's why the build was failing.

@chalin
Copy link
Collaborator

chalin commented Nov 9, 2022

Generally, it's best to keep the production built free of errors, but our project's build policy might be different, in which case: apologies, and you can ignore my comments above.

@chalin chalin mentioned this pull request Nov 9, 2022
4 tasks
@zr-msft
Copy link
Collaborator

zr-msft commented Nov 10, 2022

I believe #92 fixed the build errors related to this PR

@chalin
Copy link
Collaborator

chalin commented Nov 10, 2022

@zr-msft: yes, great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants