-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add security-opt, device, priviledged and bindmount to the buildah task #1530
base: main
Are you sure you want to change the base?
Conversation
I have no idea about how to test my changes by myself because I don't know how to build a buildah task container image, it uses the released one in the task definition. |
/ok-to-test |
You can use the tkn CLI tool:
Push it to your own quay.io namespace, make the repo public, use the task in your pipeline |
Would this change potentially allow users to do insecure things / something that would bypass the hermeticity of the build / break SBOM completeness? |
well...will there be enough information about what options were used that we can control it via enterprise contract policies? |
Those are all the options we need for bootc image right now
|
I believe so. Should we have the policies ready before we allow production use? |
9e9cc87
to
8091498
Compare
Yes, or else this will probably weaken the security of all other pipelines. Meaning, I think we should ensure the existing policies require sane values for new options before releasing the ability to configure those same new options. |
@shi2wei3 Is this going to eventually replace the ostree builder task we have now? |
For bootc image, I think we plan to use buildah task to replace rpm-ostree task, but I don't know if there are other projects whick still using it. xref: https://issues.redhat.com/browse/BIFROST-408 Cc: @cgwalters , please correct me if I'm wrong. |
8091498
to
7fa238a
Compare
Yes the goal is to drop the rpm-ostree task |
Yeah but I think we established that's true already in It'd make sense for this to be opt-in...and perhaps the high level flag should just be --enable-nested-containers (which would map to these underlying options). For example, |
@syedriko wdyt, could this feature work in
instead of the specific The GPU one?
…On Sun, Oct 27, 2024, 4:35 PM Colin Walters ***@***.***> wrote:
Would this change potentially allow users to do insecure things
Yeah but I think we established that's true already in
https://issues.redhat.com/browse/KFLUXBUGS-1499
It'd make sense for this to be opt-in...and perhaps the high level flag
should just be --enable-nested-containers (which would map to these
underlying options). For example, --device /dev/fuse is quite safe to
add, but *other* devices less so.
—
Reply to this email directly, view it on GitHub
<#1530 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4DQJ2QDNXOQLD57CBFSFTZ5VFCLAVCNFSM6AAAAABQRD7JIOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQGE3DMMZUGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It absolutely could. |
I need to re-work on this PR since it not works as expected during my test. |
7fa238a
to
c78511f
Compare
@cgwalters , sorry to bother, but the workflow in this konflux buildah task is different than directly run What I did in this PR will add With this PR, our bootc image build will return the following error message:
I checked from the log, these options has been passed to the podman run command which runs over ssh:
|
That Remember there's actually three levels of containerization going on AIUI:
And it's the 3rd level we're trying to enable. Isn't the outer |
d27f871
to
5cad861
Compare
Right, and it invokes
And I've already passed those options to
Sorry, I didn't get what you mean here, is the development work is not completed yet to support building bootc image from buildah with Containerfile?
The outer
I tried to reproduce this failure by simulate what konflux buildah task did in my local env, but without any luck, I got a different error, maybe that's because there are still some differences I didn't find out between my local environment and the konflux environment.
If you want to check the full debug output of my failed test, please find the link in the last pipeline job on MR 1446 in the downsteam rhel-bootc repo. |
This one definitely works, I use it often (usually with podman, not buildah but it should be the same in general). We can add a CI check that it works but hopefully of course this gets finished and every PR is our CI. |
I thought konflux was forcing on vfs? That may be a difference. |
@cgwalters I can reproduce the failure locally now with the following one-line command:
I tried to add
And I'm not sure if adding |
I think this is not really different from Which BTW ultimately we do want to productize in kube, so the flag eventually here would look like "the workspace can enable
The way this is working today with a default We may also be able to fix this by changing that inner containerfile to use |
as long as it is off by default and controlled by a parameter then we can allow it only in certain circumstances where it is needed and it should be acceptable. Anything that needs more permissions than the current OpenShift security context allows will need to be scheduled to a VM but bootc builds already are anyway. |
Yes. This relates to a larger picture point around why we haven't prioritized trying to lessen the privileges that the build requires - it's basically because anyone who is making bootc container images is going to want to boot it for testing - and that means a VM or bare metal. So in the end, that infrastructure (containers and VMs/metal) needs to be coupled and available. The reality is of course today the build and test infrastructure is wildly distinct; to the best of my knowledge the Konflux hardware provisioning and management is distinct from Testing Farm for example which is where a lot of the bootc tests run. |
Just FYI, the Checkton errors should go away if you rebase (it diffs the errors between main and your branch and tries to report only the new ones, which doesn't seem to work correctly if your branch is behind) |
I google it and found you answered it when Brian hit the similar issue, and it works when I test it locally, I've update the buildah task and test it in MR1446. |
Thanks for the remind, I'll rebase and update the changes when my test is pass. |
Heh yeah, totally forgot about that... |
5cad861
to
c81a518
Compare
Signed-off-by: Wei Shi <[email protected]>
c81a518
to
c221e33
Compare
Resolve https://issues.redhat.com/browse/BIFROST-475
To build bootc case image with buildah, we need additional options to be supported.
xref: https://gitlab.com/fedora/bootc/base-images/-/blob/main/Containerfile?ref_type=heads#L6