Commit graph

1722 commits

Author SHA1 Message Date
Steve Beattie
24a47e2faa Update version to prepare for impending 2.6.0 release. 2011-02-16 10:38:28 -08:00
Steve Beattie
c56ec9eea7 top-level Makefile:
- adjust snapshot versioning to be less than the upcoming version yet
  still embed the bzr repo version
2011-02-16 09:41:14 -08:00
Steve Beattie
a39d6e36e8 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-utils: Inherit flags in sub-profiles when generating profiles
References: bnc#496204

 When creating profiles with cx subprofiles, genprof will set the
 sub-profile in enforce mode. When genprof cycles multiple times, it
 prohibits the sub-profile from working correctly.

 e.g.

 # Last Modified: Mon Jan 24 13:52:26 2011
 #include <tunables/global>

 /home/jeffm/mycat flags=(complain) {
   #include <abstractions/base>
   #include <abstractions/bash>
   #include <abstractions/consoles>

   /bin/bash ix,
   /bin/cat cx,
   /home/jeffm/mycat r,

 profile /bin/cat {
     #include <abstractions/base>

     /bin/cat r,
     /home/jeffm/mycat r,

   }
 }

 This patch allows sub-profiles to inherit the flags from the parent
 profile, which allows it to be created in complain mode (if appropriate).
 The temporary complain flags are cleaned up at genprof completion as
 expected.

 This issue was reported at: https://bugzilla.novell.com/show_bug.cgi?id=496204

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>

Bug: https://launchpad.net/bugs/707092
2011-02-15 16:26:05 -08:00
Steve Beattie
4e01f55a81 From: Jeff Mahoney <jeffm@suse.com>
Subject: Subdomain.pm: Fix for null path
References: bnc#407959

When handling the following log entry, logprof will spew perl errors and
ultimately generate an invalid config: "r,"

Since there is nothing to do with a null path, just skip to the next entry.

type=APPARMOR_DENIED msg=audit(1214497030.421:39): operation="inode_permission" info="Failed name resolution - object not a valid entry" requested_mask="r" denied_mask="r" pid=31367 profile="/usr/sbin/httpd2-worker

Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 14:45:04 -08:00
Jamie Strandboge
6c7492af89 dd LibreOffice to ubuntu-browsers.d/productivity abstraction 2011-02-15 15:54:48 -06:00
Steve Beattie
4c8d4490cb From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor: Subdomain.pm: Fix handling of audits of unconfined processes

 The version of AppArmor that was accepted into the mainline kernel
 issues audit events for things like change_hat while unconfined.
 Previous versions just returned -EPERM without the audit.

 This results in logprof and friends spewing uninitialized value errors
 when it hits events like:
 type=AVC msg=audit(1291742101.899:220): apparmor="DENIED" operation="change_hat" info="unconfined" error=-1 pid=28005 comm="cron

 ... which happen any time an unconfined process does something with pam
 when pam_apparmor is installed.

 This patch skips those events.

[Note that the second half of the OpenSUSE patch had already been applied.]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 11:16:28 -08:00
Steve Beattie
5a56604f99 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor: Fix incorrect /proc/*/sys usage in usr.sbin.ntpd
References: bnc#634801

 /proc/sys/kernel exists, but /proc/*/sys/kernel doesn't. This patch
 fixes the profile.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 10:54:30 -08:00
Steve Beattie
f471bc4018 Author: Jamie Strandboge <jamie@canonical.com>
Description: the Ubuntu buildds do not have the AppArmor securityfs mounted, so
the cache tests fail. This patch skips these tests if the introspection
directory is not mounted, but runs them if it is. This should allow testing of
local builds while still allowing builds on the official buildds.

Acked-By: Steve Beattie <sbeattie@ubuntu.com> - both Ubuntu and
OpenSUSE were carrying patches that disabled the caching test,
though OpenSUSE's disabled it completely rather than checking. The
parser builds need to complete even when the kernel it's building on
doesn't support AppArmor or all the extensions that the parser needs
at runtime.
2011-02-15 10:41:29 -08:00
Steve Beattie
596cba37e8 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-docs: Fix grammar error in techdoc.pdf
References: bnc#588235

This patch fixes a grammar error in techdoc.pdf.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-09 14:29:05 -08:00
Steve Beattie
3c8538c0c6 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-utils: Translation unification
References: bnc#586072

 This patch removes small inconsistencies between identical strings to
 allow for easier translation.

Reported-by: Isis Binder <isis.binder@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-08 16:29:59 -08:00
Steve Beattie
4df8c4c09c Purge utils/severity.pl due to incorrect license/copyright statement. It
should have been covered under both the Immunix acquisition by Novell
Inc and by the open sourcing of the apparmor tree by Novell Inc.
2011-02-08 15:50:51 -08:00
Steve Beattie
bf9a559dcc From: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] apparmor-utils: cleanup after abort in genprof
References: bnc#307067

 The initial generation of the base profile is required to be written out
 to put the process in complain mode for observation. If the user
 decides to abort the profiling session, that base profile is left
 behind.

 This patch removes all profiles created during the run up to an abort.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2011-02-08 14:50:43 -08:00
Steve Beattie
974d0a33b0 Remove obsolete rc.sd-event-dispatch.suse; was replaced by not nearly
but almost as obsolete aa-eventd and controlled by the main apparmor
initscript.

Acked-by: John Johansen <john.johansen@canonical.com>
2011-02-08 14:21:51 -08:00
Steve Beattie
b5cd93aa2f Purge deprecated gnome apparmor applet, aa-notify is the preferred
notification mechanism nowadays.

Acked-by: John Johansen <john.johansen@canonical.com>
2011-02-08 14:18:39 -08:00
Steve Beattie
ef2fa2c895 From: Jeff Mahoney <jeffm@suse.com>
utils/Immunix/Reports.pm: s/SubDomain/AppArmor/ in header comment
2011-02-08 13:58:52 -08:00
Steve Beattie
4ff5b80ee8 From: Jeff Mahoney <jeffm@suse.com>
Fix compilation in deprecated gnome apparmor applet.
2011-02-08 12:52:26 -08:00
Steve Beattie
fb8d5d05dc From: Jeff Mahoney <jeffm@suse.com>
utils/Makefile: abstract out the perl vendor location for distros to
override if necessary
2011-02-08 10:39:44 -08:00
Steve Beattie
cef7289d75 From: Jeff Mahoney <jeffm@suse.com>
Fix grammar in in utils UI text.
2011-02-08 10:25:05 -08:00
Steve Beattie
94dfe15b28 From: Jeff Mahoney <jeffm@suse.com>
libapparmor: remove LD_RUN_PATH from swig generated makefile as it
results in an rpath binding in the library.
2011-02-08 09:27:32 -08:00
Steve Beattie
788bdcafb9 From: Jeff Mahoney <jeffm@suse.com>
Fix up tomcat build, also use in-tree libapparmor.
2011-02-08 08:22:46 -08:00
Steve Beattie
0cfa2b2cf8 From: Jeff Mahoney <jeffm@suse.com>
Rip out a little bit of crufty old compatibility code with immunix.h and
support directly building with in-tree libapparmor.
2011-02-08 08:18:36 -08:00
Steve Beattie
37ac8ede4f From: Jeff Mahoney <jeffm@suse.com>
Subject: adjust includes for pam_apparmor to point at the intree version
of libapparmor, rather than depend on an external version to be
installed.
2011-02-08 07:21:20 -08:00
Steve Beattie
09edd269aa Makefile: make setup target work independently 2011-02-08 07:05:39 -08:00
Jamie Strandboge
61e7aac455 make aa-disable executable 2011-02-07 21:02:57 -06:00
Jamie Strandboge
bf02536fa3 Description: add aa-disable
aa-enforce and aa-complain exist to put a profile into enforce or
 complain mode respectively. The /etc/apparmor.d/disable directory
 already exists to drop files into it to disable profile load via
 apparmor_parser (and therefore via the apparmor initscript). What
 doesn't exist is aa-disable to add a file to the disable/ directory and
 unload the profile. This patch does that. This version of aa-disable is
 based on aa-complain (in fact doing a diff between aa-complain and
 aa-disable might make review easier) and works as well as aa-enforce and
 aa-complain. In other words, aa-disable has the same limitations of not
 handling the specified binary properly if the specified attachment does
 not match the path naming scheme (eg, the profile doesn't use the
 conventional path.to.binary naming scheme, globbing is used for
 attachment within the profile, etc). Also adjust documentation to
 reference aa-disable.
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-07 20:48:50 -06:00
Jamie Strandboge
74b2fdc52c update documentation for aa-disable 2011-02-07 17:39:54 -06:00
Jamie Strandboge
1459c9eb20 add aa-disable 2011-02-07 17:39:36 -06:00
Steve Beattie
1005bfdf7e Subject: logprof - variable definitions should not have trailing commas.
This patch fixes a logprof bug where when profiles with variable
declarations at the top level (not hidden in an include) were written
back to a file, a trailing comma was being added to the declaration
statement, which is invalid apparmor policy syntax. This patch corrects
this and no longer adds the trailing comma.
2011-02-04 21:20:58 -08:00
John Johansen
52453313c1 Update to latest version of apparmor.vim from Chritian Boltz 2011-01-26 06:43:39 -08:00
Steve Beattie
6f620e9247 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor: Fix network event parsing
References: bnc#665483

 The upstream version of AppArmor had network mediation but it was
 removed. There's a compability patch floating around that both openSUSE
 and Ubuntu have applied to their kernels. Unfortunately, one part was
 overlooked. The socket operation event names where changed from the
 socket_ prefixed names they had when AppArmor was out-of-tree and
 utils/SubDomain.pm was never updated to understand them.

 This patch adds an operation-type table so that the code can just
 do a optype($operation) call to discover what type of operation a
 particular name refers to. It then uses this in place of the socket_
 checks to decide whether an event is a network operation.

 This allows genprof and logprof to work with networking rules again.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>

