Commit graph

196 commits

Author SHA1 Message Date
John Johansen
e06d1bf84b add support for audit keyword 2008-04-18 21:09:05 +00:00
John Johansen
ad996cec9c add support for set capability 2008-04-18 21:08:34 +00:00
John Johansen
94c795aa52 Hrmm. Actually add support for deny rules 2008-04-18 21:08:05 +00:00
John Johansen
ac273b33f8 Add support for deny rules 2008-04-18 21:07:37 +00:00
John Johansen
9b7912c39f add an extra hash level to distiguish between allow and deny - only use allow 2008-04-18 21:07:16 +00:00
John Johansen
36e0d38fc4 rename global vartable to the filetable 2008-04-18 21:06:24 +00:00
John Johansen
8d715ce9d6 make it so just reading an embedded hat doesn't cause the profile to be rewritten 2008-04-18 21:04:54 +00:00
John Johansen
6e87b3f004 add enough support for cx modes that parsing can succeed 2008-04-18 21:04:16 +00:00
John Johansen
bc652326a7 refactor to pass the profile down, as a step to making routines more generic and independant 2008-04-18 21:03:28 +00:00
John Johansen
1c8b9a51e4 make modes be stored as a bit set and use bit operations 2008-04-18 21:02:47 +00:00
John Johansen
83a35b57c2 give paths a sub hash to store mode into 2008-04-18 21:02:07 +00:00
John Johansen
e43a4769be retain the filename the profile was loaded from and use that when writting it back out 2008-04-18 21:01:10 +00:00
John Johansen
f213706f17 support retaining variables in the head of the file 2008-04-18 21:00:35 +00:00
John Johansen
5a088a1a47 change order that rules are output in 2008-04-18 20:59:42 +00:00
John Johansen
0cbaee9902 support parsing retaining of subset on link rules 2008-04-18 20:59:00 +00:00
John Johansen
a67cfbbb30 keep variables 2008-04-18 20:58:07 +00:00
John Johansen
2a0dc5aae9 keep change_hat rules 2008-04-18 20:57:51 +00:00
John Johansen
d07689e2a7 support and keep profiles using the profile keyword 2008-04-18 20:57:33 +00:00
John Johansen
5d1d6d31c3 keep set capability rules 2008-04-18 20:57:01 +00:00
John Johansen
03728a0155 keep rlimit rules 2008-04-18 20:56:41 +00:00
John Johansen
715952ce0d keep alias rules 2008-04-18 20:56:26 +00:00
John Johansen
de95e8b6ef keep change_profile rules 2008-04-18 20:56:08 +00:00
John Johansen
cda1e94f8a basic patch to link rules 2008-04-18 20:55:43 +00:00
John Johansen
7ec531f4e8 try to make some general writer routines 2008-04-18 20:55:11 +00:00
John Johansen
e48fccb6d0 simple patch to map u::g modes into old style 2008-04-18 20:50:18 +00:00
John Johansen
e25c4dad06 fix bug where task was getting dropped 2008-04-18 20:49:48 +00:00
John Johansen
89b9ef516a don't change locale if yast has already set them 2008-04-18 20:49:00 +00:00
John Johansen
c6666773d9 update config to point the repo to 11.0 2008-04-10 08:51:29 +00:00
John Johansen
9961c4b895 skip vim swp files in the profile dir. bnc#205105 2008-04-10 08:40:52 +00:00
John Johansen
e59f8bfd29 fix bnc@304205. Stop redefining LC_MESSAGES when it yast has alread
defined it.
2008-04-10 08:25:23 +00:00
John Johansen
6850b933dc Fix bnc#257286, so that if complain or enfore fail to load the profile,
they will fail and dump the profiles error message.
2008-04-10 07:25:46 +00:00
John Johansen
d870116ae5 fix bnc#304205. This results in the following warning, when a profile already
exits but doesn't have a flags=(X) component.

