[security] please use apparmor to restrict access to ofono to approved services
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
indicator-network (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
isc-dhcp (Ubuntu) |
Fix Released
|
Undecided
|
Jamie Strandboge | ||
Utopic |
Fix Released
|
Undecided
|
Jamie Strandboge | ||
network-manager (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
nuntium (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
ofono (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
powerd (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
ubuntu-download-manager (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
ubuntu-system-settings (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned | ||
urfkill (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned | ||
Utopic |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
NOTE: After further review from the security team, unfortunately what is presented as a solution in this bug is not sufficient to block unconfined processes from connecting to ofono for essentially two reasons:
a) anything that is unconfined can change into another profile, so an unconfined process can simply change into the profile of one of the allowed services, and
b) this doesn't protect against scenarios where the user is able to alter the behavior of the allowed services running in the user session (eg, indicator-network and ubuntu-
'a' is solvable by making sure that the user's session starts under a new AppArmor "user-session" profile that prevents changing profile in to one of the allowed services (of course, the user session services continue to run under their own profiles). We'd have to investigate the best method for profile attachment in this case as well. An alternative might be to store the profile attachment in the inode of the binary when AppArmor adds this.
'b' is perhaps solvable by more strictly confining these allowed user session services (eg, 'audit deny ptrace tracedby peer=user-session, audit deny owner /** m, preventing QML loading, future AppArmor environment filtering, etc') along with, importantly, hardening these services to the point that they can't be controlled via environment, configuration, library loading, etc, etc. An alternative solution would be to run these services as another user in such a way that the user cannot alter their behavior beyond what is exposed in the UI.
Preventing unconfined from doing things is a difficult prospect and while I think with the recent improvements with AppArmor over the last two cycles finally makes the notion plausible, significant work remains to solve 'a' and 'b'. This is cannot be achieved for RTM (note, this only affected limiting unconfined and has no effect on application isolation, which is in full effect and does not suffer from this at all).
Description:
It would be useful to limit the services that can connect to ofonod over DBus. We can implement this be creating an otherwise permissive AppArmor profile for ofonod that will limit any DBus calls to ofonod to a list of peer profiles (specifically excluding 'unconfined'). The list of peer profiles is:
- indicator-network
- network-manager (and dispatcher.
- nuntium
- telepathy-ofono
- ofono-scripts
- powerd
- ubuntu-
- system-settings
- urfkill
Each of the above needs to have a profile created for it, adjusting the boot scripts as necessary to ensure that the profile is loaded before the service starts. The peer profile implementation will be wide open as the purpose of the profile is (currently) to simply ensure the process of the service has the correct AppArmor labeling (though this opens the possibility to confine these services down the road if desired).
Merge requests have been requested for everything except urfkill, which has a debdiff attached to this bug. As mentioned, the AppArmor profiles for everything except ofonod is wide open so the risk of regression is very low for these. In fact, if it is helpful, everything except ofono could be uploaded to the archive independently and at any time.
For ofono, as mentioned, the AppArmor profile is also lenient except for the policy for its DBus interface. It is critical that ofono is updated at the same time or after all the other packages in this bug, otherwise any packages that aren't updated will fail to connect to ofono.
I've been running this configuration on my phone for weeks with no denials (excepting 03mmsproxy which I adjusted for yesterday). I've tested the packaging on x86 emulator to make sure that the profiles are installed and loaded properly on boot.
Test Plan (additional to any existing appropriate test plans)
1. Install all services on a device
2. reboot (important to restart the session and any services that aren't
restarted automatically, like nuntium. reboot is easiest). Note the time
of the reboot on the device
3. in addition to any applicable test plans, after full boot:
adb shell grep DEN /var/log/syslog # there should be no denials for
adb shell tail -f /var/log/syslog | grep DEN # run this during all tests
4. make a call
5. send a text
6. send an mms (if possible)
7. connect to wifi
8. connect to 3G
9. download an app
10. toggle wifi in system-settings
11. verify ofono-scripts (eg, /usr/share/
/usr/
12. double check `adb shell grep DEN /var/log/syslog` for no ofono denials
during the testing
= Original text =
We should try to find ways to restrict certain properties and interfaces to well known callers, for example Modem 'Online' should be settable by urfkill only. We don't want to allow other processes to set these properties. This would also help to identify if some unintended process is trying to set such properties by accident.
Related branches
- Network-manager: Pending requested
-
Diff: 116 lines (+54/-1)7 files modifieddebian/changelog (+12/-0)
debian/control (+2/-1)
debian/network-manager.dirs (+1/-0)
debian/network-manager.install (+1/-0)
debian/network-manager.upstart (+4/-0)
debian/rules (+4/-0)
debian/usr.sbin.NetworkManager (+30/-0)
- PS Jenkins bot (community): Approve (continuous-integration)
- Indicator Applet Developers: Pending requested
-
Diff: 59 lines (+23/-0)5 files modifieddebian/control (+1/-0)
debian/indicator-network.dirs (+1/-0)
debian/indicator-network.install (+1/-0)
debian/rules (+4/-0)
debian/usr.lib.indicator-network-service (+16/-0)
- Ubuntu Phablet Team: Pending requested
-
Diff: 65 lines (+25/-0)6 files modifieddebian/control (+1/-0)
debian/nuntium.dirs (+2/-0)
debian/nuntium.install (+1/-0)
debian/nuntium.links (+1/-0)
debian/rules (+4/-0)
debian/usr.bin.nuntium (+16/-0)
- PS Jenkins bot: Approve (continuous-integration)
- Ubuntu Phablet Team: Pending requested
-
Diff: 70 lines (+27/-0)6 files modifieddebian/control (+1/-0)
debian/dirs (+1/-0)
debian/install (+1/-0)
debian/rules (+4/-0)
debian/upstart (+4/-0)
debian/usr.bin.powerd (+16/-0)
- Manuel de la Peña (community): Needs Fixing
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 64 lines (+24/-1)5 files modifieddebian/control (+2/-1)
debian/rules (+4/-0)
debian/ubuntu-download-manager.dirs (+1/-0)
debian/ubuntu-download-manager.install (+1/-0)
debian/usr.bin.ubuntu-download-manager (+16/-0)
- Sebastien Bacher (community): Approve
- PS Jenkins bot: Needs Fixing (continuous-integration)
-
Diff: 79 lines (+35/-0)6 files modifieddebian/changelog (+12/-0)
debian/control (+1/-0)
debian/rules (+4/-0)
debian/ubuntu-system-settings.dirs (+1/-0)
debian/ubuntu-system-settings.install (+1/-0)
debian/usr.bin.system-settings (+16/-0)
- PS Jenkins bot: Approve (continuous-integration)
- Ubuntu Phablet Team: Pending requested
-
Diff: 114 lines (+67/-1)6 files modifieddebian/control (+2/-1)
debian/ofono.dirs (+1/-0)
debian/ofono.install (+1/-0)
debian/ofono.upstart (+4/-0)
debian/rules (+4/-0)
debian/usr.sbin.ofonod (+55/-0)
Changed in ofono (Ubuntu): | |
assignee: | nobody → Tony Espy (awe) |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in indicator-network (Ubuntu): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
Changed in network-manager (Ubuntu): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
Changed in powerd (Ubuntu): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
Changed in urfkill (Ubuntu): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
Changed in ofono (Ubuntu): | |
assignee: | Tony Espy (awe) → Jamie Strandboge (jdstrand) |
summary: |
- [security] setting "dangerous" properties such as [service].Modem - 'Powered' and 'Online' should be restricted. + [security] please use apparmor to restrict access to ofono to approved + software |
summary: |
[security] please use apparmor to restrict access to ofono to approved - software + services |
tags: | added: patch |
description: | updated |
Changed in isc-dhcp (Ubuntu Utopic): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
status: | New → In Progress |
Changed in isc-dhcp (Ubuntu Utopic): | |
status: | In Progress → Fix Committed |
description: | updated |
description: | updated |
description: | updated |
Changed in indicator-network (Ubuntu Utopic): | |
status: | In Progress → Won't Fix |
Changed in network-manager (Ubuntu Utopic): | |
status: | In Progress → Won't Fix |
Changed in nuntium (Ubuntu Utopic): | |
status: | In Progress → Won't Fix |
Changed in ofono (Ubuntu Utopic): | |
status: | In Progress → Won't Fix |
Changed in powerd (Ubuntu Utopic): | |
status: | In Progress → Won't Fix |
Changed in ubuntu-download-manager (Ubuntu Utopic): | |
status: | In Progress → Won't Fix |
Changed in network-manager (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in network-manager (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in nuntium (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in nuntium (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in ofono (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in ofono (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in powerd (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in powerd (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in ubuntu-download-manager (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in ubuntu-download-manager (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in ubuntu-system-settings (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in ubuntu-system-settings (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in urfkill (Ubuntu): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
Changed in urfkill (Ubuntu Utopic): | |
assignee: | Jamie Strandboge (jdstrand) → nobody |
After discussion with Jamie, I think we merely want to restrict ofono usage to a particular set of system processes.
AppArmor is not capable of restricting individual properties, and unfortunately "Online" is a property of the top-level org.ofono.Modem interface which we really can't restrict to just urfkill.
Our current plan of record is that we will provide basic unrestrictive AppArmor profiles to the following system/session processes:
- NetworkManager
- telepathy-ofono ( or related telepathy process/component )
- urfkill
- indicator-network
- nuntium ( MMS daemon )
- powerd