Commit graph

4890 commits

Author SHA1 Message Date
Christian Boltz
2202a8a267
dovecot: allow reading /proc/sys/fs/suid_dumpable
This is needed if a dovecot child process segfaults - in this case,
dovecot provides a helpful error message like

dovecot[6179]: auth-worker: Fatal: master: service(auth-worker): child 8103 killed with signal 11 (core not dumped - https://dovecot.org/bugreport.html#coredumps - set /proc/sys/fs/suid_dumpable to 2)

which involves reading the current value in suid_dumpable.
2018-12-06 18:12:25 +01:00
Christian Boltz
aa1e8bd55d Merge branch 'utils-xattrs' into 'master'
utils: add support to tools for profiles with xattrs

See merge request apparmor/apparmor!285

Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-12-06 13:15:49 +00:00
Eric Chiang
fde015435a utils: add support to tools for profiles with xattrs
Signed-off-by: Eric Chiang <ericchiang@google.com>
2018-12-05 19:22:32 -08:00
Steve Beattie
40449fdd27
Make coverity: do all compiles as one scan-build run
In fed101920b, the coverity build process
was modified to split out the build logs into separate files, instead of
having one log file that gets overwritten repeatedly, making failures
hard to debug.

However, the coverity service gets upset if there is no file named with
the expected build log name. Therefore, instead, we'll capture the
python bits first, and then capture all the compilation bits in one
cov-build command.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/273
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-11-30 12:23:39 -08:00
Christian Boltz
0a666b8e48 Merge branch 'certbot' into 'master'
Add /etc/letsencrypt/archive to ssl_key abstraction

See merge request apparmor/apparmor!283

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master
2018-11-30 15:44:13 +00:00
Christian Boltz
869f98a2a4 Merge branch 'postfix-profiles' into 'master'
Postfix profile updates

See merge request apparmor/apparmor!284

Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-11-30 14:20:51 +00:00
Julian Andres Klode
4c85a7ec9e profiles/postfix-smtpd: Include ssl_certs, ssl_keys
This is needed for serving TLS.
2018-11-30 14:43:29 +01:00
Julian Andres Klode
b858428dd1 profiles/postdrop: Allow reading from pickup socket 2018-11-30 14:38:57 +01:00
Julian Andres Klode
d1ab0a021e profiles/postfix-pickup: Allow reading from cleanup socket 2018-11-30 14:33:45 +01:00
Julian Andres Klode
60d203b622 postfix.local: Minor adjustments to make it work
This connects queue manager to local.
2018-11-30 14:30:13 +01:00
Julian Andres Klode
02528133d2 postfix.*: Adapt for new queue names, and extra locking and r/w communication
This gets us to the local process now, which comes next.
2018-11-30 14:24:43 +01:00
Julian Andres Klode
3d842ddb82 postifx-common: Allow access to dynamicmaps, most seems to use it 2018-11-30 14:23:56 +01:00
Julian Andres Klode
e8841a0953 postfix.tlsmgr: Connect to urandom and prng exchange 2018-11-30 14:23:34 +01:00
Julian Andres Klode
f4bfd78164 postfix.master: Change path of child processes 2018-11-30 14:22:58 +01:00
Julian Andres Klode
cb46878644 Add /etc/letsencrypt stuff to ssl_keys/ssl_certs abstraction
`/etc/letsencrypt/live/` contains symlinks to
`/etc/letsencrypt/archive/` which contains the keys. Add the
certs to ssl_certs and the private keys to ssl_keys.
2018-11-30 14:02:16 +01:00
Steve Beattie
9943da2f52
profiles/postfix: add locking perm to pid files
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
dd4903efc6
profiles/postfix: eliminate some redundant rules
Remove rules covered by the postfix-common or other abstractions.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
889503f623
profiles: add a postfix dnsblog profile
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
1c9459825a
profiles: add a postfix postscreen profile
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
35d84895fe
profiles/postfix-master: grant signal+unix communication with children
Grant the ability to communicate with the postfix named child profiles
via signals and unix sockets. Include the path-based match names as
a fallback on upgrades.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
39ca2adff6
profiles/postfix: use named profiles
Convert all the postfix subprocesses to using named profiles instead of
path match profiles, and adjust exec paths for newer debian/ubuntu
releses. Rename profiles to match profile names.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:55 -08:00
Steve Beattie
01648c6a61
profiles/postfix-master: use profile name instead of match pattern
Convert postfix's master profile to use a named profile
(postfix-master) rather than the exec path match pattern. Adjust
postfix-common abstraction to take this into account. Rename profile
name in the profiles/apparmor/profiles/extras/ directory to match
the profile name.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-29 15:14:52 -08:00
Christian Boltz
228b92ce5a
Ignore *.orig and *.rej files when loading profiles
or: get rc.apparmor.functions in sync with the tools and libapparmor.

This was "accidently" reported by Ralph on the opensuse-support
mailinglist.
2018-11-28 22:50:09 +01:00
Christian Boltz
6fd0990bca Merge branch 'cboltz-fix-view-extra' into 'master'
Fix viewing a local inactive profile in aa-genprof

See merge request apparmor/apparmor!275

Acked-by: John Johansen <john.johansen@canonical.com>
2018-11-21 21:15:14 +00:00
Jamie Strandboge
170e8d6ac8 deny ~/.mutt** in private-files and audit deny ~/.aws in private-files-strict
Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
2018-11-19 16:13:57 -06:00
Christian Boltz
8b4e76a7d5
Fix viewing a local inactive profile in aa-genprof
aa-genprof checks if one of the profiles in the extra profile dir
matches the binary, and proposes to use that profile as a starting
point.

Since 4d722f1839 the "(V)iew profile"
option to display the proposed profile was broken.

The easiest fix is to remember the filename in the extras directory, and
display the file from there.

Sidenote: when choosing to use the extra profile, it gets written to
disk without any problems, so this bug really only affected "(V)iew
profile" to preview the proposed extra profile.
2018-11-18 21:35:07 +01:00
Christian Boltz
04c91d5256
Drop unused activate_repo_profiles() 2018-11-18 17:20:30 +01:00
Christian Boltz
739b5d6cd3 Merge branch 'fix-make-clean-stress-tests' into 'master'
tests: fix make clean target

See merge request apparmor/apparmor!272

Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-11-17 18:44:57 +00:00
Steve Beattie
2e3fa8b830 Drop APPARMOR_ENABLE_AAEVENTD
Merge branch 'cboltz-eventd' into 'master'

PR: https://gitlab.com/apparmor/apparmor/merge_requests/269
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-16 23:15:36 +00:00
Steve Beattie
7496fad27f
tests: fix make clean target
Make the tests/stress 'make clean' target cope with the rename from
subdomain to apparmor.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-16 14:16:07 -08:00
John Johansen
9db669a0ef Merge branch 'cboltz-parse-remainder' into 'master'
parse_profile_data(): Ensure last line in a profile is valid

'lastline' gets merged into 'line' (and reset to None) when reading the
next line. If 'lastline' isn't empty after reading the whole profile,
this means there's something unparseable at the end of the profile,
therefore parse_profile_data() should error out.

Also remove some simple_tests testcases from the 'exception_not_raised'
list - they only didn't raise the exception because the invalid rule was
the last line in the affected profile.

Thanks to Eric Chiang for accidently (and maybe even unnoticedly ;-)
discovering this bug while adding some xattr testcases that surprisingly
didn't fail in the tools.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/271
Acked-by: John Johansen <john.johansen@canonical.com>
2018-11-13 23:58:54 +00:00
Christian Boltz
4efff35bf8
parse_profile_data(): Ensure last line in a profile is valid
'lastline' gets merged into 'line' (and reset to None) when reading the
next line. If 'lastline' isn't empty after reading the whole profile,
this means there's something unparseable at the end of the profile,
therefore parse_profile_data() should error out.

Also remove some simple_tests testcases from the 'exception_not_raised'
list - they only didn't raise the exception because the invalid rule was
the last line in the affected profile.

Thanks to Eric Chiang for accidently (and maybe even unnoticedly ;-)
discovering this bug while adding some xattr testcases that surprisingly
didn't fail in the tools.
2018-11-13 17:59:40 +01:00
Christian Boltz
7ba8dc7e2e
Drop APPARMOR_ENABLE_AAEVENTD
This is another trace of aa-eventd which is deprecated since years.
2018-11-12 15:51:15 +01:00
Christian Boltz
273e45a4af Merge branch 'cboltz-profile-list' into 'master'
Replace "existing_profiles" & fix minitools for named profiles

See merge request apparmor/apparmor!249

Acked-by: John Johansen <john.johansen@canonical.com>
2018-11-11 13:17:00 +00:00
John Johansen
2809060bec parser: limit the number of passes expr tree simplification does
Expr tree simplification makes multiple passes at simplifying the
expression tree trying to use fatoring rules and heuristics to achieve
the minimum tree, so that dfa construction has fewer nodes to deal
with.

Unfortunately expr tree simplification can slow some policy compiles,
dependent on the type of expressions generated, down, and even worse
is currently subject to never terminating on some expressions as the
left and right passes keep undoing each others work.

Limiting the number of passes that expr tree simplification does can
provide most of its benefits (later passes generally have diminishing
returns), reduces the overhead it has on simple policy where it is of
little benefit, and insures that simplifications can not get stuck in
an infinite loop due to the left and right passes ping-ponging on each
others factoring.

Note: This also results in a performance improvement in evince
compiles, and general policy compiles because it achieves a better
balance between time spent on simplifying the tree to remove nodes and
time the dfa build requires to build with extra nodes and then
eliminate with minimization.

$ time apparmor_parser -QT /etc/apparmor.d/usr.bin.evince
real	0m2.744s
user	0m2.714s
sys	0m0.028s

vs.

$ time apparmor_parser -QT /etc/apparmor.d/usr.bin.evince
real	0m2.992s
user	0m2.979s
sys	0m0.012s

and

$ time apparmor_parser -QT /etc/apparmor.d/
real	0m3.568s
user	0m14.529s
sys	0m0.152s

vs.

$ time apparmor_parser -QT /etc/apparmor.d/
real	0m3.741s
user	0m15.400s
sys	0m0.179s

PR: https://gitlab.com/apparmor/apparmor/merge_requests/246
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2018-11-09 13:01:01 -08:00
John Johansen
3318f660e3 Merge branch 'cboltz-eventd' into 'master'
Remove traces of aa-eventd

aa-eventd and its initscripts have been moved to deprecated/ in 2014 and didn't get any serious updates for several more years, so it's most probably useless and/or broken nowadays.

This also means we don't need to keep the AA_EV_BIN and AA_EV_PIDFILE variables in rc.apparmor.functions anymore.

(In theory I could move these variables to deprecated/rc.aaeventd.* - but in practise that sounds more than superfluous ;-)

PR: https://gitlab.com/apparmor/apparmor/merge_requests/263
Acked-by: John Johansen <john.johansen@canonical.com>
2018-11-09 17:02:22 +00:00
Christian Boltz
3a89e9811f
Remove traces of aa-eventd
aa-eventd and its initscripts have been moved to deprecated/ in 2014 and
didn't get any serious updates for several more years, so it's most
probably useless and/or broken nowadays.

This also means we don't need to keep the AA_EV_BIN and AA_EV_PIDFILE
variables in rc.apparmor.functions anymore.
2018-11-09 17:22:17 +01:00
John Johansen
94ff870f78 remove subdomainfs support
It has been over 10 years since transition from subdomainfs to
using securityfs. Lets drop this deprecated code.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/258
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: seth.arnold@canonical.com
2018-11-08 18:23:21 -08:00
John Johansen
0d5ab43d59 rc.apparmor.functions: drop module loading support
The apparmor kernel "module" has not been a loadable module for more
than a decade, it must be built into the kernel and due configuration
requirements it will never go back to being a loadable module.

Remove the long unfunctioning load_module support from the init script.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/257
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: seth.arnold@canonical.com
2018-11-08 18:22:09 -08:00
John Johansen
e657ca67d7 Merge branch 'use-sys' into 'master'
Use @{sys} tunable in profiles and abstractions

Commit aa065287 made @{sys} tunable available by default.

Update profiles and abstractions to actually use @{sys} tunable for better confinement in the future (when @{sys} becomes kernel var).

Closes LP#1728551

PR: https://gitlab.com/apparmor/apparmor/merge_requests/262
Acked-by: John Johansen <john.johansen@canonical.com>
2018-11-09 01:45:18 +00:00
Vincas Dargis
2438179b76 Use @{sys} tunable in profiles and abstractions
Commit aa06528790 made @{sys} tunable
available by default.

Update profiles and abstractions to actually use @{sys} tunable for
better confinement in the future (when @{sys} becomes kernel var).

Closes LP#1728551
2018-11-08 20:04:46 +02:00
Steve Beattie
5888a50a0f parser/libapparmor_re: expand comment of firstpos, lastpos, followpos
Merge branch 'regex-dragon-book' into 'master'

PR: https://gitlab.com/apparmor/apparmor/merge_requests/261
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-11-07 21:36:32 +00:00
Eric Chiang
197b5d63fe parser/libapparmor_re: expand comment of firstpos, lastpos, followpos
Elaborate in class comment of firstpos, lastpos, followpos, and nullable
fields beyond just referencing the Dragon book. Also add the section of
the book these are explained in.
2018-11-06 19:08:28 -08:00
Christian Boltz
39a2031487 Merge branch 'cboltz-strict-todo-check' into 'master'
error out on superfluous TODOs

See merge request apparmor/apparmor!197

Acked-by: John Johansen <john.johansen@canonical.com>
2018-11-06 21:14:40 +00:00
Christian Boltz
4b26850e14
error out on superfluous TODOs
If a test is marked as TODO, but matches its EXRESULT, this means the
TODO is superfluous and (probably) a change fixed what the TODO was for.

Instead of more or less ignoring such superfluous TODOs, error out to
make the change visible instantly.
2018-11-06 21:44:40 +01:00
Christian Boltz
608af94dff Merge branch 'cboltz-disable-some-abi-tests' into 'master'
disable abi/ok_10 and abi/ok_12 tests

See merge request apparmor/apparmor!259
2018-11-06 20:43:04 +00:00
Christian Boltz
a3305b512d
disable abi/ok_10 and abi/ok_12 tests
Both result in "superfluous TODO" (for unknown reason), but fail after
removing the TODO.

Disable the tests until we find out why they have this strange
behaviour, to unblock merging the "error out on superfluous TODO" patch.
2018-11-06 21:33:12 +01:00
Christian Boltz
c98d8570ee Merge branch 'cboltz-fixed-todos' into 'master'
Remove TODO notes from no-longer-failing tests

See merge request apparmor/apparmor!180

Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: intrigeri <intrigeri@debian.org>
2018-11-06 17:33:49 +00:00
intrigeri
7416138b43 Merge remote-tracking branch 'origin/merge-requests/251'
apparmor(7): Document various debugging options.

Bug-Debian: https://bugs.debian.org/826218
PR: https://gitlab.com/apparmor/apparmor/merge_requests/251
2018-11-04 12:01:38 +00:00
intrigeri
b95f9bdd3b apparmor(7): Document various debugging options.
Credits go to John Johansen <john@jjmx.net> for most of the information
and the initial phrasing.

Bug-Debian: https://bugs.debian.org/826218
2018-11-04 11:43:04 +00:00