Commit graph

1358 commits

Author SHA1 Message Date
John Johansen
f999b49843 Add change_profile onexec to libapparmor 2010-02-11 15:37:25 -08:00
John Johansen
7592c80db5 Update build version tags to 2.5~pre 2010-02-11 15:36:16 -08:00
Kees Cook
60fb075419 libraries/libapparmor/src/scanner.l: dynamic string handling to avoid stack overflows on log parsing (LP: #519686)
Bug: https://launchpad.net/bugs/519686
2010-02-10 15:13:55 -08:00
John Johansen
91f0f0053f Update regression tests test harness for known problems to use xpass and
xfail instead of known_{pass,fail}, also have it only reports unexpected
results, error for when result != what it should, and Alert for when it
result is what is should be but is a known problem and hence expected
to report something else.

Also update the regression tests for known problems under AppArmor 2.5,
this does not fix all known problems, (ie hats being removed differently
and hence resulting in unable to load profile errors, and the mknod
problem on alternate runs of the test suite, nor xattrs tests not ensuring
that the fs supports xattrs).
2010-02-06 23:04:57 -08:00
John Johansen
56d1be6ca6 Update ptrace test to fix case where unconfined is ptracing child helper
which is now allowed and add case where confined app is ptracing child
which isn't allowed.
2010-02-06 20:09:55 -08:00
John Johansen
516e3f60e4 update change_hat tests for correct error codes on AppArmor 2.5 2010-02-06 20:08:51 -08:00
John Johansen
db796ef3f1 Update test harness to allow for tests defined by profile X 2010-02-06 20:07:44 -08:00
John Johansen
335b088dd0 Bump version to 2.4 2010-02-04 14:41:36 -08:00
John Johansen
98ea04e7c6 Deprecate old management applications that are no longer supported and
do not work.
2010-02-04 14:39:27 -08:00
Jamie Strandboge
737cd15707 apparmor_notify: allow -s option with -p 2010-02-04 00:15:24 -08:00
Jamie Strandboge
3d899affcf apparmor_notify:
- handle being called as something other than apparmor_notify
- simple aggregation on first run
2010-02-03 21:51:59 -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
John Johansen
8dd795dec1 Rework the partitioning to take advantage of Partitions now being a list 2010-01-31 23:21:00 -08:00
John Johansen
8bcfa1a32f Move partitions from using sets to lists as this is a better match
for what is being done.
2010-01-31 23:19:54 -08:00
John Johansen
e984b6ff74 Seperate Partition definition for States. This is a small step to cleaning
up the code
2010-01-31 23:18:14 -08:00
John Johansen
1179c1a42c Improve partitioning performance slightly by inserting new partitions
imediately after the current partition being considered, instead of
at the back of the parition list.  This does two things, it makes it
more likely the data is in cache, and it also in general results in
more partitions being created in a single pass.
2010-01-31 23:12:33 -08:00
Kees Cook
69ebfc4cda update python shared library paths for "pyshared" 2010-01-29 10:10:31 -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
John Johansen
80c7ee74a2 Speedup transition table compression. This is a basic improvement and
not an algorithmic improvement.  It does the same basic algorithm of
test until it can insert the data, but instead of only tracking the
first free entry (and recomputing it each pass).  It tracks all
free entries reducing the number of comparisons done and the table
grows in size.

This may actually result in a small loss on small tables, but is a win
for larger tables.
2010-01-27 17:20:13 -08:00
John Johansen
f9906a9584 Update hash calculation
Update the hash calculation to guarentee that states with a different
number of transition entries will be placed in seperate partitions.

This will allow for a better character transition based state comparison.
2010-01-20 05:10:38 -08:00
John Johansen
91dd7527d9 Dfa minimization and unreachable state removal
Add basic Hopcroft based dfa minimization.  It currently does a simple
straight state comparison that can be quadratic in time to split partitions.
This is offset however by using hashing to setup the initial partitions so
that the number of states within a partition are relative few.

The hashing of states for initial partition setup is linear in time.  This
means the closer the initial partition set is to the final set, the closer
the algorithm is to completing in a linear time.  The hashing works as
follows:  For each state we know the number of transitions that are not
the default transition.  For each of of these we hash the set of letters
it can transition on using a simple djb2 hash algorithm.  This creates
a unique hash based on the number of transitions and the input it can
transition on.  If a state does not have the same hash we know it can not
the same as another because it either has a different number of transitions
or or transitions on a different set.

To further distiguish states, the number of transitions of each transitions
target state are added into the hash.  This serves to further distiguish
states as a transition to a state with a different number of transitions
can not possibly be reduced to an equivalent state.

A further distinction of states is made for accepting states in that
we know each state with a unique set of accept permissions must be in
its own partition to ensure the unique accept permissions are in the
final dfa.

The unreachable state removal is a basic walk of the dfa from the start
state marking all states that are reached.  It then sweeps any state not
reached away.  This does not do dead state removal where a non accepting
state gets into a loop that will never result in an accepting state.
2010-01-20 03:32:34 -08:00
Jamie Strandboge
d4d9dda5cb libraries/libapparmor/swig/perl/examples/example.pl: more fixes 2010-01-12 09:52:00 -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
Jamie Strandboge
3fd950e823 libraries/libapparmor/swig/perl/examples/example.pl: fix so it works again 2010-01-11 20:54:54 -06:00
Jamie Strandboge
d98c8ae8b5 add commented, but blank tunables/alias
profiles/apparmor.d/tunables/global: include tunables/alias
parser/apparmor.d.pod: add alias rules and home.d. clean up
 HOMEDIRS
2010-01-11 14:19:35 -06:00
Steve Beattie
b8b2b48949 Add long optimization option along with case-insensitive help options 2010-01-08 14:33:35 -08:00
John Johansen
636ee4a11a Update option parsing for help to add in Short flag form and Optimize
help.
2010-01-08 14:04:56 -08:00
John Johansen
fe08d62e91 Abort if bad option is passed to optimize option parsing 2010-01-08 12:48:10 -08:00
John Johansen
d87145ad23 Update trans table reporting to include some statistics 2010-01-08 05:29:25 -08:00
John Johansen
dce395e7ad Add basic controls for dfa optimization 2010-01-08 04:30:56 -08:00
John Johansen
926b0c72e8 Update the output of transtable creation 2010-01-08 03:18:59 -08:00
John Johansen
4f044e753c Add basic dfa stats and debug dumps for
equivelence classes
expr tree (add stats, update parser switch)
dfa
transition table
2010-01-08 02:17:45 -08:00
John Johansen
b69c5e9972 Fix -S so that it implies there is no kernel_load 2010-01-07 18:31:44 -08:00
John Johansen
fc597b736b Update what is considered an unprivileged op, so that only actual loading
and writing of cache trigger the privilege messages
2010-01-07 18:20:19 -08:00
John Johansen
56a9fded36 Update parser to allow for multiple debugs dump options 2010-01-07 18:09:37 -08:00
John Johansen
17a67d7227 Update parser to allow for multiple debug dump options via -D or --dump.
This will allow turning on and off various debug dumps as needed.
Multiple dump options can be specified as needed by using multiple
options.
  eg. apparmor_parser -D variables
      apparmor_parser -D dfa-tree -D dfa-simple-tree


The help option has also been updated to take an optional argument
to display help about give parameters, currently only dump is supported.

  eg.  apparmor_parser -h       # standard help
       apparmor_parser -h=dump  # dump info about --dump options

Also Enable the dfa expression tree dumps
2010-01-07 16:21:02 -08:00
Steve Beattie
09ced81ee5 Add debugging reporting for the other capability entry types (audit,
deny).
2010-01-07 15:48:14 -08:00
Steve Beattie
8304b7db87 * disable reading cache files when debugging
* rearrange action ordering so that the symbol table can be dumped
  before and after exapansion
* formatting rearrangement.
2010-01-07 14:44:42 -08:00
Steve Beattie
2f9259a215 Add debugging dump for Set Capabilities. 2010-01-07 14:17:07 -08:00
Steve Beattie
fd07a7b17a Remove obsolete data structure. 2010-01-07 14:15:36 -08:00
Kees Cook
369a280f64 Document the --skip-kernel-load parameter 2010-01-07 10:03:49 -08:00
Kees Cook
8d760811b8 do not load cache when using -S option 2010-01-06 09:04:04 -08:00
Kees Cook
8b54df93dd make note of the trailing slash requirement in the home.d/site.local example 2010-01-05 15:43:32 -08:00
Jamie Strandboge
2d8246668c fix typo in profiles/apparmor.d/tunables/home.d/site.local 2010-01-05 16:16:16 -06:00
Jamie Strandboge
ebedab89e5 add local site configuration for HOMEDIRS tunable
- add commented profiles/apparmor.d/tunables/home.d/site.local
- profiles/apparmor.d/tunables/home: include tunables/home.d
- profiles/Makefile: adjust for home.d sub-directory and install
  site.local
2010-01-05 15:58:43 -06:00
Kees Cook
a0e8bf9661 update php5 abstraction, add more details to apache hat documentation, include a common apache2 abstraction for use with hats 2010-01-03 13:16:38 -08:00
Kees Cook
938385db40 sort on profile names when reporting results from aa-status 2010-01-02 22:18:51 -08:00