Commit graph

2137 commits

Author SHA1 Message Date
John Johansen
d633495817 Add kernel patches for 3.5 and 3.6 kernels 2012-11-20 17:01:28 -08:00
John Johansen
4ede12c5c0 Update documentation of change_hat and change_profile apis
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@gmail.com>
2012-11-20 16:55:09 -08:00
Steve Beattie
849a8bd4d2 Given that we want to do more apparmor things in user space (dbus
mediation, file picker, etc.), making it easier for other source bases
to detect the presence of libapparmor would be beneficial. This patch
adds pkg-config support to the build infrastructure for libapparmor.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-11-14 11:00:06 -08:00
Christian Boltz
fab491b44c Add a profile for samba's winbindd.
I added this profile to the openSUSE apparmor-profiles package in Feb 2012. 
Until now I didn't receive any bugreports so I'd say it's complete ;-)

References: https://bugzilla.novell.com/show_bug.cgi?id=748499

Acked-By: jdstrand (on IRC)
2012-11-06 23:19:46 +01:00
Steve Beattie
8e70fdcdfd Subject: aa-decode test script v3
This patch adds a test script/driver for the aa-decode utility. The only
change from the previous versions is to support overriding the location
of the aa-decode to test via the APPARMOR_DECODE environment variable
and documenting the utils/ tests in the top level README.

