Skip to contentSkip to conversation

viewprinting: what format should views be stored in?

DISCUSSION David Dabbs 4 participants 4 messages Aug 20, 2004 – Aug 21, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 16 lines
Quoted 5 lines
Quoted 2 lines

When did masks specify visibility of files? According to Hans :

This is clearcase functionality so everyone assumed it from the original posting http://www.namesys.com/blackbox_security.html

yes.

Trying for clarity in the role of the mask interpreter layer. Does the mask act as a gatekeeper - passing things through to the fs (possibly simpler to implement but _far_ less functional)
Or (more likely) does the mask layer take over the role of authoriser(?) in which case it delegates to the fs for the fs authorisation (attr) and then bitwise ANDs that with it's own masklet (maybe shortcutting if the mask determines the file is invisible)

Quoted 1 line

I think we all agree on the latter but I thought it best to be clear.

This clarity/specificity, at least re. your Phase I, is what I've been trying
to get a handle on as well. Seems that in order to discuss /how/ to build this feature we should share an understanding of /what/ it is that it will do. This includes user inputs ('constraints' in mask[let] specifications) as well as side effects or changes to 'normal' process/OS/filesystem operations.

From Hans's original post:

Quoted 3 lines

It will however allow a useful subset of the needed security constraints to be more compactly specified

Is there a proposed membership for the "useful subset," or better yet what security constraints are not useful?

Quoted 3 lines

[viewprinting] is also useful when you want to conveniently manage the set of objects a particular executable is allowed to access without walking the filesystem tree to do it.

"Without walking the filesystem to do it" implies that the view/mask interpreter is the authorisor. The ultimate implementation may not need to walk the fs to determine whether process X can access object Y, but one cannot avoid doing so if you want to obtain dentries etc. needed by the VFS.

Hans and George, what did you find lacking in currently-available Linux security module frameworks such as LIDS or LSM? They provide system function hooks in which module writers may control object access. LSM-based work is on-going. See
http://sic.iaik.tugraz.at/Best%20Paper%20Award/2004/LSM_quaritsch_winkler.pdf
for details of their addition of module stacking (multiple policies) and hooks into the TCP layer. I'm going to read up on these frameworks.

Quoted 7 lines
Quoted 5 lines

