-
Notifications
You must be signed in to change notification settings - Fork 112
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
[RFC 0076] Export should set SID of files in windows layers #343
Comments
That looks great! TLDRI feel like there's a couple key questions to answer about this: Are we ok changing If not, should we explore trying allow a stack author to express express an SID as an integer (i.e. Separately, are we ok making If not, do we have alternative suggestions or architectural change ideas to support not-knowing a Background contextWe implemented a very minimal version based on groups instead of users in buildpacks/imgutil#47, which reads the The format of an SID is like
An SID can either refer to a user or a group, and any file/directory can have its For lifecycle's purposes, it will need to get the SID from the platform, interpolate it into a Security Descriptor Definition Language string, then convert that into a base64-encoded Raw Serial Descriptor PAX record for $sid = "S-1-5-93-2-2"
$sddlValue = "O:${sid}G:${sid}"
$sddl = (ConvertFrom-SddlString $sddlValue)
$sddlBytes = [byte[]]::New($sddl.RawDescriptor.BinaryLength)
$sddl.RawDescriptor.GetBinaryForm($sddlBytes, 0)
[Convert]::ToBase64String($sddlBytes)
# Output:
# AQAAgBQAAAAoAAAAAAAAAAAAAAABAwAAAAAABV0AAAACAAAAAgAAAAEDAAAAAAAFXQAAAAIAAAACAAAA The first tricky part might be how to express SIDs as ENV values for If we really wanted SIDs to be serialized as integers though, I did some searching around and couldn't find any de-facto examples or conventions for expressing SIDs as The second tricky part (though this may be and issue for platforms, not lifecycle) is enabling a stack author to know their But if a stack author didn't want to use those built-in users, and needed to create a user via a |
It seems like, given that the I wonder if the right long-term call here is to change the spec to accept As a stopgap maybe we should just apply generic docker |
Good call, I totally missed that PAXRecords are always initialized. That will break k8s Windows containers but Docker for Windows (on Win10 at least) won't care. I'll make an issue and PR to imgutil to always add I'd love to put an acceptance-level regression test somewhere to catch this type of error ... I'll start a discussion on the yet-to-be-created thread.
Yeah, giving the SID its own flag eventually makes sense. What do you think about At it's simplest could be (
Good call. I feel But could you elaborate on the proposed stopgap implementation? I feel like we could still translate them in imgutil and just be very binary about it:
FWIW, these are practically the same SDDLs added when running Would this be acceptable or were you thinking something else? |
Makes sense to me.
Yes, we could just set UID/GID to 0 or 1 and let The UID/GID -> SDDL translation in
To provide the best safety net I think we keep translating all non-0 UID/GID pairs to |
Apologies for the slow reply, was away on vacation last week.
Good call on just setting
That sounds fair and is close to the current By the time this is done though, I feel like most of the work involved in the end will be to:
Assuming that's true, is there a piece we want to iterate on before the spec approval? Maybe just pretend when when |
@micahyoung Sounds like a plan. I made a placeholder spec issue buildpacks/spec#129 for this. It seem like nothing proposed here is in danger of being impossible (?) and you are fairly confident about the desired UX, so we might want to get the spec PR up first and then we can simultaneously work on the implementation as the spec goes through the review/release process. |
After doing a bunch of experimenting on trying to convert
The closest non-Windows implementation I came across was the So while the SDDL->rawsd conversion doesn't seem feasible, I feel an SID->rawsd conversion may be much simpler. We can make a template SD for something like
But knowing this, would we ok with setting aside |
I put together a reference implementation that converts SID strings to So I'd feel fine spec/rfc'ing this out at this point, assuming |
RFC 0076
buildpacks/rfcs#133
-uid
and-gid
flags with-usid
and-gsid
flags for builds in windows environments02/17/2021 - Updated to reflect the result of the RFC above
The text was updated successfully, but these errors were encountered: