Replies: 5 comments 6 replies
-
I had a bit of thought about it. And it is still a hard no. However... A complete reply should be me pushing a security model for this project (but that is still a wip). For now, I will keep it short (and incomplete). The main idea behind MAC, is not to target some specific attacks and to protect the application against them. But to protect the application confined against unknown attack, ie: anything (within the limit of apparmor capabilities, obviously apparmor is neither a firewall nor a sandbox manager). In other words, the best (and only) way to ensure protection against an unknown range of attack is to use and abuse the principle of least privilege. It is exactly what this project is doing. Consequently, a profile should respect the same general rule regardless of its allowed access (internet, IPC, caps...). Regarding usability, Linux applications do not have security as compatibility requirement. Therefore, yes, trying to enforce any sort of security will always generate some compatibility issue. However, it does not mean that we do not have standards. The first being the XDG style directory definition. It is the option I selected in this project: you are free to organize yourself as you want... as long as you define your directories in apparmor. Is it a trade of regarding usability vs security? Yes. However, I am convinced it is the only way for Linux system to provide state-of-the-art security. This is for the theory. Regarding this specific example, we are talking about user data. To the end user, these are much more sensitive than anything else on the system. So being extra careful with them and not allowing
It works this way already for most profiles. For example, loupe has full access over all labelled directories. While vlc allow a smaller list of these directories. Is it perfect? Probably no, but it is both fully user configurable and much more restrictive than a systematic The only difference is that the current
Nitpicking, but I have never said this. I take inspiration from the Android security implementation that features (among other things) full system confinement. It does not mean this project's aim is to implement all Android features... The reading of their security model can be a reminder that Google is first and foremost an ads company. However Despite this theory, I acknowledge that it might be a pain to have to handle extra configuration. Even more as it is still an early stage of the project. Therefore, I am also for a pragmatic implementation:
In conclusion
Extra note This may be revisited later, especially as a future version of apparmor will add a |
Beta Was this translation helpful? Give feedback.
-
My suggestion would address this inconsistency and instead apply a rule to which restriction can/should be set by default when conditions are met.
This was basically what I intended to provide with #292 to avoid the need for users to redefine this optional abstraction.
My idea would be to add a simple condition for this abstraction before it is permitted:
If those conditions are met, there should be little reason not to allow this lesser restriction for the above mentioned reasons. |
Beta Was this translation helpful? Give feedback.
-
I don't agree that all programs without internet access should be allowed to access every user file. Then any program can delete all my work. Instead, I want that a program has access only to files I choose and only for the time period I choose. Android since the 4th version has been moving to this security policy. However, AppArmor does not have such a feature. Probably, because it was designed for a different use case. BTW, surprisingly large number of application programs require internet access. For example, |
Beta Was this translation helpful? Give feedback.
-
The condition includes only read access, so it should not matter at all since no damage can be done (as long as apparmor holds)
The problem is what to choose as a default, because the files you want a program to access are almost always different from the next users files. Perhaps a solution may be to define different access levels for user files and allow automatically setting the desired permissions at install time. For example: Option A) Option B) Option C) This could be combined with a definition of application classes like Document-Applications, Media-Applications, Internet-Applications |
Beta Was this translation helpful? Give feedback.
-
I sympathize with this idea. I suggest the following approach:
This can also be implemented in a similar way for e.g., okular, evince, gwenview etc. |
Beta Was this translation helpful? Give feedback.
-
As stated in the project objectives, the profiles in this repository are designed to provide comparable isolation to those present on mobile operating systems.
The problem with this approach as I see it, is that is does not align well with the expectation of (many) Linux users that wish to isolate their applications through apparmor. Not only does Linux not provide nearly the same infrastructure and common methods of sharing file like the share feature on Android/IOS, the use cases of most Linux applications are a lot broader since general purpose systems like most Linux Desktops are quite different from mobile systems. When the mobile approach for security boundaries is applied to apparmor profiles intended for general purpose systems, this leads back to the dreaded "OMG apparmor again" situation that we want to avoid.
Instead of forcing rather alien security boundaries of mobile systems into the apparmor profiles in this repository that are meant for desktop systems, I would suggest a more reasonable approach for normal desktop applications. Instead of trying to bind file access for applications like image viewers to specific directories like "Pictures" and preventing any user from viewing image files in e.g.
~/Downloads
or~/MyWorkProjects
by default, read access should be granted to any directory located in places that commonly contain any user files like in this example.The difference for the practical security the apparmor profiles provide with this approach compared to the more limited mobile approach is nearly non existent for most applications, at least when no network access is required. The main objective should be to prevent any easy sandbox escape, like it would be possible if write access to hidden files are granted. For applications that do not have network access, the number of non hidden directories in $HOME they can read is completely irrelevant to the provided security of the profile.
If an image viewer is compromised there are two possible consequences:
In consequence, requiring a strict isolation of normal user files (as in pictures, documents, music ...) only makes using the apparmor profiles harder while it provides no security benefits as long as the profile is already isolated to the local system, meaning no known sandbox escape or path for extracting files like network access. (I would also consider the absence of X11 access a requirement)
For applications that require network access, the current approach makes a lot more sense and when a browser only gets access to
~/Downloads
this is a lot more reasonable compared to restricting an image viewer to~/Pictures
despite the lack of network access.Consequently I suggest to change the defined isolation objective for profiles to include a more granular decision tree in regard to how much access to files can be permitted.
Beta Was this translation helpful? Give feedback.
All reactions