2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-28 21:07:56 +00:00

4838 Commits

Author SHA1 Message Date
Christian Boltz
6ab732ed38 Merge branch 'profile-usr.sbin.smbd' into 'master'
Add missing paths to usr.sbin.nmbd, usr.sbin.smbd and abstractions/samba

See merge request apparmor/apparmor!210

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.10..master

(cherry picked from commit f76a718f2846247d162e8e54a9e4d5eff5742ea8)

80e98f2d Update usr.sbin.nmbd & usr.sbin.smbd
2018-10-04 20:34:19 +00:00
John Johansen
ab91f7bfa3 Merge branch 'cboltz-abi-2.13' into 'apparmor-2.13'
2.13: Add basic support for abi rules to the tools

Add basic "understand and keep" support for abi rules, where
"understand" means to not error out when seeing an abi rule, and "keep"
simply means to keep the original abi rule when serializing a profile.

On the long term, abi rules should be parsed (similar to include rules),
but for now, this patch is the smallest possible changeset and easy to
backport.

Note that the only added test is via cleanprof_test.* which is used by
minitools_test.py - and does not run if you do a 'make check'.
Oh, and of course the simple_tests/abi/ files also get parsed by
test-parser-simple-tests.py.

BTW: Even serialize_profile_from_old_profile() can handle abi rules :-)

This is a backport of 072d3e04 / !202 (merged) to
2.13 (with some adjustments because that commit didn't appy cleanly)

I propose this patch for 2.10..2.13

PR: https://gitlab.com/apparmor/apparmor/merge_requests/216
Acked-by: John Johansen <john.johansen@canonical.com>
2018-10-03 15:02:27 +00:00
Christian Boltz
420aea6262
Add basic support for abi rules to the tools
Add basic "understand and keep" support for abi rules, where
"understand" means to not error out when seeing an abi rule, and "keep"
simply means to keep the original abi rule when serializing a profile.

On the long term, abi rules should be parsed (similar to include rules),
but for now, this patch is the smallest possible changeset and easy to
backport.

Note that the only added test is via cleanprof_test.* which is used by
minitools_test.py - and does _not_ run if you do a 'make check'.
Oh, and of course the simple_tests/abi/ files also get parsed by
test-parser-simple-tests.py.

BTW: Even serialize_profile_from_old_profile() can handle abi rules :-)

