Skip to content

Commit f09d8b7

Browse files
committed
image-rs: allow image when no signature rule covers
If the policy file has no rules for a specific image, the image should be allowed rather than raise an error. This is common when there is no default rules for the policy. Signed-off-by: Xynnn007 <[email protected]>
1 parent 1e4f2c5 commit f09d8b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

image-rs/src/signature/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ impl SignatureValidator {
139139
// Get the policy set that matches the image.
140140
let reqs = self.policy.requirements_for_image(&image);
141141
if reqs.is_empty() {
142-
bail!("List of verification policy requirements must not be empty");
142+
// Note that if no policy covers the image, the image is considered to be allowed.
143+
return Ok(());
143144
}
144145

145146
// The image must meet the requirements of each policy in the policy set.

0 commit comments

Comments
 (0)