Commit graph

1633 commits

Author SHA1 Message Date
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
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
Jamie Strandboge
2227de709b abstractions/user-mail:
- use character globbing
- require owner match for files in @{HOME}
2010-12-22 16:55:18 -06:00
Jamie Strandboge
84b5f6e441 abstractions/user-write:
- require owner match
- add @{HOME}/Public/
2010-12-22 16:54:40 -06:00
Jamie Strandboge
1f2b4a5a19 abstractions/user-download:
- fix typo for Desktop (should be Desktop/)
- require owner match
- allow writes to @{HOME}/[dD]ownload{,s}
2010-12-22 16:52:13 -06:00
Jamie Strandboge
1b78752db6 utils/Config.pm: disable the repository by explicitly setting
$config->{repository}{enabled} = "no" (LP: #692406). We need to do this
since opensuse's site is down and there is no current alternative. Can
reenable once we have an alternative.
2010-12-21 22:08:28 -06:00
Jamie Strandboge
ca30e18692 utils/Config.pm: disable the repository by explicitly setting
$config->{repository}{enabled} = "no" (LP: #692406). We need to do this
since opensuse's site is down and there is no current alternative. Can
reenable once we have an alternative.
2010-12-21 16:56:21 -06:00
Jamie Strandboge
36f6da62aa update ubuntu abstractions to use '# vim:syntax=apparmor' 2010-12-21 12:54:57 -06:00
Jamie Strandboge
046cfe305f update ubuntu abstractions to use '# vim:syntax=apparmor' 2010-12-21 12:53:33 -06:00
Jamie Strandboge
5272c9ef0a utils/apparmor.vim: update comments on how to use 2010-12-21 10:55:24 -06:00
Jamie Strandboge
aa7304f01e utils/apparmor.vim: remove trailing whitespace 2010-12-21 10:45:33 -06:00
Kees Cook
acfcdfe750 ignore generated manpages 2010-12-20 14:02:03 -08:00
Kees Cook
39b5240966 mark parser/tst/simple_tests/xtrans/minimize-x-conflict.sd as "TODO" and hook up parser/tst/Makefile "clean" to parser/Makefile "clean" rule 2010-12-20 13:44:14 -08:00
Kees Cook
b11fd82d96 make gen-xtrans executable 2010-12-20 13:25:54 -08:00
John Johansen
3973387295 Add missing files from my last 11 patches as I forgot to do bzr add before
committing.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 13:18:36 -08:00
Kees Cook
a6dc414f57 adjust line offset now that $Id$ was removed 2010-12-20 13:06:54 -08:00
Kees Cook
723a20ba7d as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
Kees Cook
46e96476d8 add python2.7 to python abstraction, LP: #644983
Bug: https://launchpad.net/bugs/644983
2010-12-20 12:10:52 -08:00
Jamie Strandboge
b3c6ec3ded add aa_change_profile.pod manpage and reference it in aa_change_hat.pod 2010-12-20 14:01:58 -06:00
Kees Cook
319777962b update RPM spec, thanks to Christian Boltz. See https://bugzilla.novell.com/show_bug.cgi?id=619893 2010-12-20 12:01:23 -08:00
John Johansen
283abda83c Default permission-hashing for dfa creation to on, to fix a bug
When doing permission merging in the dfa minimization phase the information
about whether a rule is dominant or not has been lost so the merge of
xtransitions can not be handled correctly.

When two conflicting x transitions are merged the results are unpredicitable
and not currently detected.  So default dfa minimization to set up its
initial partitions with permission hashing, this ensures that dfa states
that have different xtransitions in the minimization stage will never
be merged thus will not result in a conflict.

x permission checking is still enforced at the dfa creation phase where
the originial information is available to check whether the conflicting
permissions came from exact match or re rules so that conflict resolution
can be properly applied.

The end result is that dfa minimization does not result in a truely minimal
dfa (the minimization phase is also slightly faster).

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:58:44 -08:00
John Johansen
77be2c450f Add the safe xtransition key word
Currently apparmor provides the unsafe keyword to indicate an xtransition
is not scrubbing its environment variables.  This can be used to be
explicit about which transition are unsafe instead of relying on people
remembering which of px Px is safe or unsafe.

Add the orthogonal keyword safe to allow specifying a transition is
safe.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:58:05 -08:00
John Johansen
4eea3ae073 Make meaning of leading permissions consistent with trailing permissions
x Permissions when specified as a the start of the rule had a differnt
meaning than when they appeared at the tail of a rule.

Specifically px,cx,ux were not treated as unsafe when they appeared at
the start of the rule.
  px /foo,
instead of at the tail of the rule
  /foo px,

the keyword unsafe had to be used to force the rule to cause the x transitio
to be its unsafe variant.

Fix leading permissions so that they are consistent with file rules that
use trailing permissions.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:56:57 -08:00
John Johansen
c059224811 Merge parsing of file rules with leading permissions into a single rule
Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:56:30 -08:00
John Johansen
a29078ac04 Add auto generation of tests to verify leading and trailing perms for xrules
Test the leading permission form of an xrule against its trailing permission
form, to verify that they are generating the same xtransition and thus
don't conflict (assumes xtransition conflict checking is working).
  eg.
    px /foo,
    /foo px,

should generate the same rule and thus not result in any conflicts

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:54:27 -08:00
John Johansen
851b7655c1 Add auto generation of xtransition conflict tests
All the combiniation of xtransition conflics where not well represented in
the regression test suite.  Instead of relying on multiple static test
files, automatically generate all possible conflicts.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:53:52 -08:00
John Johansen
bdea9e5678 Fix two x transition conflict bugs.
The is_merged_x_consistend macro was incorrect in that is tested for
USER_EXEC_TYPE to determine if there was an x transition.  This fails
for unconfined execs so an unconfined exec would not correctly conflict
with another exec type.

The dfa match flag table for xtransitions was not large enough and not
indexed properly for pux, and cux transitions.  The index calculation did
not take into account the pux flag so that pux and px aliased to the same
location and cux and cx aliased to the same location.

This would result in the first rule being processed defining what the
transition type was for all following rules of the type following.  So
if a px transition was processed first all pux, transitions in the profile
would be treated pux.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:52:53 -08:00
John Johansen
6d6df2a16b Make libaare built depend on immunix.h
The dfa engine uses the defines from immunix.h for permission conflict
checking, so make the build depend on it.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:52:10 -08:00
John Johansen
240c4e3674 Fix error checking of conflicting x-trans during dfa construction.
During some of the dfa cleanups, the checks for conflicting xtransition
was removed.  This adds the conflict checking back in and makes it part
of dfa creation.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:51:20 -08:00
John Johansen
fb61ea7635 Fix xtrans tests
Several of the x-trans tests where failing because of the include file was
bad.  This kept the test from testing what it was supposed as the test
was expected to fail.  Thus hidding a bug :(

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:50:31 -08:00
John Johansen
d4ca9f3ba0 Add profile names that are independent of attachment specification
Add the ability to specify the name and attachment of the profile
separately. It does not allow for the attachment specification to
begin with a variable however since variables in profile names is not
currently support this shouldn't be and issue.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2010-12-20 11:49:42 -08:00
Jamie Strandboge
49f27414e0 update the man pages to:
* add Canonical to the headers of the pod files touched
  * use aa_change_hat() instead of change_hat() (LP: #692216)
  * use http://wiki.apparmor.net in the SEE ALSO
  * use http://https://bugs.launchpad.net/apparmor/+filebug for bugs
  * prefix 'aa-' in SEE ALSO section for utilities (eg, 'aa-complain' for
    'complain')
2010-12-20 13:47:09 -06:00
Jamie Strandboge
77b864527a changehat/mod_apparmor/mod_apparmor.pod: make several clarifications and
add a summary for the order of operations
2010-12-20 13:45:56 -06:00
Jamie Strandboge
e5f4aa4140 parser/apparmor.d.pod: more fully document child profiles, including:
- cx and Cx
  - change_profile()
2010-12-20 13:40:59 -06:00
Jamie Strandboge
289dcfb492 add [^] 2010-12-20 12:50:53 -06:00
Jamie Strandboge
79828d1f10 LP: #349049: document audit, deny and owner rule qualifiers 2010-12-20 12:48:26 -06:00
Jamie Strandboge
7296af3f39 mod_apparmor.pod: adjust for Canonical, launchpad and Ubuntu binaries and tools 2010-12-20 08:35:00 -06:00
Jamie Strandboge
2ade2782d4 parser/apparmor.d.pod: clarify alias rules 2010-12-20 08:34:12 -06:00
John Johansen
34c78d34b1 Combine hat and local profile parsing into the same base rule as profile
parsing.
2010-12-13 16:29:16 -08:00
John Johansen
7c1f5fd932 Merge profile and :namespace:profile parsing into a single rule.
clean up profile parsing by merging profile and :namespace:profile parsing
into a single rule.

This also fixes a bug where the profile	keyword was not allowed to proceed
profiles with a namespace declaration.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2010-12-13 16:26:38 -08:00
Steve Beattie
810f54ffdd Bug: https://bugzilla.novell.com/show_bug.cgi?id=510740
Short summary: Unloading of profiles with a space in the name fails,
therefore "rcapparmor stop" (or restart) causes a funny message - and
the profile is still loaded.

Thanks to Christian Boltz <apparmor@cboltz.de>
2010-11-29 13:40:45 -08:00