Commit graph

371 commits

Author SHA1 Message Date
John Johansen
b5b42f3de1 Remove old translation files and regenerate .pot as discussed in todays meeting 2013-11-13 21:20:25 -08:00
Tyler Hicks
1d1ccf7488 utils: Ignore unsupported log events
The log parsing in the Immunix::AppArmor perl module has fallen behind
when it comes to audit events from some of the newer rule types
supported by apparmor_parser.

When an unsupported event is found, it causes aa-logprof to error out.
This patch creates a list of valid, but unsupported, event operations
that should be ignored by the perl module when parsing logs.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2013-10-29 17:04:28 -07:00
Steve Beattie
17f0565afc add optional allow prefix to the language
From: John Johansen <john.johansen@canonical.com>

let allow be used as a prefix in place of deny.  Allow is the default
and is implicit so it is not needed but some user keep tripping over
it, and it makes the language more symmetric

   eg.
      /foo rw,
      allow /foo rw,
      deny /foo rw,

Patch history:
  v1: - initial revision

  v2: - rename yacc target rule from opt_deny to opt_perm_mode to
reflect
        that it can be either an allow or deny modifier
      - break apart tests into more digestible chunks and to clarify
        their purpose
      - fix some tests to exercise 'audit allow'
      - add negative tests for 'allow' and 'deny' in the same rule
      - add support for 'allow' keyword to apparmor.vim
      - fix a bug in apparmor.vim to let it recognize multiple
        capability entries in a single line.

  v3: - add support for optional keywords on capability rules in
        regression tests, as well as the bare capability keyword (via
        'cap:ALL')
      - add allow, deny, and conflicting capability behavioral
        regression tests
      - fix vim syntax modeline to refer to apparmor in parser tests
      - adjust FILE regex in vim syntax file creator script

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2013-09-20 06:48:56 -07:00
Christian Boltz
ec7381483a aa-unconfined displays less unconfined processes in some languages (for
example with LANG=pt_BR) because a regex relies on netstat output.

Enforce LANG=C to make sure aa-unconfined always sees the expected output.

