Merge lp:~serge-hallyn/apparmor-profiles/apparmor-profiles into lp:apparmor-profiles

Proposed by Serge Hallyn
Status: Merged
Approved by: Steve Beattie
Approved revision: 161
Merge reported by: Steve Beattie
Merged at revision: not available
Proposed branch: lp:~serge-hallyn/apparmor-profiles/apparmor-profiles
Merge into: lp:apparmor-profiles
Diff against target: 27 lines (+23/-0)
1 file modified
ubuntu/16.04/usr.bin.ttytter (+23/-0)
To merge this branch: bzr merge lp:~serge-hallyn/apparmor-profiles/apparmor-profiles
Reviewer Review Type Date Requested Status
Steve Beattie Approve
Review via email: mp+291919@code.launchpad.net

Description of the change

Add a ttytter profile.

To post a comment you must log in.
Revision history for this message
Seth Arnold (seth-arnold) wrote :

While this is certainly better than no profile, there's a lot of fairly
wide permissions added:

+ /usr/lib/** r,
+ /lib/** r,
+ /usr/share/** r,

<abstractions/base> ought to include a huge number of libraries already --
what else was needed in /usr/lib, /lib, /usr/share?

+ /etc/* r,
+ unix (create, connect, receive),
+ /run/** rw,

These just seem too wide by a lot -- what's it doing with unix sockets?
Can that be reduced via peer=(label=..) rules? Which files in /etc/ did it
need? Can /run/ be constrained by uid or user or at least the 'owner'
qualifier?

+ /dev/null rw,
+ network inet,

Heh I'm surprised these were needed explicitly.

Any chance this could be closed a bit further?

Thanks

Revision history for this message
Christian Boltz (cboltz) wrote :

I never used ttytter (actually I had to google what it is - if someone else also doesn't know it: a commandline client for twitter). Nevertheless, I think your profile is not strict enough ;-)

"network inet" is ways too broad. abstractions/nameservice already gives you "network inet stream" and "network inet dgram" (+ its inet6 variants), and IIRC Twitter uses an API over HTTPS, which should be covered by this. If not, I'd be interested in what is missing ;-)

Also, allowing read access for /etc/* and /run/** is way to broad and might leak data not related to ttytter which it shouldn't see. The same applies for /usr/share/**, /lib/** and /usr/lib/**. They are less critical, but still allow ways too much. Please make all these rules more tight so that they only allow what is really needed.

Finally, I'm slightly surprised that a commandline client needs abstractions/fonts and abstractions/dbus-session. Are they really needed?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Yeah my main goal was to keep it from reading most of my own
files. It runs as me so not very worried about system files.
I did the MR to make myself follow up. I'll find time to
tighten it down later.

Revision history for this message
Steve Beattie (sbeattie) wrote :

I provided an alternate profile based off of Serge's that is more restrictive, and after Serge tested with it successfully, committed that to the apparmor-profiles tree. Thanks for submitting the initial profile, Serge!

[I'm marking this merge proposal as Approved to close it out.]

review: Approve
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Awesome - thanks for improving it :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'ubuntu/16.04/usr.bin.ttytter'
2--- ubuntu/16.04/usr.bin.ttytter 1970-01-01 00:00:00 +0000
3+++ ubuntu/16.04/usr.bin.ttytter 2016-04-14 16:44:20 +0000
4@@ -0,0 +1,23 @@
5+# vim:syntax=apparmor
6+# Author: Serge Hallyn <serge.hallyn@ubuntu.com>
7+
8+#include <tunables/global>
9+/usr/bin/ttytter {
10+ #include <abstractions/base>
11+ #include <abstractions/dbus-session>
12+ #include <abstractions/fonts>
13+ #include <abstractions/nameservice>
14+ /usr/bin/ttytter ixr,
15+ /usr/bin/curl ixr,
16+
17+ owner @{HOME}/.ttytter/** rw,
18+ owner @{HOME}/.ttytterkey rw,
19+ /usr/lib/** r,
20+ /lib/** r,
21+ /usr/share/** r,
22+ /dev/null rw,
23+ /etc/* r,
24+ unix (create, connect, receive),
25+ network inet,
26+ /run/** rw,
27+}

Subscribers

People subscribed via source and target branches

to status/vote changes: