AppArmor abstraction for apps that use FileStore

Bug #857827 reported by Jason Gerard DeRose
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FileStore
Triaged
High
Unassigned

Bug Description

The FileStore layout was designed with named-based mandatory access control in mind. As all the Novacut components are heavily network-enabled (which is what makes them interesting), we need to really think about security at every layer in our component stack.

But we also want a great user experience, of course. The nice thing about the FileStore layout is it gives us a predictable pattern for the file names that an app needs to access, so we can use very tight-containment here, but without interfering with the user experience.

Files in .dmedia/files/*/* are read-only, and so anything using FileStore needs to at least be able to read from there, something like this:

# FileStore in user's home directory:

owner /home/*/.dmedia/files/*/* r,

# Shared FileStore in /home:

/home/.dmedia/files/*/* r,

# FileStore on removable drives:

/media/*/.dmedia/files/*/* r,

# Partition mount points dedicated just to a FileStore (need to consult FSH on location):

/var/lib/dmedia/*/.dmedia/files/*/* r,

# Does this work in AppAprmor? Perhaps too loose?

**/.dmedia/files/*/* r,

The above should be all that's needed by a read-only app (FileStore-wise) like the novacut player. Because many apps only need read-only access to the FileStore (remember, dmedia does the downloading for them), the common abstraction should only include permissions needed for read-only use.

In terms of writing files, those happen in two directories:

**/.dmedia/tmp/* rw,

**/.dmedia/partial/* rw,

Once a file is written and the content hash computed (or verified), the file is renamed into it's canonical location in .dmedia/files/*/*. I'm not sure if AppArmor has a permsion for "renaming into" separate from "writing", so that an app could rename a file into .dmedia/files/*/*, but only read files already in .dmedia/files/*/*.

Probably the easiest way to explore the FileStore layout is to create a FileStore in a temporary directory, which you can do like this:

jderose@jgd-test:~$ python3
Python 3.2.2 (default, Sep 5 2011, 21:17:14)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tmpdir = tempfile.mkdtemp()
>>> from filestore import FileStore
>>> fs = FileStore(tmpdir)
>>> fs.parentdir
'/tmp/tmp1vmne7'
>>> fs.basedir
'/tmp/tmp1vmne7/.dmedia'

And then browse the files in /tmp/tmp1vmne7/.dmedia

security vulnerability: yes → no
visibility: private → public
description: updated
description: updated
Changed in filestore:
milestone: 11.10 → 11.11
Changed in filestore:
milestone: 11.11 → 11.12
Changed in filestore:
milestone: 11.12 → 12.01
Changed in filestore:
milestone: 12.01 → 12.02
Changed in filestore:
milestone: 12.02 → 12.04
Changed in filestore:
milestone: 12.04 → 12.05
Changed in filestore:
milestone: 12.05 → 12.06
Changed in filestore:
milestone: 12.06 → 12.07
Changed in filestore:
milestone: 12.07 → 12.08
Changed in filestore:
milestone: 12.08 → 12.09
Changed in filestore:
milestone: 12.09 → 12.10
Changed in filestore:
milestone: 12.10 → 12.11
Changed in filestore:
milestone: 12.11 → 12.12
Changed in filestore:
milestone: 12.12 → 13.01
Changed in filestore:
milestone: 13.01 → 13.02
Revision history for this message
Jason Gerard DeRose (jderose) wrote :
Changed in filestore:
milestone: 13.02 → 13.03
Changed in filestore:
milestone: 13.03 → 13.04
Changed in filestore:
milestone: 13.04 → 13.05
Changed in filestore:
milestone: 13.05 → 13.06
Changed in filestore:
milestone: 13.06 → 13.07
Changed in filestore:
milestone: 13.07 → 13.08
Changed in filestore:
milestone: 13.08 → 13.09
Changed in filestore:
milestone: 13.09 → 13.10
Changed in filestore:
milestone: 13.10 → 13.11
Changed in filestore:
milestone: 13.11 → 13.12
Changed in filestore:
milestone: 13.12 → 14.01
Changed in filestore:
milestone: 14.01 → 14.02
Changed in filestore:
milestone: 14.02 → 14.03
Changed in filestore:
milestone: 14.03 → 14.04
Changed in filestore:
milestone: 14.04 → 14.05
Changed in filestore:
milestone: 14.05 → 14.06
Changed in filestore:
milestone: 14.06 → 14.07
Changed in filestore:
milestone: 14.07 → 14.08
Changed in filestore:
milestone: 14.09 → 14.10
Changed in filestore:
milestone: 14.12 → 15.01
Changed in filestore:
milestone: 15.08 → 15.09
Changed in filestore:
milestone: 15.09 → 16.08
Changed in filestore:
milestone: 16.04 → 16.06
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.