This is a backport of 072d3e04514b70bb3b29d4bfe400caa44dd574a2 / !202 to
2.13 (with some adjustments because that commit didn't appy cleanly)
2018-10-03 16:32:45 +02:00
Vincas Dargis
b672900629 Add qt5-compose-cache-write abstraction
Qt GUI applications that uses "platforminputcontexts"-class of plugins
might need reading and/or writing compose cache. Add read-only rule in
qt5 abstraction and create new writing dedicated for compose cache
writing.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/159
(cherry picked from commit 67816c42cfbadd85aa5cbb086284076c4c289881)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-02 23:04:35 -07:00
Vincas Dargis
77ebda113e Add qt5-write abstraction
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.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/159
(cherry picked from commit 69c4cabb93f1f07189687f830cdca7ddc506b857)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-02 23:03:53 -07:00
Vincas Dargis
f18c39514c Add qt5 abstraction
Create abtractions/qt5 with common rules needed for Qt5-based
applications.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/99
(cherry picked from commit 6a85ffe00e4fe7a7eaccc5ed9a7981dbc6f42063)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-02 22:59:02 -07:00
John Johansen
67c1eaff9d library: fix dirat_for_each2() fd handling
The function was messing up its use of fds, it could get away with
it because the cb_dirfd passed to fdopendir was still valid until
closedir was called but if code was moved around, or fdopendir
code changed behavior it could easily break.

Also the check for dup failing was wrong fix it.

Reference: coverity #187003

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Time-out
(cherry picked from commit 63cb46d20ae5633ff0ca86f33fc94c2d64b8292a)
2018-10-01 09:17:34 -07:00
Vincas Dargis
ca23b1af45 Include qt5 into kde abstraction
Currently, kde abstraction has rules relevant to Qt 3 and Qt 4
libraries, but are missing rules against latest Qt 5.

Include read-only Qt 5 abstraction to fix styling and similar issues for
software running on KDE 5 desktop.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/209
Fixes https://bugs.launchpad.net/apparmor/+bug/1787201
(cherry picked from commit bd33cdd19a370be58208e022bb51304dae09d734)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-01 08:50:35 -07:00
Vincas Dargis
1742647862 Add uid and uids kernel var placeholders
Add @{uid} and @{uids} variables to allow migrating profiles in advance
while awaiting path mediation implementation, based on current user id,
in kernel side.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/208
(cherry picked from commit cba10db7e7aed10f31cd43d2b6799d4f0a7d8c68)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-01 08:49:17 -07:00
John Johansen
b50888a6de Merge branch 'harden-abstractions-part-ii' into 'master'
Harden abstractions part ii

- abstractions/private-files: disallow access to the dirs of private files
- private-files{,-strict}: disallow writes to parent dirs too
- user-files: disallow writes to parents dirs

PR: https://gitlab.com/apparmor/apparmor/merge_requests/206
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-27 13:45:55 -07:00
Jamie Strandboge
f2a40bb530 similar change for user-files 2018-09-27 13:45:04 -07:00
Jamie Strandboge
803fef6cd9 private-files{,-strict}: disallow writes to parent dirs too 2018-09-27 13:45:04 -07:00
Emerson Bernier
732ed66f0a abstractions/private-files: disallow access to the dirs of private files
Reference:
https://launchpad.net/bugs/1794820
2018-09-27 13:45:04 -07:00
Vincas Dargis
f6ee78d5b2 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.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/204
(cherry picked from commit cee9527fa8f3fae5f86a32afa6bede60e4dceb4f)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-27 12:18:33 -07:00
John Johansen
082274c10f Merge branch 'harden-abstractions' into 'apparmor-2.13'
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

PR: https://gitlab.com/apparmor/apparmor/merge_requests/203
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-27 10:42:42 -07:00
Jamie Strandboge
734130abad we don't need to adjust keyring**. Thanks cboltz 2018-09-27 10:37:10 -07:00
Jamie Strandboge
b78e8edee0 ubuntu-browsers.d/user-files: disallow access to the dirs of private files 2018-09-27 10:37:10 -07:00
Jamie Strandboge
fbb8486fe6 abstractions/private-files: disallow writes to thumbnailer dir (LP: #1788929) 2018-09-27 10:37:10 -07:00
Jamie Strandboge
25aad109e1 abstractions/private-files-strict: disallow access to the dirs of private files
Reference:
https://launchpad.net/bugs/1794820
2018-09-27 10:37:10 -07:00
Jamie Strandboge
859a16310b abstractions/opencl-nvidia: don't allow PUx on nvidia-modprobe 2018-09-27 10:37:10 -07:00
Jamie Strandboge
052820e648 remove antiquated abstractions/launchpad-integration 2018-09-27 10:37:10 -07:00
Christian Boltz
5e4c68712f 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

(cherry picked from commit 7e22b0a89475285548265152ebeb6c8f4eedbc0e)

00871696 add zsh to logprof.conf
2018-09-24 17:35:10 +00:00
nl6720
ddee796d70 usr.sbin.dnsmasq: add paths for NetworkManager connection sharing
Also add /usr/share/dnsmasq/, DNSSEC trust anchors are kept there.

(cherry picked from commit 5bc7a9fbd65eade2f1b97e0ef331dc4b85faa467)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:08:03 -07:00
nl6720
9d841a2291 usr.sbin.ntpd: add openntpd drift and socket files
(cherry picked from commit b3c4a73e2f11f5ed0299d40cfa2688b6c1883864)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:08:03 -07:00
Cameron Nemo
9cb010f746 profiles: support void-specific binary names for openntpd, traceroute, and ping
(cherry picked from commit 6e28a94acefd5d3e001d35c53ecf999a6c3a16fd)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:08:03 -07:00
Cameron Nemo
645545048c profiles: support distributions which merge sbin into bin
Closes #8

(cherry picked from commit 9ab45d811e38ab5363ee6c8f79ee44f8a34c6be5)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:08:03 -07:00
John Johansen
540aa94418 parser: fix build warning for assigning default cache location
The compiler is spitting out the warning

parser_main.c:1291:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
    char *tmp = "/var/cache/apparmor";

fix this by constifying the cacheloc array.

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit e7949d09fa8c7ad257ddd4f162e0b4f03eeb858a)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-18 02:46:00 -07:00
intrigeri
affc7a9fb4 Move the cache to /var/cache
Let's not store a bunch of automatically generated binary files in /etc.
AppArmor 3.0 will store the cache in /var/cache and most distros
(openSUSE, Debian, and soon Ubuntu) moved it there already.

Bug-Debian: https://bugs.debian.org/904637
(cherry picked from commit 3d21cf0e321502541acd9f725639563fcaa070fd)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-18 02:46:00 -07:00
Christian Boltz
6f5c61e6af 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'.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/191
(cherry picked from commit fdfcd47baa0dcac6292969983dcb5c8e0ce77142)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-17 02:49:56 -07:00
Christian Boltz
b86f313281 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.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/191
(cherry picked from commit 5a18fd7c89ab0cc8460949088f7634c364438ea7)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-17 02:48:57 -07:00
John Johansen
4167497738 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>
(cherry picked from commit 657495fa5560cdeee432d7d10eab2496a053da96)
2018-09-17 02:42:17 -07:00
John Johansen
5cc04694bf 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>
(cherry picked from commit af1818c053374eb0c6501e56ca828850d858b69a)
2018-09-17 02:41:43 -07:00
John Johansen
b54929b0e0 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>
(cherry picked from commit 9a8e7e58d23b3e5366f15e101cc93f6939276b67)
2018-09-17 02:41:26 -07:00
John Johansen
e0f7594c73 parser: fix collision of --config-file and --compile-features options
Unfortunately both --config-file and --compile-features are using
139 to indicate the feature which breaks one or the other depending
on how the switch state that processes the options is compiled.

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>
(cherry picked from commit 3da52f751524c3083918d2dfc7065554bdb04639)
2018-09-17 02:39:48 -07:00
John Johansen
a17775b821 parser: Add fixes to --config-file option
After the config file patch was committed to 2.13 a couple of
improvements were suggested by intrigeri and cboltz. These have
been done as a separate patch so they can be applied to both
dev and 2.13.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/170
Acked-by: Christian Boltz <apparmor@cboltz.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 2c0d7e608cf008abf8f7ed093d8289edd8797b4d)
2018-09-17 02:39:35 -07:00
John Johansen
e97b1e732a parser: allow specifying the parser config file
The parser config file can affect the parsers behavior during tests.
Allow overriding the default location with the option

  --config-file=

