Commit graph

206 commits

Author SHA1 Message Date
Jamie Strandboge
a029b16066 apparmor_notify:
- verify $opt_s is initialized (LP: #582075)
- don't show summary if $opt_s < 1
2010-05-27 09:08:12 -05:00
Jamie Strandboge
ea4756a802 ##rmor_notify: show last date when using -s # -v 2010-05-14 00:08:31 +02:00
Jamie Strandboge
7d76eea05a apparmor_notify: show last date when using -s # -v 2010-05-14 00:07:32 +02:00
Jamie Strandboge
8e97e4a405 apparmor_notify: add long options. Your welcome Steve ;) 2010-05-12 10:46:22 +02:00
Jamie Strandboge
96b1328967 apparmor_notify: adjust '(3 total)' to '(3 found)' 2010-04-08 23:00:52 -05:00
Jamie Strandboge
0254d63fdc apparmor_notify: group like entries together when using -v with -s. Eg:
$ sudo apparmor_notify -s 1 -v
 Profile: /usr/lib/firefox-3.6.3/firefox-*bin
 Operation: exec
 Name: /usr/bin/apturl
 Denied: ::x
 Logfile: /var/log/audit/audit.log

 Profile: /usr/sbin/ntpd
 Operation: open
 Name: /var/lib/ntp/ntp.conf.dhcp
 Denied: r::
 Logfile: /var/log/audit/audit.log
 (3 total)

 AppArmor denials: 4 (since Wed Apr  7 22:57:56 2010)
 For more information, please see: https://wiki.ubuntu.com/DebuggingApparmor
2010-04-08 22:57:04 -05:00
Jamie Strandboge
c38f0f22bc apparmor_notify: remove stray print 2010-03-30 12:26:32 -05:00
Jamie Strandboge
24446dd1d0 apparmor_notify.pod: add -u and -w options 2010-03-30 10:48:51 -05:00
Jamie Strandboge
cd90674f37 apparmor_notify: fix reopening logfile after dropping privileges (ie, notice
when auditd logs get rotated)
- use getgrnam() with setgid when dropping to nobody_group
- add '-u USER' option to drop to this user when running priviliged but
  not under sudo. Useful for starting when logged in as root.
- add a read access check before get_logfile_inode() so we don't have to
  wait for the timeout in get_logfile_inode()
- set euid only when dropping privileges, instead of using POSIX::setuid()
  which sets uid, euid and saved id when starting privileged
- create send_message() function which fork/execs so that we can set the
  real uid before calling notify-send (notify-send looks at the real uid
  when trying to connect to dbus)
- adjust reopen_logfile() to raise privileges (via euid) before accessing
  logfile when $< != $>. Drop them again after open().
2010-03-30 10:31:23 -05:00
Jamie Strandboge
4cfe8e9d48 apparmor_notify.pod: update for -f 2010-03-27 09:16:38 -05:00
Jamie Strandboge
5ceb1fa1c9 apparmor_notify:
- also check for inode change
- update size to use stat
- treat logfile_size like logfile_inode
- update logfile_size and logfile_inode in reopen_logfile()
2010-03-27 09:14:33 -05:00
Jamie Strandboge
4fb9a702f0 apparmor_notify:
- add -f option to optionally specify the logfile
- when polling, check to see if the logfile size decreased, and if so, reopen
  it. Currently this only works if you can read the file after dropping
  privileges
2010-03-27 08:28:07 -05:00
Marc Deslauriers
daffe30e47 - utils/SubDomain.pm: get rid of warnings 2010-03-26 09:51:21 -04:00
John Johansen
e2737566ff Fix genprof/logprof to handle create (c) and delete (d) permissions that
are being reported by the kernel modules auditing.
2010-03-10 15:30:06 -08:00
Jamie Strandboge
dd3a979827 apparmor_notify: call getopt and check for -h before trying to open audit.log,
so help can be used as non-root when auditd is installed
2010-03-10 10:11:26 -06:00
Jamie Strandboge
75d858a764 apparmor_notify: add -w NUM -- wait NUM seconds before displaying notifications
(with -p)
2010-03-03 11:30:55 -06:00
Jamie Strandboge
e0ca522633 fix pod2man error in apparmor_notify.pod 2010-02-12 10:25:02 -06:00
Jamie Strandboge
a58c1b5119 utils/Makefile: install apparmor_notify
add utils/apparmor_notify.pod
2010-02-12 10:14:11 -06:00
Jamie Strandboge
737cd15707 apparmor_notify: allow -s option with -p 2010-02-04 00:15:24 -08:00
Jamie Strandboge
858d535389 apparmor_notify: simple aggregation on first run 2010-02-03 21:50:05 -08:00
Jamie Strandboge
767bf6d1d7 apparmor_notify: handle being called as apparmor_notify or aa-notify 2010-02-03 20:56:38 -08:00
Jamie Strandboge
29a95e10de rename apparmor-notify to apparmor_notify
update apparmor_notify to read ~/.apparmor/notify.conf
2010-02-01 17:30:04 -08:00
Jamie Strandboge
26499f965b utils/apparmor-notify: adjust copyright to match the rest of the source 2010-01-28 10:58:38 -06:00
Jamie Strandboge
75b07641fd add utils/apparmor-notify and utils/notify.conf, but don't install yet 2010-01-28 10:25:09 -06:00
Jamie Strandboge
e8b3312f2e add aa-decode and manpage
For now just look at 'name=...' which is usually the last in the log entry,
so validate input against this and output based on it.
TODO: better handle other cases too
2010-01-12 07:19:20 -06:00
Kees Cook
938385db40 sort on profile names when reporting results from aa-status 2010-01-02 22:18:51 -08:00
Kees Cook
3c43ce869c have "enforce" command clear out symlink directories, from Ubuntu 2009-11-11 11:38:26 -08:00
Kees Cook
190329745d handle new null profile logs, handle new include directories. from ubuntu branch 2009-11-11 11:37:30 -08:00
Kees Cook
6fa3406b0e update more documentation, update Debian start-up script for LSB, flip logprof repo 2009-11-11 10:51:05 -08:00
Kees Cook
da6c9246f5 clear remaining $Id$ tags, since bzr does not suppor them 2009-11-11 10:44:26 -08:00
Steve Beattie
b02e3ff0cd Fix up a couple of grotty bits around the debugging code. 2009-03-19 17:36:40 +00:00
Steve Beattie
be5ddfa59b utils/SubDomain.pm:
- Update matching regex for reordered kernel audit messages (when they
  come through syslog). Ideally, rather than use a regex, the utils would
  just use the log parsing library to determine whether it's a log even
  of interest.
