viewprinting: what format should views be stored in?
Hans and George,
I've been lurking at the edge of this discussion and have not chimed in mostly because I only have a dial-up connection here at my in-laws house (and I'm suposed to be on vacation). Since there was a request for arguments for or against Hans's preferred approach, I thought I'd add my $0.02.
In order to put everything into perspective as well as to provide context for some questions, I attempted to distill concrete items or decisions from the last several days' exchanges.
As to arguments For or Against;
For
If you only have three months to prove a concept and obtain continued funding, then I agree with Hans's preference for reusing as much existing work as possible. Adapting Hans's statement regarding [in]compatibility, "...if we [write new code] we should do so only if it is sufficiently worthwhile."
Against
I can think of none at this point, given my understanding of the features.
Project
----------------------------------------------------------------------
Demonstrate process-oriented filesystem viewprinting that scales to filesystems (and masks) containing millions of files. Provide exec-time mask application as well as tools for automating mask creation and maintenance.
Definitions
---------------------------------------------------------------------
Process-Oriented
Specifications of filesystem object visibility are applied to processes regardless of the effective user rights with which the process runs.
Mask (or viewprint)
A specification as to which files are visible to process[es] "running under" the mask. The [file] security underlying the mask remains a user/object/permission mapping. If a mask a) does not include a file or b) explicitly filters out acess, the file operation ceases and an error is returned. If the file upon which the process wants to operate is not filtered by the mask, then the operation request is passed on to the underlying filesystem. There, the requested file
a) might not exist, b) might exist but not be visible/readable by the user running the process, etc.
Fall-Through Point
The point during some file operation at which it is determined that the file is not filtered by the mask. The request [for operation X on the file] is passed on to the VFS/underlying filesystem.
Features & Performance (Qualitative/Soft)
----------------------------------------------------------------------
It is...our task to ensure that creating a correct mask is well automated and easy.
We do process oriented security, and that is all for now. The underlying [file] security remains a user/object/permission mapping.
We need to be able to determine in insignificant time whether a file "passes through" a mask consisting of a million filenames.
..if we must break an existing program we should do so only with care and only if it is sufficiently worthwhile to do so.
Features & Performance (Quantitative/Hard)
----------------------------------------------------------------------
Masks
- must support dirname/*
- do not [yet] need to support dirname/foo.*
- should not allow symbolic link traversal unless the file pointed to is within the mask.
- (by extension) should not allow hard links unless the file pointed to is within the mask.
Hans's Initial Considerations & Design Proposal
----------------------------------------------------------------------
[The solution] must be treelike in its performance scalability.
It is very important that we have something simple that reuses code for this purpose. The big issue to decide at the start is, should a view specification be implemented with a format that is as if it is a subdirectory of the masked executable, and which we then take the filenames used by the executable and traverse the subdirectory as though it was root, and if we reach a valid fall through point, then allow [us to] traverse from the real filesystem root, and if not, we issue a suitable error.
This would let us use all the existing semantic tree traversal code. It would, however, require us to add such plugins as "fall through points", and "prints", etc. I think the answer is yes, we want to do it this way. Please come up with arguments for and against it.
Questions
----------------------------------------------------------------------
Handwaving for a moment over view creation and storage particulars, it is pretty clear that this new security feature will rely upon reiser4 for masking. Does this mean that one will only be able to mask a reiser4 filesystem, or will any VFS fs be "maskable?"
All file types and access methods will be supported, yes? (mmap, AIO, DIRECT, pipes, hard/sym links, etc.)
In the original proposal posted to the list Hans (I think) referred to viewprinting as "chroot on steroids." Let's assume that the mask creation tools deliver on making viewprint creation and maintainance very easy/painless for admins. In what way will viewprinting be more secure than chroot?
If I understand the ways admins use chroot, or would like to use it, then should the design include "stackable" or "inheritable" masks? This is not unlike stackable filesystems or filter pipelines. If, for instance, most processes need to see /usr/local/lib/* and /usr/local/bin/*, then this spec is in a 'base' mask and the mask for /usr/local/bin/fooprocess would inhert from and add to this base specification.
Early on in the conversation, there was discussion about "permissible functionality." At a minimum, a mask, true to its name, will effect filesystem object _visibility_. It was not completely clear whether the mask will be proscriptive viz operations. IOW, will the mask say that fooprocess "is not permitted to [attempt to] RWX object bar?" I believe this is not something masks will do, but I wanted clarification.
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have in mind checking for something like /usr/bin/fooprocess/metas/mask when exec() loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?
Are masks capable of explicit exclusion as well as inclusion? If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.
I wonder if it would be feasible if masks only specified
exclusions? If, for instance, the mask wanted to exclude /foo/*,
then the directory foo would exist (in the mask semantic tree).
To exclude /etc/passwd, passwd would exist in the directory /etc.
Since you're already going to need to preempt dcache searches
(aren't you?) you can insert a search of the mask tree. If the
search fails, then it is not excluded and the request falls through
to normal VFS handling. In the /etc/passwd case above, it would find/etc/passwd and so the file is excluded. Processing would stop there, returning some error. How does this sound? I need to sleep on this, because it is very late here.
David
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David Dabbs wrote:
| If you only have three months to prove a concept and obtain continued | funding, then I agree with Hans's preference for reusing as much | existing work as possible. Adapting Hans's statement regarding
I've also been lurking and not reading too much, but here's my thought:
It is far more important to create code which can easily be re-used in the future than to re-use code that you have now.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iQIVAwUBQSOh8ngHNmZLgCUhAQKGGBAAhIOpJGCU2qcknOIjJ1qUdYEVOoqUIi8R 85G4WzVbJm/q73N/gaIhvyYfpRz6dvLdcfLoLkg2NbYcOfL7g54TrmKzEF6wsbQb 9SVE6zkrffqlclDUV7vkaIv1ZtipMDhbpWqLXM0UNiGvyNq1ltVazOQxdI9ptmC6 f9xj/EkwWT35PDddTLk8pEp0wa1D3WhBc+IjFPKplSD/eoHwfypAU/Hfbcrj80F7 wNdgEv9/kYUcgRqCoZcCoEODoBgiol5hcbVg44RdAyQVUhqJHV0rOqmZJ3llLQBR EEnoqLTdPgmF8OnZUJ6GRfgKIeQsXy0OQ4Dl4r8YbxbanAaUSdMEacKclgyY7GeX Y72/XiEr6WR4SumdckgHdTkMlwxJPndUeUC4L2f/ZpK+f7A3PAU6IjguxSy7vHU7 2LffTf8xkGegR9hwlgDwRFuyyZTaYqRqU/5h04lheUFhu5E43gI/N3NsR9+gkDdc IXEW1n+UCMgUrxLW+9VnvujOruDHDkrjDUgEBENBQOmksJfq1nc6o48jbWtOjnVD Wp1nD6CIGdcmGLXIXhKXZYwLKNrrGFVPd9xwQRjmuTU0DtoYBCA7t6ezyhzGcQYs UtEtGaDJXiiYZCL9sXwjrwx3Pag06Zc12icqlPSfddiSufQeesokEG7hiD2kP2G0 2SURGS8gjhs=
=AXNc
-----END PGP SIGNATURE-----
Quoted 11 lines · David Masover
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1David Dabbs wrote:
| If you only have three months to prove a concept and obtain continued | funding, then I agree with Hans's preference for reusing as much | existing work as possible. Adapting Hans's statement regardingI've also been lurking and not reading too much, but here's my thought:
It is far more important to create code which can easily be re-used in the future than to re-use code that you have now.
Point taken, but based on my initial reading I think that there is more to be saved and than redone to improve the re-use of the existing code.
Thanks for joining the discussion. I have answered your questions as best I can for the moment---which in fact has been to make some further points and encourage you and others to ask more questions and make more suggestions :-)
Quoted 7 lines · David Dabbs
Questions
----------------------------------------------------------------------
Handwaving for a moment over view creation and storage particulars, it
is pretty clear that this new security feature will rely upon reiser4 for masking. Does this mean that one will only be able to mask a reiser4 filesystem, or will any VFS fs be "maskable?"
As a proof of concept reiser4---although I think that the ability to work with multiple reiser4 mounted filesystems is relevant and important.
Quoted 3 lines
All file types and access methods will be supported, yes? (mmap, AIO, DIRECT, pipes, hard/sym links, etc.)
That is the plot. Again, we are taking the point of view that the proof of concept does not need to be complete; links however are included.
Quoted 3 lines
In the original proposal posted to the list Hans (I think) referred to viewprinting as "chroot on steroids." Let's assume that the mask creation tools deliver on making viewprint creation and maintainance very easy/painless for admins. In what way will viewprinting be more secure than chroot?
Basically, chroot as I at least normally use it, has a lot of baggage in terms of disk consumption that we are planning to avoid by creating a view rather than a copy. Second, users always interact with a system via executables so normally the executables have taken on the security attributes of the user (set-UID being the major exception on Unix) but, to some extent, we are developing a new semantic.
While views for DBMS, ClearCase, etc. have been around for a long time attaching access lists to process seems to be semi-virgin territory, at least for Unix systems.
Any and all pointers to references to prove me wrong appreciated :-)
Quoted 3 lines
If I understand the ways admins use chroot, or would like to use it, then should the design include "stackable" or "inheritable" masks? This is not unlike stackable filesystems or filter pipelines. If, for instance, most processes need to see
/usr/local/lib/*and/usr/local/bin/*, then this spec is in a 'base' mask and the mask for/usr/local/bin/fooprocesswould inhert from and add to this base specification.
Something like this had occurred to me, but I think that for a proof of concept having the tools that assist the user in creating the mask make it easy to include these but have each actual mask on disk be a standalone entity is the way to go.
I think that inherited masks from a parent process are a much stronger requirement---think about restricted shell.
All questions which keep me from wasting time on an overly simplistic approach welcome :-)
Quoted 3 lines
Early on in the conversation, there was discussion about "permissible functionality." At a minimum, a mask, true to its name, will effect filesystem object _visibility_. It was not completely clear whether the mask will be proscriptive viz operations. IOW, will the mask say that fooprocess "is not permitted to [attempt to] RWX object bar?" I believe this is not something masks will do, but I wanted clarification.
The attempt will be blocked with a suitable error return from the system call, it is the responsibility of the mask administrator to get this right.
There are many interesting application correctness and/or mask correctness questions which will need a lot more thought to bring to fruition.
Quoted 7 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have
in mind checking for something like/usr/bin/fooprocess/metas/maskwhenexec()loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?Are masks capable of explicit exclusion as well as inclusion?
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.
I think the correct answer is "anything not explicitly included is excluded" or on the other side of the looking glass "anything not explicitly excluded is included".
As a user friendly interface both should be supported and the "compilation" layer handle the conversion.
Maybe I am not understanding the question.
Quoted 3 lines
I wonder if it would be feasible if masks only specified exclusions? If, for instance, the mask wanted to exclude /foo/*, then the directory foo would exist (in the mask semantic tree). To exclude
/etc/passwd, passwd would exist in the directory /etc. Since you're already going to need to preempt dcache searches (aren't you?) you can insert a search of the mask tree. If the search fails, then it is not excluded and the request falls through to normal VFS handling. In the/etc/passwdcase above, it would find/etc/passwdand so the file is excluded. Processing would stop there, returning some error. How does this sound? I need to sleep on this, because it is very late here.
At this time I think feasible is true and useful is an open question.
To address the useful I find that known/desirable use-case scenarios get the most discussion.
To give a couple of examples:
1) A given process (say a restricted shell) can not exec() an executable with the set-uid bit on.
- directly
- indirectly (e.g., via bash)
2) Apache can only create/write files in /var/web/incoming.
- files created or modified can not have any execute bit set
and executing chmod is excluded.
This will be the topic of many future e-mails I am sure. ;-)
Quoted 5 lines
David
Quoted 25 lines · George Beshers
Thanks for joining the discussion. I have answered your questions as best I can for the moment---which in fact has been to make some further points and encourage you and others to ask more questions and make more suggestions :-)
Quoted 7 lines · David Dabbs
Questions
----------------------------------------------------------------------
Handwaving for a moment over view creation and storage particulars, it
is pretty clear that this new security feature will rely upon reiser4 for masking. Does this mean that one will only be able to mask a reiser4 filesystem, or will any VFS fs be "maskable?"As a proof of concept reiser4---although I think that the ability to work with multiple reiser4 mounted filesystems is relevant and important.
Quoted 3 lines
All file types and access methods will be supported, yes? (mmap, AIO, DIRECT, pipes, hard/sym links, etc.)
That is the plot. Again, we are taking the point of view that the proof of concept does not need to be complete; links however are included.
Quoted 6 lines
Quoted 3 lines
In the original proposal posted to the list Hans (I think) referred to viewprinting as "chroot on steroids." Let's assume that the mask creation tools deliver on making viewprint creation and maintainance very easy/painless for admins. In what way will viewprinting be more secure than chroot?
Basically, chroot as I at least normally use it, has a lot of baggage in terms of disk consumption that we are planning to avoid by creating a view rather than a copy.
Chroot lacks fall through points.
Quoted 40 lines
Second, users always interact with a system via executables so normally the executables have taken on the security attributes of the user (set-UID being the major exception on Unix) but, to some extent, we are developing a new semantic.
While views for DBMS, ClearCase, etc. have been around for a long time attaching access lists to process seems to be semi-virgin territory, at least for Unix systems.
Any and all pointers to references to prove me wrong appreciated :-)
Quoted 3 lines
If I understand the ways admins use chroot, or would like to use it, then should the design include "stackable" or "inheritable" masks? This is not unlike stackable filesystems or filter pipelines. If, for instance, most processes need to see
/usr/local/lib/*and/usr/local/bin/*, then this spec is in a 'base' mask and the mask for/usr/local/bin/fooprocesswould inhert from and add to this base specification.Something like this had occurred to me, but I think that for a proof of concept having the tools that assist the user in creating the mask make it easy to include these but have each actual mask on disk be a standalone entity is the way to go.
I think that inherited masks from a parent process are a much stronger requirement---think about restricted shell.
All questions which keep me from wasting time on an overly simplistic approach welcome :-)
Quoted 3 lines
Early on in the conversation, there was discussion about "permissible functionality." At a minimum, a mask, true to its name, will effect filesystem object _visibility_. It was not completely clear whether the mask will be proscriptive viz operations. IOW, will the mask say that fooprocess "is not permitted to [attempt to] RWX object bar?" I believe this is not something masks will do, but I wanted clarification.
The attempt will be blocked with a suitable error return from the system call, it is the responsibility of the mask administrator to get this right.
There are many interesting application correctness and/or mask correctness questions which will need a lot more thought to bring to fruition.
Quoted 6 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have
in mind checking for something like/usr/bin/fooprocess/metas/maskwhenexec()loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?Are masks capable of explicit exclusion as well as inclusion?
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.
Quoted 8 lines
I think the correct answer is "anything not explicitly included is excluded" or on the other side of the looking glass "anything not explicitly excluded is included".
As a user friendly interface both should be supported and the "compilation" layer handle the conversion.
Maybe I am not understanding the question.
clearcase has an exclude operation for its view specifications.
Quoted 9 lines
Quoted 4 lines
I wonder if it would be feasible if masks only specified exclusions? If, for instance, the mask wanted to exclude /foo/*, then the directory foo would exist (in the mask semantic tree). To exclude
/etc/passwd, passwd would exist in the directory /etc. Since you're already going to need to preempt dcache searches (aren't you?) you can insert a search of the mask tree. If the search fails, then it is not excluded and the request falls through to normal VFS handling. In the/etc/passwdcase above, it would find/etc/passwdand so the file is excluded. Processing would stop there, returning some error. How does this sound? I need to sleep on this, because it is very late here.At this time I think feasible is true and useful is an open question.
To address the useful I find that known/desirable use-case scenarios get the most discussion.
Quoted 8 lines
To give a couple of examples:
1) A given process (say a restricted shell) can notexec()an executable with the set-uid bit on.
- directly
- indirectly (e.g., via bash)
2) Apache can only create/write files in/var/web/incoming.
- files created or modified can not have any execute bit set
and executing chmod is excluded.
this protection happens while traversing the mask or at the fall through point. Hmmm, we need to accumulate a set of permissions that apply to something that are specific to how we got there. That could be complex in the VFS details. We can defer it to Phase II if necessary. George, you should spend a day (not this week) figuring out how much work it would be to make that work. It will be the details of it that will be dangerous....
Quoted 11 lines
This will be the topic of many future e-mails I am sure. ;-)
Quoted 5 lines
David
Quoted 8 lines · Hans Reiser
Quoted 6 lines · George Beshers
Quoted 3 lines · David Dabbs
In the original proposal posted to the list Hans (I think) referred to viewprinting as "chroot on steroids." Let's assume that the mask creation tools deliver on making viewprint creation and maintainance very easy/painless for admins. In what way will viewprinting be more secure than chroot?
Quoted 6 lines
Quoted 3 lines
Basically, chroot as I at least normally use it, has a lot of baggage in terms of disk consumption that we are planning to avoid by creating a view rather than a copy.
Chroot lacks fall through points.
Other than saving disk space is this important?
Are you thinking about multiple processes, with different views, but sharing a few "resources", i.e., files of one form or another as part of a long term vision?
Quoted 12 lines
Quoted 12 lines
Quoted 7 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have
in mind checking for something like/usr/bin/fooprocess/metas/maskwhenexec()loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?Are masks capable of explicit exclusion as well as inclusion?
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.I think the correct answer is "anything not explicitly included is excluded" or on the other side of the looking glass "anything not explicitly excluded is included".
Quoted 8 lines
Quoted 4 lines
As a user friendly interface both should be supported and the "compilation" layer handle the conversion.
Maybe I am not understanding the question.
clearcase has an exclude operation for its view specifications.
I don't remember it being more than the boolean complement of a (potentially much more complex) include operation.
So good UI point but I don't think extends the semantics?
Quoted 18 lines
Quoted 8 lines
Quoted 3 lines
I wonder if it would be feasible if masks only specified exclusions? If, for instance, the mask wanted to exclude /foo/*, then the directory foo would exist (in the mask semantic tree). To exclude
/etc/passwd, passwd would exist in the directory /etc. Since you're already going to need to preempt dcache searches (aren't you?) you can insert a search of the mask tree. If the search fails, then it is not excluded and the request falls through to normal VFS handling. In the/etc/passwdcase above, it would find/etc/passwdand so the file is excluded. Processing would stop there, returning some error. How does this sound? I need to sleep on this, because it is very late here.At this time I think feasible is true and useful is an open question.
To address the useful I find that known/desirable use-case scenarios get the most discussion.
Quoted 8 lines
To give a couple of examples:
1) A given process (say a restricted shell) can notexec()an executable with the set-uid bit on.
- directly
- indirectly (e.g., via bash)
2) Apache can only create/write files in/var/web/incoming.
- files created or modified can not have any execute bit set
and executing chmod is excluded.
Quoted 2 lines
this protection happens while traversing the mask or at the fall through point. Hmmm, we need to accumulate a set of permissions that apply to something that are specific to how we got there. That could be complex in the VFS details. We can defer it to Phase II if necessary. George, you should spend a day (not this week) figuring out how much work it would be to make that work. It will be the details of it that will be dangerous....
OK.
Quoted 18 lines · George Beshers
Quoted 14 lines · Hans Reiser
Quoted 9 lines · George Beshers
Quoted 3 lines · David Dabbs
In the original proposal posted to the list Hans (I think) referred to viewprinting as "chroot on steroids." Let's assume that the mask creation tools deliver on making viewprint creation and maintainance very easy/painless for admins. In what way will viewprinting be more secure than chroot?
Basically, chroot as I at least normally use it, has a lot of baggage in terms of disk consumption that we are planning to avoid by creating a view rather than a copy.
Quoted 4 lines
Quoted 1 line
Chroot lacks fall through points.
Other than saving disk space is this important?
It is different.
Quoted 4 lines
Are you thinking about multiple processes, with different views, but sharing a few "resources", i.e., files of one form or another as part of a long term vision?
Yes, but chroot can also do that.
Quoted 21 lines
Quoted 21 lines
Quoted 18 lines
Quoted 8 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have
in mind checking for something like/usr/bin/fooprocess/metas/maskwhenexec()loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?Are masks capable of explicit exclusion as well as inclusion?
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.I think the correct answer is "anything not explicitly included is excluded" or on the other side of the looking glass "anything not explicitly excluded is included".
As a user friendly interface both should be supported and the "compilation" layer handle the conversion.
Maybe I am not understanding the question.
Quoted 6 lines
Quoted 2 lines
clearcase has an exclude operation for its view specifications.
I don't remember it being more than the boolean complement of a (potentially much more complex) include operation.
So good UI point but I don't think extends the semantics?
exclude is a semantic feature.
Quoted 27 lines
Quoted 21 lines
Quoted 10 lines
Quoted 5 lines
I wonder if it would be feasible if masks only specified exclusions? If, for instance, the mask wanted to exclude /foo/*, then the directory foo would exist (in the mask semantic tree). To exclude
/etc/passwd, passwd would exist in the directory /etc. Since you're already going to need to preempt dcache searches (aren't you?) you can insert a search of the mask tree. If the search fails, then it is not excluded and the request falls through to normal VFS handling. In the/etc/passwdcase above, it would find/etc/passwdand so the file is excluded. Processing would stop there, returning some error. How does this sound? I need to sleep on this, because it is very late here.At this time I think feasible is true and useful is an open question.
To address the useful I find that known/desirable use-case scenarios get the most discussion.
Quoted 8 lines
To give a couple of examples:
1) A given process (say a restricted shell) can notexec()an executable with the set-uid bit on.
- directly
- indirectly (e.g., via bash)
2) Apache can only create/write files in/var/web/incoming.
- files created or modified can not have any execute bit
set and executing chmod is excluded.Quoted 2 lines
this protection happens while traversing the mask or at the fall through point. Hmmm, we need to accumulate a set of permissions that apply to something that are specific to how we got there. That could be complex in the VFS details. We can defer it to Phase II if necessary. George, you should spend a day (not this week) figuring out how much work it would be to make that work. It will be the details of it that will be dangerous....
OK.
Quoted 11 lines · Hans Reiser
Quoted 6 lines · George Beshers
Quoted 2 lines
Chroot lacks fall through points.
Other than saving disk space is this important?
It is different.
Sure. I am trying to understand the advantages/disadvantages of fall through points in your thinking.
Quoted 6 lines
Quoted 3 lines
Are you thinking about multiple processes, with different views, but sharing a few "resources", i.e., files of one form or another as part of a long term vision?
Yes, but chroot can also do that.
Achieve it yes, document it in the specification no.
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 8 lines
Quoted 5 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have
in mind checking for something like/usr/bin/fooprocess/metas/maskwhenexec()loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?Are masks capable of explicit exclusion as well as inclusion?
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.Quoted 8 lines
I think the correct answer is "anything not explicitly included is excluded" or on the other side of the looking glass "anything not explicitly excluded is included".
As a user friendly interface both should be supported and the "compilation" layer handle the conversion.
Maybe I am not understanding the question.
clearcase has an exclude operation for its view specifications.
Quoted 7 lines
Quoted 4 lines
I don't remember it being more than the boolean complement of a (potentially much more complex) include operation.
So good UI point but I don't think extends the semantics?
exclude is a semantic feature.
Can you elaborate please? That is specifically why it is different from "not included"?
Quoted 28 lines · George Beshers
Quoted 8 lines · Hans Reiser
Quoted 6 lines · George Beshers
Quoted 2 lines
Chroot lacks fall through points.
Quoted 5 lines
Quoted 1 line
Other than saving disk space is this important?
It is different.
Sure. I am trying to understand the advantages/disadvantages of fall through points in your thinking.
Quoted 6 lines
Quoted 3 lines
Are you thinking about multiple processes, with different views, but sharing a few "resources", i.e., files of one form or another as part of a long term vision?
Quoted 4 lines
Quoted 1 line
Yes, but chroot can also do that.
Achieve it yes, document it in the specification no.
I don't understand the difference between us doing ls -R in a view and in a chrooted root, as far as documentation is concerned.
What might be different is that two processes can share a common directory (that they can create files in for the other process to see) using a mask but not using chroot. Am I right about that?
Quoted 32 lines
Quoted 32 lines
Quoted 29 lines
Quoted 17 lines
Quoted 17 lines
Quoted 6 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have
in mind checking for something like/usr/bin/fooprocess/metas/maskwhenexec()loads the exe, and if this exists then the files rooted in this directory would be set as the process's root filesystem?Are masks capable of explicit exclusion as well as inclusion?
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion? If you are limited to the semantic layer, then there's no stat node with which to play tricks.I think the correct answer is "anything not explicitly included is excluded" or on the other side of the looking glass "anything not explicitly excluded is included".
As a user friendly interface both should be supported and the "compilation" layer handle the conversion.
Quoted 8 lines
Quoted 1 line
Maybe I am not understanding the question.
clearcase has an exclude operation for its view specifications.
I don't remember it being more than the boolean complement of a (potentially much more complex) include operation.
So good UI point but I don't think extends the semantics?
Quoted 5 lines
Quoted 1 line
exclude is a semantic feature.
Can you elaborate please? That is specifically why it is different from "not included"?
Not included is also a semantic feature. Explicit rather than implicit exclusion is a different semantic. Lingustic expressions can differ in their semantics while still resolving to the same value.
If A = 1 and B =1 and C = 2
then A + B + C is semantically different from 2 * C, even if it is numerically equal.
Quoted 20 lines · Hans Reiser
Quoted 18 lines · George Beshers
Sure. I am trying to understand the advantages/disadvantages of fall through points in your thinking.
Quoted 8 lines
Quoted 3 lines
Are you thinking about multiple processes, with different views, but sharing a few "resources", i.e., files of one form or another as part of a long term vision?
Yes, but chroot can also do that.
Quoted 6 lines
Quoted 1 line
Achieve it yes, document it in the specification no.
I don't understand the difference between us doing ls -R in a view and in a chrooted root, as far as documentation is concerned.
What might be different is that two processes can share a common directory (that they can create files in for the other process to see) using a mask but not using chroot. Am I right about that?
Unsure. I will try nested chroot tomorrow. What I do know is that files written by a chroot process can be seen by a non-chroot process. What I find attractive in the mask specification is that one could understand that, e.g., lp was putting files in the spooling area and lpd or cupsd was actually reading them and removing them.
Grant you it is beyond the current project, but would be nice to be able to isolate all the programs with rights to manipulate files in /var/whatever or /etc/whatever.
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
I don't remember it being more than the boolean complement of a (potentially much more complex) include operation.
So good UI point but I don't think extends the semantics?
Quoted 6 lines
Quoted 1 line
exclude is a semantic feature.
Can you elaborate please? That is specifically why it is different from "not included"?
Quoted 6 lines
Not included is also a semantic feature. Explicit rather than implicit exclusion is a different semantic. Lingustic expressions can differ in their semantics while still resolving to the same value.
If A = 1 and B =1 and C = 2
then A + B + C is semantically different from 2 * C, even if it is numerically equal.
Ah... my language design background gets us into communication trouble :-)
Suppose for a moment that exclude actually added functionality (as for example regular expressions over file names will) what terminology would you use? You see, to me the exclude is, at some level, little more than syntactic sugar for the specification tools because the expressive power is equivalent in theory even if using exclusion is much more convenient in practice.
Quoted 8 lines · George Beshers
Ah... my language design background gets us into communication trouble :-)
Suppose for a moment that exclude actually added functionality (as for example regular expressions over file names will) what terminology would you use? You see, to me the exclude is, at some level, little more than syntactic sugar for the specification tools because the expressive power is equivalent in theory even if using exclusion is much more convenient in practice.
Do you consider the various turing complete languages to have significant semantic differences?
Quoted 5 lines · Hans Reiser
Quoted 3 lines · George Beshers
Ah... my language design background gets us into communication trouble :-)
Quoted 8 lines
Quoted 5 lines
Suppose for a moment that exclude actually added functionality (as for example regular expressions over file names will) what terminology would you use? You see, to me the exclude is, at some level, little more than syntactic sugar for the specification tools because the expressive power is equivalent in theory even if using exclusion is much more convenient in practice.
Do you consider the various turing complete languages to have significant semantic differences?
Yes, but I understand your point.
The distinction I am drawing is that something is syntactic sugar if there is an algorithm to translate some syntactic construct into a subset of a language with more primitive attributes, e.g., 'elseif' is syntactic sugar.
Assume the alphabet is lower case letters for simplicity.
exclude "bar"
becomes
include ".|..|[ac-z][b-z][a-qs-z]|...+"
A moments thought and you will see that both can be implemented with 5 state finite state autometa (adding a failure/success state as the 5th state with entire alphabet transitioning to the 5th state).
I completely agree that the exclude clause is much cleaner syntactically and the specification compiler should handle them (requirement), but I don't think they are a consideration in terms of the "compiled" spec that must be evaluated in the kernel as the process is being run.
*Getting Pragmatic
*
I have been assuming a model something like the following:
- There is a *presentation mask* format (the mask source) that is platform independent and probably human readable.
- There is a *compiled mask* which is designed to optimize *mask evaluation*, i.e., the chroot like semantics.
- The mask evaluation is done by the *mask interpreter* which is in the kernel (reiser4 area until we take over the world ;-) ).
- That the format produced by tracing can be converted to a presentation mask for user editing.
Proposed definition:
An extension to the presentation mask language is *syntactic sugar* Iff it does not require increasing the complexity of the mask
interpreter.
Quoted 6 lines · George Beshers
include ".|..|[ac-z][b-z][a-qs-z]|...+"A moments thought and you will see that both can be implemented with 5 state finite state autometa (adding a failure/success state as the 5th state with entire alphabet transitioning to the 5th state).
Yes, but you can avoid the transformation and just have a mask that excludes what it lists. You can have bounce off points instead of fall through points.
You can also have the exclude be a completely separate mask from the include mask.
It is an interesting question whether that is a good or a bad idea.... it might be a good idea but less space efficient.
Quoted 6 lines
I completely agree that the exclude clause is much cleaner syntactically and the specification compiler should handle them (requirement), but I don't think they are a consideration in terms of the "compiled" spec that must be evaluated in the kernel as the process is being run.
Quoted 6 lines
*Getting Pragmatic
*
I have been assuming a model something like the following:- There is a *presentation mask* format (the mask source) that is platform independent and probably human readable.
Nah, I no longer think so, I like
ls -R executable/metas/mask
as what the humans look at.
Quoted 9 lines
- There is a *compiled mask* which is designed to optimize *mask evaluation*, i.e., the chroot like semantics.
- The mask evaluation is done by the *mask interpreter* which is in the kernel (reiser4 area until we take over the world ;-) ).
- That the format produced by tracing can be converted to a presentation mask for user editing.
Just use the filesystem tree and create a few fall through and bounce off plugins.
Quoted 7 lines
Proposed definition:
An extension to the presentation mask language is *syntactic sugar* Iff it does not require increasing the complexity of the mask
interpreter.
Ah, I suspect that this disagreement has more to do with:
What should go into the proof of concept implementation?
vs.
What is needed to win Linux community support?
Quoted 11 lines · Hans Reiser
Quoted 6 lines · George Beshers
include ".|..|[ac-z][b-z][a-qs-z]|...+"A moments thought and you will see that both can be implemented with 5 state finite state autometa (adding a failure/success state as the 5th state with entire alphabet transitioning to the 5th state).
Yes, but you can avoid the transformation and just have a mask that excludes what it lists. You can have bounce off points instead of fall through points.
True.
Quoted 1 line
You can also have the exclude be a completely separate mask from the include mask.
True.
Quoted 1 line
It is an interesting question whether that is a good or a bad idea.... it might be a good idea but less space efficient.
Also potentially a greater performance hit.
Quoted 13 lines
Quoted 11 lines
I completely agree that the exclude clause is much cleaner syntactically and the specification compiler should handle them (requirement), but I don't think they are a consideration in terms of the "compiled" spec that must be evaluated in the kernel as the process is being run.
*Getting Pragmatic
*
I have been assuming a model something like the following:- There is a *presentation mask* format (the mask source) that is platform independent and probably human readable.
Quoted 5 lines
Nah, I no longer think so, I like
ls -R executable/metas/mask
as what the humans look at.
To gain community support we are going to need a way to ship the masks with the executables, and probably parameterize them for Makefiles. Grant you it is Phase II work, but it will become a requirement.
Quoted 5 lines
Quoted 5 lines
- There is a *compiled mask* which is designed to optimize *mask evaluation*, i.e., the chroot like semantics.
Quoted 8 lines
Quoted 5 lines
- The mask evaluation is done by the *mask interpreter* which is in the kernel (reiser4 area until we take over the world ;-) ).
- That the format produced by tracing can be converted to a presentation mask for user editing.
Just use the filesystem tree and create a few fall through and bounce off plugins.
For the proof of concept I agree.
Hans, while your points are valid, they are not compelling. The transformations involved have been well understood for 3-4 decades.
Ultimately, performance and scalability needs to drive these implementation/optimization decisions and they can and should wait until we have something working and can take measurements.
Quoted 9 lines
Proposed definition:
Quoted 5 lines
An extension to the presentation mask language is *syntactic sugar* Iff it does not require increasing the complexity of the mask
interpreter.
Quoted 55 lines · George Beshers
Ah, I suspect that this disagreement has more to do with:
What should go into the proof of concept implementation?
vs.
What is needed to win Linux community support?
Quoted 5 lines · Hans Reiser
Quoted 3 lines · George Beshers
include ".|..|[ac-z][b-z][a-qs-z]|...+"Quoted 7 lines
Quoted 3 lines
A moments thought and you will see that both can be implemented with 5 state finite state autometa (adding a failure/success state as the 5th state with entire alphabet transitioning to the 5th state).
Yes, but you can avoid the transformation and just have a mask that excludes what it lists. You can have bounce off points instead of fall through points.
True.
Quoted 1 line
You can also have the exclude be a completely separate mask from the include mask.
True.
Quoted 1 line
It is an interesting question whether that is a good or a bad idea.... it might be a good idea but less space efficient.
Also potentially a greater performance hit.
Quoted 18 lines
Quoted 11 lines
I completely agree that the exclude clause is much cleaner syntactically and the specification compiler should handle them (requirement), but I don't think they are a consideration in terms of the "compiled" spec that must be evaluated in the kernel as the process is being run.
*Getting Pragmatic
*
I have been assuming a model something like the following:- There is a *presentation mask* format (the mask source) that is platform independent and probably human readable.
Nah, I no longer think so, I like
ls -R executable/metas/mask
Quoted 7 lines
Quoted 1 line
as what the humans look at.
To gain community support we are going to need a way to ship the masks with the executables, and probably parameterize them for Makefiles. Grant you it is Phase II work, but it will become a requirement.
True. We need to modify tar I think.
Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
- There is a *compiled mask* which is designed to optimize *mask evaluation*, i.e., the chroot like semantics.
- The mask evaluation is done by the *mask interpreter* which is in the kernel (reiser4 area until we take over the world ;-) ).
- That the format produced by tracing can be converted to a presentation mask for user editing.
Quoted 4 lines
Quoted 1 line
Just use the filesystem tree and create a few fall through and bounce off plugins.
For the proof of concept I agree.
and for the non-proof of concept you would do what?
Quoted 19 lines
Hans, while your points are valid, they are not compelling. The transformations involved have been well understood for 3-4 decades.
Ultimately, performance and scalability needs to drive these implementation/optimization decisions and they can and should wait until we have something working and can take measurements.Quoted 9 lines
Proposed definition:
Quoted 5 lines
An extension to the presentation mask language is *syntactic sugar* Iff it does not require increasing the complexity of the mask
interpreter.
Quoted 15 lines · Hans Reiser
Quoted 13 lines · George Beshers
- There is a *compiled mask* which is designed to optimize *mask
Quoted 7 lines
evaluation*, i.e., the chroot like semantics.
- The mask evaluation is done by the *mask interpreter* which is in the kernel (reiser4 area until we take over the world ;-) ).
- That the format produced by tracing can be converted to a presentation mask for user editing.
Quoted 9 lines
Quoted 5 lines
Just use the filesystem tree and create a few fall through and bounce off plugins.
For the proof of concept I agree.
and for the non-proof of concept you would do what?
It depends on how useful people find the masks and what extensions people start asking for.
I think mask composition (because of inheritance, group specific access rights, whatever) is likely to be an emerging requirement. Merging several masks into a single mask would then be a form of optimization.
I also think that combining masks with other aspects of SELinux, as was suggested in an earlier e-mail, is a potentially quite fruitful phase II scenario.
Another possibility is that simple paths will prove not to be sufficient, people will want/need path patterns. For example, each user is allowed their own ~user/bin and ~user/lib and those programs can load .so's from trusted libraries but not from ~user2/lib (for whatever reason). The point is that in this case is that a common substring is required.
So, for the time being, I will note that trees *are* a really good implementation strategy for the masks that can be specified in my proof of concept proposal and will wait for a compelling example to justify returning to full REs over paths or promoting the utility of composition of masks.
Besides, I recently received saga advice about the dangers of "analysis paralysis"
George, trust me, the project will be a LOT more fun if we implement the bare minimum
and get it done early, and then after that spend the rest of the time doing what amuses us.
;-)
Quoted 22 lines
Quoted 20 lines
Hans, while your points are valid, they are not compelling. The transformations involved have been well understood for 3-4 decades.
Ultimately, performance and scalability needs to drive these implementation/optimization decisions and they can and should wait until we have something working and can take measurements.Quoted 10 lines
Proposed definition:
Quoted 6 lines
An extension to the presentation mask language is *syntactic
sugar*
Iff it does not require increasing the complexity of the mask
interpreter.
Quoted 57 lines · David Dabbs
Hans and George,
I've been lurking at the edge of this discussion and have not chimed in mostly because I only have a dial-up connection here at my in-laws house (and I'm suposed to be on vacation). Since there was a request for arguments for or against Hans's preferred approach, I thought I'd add my $0.02.
In order to put everything into perspective as well as to provide context
for some questions, I attempted to distill concrete items or decisions from the last several days' exchanges.As to arguments For or Against; For
If you only have three months to prove a concept and obtain continued funding, then I agree with Hans's preference for reusing as much existing work as possible. Adapting Hans's statement regarding [in]compatibility, "...if we [write new code] we should do so only if it is sufficiently worthwhile."Against
I can think of none at this point, given my understanding of the features.Project
----------------------------------------------------------------------
Demonstrate process-oriented filesystem viewprinting that scales to filesystems (and masks) containing millions of files. Provide exec-time mask application as well as tools for automating mask creation and maintenance.Definitions
---------------------------------------------------------------------
Process-Oriented
Specifications of filesystem object visibility are applied to processes regardless of the effective user rights with which the process runs.Mask (or viewprint)
A specification as to which files are visible to process[es] "running under" the mask. The [file] security underlying the mask
remains a user/object/permission mapping. If a mask a) does not include a file or b) explicitly filters out acess, the file operation ceases
and an error is returned. If the file upon which the process wants to operate is not filtered by the mask, then the operation request is passed on to the underlying filesystem. There, the requested file a) might not exist, b) might exist but not be visible/readable by the user running the process, etc.Fall-Through Point
The point during some file operation at which it is determined that the file is not filtered by the mask. The request [for operation X on the file] is passed on to the VFS/underlying filesystem.Features & Performance (Qualitative/Soft)
----------------------------------------------------------------------
It is...our task to ensure that creating a correct mask is well automated and easy.We do process oriented security, and that is all for now. The underlying [file] security remains a user/object/permission mapping.
We need to be able to determine in insignificant time whether a file "passes through" a mask consisting of a million filenames.
..if we must break an existing program we should do so only with care and only if it is sufficiently worthwhile to do so.
Features & Performance (Quantitative/Hard)
----------------------------------------------------------------------
Masks
- must support dirname/*
- do not [yet] need to support dirname/foo.*
- should not allow symbolic link traversal unless the file pointed to is within the mask.
Quoted 4 lines
- (by extension) should not allow hard links unless the file pointed to is within the mask.
^ should not allow hard links^ should not allow hard link to be created.
Quoted 13 lines
Hans's Initial Considerations & Design Proposal
----------------------------------------------------------------------
[The solution] must be treelike in its performance scalability.It is very important that we have something simple that reuses code for this purpose. The big issue to decide at the start is, should a view specification be implemented with a format that is as if it is a subdirectory of the masked executable, and which we then take the filenames used by the executable and traverse the subdirectory as though it was root, and if we reach a valid fall through point, then allow [us to] traverse from the real filesystem root, and if not, we issue a suitable error.
This would let us use all the existing semantic tree traversal code.
It would, however, require us to add such plugins as "fall through points", and "prints", etc. I think the answer is yes, we want to do it this way. Please come up with arguments for and against it.
Quoted 5 lines
Questions
----------------------------------------------------------------------
Handwaving for a moment over view creation and storage particulars, it
is pretty clear that this new security feature will rely upon reiser4 for masking. Does this mean that one will only be able to mask a reiser4 filesystem
yes
Quoted 3 lines
, or will any VFS fs be "maskable?"
Filesystems without support for plugins are a horror....;-)
The other filesystems will be encouraged to adopt the reiser4 plugin infrastructure.....
Quoted 3 lines
All file types and access methods will be supported, yes? (mmap, AIO, DIRECT, pipes, hard/sym links, etc.)
Yes.
Quoted 3 lines
In the original proposal posted to the list Hans (I think) referred to viewprinting as "chroot on steroids." Let's assume that the mask creation tools deliver on making viewprint creation and maintainance very easy/painless for admins. In what way will viewprinting be more secure than chroot?
It won't. Security research is the art of security/effort. Maximizing just security is a solved problem, and is called a turned off computer in a good safe.
Viewprinting is less work than chroot.
Quoted 3 lines
If I understand the ways admins use chroot, or would like to use it, then should the design include "stackable" or "inheritable" masks?
Sure, but not in 1.0. Good point though.
Quoted 3 lines
This is not unlike stackable filesystems or filter pipelines. If, for instance, most processes need to see
/usr/local/lib/*and/usr/local/bin/*, then this spec is in a 'base' mask and the mask for/usr/local/bin/fooprocesswould inhert from and add to this base specification.
I dislike your example but agree with your argument.
Quoted 3 lines
Early on in the conversation, there was discussion about "permissible functionality." At a minimum, a mask, true to its name, will effect filesystem object _visibility_. It was not completely clear whether the mask will be proscriptive viz operations. IOW, will the mask say that fooprocess "is not permitted to [attempt to] RWX object bar?" I believe this is not something masks will do, but I wanted clarification.
I don't know why I don't understand your question, but I don't.....;-)
Quoted 3 lines
Hans, in your preferred approach you referred to "a format that is as if it is a subdirectory of the masked executable." Did you have in mind checking for something like
/usr/bin/fooprocess/metas/maskwhenexec()loads the exe,
yes
Quoted 3 lines
and if this exists then the files rooted in this directory would be set as the process's root filesystem?
your statement is imprecise.
The mask will be checked first, and then iff it falls through we do a normal filesystem traversal.
Quoted 3 lines
Are masks capable of explicit exclusion as well as inclusion?
Not in version 1.0.
Quoted 2 lines
If the answer is 'Yes,' then what are your thoughts as to how this might be accommodated when your main tool is reiser4's semantic tree layer? Inclusion would be straightforward -- if the directory exists or the name exists within the directory then fall through. But exclusion?
True, it might be an issue. I must think about it.
Quoted 4 lines
If you are limited to the semantic layer, then there's no stat node with which to play tricks.
I wonder if it would be feasible if masks only specified exclusions? If, for instance, the mask wanted to exclude /foo/*, then the directory foo would exist (in the mask semantic tree). To exclude
/etc/passwd, passwd would exist in the directory /etc. Since you're already going to need to preempt dcache searches (aren't you?)
Sigh, yes, or we need to use dcache for the mask.
Quoted 3 lines
you can insert a search of the mask tree. If the search fails, then it is not excluded and the request falls through to normal VFS handling. In the
/etc/passwdcase above, it would find/etc/passwdand so the file is excluded. Processing would stop there, returning some error. How does this sound? I need to sleep on this, because it is very late here.
I don't quite understand this paragraph above.
Quoted 6 lines
David