What if it [mask] changes between two processes starting? Does the running processes mask change? (cf chmod a file - seems

George: I am disinclined to tackle changing masks on the fly until I have a compelling story to justify the work.

ok - agreed.

No changes on the fly? How does that square with the following from the blackbox_security.html feature description?

Quoted 41 lines

We will accomodate these scenarios by creating three special view specifications:
...
2. Every access outside some view creates a dialogue with the administrator, in which if he oks it the view specification is amended to allow the access. The administrator is also allowed to ok the access without amending the specification, for the case where close monitoring of some accesses is desired, which will result in his being prompted for every access of that kind until he chooses to amend the specification.
...

Quoted 28 lines
Quoted 5 lines
Quoted 4 lines

Hans: Your statement is imprecise. The mask will be checked first, and then iff it falls through we do a normal filesystem traversal.

Quoted 15 lines

It was imprecise because perhaps I had a different vprint concept and implementation in mind. Using the creation tool, JAdmin creates a mask for fooprocess. The mask would be a directory structure rooted at /bin/fooprocess/metas/mask. All files (not dirs) in this tree would be hard links to the "real" files specified in the mask. Only dirs & files included in the spec are visible. When an instance of fooprocess is started, /bin/fooprocess/metas/mask is automagically mounted as the process's root filesystem. The mask would be the filesystem. Other than the use of the metas reiserism (and mask maintenance wizardry)
this is not any different than chroot. Since the end result here is to be no more secure than chroot, but very much easier to deploy and maintain, is there a reason why this cannot be the case?

I think the 'thing' at /usr/bin/fooprocess/metas/mask is a semantic expansion of the mask (ie it's like a directory tree but it doesn't point to files, it just contains lots of masklets). It can be traversed in parallel to the real tree traversal and the masklets it returns will modify the real results. It is purely semantic. I've expanded this later.

Call it a maskfs?

David, isn't what I described above a maskfs (just not called that?) Anyway, I believe it [mask layer] should be a real filesystem that does (eventually) point to files. Yes, the maskfs would need to store the "compact representation of the security constraints." Isn't that stat data?

Based upon the shorthand in use so far, we'll say a masklet specification
consists of an object name and some permission flags. Why not build the
maskfs (as before, a directory tree in an existing reiser4 fs) with an entry
for each object referenced in the mask. So, starting with the (admittedly poor)
prior example mask; Note that since masks can only deny authorisation but not grant it, any flags in the mask are denials. The following are logical:

/ -w- # default dir perms
/** -wx # default file perms
/etc/config.file --x # only exec denied, rw depends on fs attrs
<other dirs/files obtained from the admin's process viewprint>

you would then end up with something like:

# ls -l /usr/local/bin/fooprocess/metas

mask/ ?-? ?-? ?-? # perms from above ANDed with fs attrs
metas/
dirdefault ??? ??? ??? # whatever was in the mask
filedefault ??? ??? ???
etc/ ?-? ?-? ?-? # writing prohibited
config.file ??- ??- ??- # cannot execute
...

When this 'maskfs' tree is created every explicitly named object from the mask is associated/linked to the actual object's inode but the attr bits are the real ones ANDed with the masklet's. Processes would be chrooted to this dir. When the process wants to write to /etc/config.file it simply interacts with the chrooted fs with no changes required in the VFS layer, yes? Now, say the process wants to read a file that is allowed by the masklet but not explicitly included in the mask e.g. /etc/foo.conf. The VFS will first resolve etc, then the file foo.conf. The dir plugins we configure for this tree will, upon not finding foo in this dir, search the real /etc for it. If it exists, it is created in the maskfs tree, assigned the proper attrs, and finally linked to the real /etc/foo.conf. Subsequent requests for /etc/foo are processed directly from the maskfs. This is a 'lazy linking' of sorts.

Changing a mask is as easy as chmod on the file, if it was explicitly part of the mask when it was created. If it wasn't, simply touching it adds it. The plugins will check that the file actually exists, read the real object's attr and mask out anything denied by the default file attrs.

Updating the maskfs when the underlying fs has changed is an issue. This is only a concern for fs objects that have been instantiated in maskfs. An enhanced dnotify might be the way to go,
http://www.lambda-computing.com/~rudi/dnotify/

Is this feasible/workable?

Quoted 11 lines
Quoted 10 lines

If it hits, what types are there in a masklet?
I think:
* doesn't exist (file not found)
* file attribute mask (eg: prevent any writing)
* acl 'mask' (an obvious extension of attr but no longer simple 'AND' logic)
* syscall mask (prevent hardlink and maybe chmod - although see below)
* 'umask' (chmod) mask (prevent setting suid or execute bit - but may allows setting +w and setgid on directories - may extend to acls too)

Quoted 1 line

For proof of concept the first 2 suffice.

If we want to specify permissions for a process irrespective of the uid/gid executing it wouldn't we just specify explicit rights and ignore the ugo fs attrs?

Regarding permitting/denying syscalls, chmod, etc. I think we should look into using LSM modules for this (whenever there is funding for it, of course).

David D.

#1 lore raw
Quoted 6 lines · David Dabbs

Hans and George, what did you find lacking in currently-available Linux security module frameworks such as LIDS or LSM? They provide system function hooks in which module writers may control object access. LSM-based work is on-going. See
http://sic.iaik.tugraz.at/Best%20Paper%20Award/2004/LSM_quaritsch_winkler.pdf
for details of their addition of module stacking (multiple policies) and hooks into the TCP layer. I'm going to read up on these frameworks.

Amen to that - while reading through Hans' summary, I was having a hard time figuring out what this was buying us that SELinux doesn't provide. Thanks for the pointer to the Quartisch&Winkler paper, as module stacking seems to be heating up. The "usual scenario" for what people seem to want with LSM is a MAC system like SELinux or LIDS, then zero or more "pathological case" handlers (for instance, the 'BSD Securelevels' LSM, or some variant of the OpenWall mods, or a chroot/jail module) to harden a specific aspect of the system, and then the Capabilities LSM.

The biggest reason for wanting to do security at the LSM level rather than the filesystem level is because that way you can *really* secure things (hint - your filesystem can be as secure as you want, but if you don't also secure stuff like unix-domain sockets or SYSV shared memory segments, 2 cooperating processes can end-run an MLS trying to prevent it....)

If there's a specific need that you can't think of how to implement via SELinux or the low-level LSM calls, please feel free to ask - if the exact nature of the problem is itself sensitive, I can vector you to people over on the spook side of the fence who should be able to either help you out or redirect you to even spookier people.. ;)

#2 lore raw

The honest answer is that it has been over a year since I looked at the SELinux stuff. It is on my to-do list to review what's there.

However, modulo that disclaimer, I believe what we are doing can readily become part of a larger strategy, indeed as you point out, it must to truely promote security. This doesn't bother me in the slightest. I will feel that the time was worthwhile if our implementation becomes a standard part of a larger security apparatus, e.g., because we proved that file system masks could scale to multi-terabyte repositories.

I will take a gander at the paper you reference this weekend.

Quoted 35 lines · [email protected] wrote:
Quoted 7 lines · David Dabbs

Hans and George, what did you find lacking in currently-available Linux security
module frameworks such as LIDS or LSM? They provide system function hooks
in which module writers may control object access. LSM-based work is on-going. See http://sic.iaik.tugraz.at/Best%20Paper%20Award/2004/LSM_quaritsch_winkler.pdf
for details of their addition of module stacking (multiple policies) and hooks into
the TCP layer. I'm going to read up on these frameworks.

Amen to that - while reading through Hans' summary, I was having a hard time figuring out what this was buying us that SELinux doesn't provide. Thanks for the pointer to the Quartisch&Winkler paper, as module stacking seems to be heating up. The "usual scenario" for what people seem to want with LSM is a MAC system like SELinux or LIDS, then zero or more "pathological case" handlers (for instance, the 'BSD Securelevels' LSM, or some variant of the OpenWall mods, or a chroot/jail module) to harden a specific aspect of the system, and then the Capabilities LSM.

The biggest reason for wanting to do security at the LSM level rather than the filesystem level is because that way you can *really* secure things (hint - your filesystem can be as secure as you want, but if you don't also secure stuff like unix-domain sockets or SYSV shared memory segments, 2 cooperating processes can end-run an MLS trying to prevent it....)

If there's a specific need that you can't think of how to implement via SELinux or the low-level LSM calls, please feel free to ask - if the exact nature of the problem is itself sensitive, I can vector you to people over on the spook side of the fence who should be able to either help you out or redirect you to even spookier people.. ;)

#3 lore raw

We only do filesystem isolation because that is our specialty, filesystems, and it is better to do less well.

We fundamentally differ from other approaches because I don't think the problem is in developing tools to allow people to fine grain security if they take the time to do it, I think the problem is that nobody has the time to specify fine grained security for the executables on their computers, and our focus is on the filesystem aspects of automating the specification of the fine grained security for an executable. Researchers after us can generalize our approach to things outside the filesystem namespace, or, better, put those things into the filesystem namespace.;-)