- fix debugging code write a logfile in /var/log/apparmor and not a
  predictable location in /tmp; File::Temp would be the right solution
  except that the log file is created in a BEGIN clause, and
  File::Temp.new() ends up returning an unopened filehandle in that
  situation, so logging fails. Someone with more perl-fu may know how to
  fix that.
2009-03-19 15:32:02 +00:00
John Johansen
262075ca80 Update translation files 2009-02-07 12:09:50 +00:00
John Johansen
1def78f1c4 Add missing gettext for "Repository" prompt 2009-02-06 11:09:54 +00:00
John Johansen
9bf970a4c1 Fix the utils to use the unconfined instead of unconstrained, as the kernel no
longer supports the word unconstrained.
2008-11-21 13:03:52 +00:00
John Johansen
e9e58b9887 Fix bnc#447566, where enforce, complain, and audit tools fail to work
for profiles that use the profile keyword before the profile name.
2008-11-21 13:03:00 +00:00
John Johansen
7fdf8d9925 Fix bnc#430358 where the utils make an invalid profile, by outputting
other rules with no permissions.

Since other rules are not currently supported, remove them.
2008-11-21 12:58:48 +00:00
John Johansen
4c3df3ae53 fix bnc#407491, where a solatary / is not properly handled by the utils
The / is stripped and permission is prompted for a "" path.
2008-11-21 12:57:08 +00:00
John Johansen
39343c8675 Fix fork track (bnc#447564)
Fork tracking is broken by the kernel message for clone no longer supplying
the child pid correctly.  Instead the parent pid will be output with each
message and the tools will fake a fork when they detect a previously
unknow parent child relationship.
2008-11-21 12:55:00 +00:00
John Johansen
77caea2cc7 'unconfined' can appear to mix up process names eg. (/usr/bin/rsync vs.
/usr/bin/rsyncd) bnc#408869

The unconfined tool shows:

[...]
29799 /usr/bin/rsync not confined
29799 /usr/bin/rsync not confined

This is because unconfined is grabbing the post symlink resolved exe filename
which for /usr/sbin/rsyncd is /usr/bin/rsync.

To fix this provide both the cmdline and exec name in parenthesis when the
exe name and the cmdline name differ.

For the above example you would see
29799 /usr/bin/rsync (/usr/sbin/rsyncd) not confined
2008-11-21 12:31:22 +00:00
John Johansen
4f2821bce0 Update translation files 2008-11-07 12:02:32 +00:00
Steve Beattie
32696e32bc Things will also be painfully broken if there's a profile for /bin/dash,
which serves as /bin/sh on ubuntu.
2008-11-06 22:48:32 +00:00
Steve Beattie
288aed8886 Fix uninitialized variable warning if /etc/apparmor/repository.conf does
not exist.
2008-11-04 20:37:57 +00:00
John Johansen
f2dec0e337 fix for bnc408846, where network rules are repeatedly prompted for even when
a matching rule is in the profile.
2008-09-10 08:38:44 +00:00
John Johansen
4fb77c6f5d fix 3 bugs currently convered by bnc408877
- flags being dropped from hats
- rules can be poorly split on writing the profile
- identical rules with different permissions are not properly combined, so
  that only permissions of the last rule are kept
2008-09-10 08:36:59 +00:00
John Johansen
748e398c21 - various patches and cleanups from kees@ubuntu.com 2008-06-11 20:19:36 +00:00
John Johansen
e663e7c0b0 Zbyniu Krzystolik <zbyniu@pld-linux.org>
Added missing capabilities names.
Simple rlimits support.  It doesn't care about range of individual limit, 
you can add ie -100G stack size or 100M nice. But maybe sufficient?
2008-06-09 23:30:35 +00:00
John Johansen
aa0b2030c7 add missing for 2008-06-04 11:36:13 +00:00
John Johansen
9e8c5e9914 Fix two bugs
- rpc was failing when passing arrays because the perl is_utf8 string flag
  was set even though its only sending numbers but newer HTTP::Message
  checks for this is_utf8 and if it finds it aborts.
- fix local profiles
  local profiles were failing because
  1.) the parameters to serialize_profile were bad
  2.) the file location was not getting updated so they would get written
      back to the inactive profiles directory
2008-06-03 21:54:55 +00:00
John Johansen
cb9f84a61e fix repository profile saving, where the name for profiles from the repository got lost on saving 2008-06-03 10:38:19 +00:00