The aa-decode test can be run directly from the commandline in the utils
directory like so:

  test/test-aa-decode.py -v

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Christian Boltz <apparmor@cboltz.de>
2012-11-05 17:27:20 -08:00
Steve Beattie
8c7c5a6a80 Subject: two fixes to the parser's simple test driver
This patch fixes two issue with the simple test driver. The first is
that child exec that actually ran the parser was located inside the
eval statement. This meant that if the exec failed for some reason
(like the parser didn't exist), the child wouldn't actually die,
but would pop out of the eval and continue running through the loop
of test profiles (while the parent process does the same). This meant
that if the script ran on the full testsuite with a misconfiguration,
it would explode creating O(n^2) processes, where n is the number of
testcase files -- with over 25k testcases, that's a lot. The fis is to
lift the child exec outside the eval{}, then an exec() failure causes
the child process to die correctly.

The second fix is that several of the testcases were added with the
DESCRIPTION field added in lower case (i.e. #=Description blah blah).
This fix makes the regex that pulls out the description not be
case-sensitive.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: John Johansen <john.johansen@canonical.com>
2012-11-05 17:23:53 -08:00
Steve Beattie
4791fb1bc8 Subject: parameterize parser tests to support different binaries
This patch replaces the hardcoded path to the in-tree apparmor parser
in several of the script based test scripts with the APPARMOR_PARSER
environment variable, keeping the hardcoded location as the default.
It also adds support for overriding the location of the parser via the
same environment variable. The make infrastructure is updated to use
this, though uses a different variable (PARSER) to drive it.

Thus 'make check PARSER=/some/path/to/an/alternate/apparmor_parser'
will run all the parser tests on that binary. This is useful for
running the testsuite in an automated post-install environment.
(It should be noted that doing so will still build and run the unit
test binaries based on the source tree.)

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: John Johansen <john.johansen@canonical.com>
2012-11-05 17:22:37 -08:00
John Johansen
0e88c3ac70 apparmor: Fix clone test on quantal arm omap-4
It turns out that PAGE_SIZE isn't defined on all architectures.

This fixes a regression test failure happening on Ubuntu quantal
on the arm ti-omap4 architecture.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-10-20 01:22:29 -07:00
John Johansen
6fe8e80388 apparmor: add abstractions to support the apparmor api
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-10-20 01:19:22 -07:00
Christian Boltz
50d89bc579 Fix aa-decode handling of stdin
Handling stdin was totally broken (= no output) with the current log 
format because aa-decode expected name= to be the last entry in the 
log line.

This patch for stdin handling
- fixes the pattern to match the current log format (name= is NOT the
  last part in the log entry)
- uses bash replacement to avoid some sed calls (which also means the 
  script now needs an explicit "#!/bin/bash")
- prints decoded filenames in double instead of single quotes to be
  consistent with filenames that were not encoded
- also prints lines that do not contain an encoded filename (instead of 
  grepping them away)
- replace tr calls by perl's uc() (also for non-stdin mode)
- also handle encoded profile names (introduced by Steve)
- don't fail if a file or profile name contains a '

In other words: you can pipe your audit.log through aa-decode, and the 
only difference to the raw audit.log is that filenames are decoded.


Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-10-16 00:19:49 +02:00
John Johansen
528d7c463a So the library version has not been being correctly bumped.
Make this a little bit easier to follow

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-10-12 11:44:11 -07:00
John Johansen
3a9cb05d58 The apparmor coredump regression test was broken.
- It failed to remove coredump files named "core"
- It failed to properly detect "core.<pid>" files
- And it would fail if the coredump_pattern had been modified to
  a different location.

This lead one of the tests to report it was passing when it
wasn't because it was detecting the previous tests core file.
- Fix the test to set the coredump_pattern, to dump into the
  tmpdir used for the test.
- Make it so it will only detect the core file for the pid of
  the last test run.
- And extend the test to have a couple of extra test cases.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-10-01 11:05:24 -07:00
Christian Boltz
5ae05cc2f4 Install extra profiles in /usr/share/apparmor/extra-profiles/ instead of
/etc/apparmor/profiles/extras/, and update the path at various places.

Also update the mailinglist address in extra-profiles README and 
recommend cp instead of mv.

Note: if you want to have a symlink 
    /etc/apparmor/profiles/extras -> /usr/share/apparmor/extra-profiles/
for backward compability, you'll have to create it yourself (for example
in the .spec file)

This also fixes https://bugzilla.novell.com/show_bug.cgi?id=713647


Acked-by: John Johansen <john.johansen@canonical.com>
2012-09-27 23:57:21 +02:00
Christian Boltz
0742f72f4f fix error handling in aa-decode
Acked-By: Steve Beattie <sbeattie@ubuntu.com>

Looks-Good-By: ;-)  Seth Arnold <seth.arnold@gmail.com>
2012-09-17 23:55:28 +02:00
John Johansen
5a026afd9f Merge branch 'bzr/master' 2012-08-16 16:29:16 -07:00
John Johansen
c0b5035b1a apparmor: abstract out the directory walking routine
The apparmor_parser has 3 different directory walking routines. Abstract
them out and use a single common routine.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-16 16:26:03 -07:00
Jamie Strandboge
1b2aaaa440 Gnome applications are now quite interested in reading
/usr/share/poppler/cMap/**. These files are included in the poppler-data
package on Ubuntu, and their 'r' denials create quite a bit of noise.
Apparently they are needed to display PDF documents containing CJK
characters with libpoppler. I added it to the gnome abstraction because
several applications not linked against poppler are consulting this
data.

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-14 14:31:58 -05:00
Jamie Strandboge
175120fdd7 Gnome applications are now quite interested in reading
/usr/share/poppler/cMap/**. These files are included in the poppler-data
package on Ubuntu, and their 'r' denials create quite a bit of noise.
Apparently they are needed to display PDF documents containing CJK
characters with libpoppler. I added it to the gnome abstraction because
several applications not linked against poppler are consulting this
data.

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-14 14:31:58 -05:00
Jamie Strandboge
bf2eebd54d CAP_EPOLLWAKEUP was renamed to CAP_BLOCK_SUSPEND. Update severity.db for that.
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-14 13:46:10 -05:00
Jamie Strandboge
19a6b9673e update fonts abstraction for new fontconfig paths
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-14 13:40:58 -05:00
John Johansen
9c42360b34 apparmor: correct apparmor_parser -N command privilege
Fix the apparmor_parsers -N command (which dumps the list of profile
names found in a policy file) to be available without privilege and
also make it be recognized as a command instead of an option so that
it can conflict with -a -r -R -S and -o.

Currently it can be specified with these commands but will cause the
parser to short circuit just dumping the names and not doing the actual
profile compile or load.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-13 16:59:00 -07:00
John Johansen
8eb069cce5 apparmor: update apparmor_parser man page
Rework and update the apparmor_parser man page. It reworks some of the
text but mostly just reorganizes the commands and options into logical
grouping to make it easier to sort out how the various commands and
options work.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-13 16:58:46 -07:00
John Johansen
55d6f869fc apparmor: add clearing the profile cache when inconsistent
Add the ability to clear out the binary profile cache. This removes the
need to have a separate script to handle the logic of checking and
removing the cache if it is out of date.

The parser already does all the checking to determine cache validity
so it makes sense to allow the parser to clear out inconsistent cache
when it has been instructed to update the cache.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-08-13 16:58:33 -07:00
Christian Boltz
aa4f2813e4 /bin/ping moved to /usr/bin/ping on openSUSE (usrMerge)
Update the profile to make sure it's still used.

Acked-by: John Johansen <john.johansen@canonical.com>
2012-08-10 00:51:40 +02:00
Christian Boltz
ee71bf3b71 ls moved from /bin/ to /usr/bin/ on openSUSE (usrMove)
Acked-by: John Johansen <john.johansen@canonical.com>
2012-08-06 13:56:31 +02:00
John Johansen
d64d860c93 The previous patch to fix policy compilation around the network flag had a
serious flaw. The test for the network flag was being applied against both
the kernel flags and the cache flags. This means that if either the kernel
or the cache did not have the flag set then network mediation would be
turned off.

Thus if a kernel was booted without the flag, and a cache was generated
based on that kernel and then the system was rebooted into a kernel with
the network flag present, the parser on generating the new policy would
detect the old cache did not support network and turn it off for the
new policy as well.

This can be fixed by either removing the old cache first or regenerating
the cache twice. As the first generation will write that networking is
supported in the cache (even though the policy will have it disabled), and
the second generation will generate the correct policy.

The following patch moves the test so that it is only applied to the kernel
flags set.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2012-07-17 16:03:32 -07:00
Jamie Strandboge
83a48dd395 Author: Mark Ramsell <mramsell@qazonline.net>
Description: ubuntu-integration does not work properly with exo-open
Bug-Ubuntu: https://launchpad.net/bugs/987578

Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-07-05 12:37:03 -05:00
Jamie Strandboge
58646ebf20 Description: let sanitized-helper also allow access to /usr/local. Patch based
on work by Reuben Thomas
Bug-Ubuntu: https://launchpad.net/bugs/1013887

Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-07-05 12:36:01 -05:00
Jamie Strandboge
f7d1df0aab Description: update ubuntu-browsers.d/java for IcedTea 7
Bug-Ubuntu: https://launchpad.net/bugs/1003856

Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-07-05 12:34:45 -05:00
Jamie Strandboge
e7da3d81d1 use PYTHON in utils/python-tools-setup.py if it is defined
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2012-07-01 09:12:29 -05:00
John Johansen
3d4a98bed9 Fix the parser so it checks for the presence of the network feature in the
compatibility interface. Previously it was assuming that if the compatibility
interface was present that network rules where also present, this is not
necessarily true and causes apparmor to break when only the compatibility
patch is applied.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-07-01 01:36:37 -07:00
John Johansen
a465a211c2 Have build check for presence of awk and fail with a sensible error message
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-06-29 16:54:12 -07:00
Jamie Strandboge
09ab5e4d65 CAP_EPOLLWAKEUP was added to the 3.5 series in:
http://thread.gmane.org/gmane.linux.kernel/1289986

This allows for drivers that support poll to prevent suspend. Adjust
utils/severity.db for this.

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2012-06-29 13:48:28 -05:00
Jamie Strandboge
87d912e4db Initial port to python3 for utilities. Thanks to Dmitrijs Ledkovs
Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-06-29 13:35:57 -05:00
Dmitrijs Ledkovs
18ea588e5c typo 2012-06-12 14:30:57 +01:00
Dmitrijs Ledkovs
3418d895f2 Remaining typos 2012-06-12 14:28:41 +01:00
Dmitrijs Ledkovs
5fcbcf3ddc python2/3 compatible ac_python_devel.m4 2012-06-12 13:56:57 +01:00
Dmitrijs Ledkovs
9f19fb7b53 * Use with open('file') as f, to prevent leaking file descriptors
* More print -> sys.stdXXX.write() conversions
* Use `except Error as ex` & no sys.version checks
* add with_statement import for py2.5 compat
* remove unused import
2012-06-12 11:37:36 +01:00
Dmitrijs Ledkovs
00505ab2dc newline parity with print statement vs sys.stdout.write 2012-06-11 18:31:31 +01:00
Dmitrijs Ledkovs
dac3c00862 Initial port to python3 for utilities. 2012-06-11 17:56:21 +01:00
John Johansen
5b6b2bbc01 Original Author: mancha@mancha.user.oftc.net
create-apparmor.vim.py was failing on systems with python 2.5, fix that

Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
2012-06-08 14:30:22 -07:00
John Johansen
ad7fecf48e While integrating 3.4-rc1, I ran into a problem where network rules
weren't being processed. It ultimately boiled down to a kernel issue
but I found it useful to see what the parser thought it was working
with. Since the parser already has a debugging mode that will show things
like capabilities, it was an obvious extension to add network rules.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2012-06-07 00:41:04 -07:00
John Johansen
cc06a43142 Change version to 2.8.95 to reflect this is the development version 2012-06-07 00:34:08 -07:00
Christian Boltz
79aa2d1138 move generation of file rules to create-apparmor.vim
This patch moves the generation of file rules from apparmor.vim.in to
create-apparmor.vim.py. It also adds support for
- filenames in quotes
- reverse syntax (permissions first)

The patch also removes an outdated $Id header in apparmor.vim.in and
updates the copyright year.


Acked-By: John Johansen <john.johansen@canonical.com>
2012-06-05 21:18:30 +02:00
John Johansen
1fd88819be Set apparmor_2.8.0 release tag 2012-05-31 10:29:35 -07:00
John Johansen
7b98d8a227 Bump version to apparmor 2.8.0 2012-05-31 10:27:48 -07:00
John Johansen
b0443467aa Bump version number to 2.8.0 2012-05-31 10:25:02 -07:00
John Johansen
41b454f2e5 Older C++ compilers complain about the use of a class with a non trivial
constructor in a union.  Change the ProtoState class to use an init fn
instead of a constructor.
2012-05-30 14:31:41 -07:00
John Johansen
2347b6628d Kernel patches for v3.2, v3.3, v3.4 kernels 2012-05-21 20:23:15 -07:00
Jamie Strandboge
64a8698a5f Adjust path for thunderbird to include non-versioned path
Bug-Ubuntu: https://launchpad.net/bugs/990931

Acked-By: Jamie Strandboge <jamie@canonical.com>
2012-05-18 15:30:22 -05:00