add example to test registry - #107
Conversation
4357fbb to
1ba5a54
Compare
anderseknert
left a comment
There was a problem hiding this comment.
Nice! One issue to address, but besides that, awesome!
|
|
||
| allowed_registries := [ | ||
| "public.ecr.aws/", | ||
| "busybox", |
There was a problem hiding this comment.
This too should have a trailing /, or else there's always the risk that someone registers busyboxevilhacker and we'll consider it a an allowed registry.
There was a problem hiding this comment.
Since docker allows "busybox" as image I tested some more and changed the policy to allow if the image matches explicitly or has registry prefix.
@anderseknert do you think this is a ok solution, or do you have any tips on a better one? :) Thanks
There was a problem hiding this comment.
That's just Docker benefiting themselves by having "no registry in the image string" mean their registry, i.e. docker.io. I would probably do something like this:
image := input.Body.Image if {
contains(input.Body.Image, "/")
} else := concat("/", ["docker.io", input.Body.Image])And then using image everywhere in place of input.Body.Image you can work with the same logic for docker.io as any other registry in your policy (meaning it would have to be included in allowed_registries).
Let me know if I missed any details :)
f83e8b2 to
e2fae5c
Compare
Signed-off-by: Lars Haugan <lars.haugan@sparebank1.no>
e2fae5c to
d3f944b
Compare
add example of how to test image registries.
fixes #93