Skip to content

Conversation

akashsinghal
Copy link
Owner

@akashsinghal akashsinghal commented May 27, 2023

This is a very experimental and rudimentary ratify binary for the new image verifier containerd plugin proposal. It's purely used as POC.

Setup:

Use containerd version on main branch

Use a custom config.toml with contents:

version = 2

[plugins]
  [plugins."io.containerd.image-verifier.v1.bindir"]
    bin_dir = "/home/devuser/code/ratify/containerd-plugins"
    max_verifiers = 10
    per_verifier_timeout = "10s"

Start containerd:

sudo bin/containerd -c config.toml -l debug

Sample ctr command of image being blocked:

> sudo bin/ctr image pull --local=false wabbitnetworks.azurecr.io/test/notary-image:unsigned
ctr: rpc error: code = Unknown desc = image verifier bindir blocked pull of wabbitnetworks.azurecr.io/test/notary-image:unsigned with digest sha256:17490f904cf278d4314a1ccba407fc8fd00fb45303589b8cc7f5174ac35554f4 for reason: verifier ratify rejected image (exit code 1): {
  "isSuccess": false,
  "verifierReports": [
    {
      "subject": "wabbitnetworks.azurecr.io/test/notary-image:unsigned@sha256:17490f904cf278d4314a1ccba407fc8fd00fb45303589b8cc7f5174ac35554f4",
      "isSuccess": false,
      "message": "verification failed: no referrers found for this artifact"
    }
  ]
}

Sample ctr command of image passing verification:

> sudo bin/ctr image pull --local=false wabbitnetworks.azurecr.io/test/notary-image:signed

# Output from the containerd logs
DEBU[2023-05-27T00:36:52.223126601Z] Verifying image pull                          digest="sha256:8e3d01113285a0e4aa574da8eb9c0f112a1eb979d72f73399d7175ba3cdb1c1b" name="wabbitnetworks.azurecr.io/test/notary-image:signed" verifier=bindir
DEBU[2023-05-27T00:36:52.252267490Z] time="2023-05-27T00:36:52Z" level=info msg="Setting log level to info"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.252314489Z] warning: GOCOVERDIR not set, no coverage data emitted  image_verifier=ratify
DEBU[2023-05-27T00:36:52.252633187Z] time="2023-05-27T00:36:52Z" level=info msg="selected default auth provider: dockerConfig"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.278756698Z] time="2023-05-27T00:36:52Z" level=info msg="defaultPluginPath set to /home/devuser/.ratify/plugins"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.278918597Z] time="2023-05-27T00:36:52Z" level=info msg="selected policy provider: configPolicy"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.511484911Z] time="2023-05-27T00:36:52Z" level=info msg="Resolve of the image completed successfully the digest is sha256:8e3d01113285a0e4aa574da8eb9c0f112a1eb979d72f73399d7175ba3cdb1c1b"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.546894954Z] time="2023-05-27T00:36:52Z" level=info msg="1 notary verification certificates loaded from path '/home/devuser/code/ratify/notary.crt'"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.546933254Z] time="2023-05-27T00:36:52Z" level=warning msg="Invalid path '/home/devuser/.ratify/ratify-certs/notary/truststore' skipped, error lstat /home/devuser/.ratify/ratify-certs/notary/truststore: no such file or directory"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.546955753Z] time="2023-05-27T00:36:52Z" level=info msg="0 notary verification certificates loaded from path '/home/devuser/.ratify/ratify-certs/notary/truststore'"  image_verifier=ratify
DEBU[2023-05-27T00:36:52.552758811Z] Image verifier allowed pull                   digest="sha256:8e3d01113285a0e4aa574da8eb9c0f112a1eb979d72f73399d7175ba3cdb1c1b" name="wabbitnetworks.azurecr.io/test/notary-image:signed" ok=true reason="ratify => { \"isSuccess\": true, \"verifierReports\": [ { \"subject\": \"wabbitnetworks.azurecr.io/test/notary-image@sha256:8e3d01113285a0e4aa574da8eb9c0f112a1eb979d72f73399d7175ba3cdb1c1b\", \"isSuccess\": true, \"name\": \"notaryv2\", \"message\": \"signature verification success\", \"extensions\": { \"Issuer\": \"CN=wabbit-networks.io,O=Notary,L=Seattle,ST=WA,C=US\", \"SN\": \"CN=wabbit-networks.io,O=Notary,L=Seattle,ST=WA,C=US\" }, \"artifactType\": \"application/vnd.cncf.notary.signature\" } ] }\nratify verification succeeded" verifier=bindir

Note: if you have an existing containerd instance running, you may need to stop the service temporarily so the custom instance can use the same sock. I'm sure there are better ways to get around this but I just did this: sudo systemctl stop containerd.service

@akashsinghal akashsinghal changed the title basic ratify containerd plugin [prototype] feat: add ratify containerd plugin May 27, 2023
binbin-li and others added 27 commits April 9, 2024 04:59
Signed-off-by: Binbin Li <libinbin@microsoft.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@7afa10e...8450866)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
feat: add verifiers interface to wrap up operations on namespaced verifiers [multi-tenancy PR 2]
…_actions/codecov/codecov-action-4.3.0

chore: Bump codecov/codecov-action from 4.2.0 to 4.3.0
…project#1383)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…yproject#1394)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….17.11 (notaryproject#1393)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….1 to 1.5.2 (notaryproject#1392)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Binbin Li <libinbin@microsoft.com>
…ct#1391)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
notaryproject#1390)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
feat: merge from `staging` to `main`
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Binbin Li <libinbin@microsoft.com>
dependabot bot and others added 23 commits June 17, 2024 11:18
…#1577)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Yi Zha <yizha1@microsoft.com>
Signed-off-by: Susan Shi <huish@microsoft.com>
Co-authored-by: Binbin Li <libinbin@microsoft.com>
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Co-authored-by: Akash Singhal <akashsinghal@microsoft.com>
…9.2 (notaryproject#1575)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Akash Singhal <akashsinghal@microsoft.com>
Co-authored-by: huish@microsoft.com <huish@microsoft.com>
Signed-off-by: Susan Shi <huish@microsoft.com>
Bumps golang from `2eb85b8` to `b405b62`.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps alpine from `77726ef` to `b89d9c9`.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…docker/alpine-b89d9c93e9ed3597455c90a0b88a8bbb5cb7188438f70953fede212a0c4394e0

chore: Bump alpine from `77726ef` to `b89d9c9`
…docker/httpserver/golang-b405b62

chore: Bump golang from `2eb85b8` to `b405b62` in /httpserver
Signed-off-by: Juncheng Zhu <74894646+junczhu@users.noreply.github.com>
Co-authored-by: Binbin Li <libinbin@microsoft.com>
…21 (notaryproject#1586)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…notaryproject#1592)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….28.6 (notaryproject#1587)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1.17.22 (notaryproject#1594)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1.17.23 (notaryproject#1600)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…23 (notaryproject#1602)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Susan Shi <huish@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Susan Shi <huish@microsoft.com>
…ct#1598)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

9 participants