Use of uninitialized value in substitution (s///) at
       /usr/lib/perl5/vendor_perl/Immunix/SubDomain.pm line 4687 (#1)
   (W uninitialized) An undefined value was used as if it were already
   defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
   To suppress this warning assign a defined value to your variables.

   To help you figure out what was undefined, perl tells you what operation
   you used the undefined value in.  Note, however, that perl optimizes your
   program and the operation displayed in the warning may not necessarily
   appear literally in your program.  For example, "that $foo" is
   usually optimized into "that " . $foo, and the warning will refer to
   the concatenation (.) operator, even though there is no . in your
   program.
2008-03-13 15:12:30 +00:00
John Johansen
aed6f06800 Fix bug where genprof/logprof would just die on newer mode format.
This does not allow genprof/logprof to enable features using the
new format, just work with the new style logs.
2008-03-13 10:49:44 +00:00
John Johansen
ba6606460d add missing files from previous set of commits 2008-02-26 12:28:42 +00:00
John Johansen
28860a8386 repo-cmd-line-tool.diff - Basic prototype for a command line tool to allow
users to push/pull/search for profiles in remote
                            repositories. It is not fully functional at the
                            moment (the official repository is down) but I'd
                            like to get feedback on the basic usage. The
                            options for
                              push/pull/search/status/getconfig/setconfig
                            are working (usage/help below). I think the next
                            step could be a basic gtk UI to give users a
                            decent UI to manage profiles/repositories.
                            Feedback welcomed about the usage model - 
                            would a graphical tool make sense?

--------------------------------------------------------
aa-repo.pl --command args
    --search [author=XXX] [prog=XXX] [id=XXX]
             Search the repository for profiles matching the search criteria
             and return the results.
             NOTE: One --search switch per option

    --verbose|v
             Verbosity level. Supply either one or two switches. Two switches
             adds full profile text in returned search results.

    --push   [--profile=XXX|all] [--changelog=XXX]
             Push local profiles to repository, uses configured user and upon
             overwrite of an existing profile in the repository then prompt
             user with a diff for confirmation XXX the name of the application
             whose profile should be uploaded or "all"  to upload all
             profiles.  Multiple --profile switches may be passed to supply
             multiple profile names

             e.g.  --push --profile /usr/sbin/mdnsd --profile /usr/sbin/ftp
             e.g.  --push --profile all

    --pull   [--author=XXX] [--profile=XXX] or [--id=XXX] [--mode=complain]
             pull remote profiles and install on local system
             If operation will change local profiles then prompt user with
             diff for confirmation
             NOTE: One --pull switch per option and there are three acceptable
                   combinations

             --pull --author=XXX
               * pull all profiles in the repo for the author

             --pull --author=XXX  --profile=XXXX
               * pull the profile for prog owned by author

             --pull --id=XXXX
               * pull the profile with id

             --pull --mode=complain
               * set the profile(s) to complain mode when installed

             Profiles are checked for conflicts with currently installed
             profiles and presented as a list to the user to confirm and view.

    --sync   [--up] [--down] [--noconfirm]
             Synchronize local profile set with the repository - showing
             changes and allowing prompting the user with the diffs and
             suggest the newest version to be activated. If the --all option
             is passed then treat profiles not marked as remote as new
             profiles that will be uploaded to the repository.

    --status
             Show the current status of the local profile set. This operation
             is similar to sync but does not prompt the user to up|down load
             changes

    --setconfig [url=xxx] [username=xxxx] [password=xxxx] [enabled=(yes|no)]
                [upload=(yes|no)]
              Set the configuration options for the repository.
              NOTE: One --setconfig switch per option

    --getconfig|c
             Print the current configuration for the repsository

    --quiet|q Don't prompt user - assume that all changes should be made.
2008-02-26 12:02:00 +00:00
John Johansen
010fc621ca logparse.diff - Update the tools to use the apparmor loparsing
library to read events from the log files.
2008-02-26 12:01:10 +00:00
John Johansen
0562961d71 repo-refactor.diff - Refactor the basic repository communication
routines into a standalone perl module.
                            Factor out the config file reading/writing into a
                            standalone perl module. The goal here was to
                            start to break out some of the basic routines
                            that the tools use into their own independent
                            modules.
2008-02-26 12:00:37 +00:00
John Johansen
dfe2b6d3db reverse commit 1104 removing optional use of xml-rpc. May reintroduce later 2008-02-26 11:58:40 +00:00
John Johansen
7140ac64a3 Make rpc-xml optional (only needed if repository is used) 2008-02-19 18:50:36 +00:00
John Johansen
1421b0b366 merge over update of .spec %changes from r1083 2008-02-19 18:49:35 +00:00
John Johansen
fb62cb15b2 update apparmor_status to work when apparmor is a kernel builtin 2008-01-05 08:29:39 +00:00
Dominic Reynolds
472a1d333a Added handling to correctly check the result of the profile development
run and reset the profile mode to enforce when the profile development
run exits without an error.
Addresses novell bug: https://bugzilla.novell.com/show_bug.cgi?id=328045
2007-11-06 18:08:24 +00:00
Dominic Reynolds
c074a19f24 Ignore complain flags when up|down loading profiles to|from the
repository. This makes the repository agnostic to profile mode
(complain/enforce) - users must manage this locally via
aa-complain/aa-enforce.
Addresses novell bug: https://bugzilla.novell.com/show_bug.cgi?id=328033
2007-11-06 18:06:18 +00:00
Dominic Reynolds
63a7fa4aed Modified code to check the repository for new profile when:
- processing an unknown hat/execute rejection if its not already in the profile
   - at the start of processing all the remain events for the profile
Addresses novell bug: https://bugzilla.novell.com/show_bug.cgi?id=328707
2007-11-06 16:46:57 +00:00
Dominic Reynolds
57f1e839b7 Updated regex used to detect syslog messages (from bug reported against
Ubuntu gutsy)
2007-11-06 16:37:52 +00:00
David J Drewelow
6eedd28dc2 Fix for bug #329476. The mode validation regexp has been updated to
support additional values.
2007-09-28 16:51:56 +00:00
Dominic Reynolds
de278ffef8 Don't try to read inactive profile directory if it doesn't exist. Fix
based on feedback from mathiaz@ubuntu.com and from bug report:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/141128.
2007-09-28 15:39:42 +00:00
Dominic Reynolds
27c13607be Change the default repository to
http://apparmor.opensuse.org/backend/api - the host for the production
repository.
2007-09-17 02:28:26 +00:00
Dominic Reynolds
4ffd798b57 Update to log parsing to correctly unpack the hex encoded values passed
from the module: name, name2, and profile. (fix from jmichael@suse.de)
2007-09-17 01:58:36 +00:00
Dominic Reynolds
0cd4b39f4c Remove the confirmation prompt for confirm_and_finish - this was a
duplicate prompt after the repository changes to save_profiles.
2007-09-17 01:56:14 +00:00