the option must be the first option in the commands argument list.

Also provile a
  --print-config-file

option to display what the parser is using for a config file.

BugLink: http://bugs.launchpad.net/bugs/1277711
Acked-by: Christian Boltz <apparmor@cboltz.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit b1967c892a7b63e8b0f5e1d09d0027a4e04bb6b4)
2018-09-17 02:38:59 -07:00
John Johansen
bc133dd9b5 Revert "parser: allow specifying the parser config file"
The version of --config-file that landed in apparmor-2.13 has bugs
and the upstream version evolved before it was committed (it is
not just commits on top of the 2.13 patch).

So to backport the newer version with fixes,
revert commit 56b8e16698bffb2cd8fa7964de8e5c78ca4d21f8.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-17 02:35:44 -07:00
Christian Boltz
2f658e2422 add python3.7 to logprof.conf
(cherry picked from commit db096135ebe0581b26c4b1fab2953cfe1be928f1)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-14 16:56:22 -07:00
John Johansen
730b346fde Merge branch 'mesa-abstraction-2.13' into 'apparmor-2.13'
Backport Mesa abstraction to 2.13

See merge request apparmor/apparmor!189
2018-09-14 07:29:15 +00:00
intrigeri
51a7041f85 mesa abstraction: allow locking .cache/mesa_shader_cache/??/*.
At least Totem needs it on current Debian sid.
2018-09-14 06:26:13 +00:00
Vincas Dargis
d55b94642c Add mesa abstraction
Add mesa abstraction to allow writing to the Mesa-specific cache
locations and listing devices. Abstraction is needed for applications
utilizing OpenGL API with Mesa implementation available on the system.
2018-09-14 06:26:09 +00:00
John Johansen
8b79ce540c infrasture: update branch name for release builds
When apparmor-2.13 was branched from master the branch name was not
updated in the Makefile. Fix it.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-13 16:04:53 -07:00
John Johansen
866aaa1687 Documentation: Sync Readme.md with master branch updates
Sync Readme.md with master branch updates and to add badge, build and
coverage badges.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-13 15:44:40 -07:00
Tyler Hicks
08412a8a39 README: Point to the security vuln section of the wiki
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:45:59 -07:00
Tyler Hicks
1f99202c26 README: Point to the new email address for security bug reports
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:45:59 -07:00
Tyler Hicks
14744e83a6 README: Improve the bug reporting instructions
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:45:59 -07:00
Tyler Hicks
69800c435a README: Move project contact info into the main README
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:45:59 -07:00
Tyler Hicks
50ae9a1884 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 11:45:59 -07:00
Tyler Hicks
e27df656f0 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 11:45:59 -07:00
Tyler Hicks
2bef2e23d1 all: Use HTTPS links for apparmor.net
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:45:59 -07:00