Commit graph

54 commits

Author SHA1 Message Date
Christian Boltz
8c80c56252
Check if all profiles and abstractions contain abi/4.0
... and add abi/4.0 where it was missing
2024-10-06 12:07:58 +02:00
Daniel Richard G
e4a395b620 profiles/Makefile: Clean up rules to better support extra profiles
Rename the "check-extras" target to "check-local" as it is no longer
limited to the extra profiles, and also fix a local include in the
sbuild-shell profile so that it passes the newly-applied CI check.
2024-04-16 01:57:16 -04:00
Christian Boltz
adf19138d5
Don't create local/* profile sniplets by default
... and document how to create them if you still want them.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/337
2023-08-20 11:49:10 +02:00
Christian Boltz
d6bc107940
make check: ensure that all tunables include tunables/$FILE.d
(except the deprecated tunables/sys)
2023-07-30 00:58:21 +02:00
John Johansen
f1b4da2f64 policy: update to use 4.0 abi
Begin preparing policy for the 4.0 release. This may result in new
denials. This is expected and needed to make sure policy is ready
for the 4.0 release.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2023-06-30 23:36:12 -07:00
Christian Boltz
8a34439593
Check if extra profiles have a local/ include
... now that they all got it added.

Also remove a superfluous backslash in another make target.
2023-02-02 13:33:58 +01:00
David Runge
1ff0c2c7d6
Use basepath.py in profiles Makefile
profiles/Makefile:
Set PYTHON_DIST_BUILD_PATH using
libraries/libapparmor/swig/python/test/buildpath.py as it solves the
problem of setting the build directory generically.
2022-08-03 10:56:51 +02:00
Georgia Garcia
21e5a721ab replace deprecated distutils with setuptools
Adds python3 setuptools as a build dependency for libapparmor

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/202
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/813
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2021-11-11 20:23:35 -03:00
Georgia Garcia
644d36003c profiles: Fix config dir on make check
The check-logprof test in the profiles Makefile specifies
the configuration directory as --configdir ../utils/test,
but when aa-logprof looks for severity.db in the configdir,
it cannot find it.

This fix points the configdir to utils. Note that the
logprof.conf on utils uses the configuration for files
created during the libapparmor installation on the system.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/177
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2021-06-21 14:20:34 +00:00
Steve Beattie
461d9c2294
treewide: spelling/typo fixes in comments and docs
With the exception of the documentation fixes, these should all be
invisible to users.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/687
2020-12-01 12:47:11 -08:00
Christian Boltz
87eec0d62d
use aa-logprof --configdir ../utils in profile testsuite
(except if USE_SYSTEM is given)

