-
Notifications
You must be signed in to change notification settings - Fork 206
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] Allowed and protected file definitions within trusted parent folders #359
Comments
I don't think we should support such cases, allowed,protected,trusted subtrees should not overlap. |
Alternatively, we could make it work like mounts on Linux, but then we'd need to merge all of them into one list instead of three (to define the mounting order), which is probably not something we want to do. |
btw. What does "RFQ" mean? |
Can you elaborate on that? Do you see security issues?
Sorry, typo |
Yet another way of making the semantics explicit is to decide the order of precedence of these three lists. I think currently in our code we have the following order:
But I'm not sure about this order, and if this order is indeed enforced across all our SGX code. We never bothered to define exact semantics. Unifying the semantics of this ordering and explaining it in our documentation (https://gramine.readthedocs.io/en/latest/manifest-syntax.html#allowed-files -- somewhere around here) would be the easiest route. But I guess this is not very intuitive; and nobody reads our documentation anyway... Alternatively, I like @boryspoplawski's suggestion for Gramine to fail since it follows the principle of least surprise. Actually, @lead4good, do you have any particular use case that breaks because of this? Which of the proposed solutions would work for you, and which definitely wouldn't? |
Not really security issues, but let's say "unclear" semantics with nesting trusted and protected directories. Trusted files are by definition read-only pre-created files. What should happend if you try to create a file at path |
I do :)
My use case is very similar to GSC; there's no knowledge about a users application, so for improved compatibility in an initial step all existing files in a containerized application are added to the trusted files. A user might provide a list of additional protected files, and of this list, some of the files had been in the container while scanning trusted files. According to the order described above, this is no issue, some files have both trusted and protected attributes but the protected file attribute counts first. A user might provide a list of additional allowed files, and of this list, some of the files had been in the container while scanning trusted files. According to the order described above, this is an issue, some files have both trusted and allowed attributes but the allowed file attribute will be ignored.
I think it is very important to define an order. One for the case when a file is found during execution that has more then one of three attributes. The other case is expanding folders in I think the order that makes most sense from a user perspective is
Say we have defined the order Say we have defined the order |
Why do I think the |
Sorry, another typo in the title. |
Closing in favor if #371 |
The current expansion algorithm for trusted files does not take protected and allowed files into consideration.
Example
The current expansion algorithm will add both the protected folder
/mydirectory/secrets
as well as the allowed file/mydirectory/config/system.yaml
to the list of trusted files. As they are trusted files now, gramine will ignore their protected or allowed status (?) and hence the application will fail due to false configuration.Of course it depends on how we interpret the manifest syntax. My understanding would be, if I explicitly define something as protected or allowed then I want that to outweigh a parent directory defined as trusted.
The text was updated successfully, but these errors were encountered: