-
Notifications
You must be signed in to change notification settings - Fork 73
Rebase Buildpack Contributed Layers #333
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
base: main
Are you sure you want to change the base?
Conversation
|
Maintainers, As you review this RFC please queue up issues to be created using the following commands: Issues(none) |
|
This is great! One thing I was hoping for is the ability to rebase the launcher layer as well individual buildpack layers. What do you think of the revised config file below. {
"patches": {
"buildpacks": [
{
"buildpack": "heroku/nodejs",
"layer": "dist",
"data": {
"artifact.version": "24.7.*"
},
"patch-image": "registry.example.com/patches/nodejs:24.7.2",
"patch-image.mirrors": [
"backup-registry.example.com/patches/nodejs:24.7.2"
]
}
],
"launcher": {
"must-match-sha": [
"sha256:exampledigest1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"sha256:exampledigest2234567890abcdef1234567890abcdef1234567890abcdef1234567890"
],
"patch-image": "registry.example.com/patches/nodejs:24.7.2",
"patch-image.mirrors": [
"backup-registry.example.com/patches/nodejs:24.7.2"
]
}
}
}The same I know that users can specify different lifecycle images at build time, or use different builders with different lifecycle versions. The At present it looks like the only metadata stored for |
|
I think for many languages swapping out any runtime layer might be too high of a risk, even if it "should" work 90% of the time. For example:
From our discussion on Salesforce Slack, it sounds like this feature is perhaps aimed at simpler use-cases than language runtimes - however, the RFC uses language runtimes for many of the examples, which makes it harder to understand the true use-cases/value this might offer. Would it be possible to swap the examples to something closer to what we think might be safe enough to use this feature with? Also, reading the RFC I can't tell exactly how the patches are advertised/distributed? (Due to the verbosity of the LLM generated text I had to skim rather than read fully, so I could have missed something) Specifically, I think it would be essential that users can run I'm also slightly concerned about how we explain this to users - I think for base image updates the "we replay the entire top of the image on a new base image" is slightly easier to explain and users are more likely to be ok with it. But a "we selectively patch some layers of your image depending on if the SHA256 matches some internal manifest you can't see or might not even know exists" will be potentially more confusing to them / leave them more red herrings when it comes to "my app stopped working, did your platform break my app" type support tickets? Lastly, it seems that best practices for production apps are moving towards methods that provide more determinism and predictable deploys, not less. For example best practices like:
...whereas this proposal seems aimed at making images more mutable / easier for changes to bypass the CI/CD process? |
|
After some comments and discussion with other stakeholders I believe there are a few things that this RFC should include.
Below is an example of what this might look like. The first option is a single boolean key/value called The (simplified) output below was taken from a test app built with the paketo azul-zulu buildpack and a custom buildpack.
If we try to rebase the image above, which has the required rebase-able metadata, then pack would allow rebasing without complaint. What if the user tries to rebase layers in an image that are missing rebase-able metadata? Since
I used I have mentioned a previous comment that rebasing the launcher layer is important for a platform/user that patching CVEs. Another reason I believe the launcher layer to be rebase-able through the same mechanism is that you could modify the sbom for all layers in a single operation. This would simplify implementation and the workflow for a platform/user that would use this feature for security patching. |
I agree that the current use case example may suggest swapping run times is a safe operation when it could actually be problematic depending on the language and other layers with packages. For me the initial use case for this RFC is security vulnerability fixes, which it does mention as a use case but is not the primary example. Perhaps using security patching as the primary example would be better.
The thing that is appealing about this RFC in its current form is that it is entirely up to the platform/user to generate their own patched images. As stated in the RFC, the patch image generation process would involve doing a If buildpack authors are responsible for creating and publishing "patch" images that are strictly intended for rebasing their own layers it will change the scope of this RFC and probably require changes to the spec to set the contracts for how these patch images should be built and consumed. While I am not against this discussion, I think it is outside the scope of what this RFC is addressing, which is an immediate need of allowing platforms/users to apply security fixes to rebase-able buildpacks-provided layers, as well as the launcher layer. In my opinion this feature would give platforms/users all they need for dealing with security fixes in layers without the need for buildpacks authors to worry about publishing patch images for specific layers. If that approach is important to folks, then I think that should be done in a subsequent RFC.
My previous comment, where I suggest updating the RFC to make it clear that the sbom will be updated for any layers that are rebased, should preserve provenance and integrity. Any platform/user using rebasing today is already mutating their images, but they are doing so in a controlled manner. If they have automated rebasing based on a schedule or some trigger then that becomes part of their CI/CD process. I see this as a tool in the CI/CD process that will remove the burden from development teams so they don't have to build new images/releases just to deal with CVEs caused by "buildpacks." |
|
@edmorley @jericop I took a first quick pass at some of the feedback. @edmorley what do you think about buildpacks having to set some metadata in the @edmorley or @jericop Do you have any suggestions on patch distribution? |
|
@edmorley can you take a peek at this again? |
|
Sorry for the delay in replying here.
I think there might have been a misunderstanding here. I'm not asking for buildpack authors to be able to control this process - it's fine if this is driven by the platform operators. However, IMO it's a big issue if it's hard for platform operators to distribute these patches. For example, if Heroku (as a platform operator), creates a patches file that covers a bunch of security fixes across its official language buildpacks, it wouldn't be ideal if this patches file only existed internally in Heroku's build/rebase system - since then someone performing a
Yeah I think this might be safest (making it that the buildpack author has to opt into it, unless
Hmm I'm not really sure. Off the top of my head it seems we can either distribute the patches via an OCI image/layer (even as part of the builder, as you say) or via a file download. And as for where to obtain the location URI of those, we could either embed something in the app image at build time (eg the builder has a patches URI), or require that the user provide it at |
|
@joeybrown-sf - Your recent exploration of artifact hub got us wondering if there is something that might make sense to lean on for a platform like |
|
After Thursday's discussion last week - I'm going to update this RFC to be gated by experimental so that we can kick the tires but not be beholden to the this first design. @edmorley / @jericop what do you think about buildpacks being the one to publish metadata keys in the buildpack.toml or something for their patch distribution file or registry? I'm thinking about a case where an end user is using |
Yeah that could work :-) |
Added details about the experimental feature for rebase to accept a metadata file for buildpack-contributed layers. Included a section on potential buildpack patch distribution and provided an example in TOML format. Signed-off-by: Jesse Brown <jabrown85@gmail.com>
Rendered