This also needs an additional parser path in utils/test/logprof.conf,
which then needs an update in test-config.py.
2020-10-29 21:24:15 +01:00
Steve Beattie
76162d4b84
profiles/Makefile: fix aa-logprof invocation
The commit c8b6d8b393 ("profiles: Update 'make check' to select tools
based on USE_SYSTEM") set a bunch of variables but neglected to apply
them when invoking aa-logprof. This commit addresses this by:

  * correcting the PYTHONPATH used with aa-logprof
  * setting LD_LIBRARY_PATH when invoking aa-logprof
  * adjusting LD_LIBRARY_PATH to include both the directory location
    of libapparmor but also the swig libapparmor library needed for
    python tools to function.
  * adjusts the test for the presence of libapparmor to not use
    LD_LIBRARY_PATH but instead a libapparmor specific variable
    LIBAPPARMOR_PATH

Bug: https://gitlab.com/apparmor/apparmor/-/issues/98
Fixes: c8b6d8b393
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/586
2020-07-24 23:52:36 -07:00
Steve Beattie
2d94faeb5b
profiles/Makefile: add check for built libapparmor
When running the 'check-logprof' test using tools in the tree,
libapparmor needs to have been built for the python utilities to work.
Add a check for its existence to the test-dependencies target.

Bug: https://gitlab.com/apparmor/apparmor/-/issues/98
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/586
2020-07-24 23:52:27 -07:00
Steve Beattie
75c02604be
profiles/Makefile: local target does not depend on parser
The "local" make target does not depend on the parser having been
built. Create a separate "test-dependencies" target and have the tests
that need them depend on that and the "local" target, when validating
the profile set against the apparmor tools.

Fixes: c8b6d8b393
Bug: https://gitlab.com/apparmor/apparmor/-/issues/98
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/586
2020-07-24 23:52:16 -07:00
John Johansen
c8b6d8b393 profiles: Update 'make check' to select tools based on USE_SYSTEM
The profiles dirs make check is not always using the correct tools.
Update it to be similar to other Makefiles where the var USE_SYSTEM

  make check USE_SYSTEM=1

is used to indicated that the system installed tools should be used
and

  make check

is used to run the tests against the in tree tools

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/580
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2020-07-22 13:37:43 -07:00
John Johansen
3b4e9ed7e3 Merge Define abi when checking abstractions
This fixes lots of warnings like

```
*** Checking abstractions from ./apparmor.d/abstractions against apparmor_parser
Warning from stdin (stdin line 1): ../parser/apparmor_parser: File 'stdin' missing feature abi, falling back to default policy feature abi
Warning from stdin ([...]/profiles/./apparmor.d/abstractions/apparmor_api/change_profile line 9): ../parser/apparmor_parser: [...]/profiles/./apparmor.d/abstractions/apparmor_api/change_profile features abi 'abi/3.0' differes from policy declared feature abi, using the features abi declared in policy
```

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/554
Acked-by: John Johansen <john.johansen@canonical.com>
2020-06-01 08:54:17 +00:00
Christian Boltz
35a6676744
Define abi when checking abstractions
This fixes lots of warnings like

```
*** Checking abstractions from ./apparmor.d/abstractions against apparmor_parser
Warning from stdin (stdin line 1): ../parser/apparmor_parser: File 'stdin' missing feature abi, falling back to default policy feature abi
Warning from stdin ([...]/profiles/./apparmor.d/abstractions/apparmor_api/change_profile line 9): ../parser/apparmor_parser: [...]/profiles/./apparmor.d/abstractions/apparmor_api/change_profile features abi 'abi/3.0' differes from policy declared feature abi, using the features abi declared in policy
```
2020-05-31 00:45:17 +02:00
Christian Boltz
9fc8e43c67
abstractions: remove '#' from 'include if exists'
This matches what we use in the profiles for local abstractions.

Also adjust the check in the Makefile to expect the variant without '#'.
2020-05-30 19:53:49 +02:00
Christian Boltz
bb2409f935
adjust check for local/ includes to "include if exists" 2020-05-03 22:01:16 +02:00
Christian Boltz
e10a1b5ad9
Make check-abstractions.d compatible with more shells 2020-01-27 23:44:59 +01:00
Christian Boltz
85c01a56e6
add test to ensure abstractions have '#include if exists <*.d>'
Exceptions are
- ubuntu-browsers (because we already have ubuntu-browsers.d with
  different usage)
- ubuntu-helpers (which includes the sanitized_helper subprofile, so
  adding something in the global area wouldn't make much sense)

Also adjust abstractions/postfix-common to use the style all
abstractions use.
2019-01-27 20:41:28 +01:00
Vincas Dargis
dc7ae28de0 profiles/Makefile: test abstractions against apparmor_parser
Update Makefile to test abstractions by generating temporary profile, to
check for missing (not backported) abstractions or other issues.
2018-10-17 20:05:51 +03: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
208933829f Fix $(PWD) when using "make -C profiles"
By default, it stays at the "calling directory" instead of the directory
of the Makefile, which breaks "make -C profiles check".
Explicitely set it in the Makefile to get the right directory.
2018-03-18 18:09:04 +00:00
Steve Beattie
106396289a build: make documentation at tarball creation time, not during build
The latex based techdoc in the parser/ tree adds a number of build
dependencies for downstreams to create it; it also is the primary
element to make the builds unrepeatable. Creating the techdoc and other
documentation when generating a tarball for distribution avoids all
that.

* Makefile: build documentation as part of the tarball creation. Skip
  the libraries/libapparmor directory as it needs to have configure run
  before the manpages can be made.
* changehat/mod_apparmor/Makefile, changehat/mod_apparmor/Makefile,
  utils/Makefile, profiles/Makefile: create separate docs target,
  some of them dummies.
* parser/Makefile: pull the techdoc out of the default build target, add
  an extra_docs target to create it.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-12-10 10:25:31 -08:00
Christian Boltz
756d622db3 Re-enable check-logprof in profiles 'make check' target
aa-logprof is able to parse all profiles, so there is no longer a
reason to skip this test.

This patch reverts r2097 and r2098 from 2013-01-02.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com>
(and now that the tests work even if logprof.conf doesn't exist,
Steve's NACK is no longer valid)
2015-10-20 23:42:41 +02:00
Christian Boltz
73dfc75ff4 profiles/Makefile check-parser depends on local/* files
Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2015-06-19 21:05:49 +02:00
Christian Boltz
7d625e384e check-logprof needs local/* files
check-logprof in profiles/Makefile needs the local/* files.
Add a dependency to make sure they are generated.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2015-06-18 22:58:59 +02:00
Steve Beattie
f19eb31f23 Entire tree: makefile cruft removal
- drop the symlink magic of the common/ directory, and just include
  files directly from there.
- update comments indicating required steps to take when including
  common/Make.rules
- drop make clean steps that refer to no longer generated tarballs,
  specfiles, and symlinks to the common directory/Make.rules.
- don't silence clean steps if VERBOSE is set

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian "Ghostbuster" Boltz <apparmor@cboltz.de>
2015-01-23 15:52:09 -08:00
Steve Beattie
f05649e518 profiles: update make check-logprof for python tools
The check-logprof target was not updated to use the python tools, when
they were merged in. This patch fixes the issue.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-12-02 08:03:09 -08:00
Christian Boltz
c38062f9b0 make clean: delete "common" symlink in all directories
Acked-by: <timeout>
2014-11-10 20:14:35 +01:00
Alban Crequy
5a826d8a5c profiles/Makefile: grep: use [[:space:]] instead of \s
\s is a new feature of GNU grep 2.6 (released on 2010-03-23) and
it does not work in older versions. By using [[:space:]] instead,
AppArmor can compile on systems with older versions of grep.

Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-03-25 10:45:20 -07:00
Christian Boltz
1886ab9f35 make sure all profiles have #include <local/...>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-01-20 23:35:13 +01:00
Steve Beattie
33bfedb95a Add comment describing why check-logprof was dropped from the make check
target in the profiles Makefile, for future archaeological spelunking.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2013-01-04 16:33:41 -08:00
Steve Beattie
fd26b2c044 Disable the logprof check by default for the profiles tree, as logprof
has not kept pace with language changes.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2013-01-02 17:56:45 -08:00
Steve Beattie
f9b9212100 Subject: profiles - separate out logprof checks from parser checks
This patch separates out make check in the profiles/ directory into
two sub targets, for checking profiles against the built parser
and aa-logprof respectively. The logprof check currently makes some
assumptions about the environment that make it difficult to run in
a minimal chroot environment.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
2013-01-02 14:33:12 -08:00
Steve Beattie
3690a2e1c0 Subject: profiles - fix make check
When I corrected the profiles/Makefile to automatically find files to
install, I converted one variable name but missed a later location where
that variable was used, which broke the 'make check' target, because
directories would be handed to the apparmor parser. This patch corrects
that and also makes the VERBOSE flag report each profile name as it's
being handed to the parser.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Seth Arnold <seth.arnold@canonical.com>
2012-12-21 22:43:11 -08:00
Steve Beattie
7d5f45d9e3 This patch fixes an existing install failure in the profiles tree, due
to the apparmor_api subtree not getting added in the Makefile. Rather
Rather than require every sub-directory that gets added to be
enumerated, it uses find to determine what directories and files to
install, to avoid future breakage. It is admittedly slower than the
original code because install(1) is being invoked for every file in
the apparmor.d tree, rather than acting on wildcard globs. That said,
I think it's an acceptable tradeoff.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2012-11-21 07:39:40 -08:00
Christian Boltz
5ae05cc2f4 Install extra profiles in /usr/share/apparmor/extra-profiles/ instead of
/etc/apparmor/profiles/extras/, and update the path at various places.

Also update the mailinglist address in extra-profiles README and 
recommend cp instead of mv.

Note: if you want to have a symlink 
    /etc/apparmor/profiles/extras -> /usr/share/apparmor/extra-profiles/
for backward compability, you'll have to create it yourself (for example
in the .spec file)

This also fixes https://bugzilla.novell.com/show_bug.cgi?id=713647


Acked-by: John Johansen <john.johansen@canonical.com>
2012-09-27 23:57:21 +02:00
Christian Boltz
b9bbcdc45c Create /etc/apparmor.d/tunables/multiarch.d directory in profiles/Makefile
(otherwise it's created as a file, which is wrong)

Acked-by: John Johansen <john.johansen@canonical.com>
2012-01-03 23:41:07 +01:00
Christian Boltz
33b7c5316f create the directory /etc/apparmor.d/disable which is required by aa-disable
Acked-by: John Johansen <john.johansen@canonical.com>
2011-10-20 00:23:19 +02:00
Steve Beattie
e8f297db5a Fix up the profiles make install target for the tunables/multiarch.d/
change.
2011-03-23 16:10:33 -07:00
Steve Beattie
bb28ca5371 profiles/Makefile: fix 'check' target to iterate over the profiles in
the extras directory as intended and fail the make if a parse failure
occurs. Also, set the default parser and logprof to be the intree ones;
the system ones can still be used by setting environment variables.
Finally, have the 'all' target generate the local files. Also, set the
parser base directory to the apparmor.d directory (rather than as an
added include, to avoid outside contamination from system profiles and
includes).

With these changes, make && make check should verify the profile set is
compilable and mostly consistent. (Alas, the current profiles are not
quite consistent).
2011-03-18 22:31:26 -07:00
Jamie Strandboge
23a77d70e8 adjust profiles/Makefile for abstractions/ubuntu-browsers.d 2010-08-10 16:42:00 -05:00
Jamie Strandboge
eace04e2e7 profiles/Makefile: use LOCAL_ADDITIONS using filter-out in clean target, which
is much cleaner.
2010-08-05 16:00:23 -05:00
Jamie Strandboge
f9187ac661 profiles/Makefile: use same logic in 'clean' target as we did in 'local' 2010-08-05 15:53:07 -05:00
Jamie Strandboge
b550fa291c adjust profiles/Makefile for local files 2010-08-05 15:10:33 -05: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
40e8c9f6e6 merge profiles from Ubuntu, including change_hat apache2 template 2009-11-11 11:42:30 -08:00
Seth Arnold
2e9a82868f Grand profile repository re-organization. Move directories around to
make the final install layout match the layout in the repository (at
long last :) -- now we can use a single 'make check' target to check the
profiles in the repository against both apparmor_parser and logprof.
2007-05-16 18:51:46 +00:00