Bug: https://launchpad.net/bugs/706733
2011-01-24 15:49:46 -08:00
Steve Beattie
1c2591de1e This patch removes all of the old log parsing code from libapparmor.
The testcases that were in place for the old style log messages have
had their expected output modified such that they are expected to
return invalid results, rather than deleting the testcases outright.
2011-01-21 11:47:54 -08:00
Steve Beattie
93ae7808cb From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-parser: Fix up translations
References: bnc#586070

Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 17:44:51 -06:00
Kees Cook
14d8bac7b2 Here's an update to rename another chunk of things that still used
"SubDomain" in some way. This leaves only "subdomain.conf" and the
function names internally.

Additionally, I added a "make check" rule to the utils/Makefile to do a
simple "perl -c" sanity check just for good measure.
2011-01-13 13:58:26 -08:00
Kees Cook
dd3a964249 drop /var/log/apparmor, stop installing Reports.pm, use LOGPROF_DEBUG as the debugging target instead of /var/log/apparmor 2011-01-13 09:13:34 -08:00
Steve Beattie
d088727bdf Support newer auditd formatted messages. Patch from mancha on irc.
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-12 13:57:19 -06:00
Jamie Strandboge
0807a74490 The example firefox profile in extras has been pretty out of date. Also, it
allows write to the ~/Desktop directory, which could conceivably allow writing
of .desktop files which could be clicked on and executed by the user. This is
based on the firefox base profile as included in Ubuntu. Notable features:
- allows for using the browser to navigate through directories
- allows reads from @{HOME}/Public/**
- allows writes to @{HOME}/Downloads/**

The intent of this profile is to restrict code execution, writes to $HOME
and information leaks while allowing basic web browsing and reading of
system documentation. It does not allow for plugins, extensions or other
helpers (but these can be added via the local/ mechanism).
2011-01-12 11:51:22 -06:00
Jamie Strandboge
b12d93a739 Attached is an updated dnsmasq profile that fixes the following:
- allow net_admin capability for DHCP server
- allow net_raw and network inet raw for ICMP pings when used as a DHCP
server
- allow read and write access to libvirt pid files for dnsmasq

See the FAQ in the dnsmasq source for details. This fixes
https://launchpad.net/bugs/697239
2011-01-12 11:47:04 -06:00
John Johansen
2796c58eca Refresh kernel compatibility patches for 2.6.36.2 and 2.6.37 2011-01-09 21:03:19 -08:00
Jamie Strandboge
22f912b9f1 abstractions/private-files: don't allow wl to autostart directories
abstractions/private-files-strict: don't allow access to:
  - chromium
  - thunderbird
  - evolution
  - kmail
  - kwallet
2011-01-07 21:05:59 -06:00
Steve Beattie
0e87acb318 Change the compilation ordering in the regression testsuite as the
toolchain has gotten stricter about linking order; in short, linked
libraries need to come after the objects referring to them. Adding to
LDLIBS is the correct solution for this.

See https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition for more
details.
2011-01-07 10:35:47 -08:00
Jamie Strandboge
f7c6a848bb abstractions/private-files: don't allow wl to autostart directories
abstractions/private-files-strict: don't allow access to:
- chromium
- thunderbird
- evolution
- kmail
- kwallet
2011-01-07 10:44:47 -06:00
Steve Beattie
cb96345f21 From: Jeff Mahoney <jeffm@suse.com>
dynamically link in libapparmor library in libapparmor's testsuite.
2011-01-05 14:41:11 -08:00
Jamie Strandboge
d03c2e681f abstractions/freedesktop.org updates:
- require owner match for files in @{HOME}
- add new path for @{HOME}/.local/share/recently-used.xbel*
- add the following, confirmed via specifications:
  /usr/share/applications/mimeinfo.cache r,
  /usr/share/applications/*.desktop r,
  owner @{HOME}/.local/share/applications/defaults.list r,
  owner @{HOME}/.local/share/applications/mimeinfo.cache r,
  owner @{HOME}/.local/share/applications/mimeapps.list r,
  owner @{HOME}/.local/share/applications/*.desktop r,

References:
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.4.html
http://www.freedesktop.org/wiki/Specifications/mime-actions-spec
2010-12-23 18:39:28 -06:00
Jamie Strandboge
73c1283e98 abstractions/X: allow access to /usr/lib32 and /usr/lib64 for dri modules
(LP: #658135)
2010-12-23 18:39:02 -06:00
Jamie Strandboge
e400b296d8 abstractions/freedesktop.org updates:
- require owner match for files in @{HOME}
- add new path for @{HOME}/.local/share/recently-used.xbel*
- add the following, confirmed via specifications:
  /usr/share/applications/mimeinfo.cache r,
  /usr/share/applications/*.desktop r,
  owner @{HOME}/.local/share/applications/defaults.list r,
  owner @{HOME}/.local/share/applications/mimeinfo.cache r,
  owner @{HOME}/.local/share/applications/mimeapps.list r,
  owner @{HOME}/.local/share/applications/*.desktop r,

References:
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.4.html
http://www.freedesktop.org/wiki/Specifications/mime-actions-spec
2010-12-23 07:52:47 -06:00
Jamie Strandboge
8180aa0bd3 abstractions/base: allow access to /usr/lib32 and /usr/lib64 for dri modules
(LP: #658135)
2010-12-23 07:46:55 -06:00
Jamie Strandboge
e356c4b19e add enchant abstraction. Enchant is a frontend for spellcheckers and in
use by more and more applications, including empathy and evolution. It
is listed on freedesktop.org. See:
http://www.abisource.com/projects/enchant/

This abstraction gives access to enchant itself, files in the user's home
directory for enchant and various dictionaries for:
- aspell
- ispell
- hunspell
- myspell
- hspell
- zemberek
- voikko
2010-12-22 16:59:44 -06:00
Jamie Strandboge
5c040c6149 allow 'rw' to /var/log/samba/cores/ (LP: #652562) 2010-12-22 16:58:23 -06:00
Jamie Strandboge
d097df8226 add preliminary ibus abstraction. Will likely need more once more ibus users
start to use it. Additionally, the 'rw' on the @{HOME}/.config/ibus/bus/
probably only needs 'create' and 'chmod', so that could be tightened up once
those are exposed in the tools. LP: #649497.
2010-12-22 16:57:35 -06:00
Jamie Strandboge
add5d47fc3 abstractions/user-manpages: require owner match for files in @{HOME} and /tmp 2010-12-22 16:55:50 -06:00