Acked-by: Steve Beattie <steve@nxnw.org>
2013-09-20 13:21:50 +02:00
Christian Boltz
198f660ee8 fix broken URLs in various utils/*.pod files.
(The broken URLs were introduced in r1582.)

for utils/*.pod:
  Acked-by: Steve Beattie <steve@nxnw.org> 

for the other directories:
  Patch by Steve Beattie
  Acked-by: Christian Boltz <apparmor@cboltz.de>
2013-09-19 21:17:39 +02:00
Christian Boltz
3d989e822d fix some (mis)translations in utils/po/de.po
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2013-09-14 00:36:31 +02:00
Tyler Hicks
a5213b572c utils: Ignore unsupported rules
The profile parsing in the Immunix::AppArmor perl module has fallen
behind when it comes to some of the newer rule types and syntax
supported by apparmor_parser.

When an unsupported rule is found, it causes aa-logprof and aa-genprof
to error out. This patch creates a list of valid, but unsupported rule
types that should be ignored by the perl module when parsing policy.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2013-08-26 16:53:01 -07:00
Christian Boltz
9af7906180 use grep instead of ~~ (smartmatch)
Patch by Kshitij Gupta <kgupta8592@gmail.com>

A previous bugreport [1] was fixed using the smartmatch operator,
which raised the minimum Perl version requirement to >=5.10.1 .
However in Perl5.18 the smartmatch operator has again become
"experimental" [2] so the following patch replace smartmatch operator
with grep and thereby avoiding the requirement hike and avoiding
warnings.

[1] https://bugs.launchpad.net/apparmor/+bug/1180230

[2] http://blogs.perl.org/users/mike_b/2013/06/a-little-nicer-way-to-use-smartmatch-on-perl-518.html

ACKed-by: Christian Boltz <apparmor@cboltz.de>
2013-08-23 22:02:15 +02:00
Steve Beattie
d1791ff286 Description: clean out test dir python cache directory
Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2013-08-12 17:55:45 -07:00
Seth Arnold
2ba755318f Fix $options -> @options in previous patch. Fix tabs -> spaces.
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
2013-07-09 16:02:08 -07:00
Seth Arnold
03908feacc Kshitij Gupta found and fixed a problem with Glob and Glob w/ Ext behavior
in aa-logprof and aa-genprof that would add duplicate entries to the
interactive list of permissions.

https://bugs.launchpad.net/bugs/1180230
2013-07-05 14:12:08 -07:00
Christian Boltz
e03a9ba22f merge https://code.launchpad.net/~kensington/apparmor/apparmor/+merge/169010
Michael Palimaka 2013-06-13 Add missing key shortcuts for hu linguas.
2013-07-01 17:44:53 +02:00
Michael Palimaka
1974c22e54 Move apparmor.vim.5 from parser to utils (apparmor.vim already lives there). 2013-06-30 00:25:44 +10:00
Jamie Strandboge
80f5a9a448 remove unneeded perl requires on Time::Local and File::Basename
Acked-By: Jamie Strandboge <jamie@canonical.com>
2013-06-27 12:11:09 -05:00
Michael Palimaka
b6c9f6cc53 Add missing key shortcuts for hu linguas. 2013-06-13 02:10:46 +10:00
Jamie Strandboge
ae2cdf0fad Fix two race conditions:
1) make sure that the xpra socket exists before trying to attach to it
2) make sure that the client has attached before we start the application

The fix for '1' solves a problem when the system is under load and the
one for '2' fixes a problem with firefox starting too soon and not
having system themes applied.

Exercising the 1 week rule. Seth Arnold commented on the added sleeps and I
adjusted one based on his comments and replied to the list that the other is
needed and that this improves the sandbox/xpra code but that there are
limitations with driving xpra.

Acked-By: Jamie Strandboge <jamie@canonical.com>
2013-04-09 08:31:39 -05:00
Jamie Strandboge
e91ac70739 revert r2080, it doesn't actually help anything 2013-01-14 08:55:53 -06:00
Jamie Strandboge
52d8345a55 merge from trunk 2013-01-14 08:54:29 -06:00
Christian Boltz
5a053dc580 speed up aa-decode by using a bash regex matching instead of calling egrep for each line.
Acked-by: Steve Beattie <sbeattie@ubuntu.com>

(Patch sent 2012-11-01, Acked-by from 2013-01-01)
2013-01-01 20:15:04 +01:00
Jamie Strandboge
7baf9a4d36 utils/apparmor/sandbox.py: sigh, add another sleep to avoid a race in firefox 2012-12-04 10:15:34 -06:00
Jamie Strandboge
826a84aca1 merge from trunk 2012-12-04 10:12:09 -06: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
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
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
Jamie Strandboge
a8f5562bde utils/apparmor/sandbox.py: adjust LIBOVERLAY_SCROLLBAR too, since the overlay
scrollbar doesn't track properly
2012-09-03 14:29:05 -05:00
Jamie Strandboge
aa6407d07b utils/apparmor/sandbox.py: only save environment variables that exist 2012-08-29 08:56:06 -05:00
Jamie Strandboge
457d19beaf utils/aa-sandbox.pod: note on hotplugging monitors 2012-08-29 08:49:15 -05:00
Jamie Strandboge
a324724cf3 utils/apparmor/sandbox.py: set QT_X11_NO_NATIVE_MENUBAR=1
utils/aa-sandbox.pod: update KNOWN LIMITATIONS for global menu
2012-08-29 08:43:48 -05:00
Jamie Strandboge
08d91ef714 utils/apparmor/sandbox.py: update title again 2012-08-28 11:56:18 -05:00
Jamie Strandboge
7eeaa74dd9 utils/apparmor/sandbox.py: fix error warning 2012-08-28 08:39:39 -05:00
Jamie Strandboge
0cd5965fcc utils/aa-sandbox.pod:
- clean up LIMITATIONS a bit
- mention lack of cursor support
2012-08-28 08:09:46 -05:00
Jamie Strandboge
06cc33166d utils/aa-sandbox.pod: document limitations 2012-08-28 08:01:15 -05:00
Jamie Strandboge
f2050ec13a utils/aa-sandbox.pod: document --with-clipboard 2012-08-28 07:44:49 -05:00
Jamie Strandboge
c92491621b utils/apparmor/sandbox.py:
- add --with-clipboard for use with xpra
- check for incompatible options
2012-08-28 07:41:23 -05:00
Jamie Strandboge
091bcd72fd adjust title to include the display 2012-08-27 20:13:41 -05:00
Jamie Strandboge
981188e17a utils/apparmor/sandbox.py: use a 3840x2560 server size to reduce memory usage 2012-08-27 17:18:21 -05:00
Jamie Strandboge
72995c5bcb utils/easyprof/templates/sandbox-x: add explicit deny rule to deny
@{HOME}/.Xauthority
utils/apparmor/sandbox.py: verify the above rule is any any dynamic templates
 that use -X
utils/aa-sandbox.pod: update man page to warn about /.Xauthority access
2012-08-27 16:43:20 -05:00
Jamie Strandboge
cb3d73424b utils/apparmor/sandbox.py: add --read-path=x.xauth to opt 2012-08-27 16:16:04 -05:00
Jamie Strandboge
392b5e07c0 various fixes based on feedback from James Troup. 2012-08-27 16:11:01 -05:00
Jamie Strandboge
ea6b1568b4 utils/apparmor/sandbox.py:
- use signal.<signal> instead of hardcoding a number
- add --with-xauthority option
- remove '-r' and '--with-geometry' and use --with-xephyr-geometry instead
- allow passing arguments to the application when using aa-exec
- kill with SIGTERM, then try again with SIGKILL
- always use os.execv() in forks. Using cmd() when not specifying '-d' created
  different behaviors between debug and non-debug mode
- better cleanup Xpra when aa-exec command fails
- use the full dummy.xorg.conf, which gives us the correct modelines for large
  displays. This fixes the issue "Server's virtual screen is too small .... You
  may see strange behavior." which should up when the window's size was bigger
  than the 'current server resolution'
2012-08-27 15:27:30 -05:00
Jamie Strandboge
3ad2820ebd utils/apparmor/sandbox.py:
- cleanup environment handling
- refactor cleanup code
- verify Xsecurity is setup correctly (ie, interpret output of xhost)
- add generation of .Xauthority-sandbox...
- explitly use SECURITY extension
2012-08-27 10:54:26 -05:00
Jamie Strandboge
fd4986e726 manpage updates 2012-08-24 12:16:20 -05:00
Jamie Strandboge
bb58f40ae3 add utils/aa-sandbox.pod 2012-08-24 12:07:19 -05:00
Jamie Strandboge
ec5973a3e6 utils/apparmor/sandbox.py: change 'resolution' to 'geometry' 2012-08-24 12:06:54 -05:00
Jamie Strandboge
72dbf597cc utils/apparmor/sandbox.py: use pkexec if '--with-x' is specified 2012-08-24 11:21:21 -05:00
Jamie Strandboge
c062a8a841 utils/apparmor/sandbox.py:
- fix detection of xdummy driver
- update comments
- add '--no-tray' to 'xpra attach'
2012-08-24 11:09:35 -05:00
Jamie Strandboge
056e642d2b utils/apparmor/sandbox.py: bail if we don't have xdummy 2012-08-24 10:57:28 -05:00
Jamie Strandboge
3fe45e4a9b utils/apparmor/sandbox.py: sleep for 0.5 seconds initially, then poll every
second
2012-08-24 10:52:22 -05:00
Jamie Strandboge
064887dfbd catch exception for x.start() 2012-08-24 10:49:24 -05:00