Bound images are verified with the old deployment's policy

Open
#2,652 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust

Research direction

Start in crates/lib/src/boundimage.rs (lines 41-59) to see how bound images are read from the new deployment, then read crates/lib/src/podstorage.rs (lines 459-475) where the pull happens. Trace how the policy path is resolved there and why it still points at the booted system's /etc/containers/policy.json rather than the new deployment's. Done means the pull is given the new deployment's policy (as podman pull --signature-policy allows) and a test exercises an upgrade that adds and permits a bound image.

Written by the indexing model from the issue text.

Description

If you define a /etc/containers/policy.json in a bootc image, and update this policy in a new image, bootc upgrade will reads the bound images from the new deployment:

https://github.com/bootc-dev/bootc/blob/7cde7bbe233ee45a40cff3d89d4f42b68a258d46/crates/lib/src/boundimage.rs#L41-L59

but pulls them with the booted system's /etc/containers/policy.json:

https://github.com/bootc-dev/bootc/blob/7cde7bbe233ee45a40cff3d89d4f42b68a258d46/crates/lib/src/podstorage.rs#L459-L475

So an image that adds a bound image and allows it in its own policy.json can't be upgraded to:

Source image rejected: Running image docker://ghcr.io/example/app@sha256:… is rejected by policy.

Expected: use the new deployment's policy (podman pull --signature-policy).

bootc 1.17.1, same code in v1.17.4.

Dominant language
Rust
Stars
2.3k
Forks
230
Avg merge
2d 11h
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bootc-dev/bootc

All issues in bootc-dev/bootc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.