Commit graph

4613 commits

Author SHA1 Message Date
Emerson Bernier
afdd4f2189 abstractions/private-files: disallow access to the dirs of private files
Reference:
https://launchpad.net/bugs/1794820
2018-09-27 19:07:21 +00:00
John Johansen
495c4ff30e Merge branch 'ubuntu-email-thunderbird' into 'master'
ubuntu-email: allow running Thunderbird wrapper script

See merge request apparmor/apparmor!204
2018-09-27 18:54:03 +00:00
Vincas Dargis
cee9527fa8 ubuntu-email: allow running Thunderbird wrapper script
gio-launch-desktop helper tries to execute /usr/bin/thunderbird wrapper
script, not the /usr/lib/thunderbird... directly.

Add rule allowing to execute /usr/bin/thunderbird.
2018-09-27 21:04:32 +03:00
John Johansen
63ffb8ea64 Merge branch 'harden-abstractions' into 'master'
Harden abstractions

 Harden abstractions

    remove antiquated abstractions/launchpad-integration
    abstractions/opencl-nvidia: don't allow PUx on nvidia-modprobe
    abstractions/private-files-strict: disallow access to the dirs of private files
    abstractions/private-files: disallow writes to thumbnailer dir (LP: #1788929)
    ubuntu-browsers.d/user-files: disallow access to the dirs of private files

Nominating launchpad-integration and opencl-nvidia for 2.13. Nominating private-files-strict, private-files and user-files for 2.10 and higher

See merge request apparmor/apparmor!203

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-27 17:32:47 +00:00
Jamie Strandboge
5efd257585 we don't need to adjust keyring**. Thanks cboltz 2018-09-27 12:13:04 -05:00
Jamie Strandboge
ea2429dab5 ubuntu-browsers.d/user-files: disallow access to the dirs of private files 2018-09-27 12:09:09 -05:00
Jamie Strandboge
503d2904dc abstractions/private-files: disallow writes to thumbnailer dir (LP: #1788929) 2018-09-27 11:56:09 -05:00
Jamie Strandboge
d1937093f7 abstractions/private-files-strict: disallow access to the dirs of private files
Reference:
https://launchpad.net/bugs/1794820
2018-09-27 11:55:37 -05:00
Jamie Strandboge
8f9bd5b0e3 abstractions/opencl-nvidia: don't allow PUx on nvidia-modprobe 2018-09-27 11:38:51 -05:00
Jamie Strandboge
ae771b475a remove antiquated abstractions/launchpad-integration 2018-09-27 11:29:11 -05:00
Christian Boltz
7e22b0a894 Merge branch 'zsh' into 'master'
add zsh to logprof.conf

See merge request apparmor/apparmor!201

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master
2018-09-24 17:34:56 +00:00
Emerson Bernier
00871696f1 add zsh to logprof.conf 2018-09-24 16:51:11 +00:00
John Johansen
bfd5445870 Revert "Update ubuntu-email for launching Thunderbird wrapper script"
This reverts commit ab7459ed40.

This commit was meant to go to a branch to setup a merge request in
gitlab. Revert until the commit has gone through the regular review
process.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-24 03:01:46 -07:00
Vincas Dargis
ab7459ed40 Update ubuntu-email for launching Thunderbird wrapper script 2018-09-21 16:46:48 +00:00
John Johansen
cac5a5d293 Merge branch 'cboltz-more-useful-simple-test-output' into 'master'
make simple.pl / parser make check output more useful

Instead of printing the (useless) numbers of no-longer-failing tests
marked as TODO, let prove print out the actual test names.

A side effect is that really unfixed TODOs and disabled tests get
printed (lists about 10 tests), but that's much better than having to
hunt down the no-longer-failing TODOs.

This change will print out lines like (the first one is still a TODO,
the second one got fixed at some time)

not ok 71447 - TODO: ./simple_tests//vars/vars_profile_name_13.sd: reference variables that are the profile name and attachment # TODO Unfixed testcase.

ok 71448 - TODO: ./simple_tests//vars/vars_profile_name_14.sd: reference variables in rules that also have alternations # TODO Unfixed testcase.
before printing the test summary.

I propose this patch for master and (optionally) the maintained branches.

See merge request apparmor/apparmor!194

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-19 06:42:37 +00:00
Christian Boltz
e9b25c4969
make simple.pl / parser make check output more useful
Instead of printing the (useless) numbers of no-longer-failing tests
marked as TODO, let `prove` print out the actual test names.

A side effect is that really unfixed TODOs and disabled tests get
printed (lists about 10 tests), but that's much better than having to
hunt down the no-longer-failing TODOs.

This change will print out lines like (the first one is still a TODO,
the second one got fixed at some time)

```
not ok 71447 - TODO: ./simple_tests//vars/vars_profile_name_13.sd: reference variables that are the profile name and attachment # TODO Unfixed testcase.
ok 71448 - TODO: ./simple_tests//vars/vars_profile_name_14.sd: reference variables in rules that also have alternations # TODO Unfixed testcase.
```

before printing the test summary.
2018-09-18 21:42:14 +02:00
John Johansen
884041605c Merge branch 'profile-usr.sbin.ntpd' into 'master'
usr.sbin.ntpd: add openntpd drift and socket files

See merge request apparmor/apparmor!192

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-18 11:35:28 +00:00
John Johansen
50c9901d62 Merge branch 'profile-usr.sbin.dnsmasq' into 'master'
usr.sbin.dnsmasq: add paths for NetworkManager connection sharing

dnsmasq needs to access additional paths when used for connection sharing by NetworkManager.
Additionally it needs read permissions to /usr/share/dnsmasq/trust-anchors.conf which contains the DNSSEC trust anchors.

See merge request apparmor/apparmor!193

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-18 11:34:13 +00:00
John Johansen
20de92c5d6 Merge branch 'qt-settings-write' into 'master'
Add qt5 writing abstractions

Qt-based applications stores QFileDialog (latest browsed directory) and
other shared user settings inside ~/.config/QtProject.conf. Currently
available qt abstraction only allows to read it (by design), so this
patch introduces abstraction that grants permissions for writing.
Relevant denies discovered with KDE Dragon Player:
/var/log/audit/audit.log.1:type=AVC msg=audit(1533485161.999:981): apparmor="DENIED" operation="mknod" profile="/usr/bin/dragon" name="/home/vincas/.config/QtProject.conf.lock" pid=29911 comm="dragon" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
type=AVC msg=audit(1533486419.266:1141): apparmor="DENIED" operation="file_lock" profile="/usr/bin/dragon" name="/home/vincas/.config/QtProject.conf.lock" pid=30406 comm="dragon" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
/var/log/audit/audit.log.1:type=AVC msg=audit(1533485206.575:1006): apparmor="DENIED" operation="link" profile="/usr/bin/dragon" name="/home/vincas/.config/QtProject.conf.Gflpds" pid=29946 comm="dragon" requested_mask="l" denied_mask="l" fsuid=1000 ouid=1000 target="/home/vincas/.config/#12982163"
In addition, added new qt-compose-cache-write abstraction as some applications wants to write compose cache. qt5 abstraction is appended with read-only rule (that's enough for LibreOffice using KDE file dialog).

See merge request apparmor/apparmor!159

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-18 10:03:08 +00:00
nl6720
5bc7a9fbd6 usr.sbin.dnsmasq: add paths for NetworkManager connection sharing
Also add /usr/share/dnsmasq/, DNSSEC trust anchors are kept there.
2018-09-18 12:57:22 +03:00
nl6720
b3c4a73e2f usr.sbin.ntpd: add openntpd drift and socket files 2018-09-18 11:53:36 +03:00
John Johansen
50658a9409 Merge branch 'cboltz-parser-tests-configfile' into 'master'
use empty parser/tst/parser.conf in all parser and profile tests

See merge request apparmor/apparmor!191

Without this, the system-wide parser.conf gets used, which causes test
failures if for example caching is enabled and the cache dir isn't
writeable for the user running the tests.

I propose this for all branches where the parser understands --config-file.

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-17 09:43:47 +00:00
Christian Boltz
fdfcd47baa
Use parser/tst/parser.conf in profiles 'make check'
This avoids problems if the system-wide parser.conf has caching enabled,
and the cache location is not writeable for the user running 'make check'.
2018-09-16 22:06:46 +02:00
Christian Boltz
5a18fd7c89
use empty parser/tst/parser.conf in all parser tests
Without this, the system-wide parser.conf gets used, which causes test
failures if for example caching is enabled and the cache dir isn't
writeable for the user running the tests.
2018-09-16 21:58:28 +02:00
John Johansen
b4f6711f4e Merge branch 'cboltz-logprof-python3.7' into 'master'
add python3.7 to logprof.conf

See merge request apparmor/apparmor!190

 add python3.7 to logprof.conf

I propose this patch for at least 2.12..master, maybe also 2.10 and 2.11 (even if it's unlikely that someone uses the latest python3 on a distro with old AppArmor)

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-14 23:51:52 +00:00
Christian Boltz
db096135eb
add python3.7 to logprof.conf 2018-09-15 00:32:48 +02:00
Tyler Hicks
be29aac40c Merge branch 'doc-improvements' into 'master'
Doc improvements

See merge request apparmor/apparmor!188

Acked-by: Christian Boltz <apparmor@cboltz.de>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 17:49:22 +00:00
Tyler Hicks
f26afb5b55 README: Point to the security vuln section of the wiki
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 17:01:32 +00:00
Tyler Hicks
35e59af532 README: Point to the new email address for security bug reports
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 17:00:22 +00:00
Tyler Hicks
1f935c4145 README: Improve the bug reporting instructions
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 16:59:29 +00:00
Tyler Hicks
f91235ca6a README: Move project contact info into the main README
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 16:54:09 +00:00
Tyler Hicks
a97fe6337a parser: Remove mention of wiretrip vulnerability handling policy
It looks as if the wiretrip domain has changed hands. The linked policy
page no longer exists.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 16:48:49 +00:00
Tyler Hicks
2f0a773506 utils: Point to the correct Profiles wiki page
The URL redirect ends up at a page in the new wiki that doesn't exist.
We have to link directly to the gitlab URL here since the current URL
redirect doesn't let us use a wiki.apparmor.net URL and still reach the
expected Profiles page.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 16:46:10 +00:00
Tyler Hicks
eb8975e0cc all: Use HTTPS links for apparmor.net
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 16:41:32 +00:00
John Johansen
25f98537db libapparmor: fix readdirfd to memory checks and cleanup on failure
The open-coded readdirfd fn used to replace scandirat skipped
checks for memory allocation failures and cleaning on faulures,
fix this.

Acked-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-12 16:20:03 -07:00
Patrick Steinhardt
259a4bad50 libapparmor: replace scandirat with open-coded variant
The `scandirat` function is a nonstandard GNU extension, which opens a
directory relative to a file descriptor. musl libc does not implement
that function and thus cannot be used to compile libapparmor.

All our uses of `scandirat` directly scan the directory the file
descriptor is referring to, not any directory beneath the FD. Implement
a function `readdirfd()`, which gets as arguments the directory FD, the
location where to put the list of directory entries as well as a
function pointer to a comparing function. `readdirfd` will then scan all
directory entries except "." and ".." and return them via an allocated
array. The array is sorted in case the comparing function is set.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/107
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-12 10:45:58 -07:00
John Johansen
474be603c4 parser: fix cache write message when stdin is used
Using stdin with --write-cache set results in

  # apparmor_parser --show-cache --write-cache
  Cache: added primary location '/var/cache/apparmor'
  Warnung aus stdin (Zeile 1): Cache: added readonly location '/usr/share/apparmor/cache'
  Warnung aus stdin (Zeile 1): apparmor_parser: cannot use or update cache, disable, or force-complain via stdin
  Cache miss: stdin
  Wrote cache: /var/cache/apparmor/9b2cd0d0.0/(null)

The "Wrote cache:" message is referencing a null value and should not
be displayed.

BugLink: http://bugs.launchpad.net/bugs/1787717
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Timeout
2018-09-11 18:31:06 -07:00
John Johansen
c6e704529d Merge branch 'cboltz-php-icu' into 'master'
abstractions/php: allow ICU (unicode support) data tables

See merge request apparmor/apparmor!184

  abstractions/php: allow ICU (unicode support) data tables

  Reported by darix on IRC, and also something I noticed in my own usage of PHP.

  I propose this addition for 2.10..master.

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-12 00:19:06 +00:00
John Johansen
a75d5503cf Merge branch 'cboltz-pyflakes2' into 'master'
remove unused exception binding in sandbox.py

See merge request apparmor/apparmor!178

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-12 00:16:30 +00:00
Christian Boltz
ce8038f602 Merge branch 'void' into 'master'
profiles: support void-specific binary names for openntp and traceroute

See merge request apparmor/apparmor!183

Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-09-11 18:41:03 +00:00
Cameron Nemo
6e28a94ace profiles: support void-specific binary names for openntpd, traceroute, and ping 2018-09-11 09:54:33 -07:00
Christian Boltz
e396f9dae9
abstractions/php: allow ICU (unicode support) data tables
Reported by darix on IRC, and also something I noticed in my own usage
of PHP.
2018-09-02 15:46:43 +02:00
John Johansen
770b100102 Merge branch 'cboltz-readme' into 'master'
README: another <pre> fix

See merge request apparmor/apparmor!182

Acked-by: John Johansen <john.johansen@canonical.com>
2018-08-27 21:59:35 +00:00
Christian Boltz
9c539ac3b9
README: another <pre> fix 2018-08-27 23:40:38 +02:00
Christian Boltz
edd9d7e049 Merge branch 'patch-1' into 'master'
README: Fix markup for preformatted text

See merge request apparmor/apparmor!181


Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-08-27 21:32:18 +00:00
林博仁(Buo-ren, Lin)
f9582a1cff README: Fix markup for Preformatted text
Fix concatenated-multiple-lines due to lacking Markdown's linebreak markup
by wrapping it with <pre>.

Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-08-26 10:47:17 +00:00
Christian Boltz
51482c33f5
remove unused exception binding in sandbox.py
pyflakes 2.0 is more strict and found that 'e' is never used.

References: https://build.opensuse.org/request/show/629206 (comment
section)
2018-08-22 21:23:25 +02:00
John Johansen
657495fa55 parser: add empty config file for parser caching tests
The caching tests will fail if a warning is thrown. Some setups may
not have a parser config file in the default location which results
in the warning
  config file '/etc/apparmor/parser.conf' not found

which causes the tests to fail.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/175
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-21 23:14:52 -07:00
John Johansen
af1818c053 parser: update option parsing so --config-file does not have to be first
Requiring --config-file to be first in the option list is not user
friendly fix the option parsing so that --config-file can be specified
anywhere in the option list.

This also fixes a bug where even when the --config-file option is
first the option parsing fails because the detection logic is broken
for some option cases.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/175
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-21 23:14:52 -07:00
John Johansen
9a8e7e58d2 parser: group parser number of config options together
To help avoid the duplicate option problem in the future sort and group
the config options using numbers at the end of the option table.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/173
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-21 23:14:52 -07:00