From 10d852ca1d9e064b6c923e23e4caf5fca999cf46 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Sat, 19 Aug 2023 14:32:08 +0100 Subject: [PATCH] doc: update variables ref & minor improvment. --- docs/development/guidelines.md | 2 +- docs/development/integration.md | 10 +++++++-- docs/install.md | 15 +++++++++++++ docs/issues.md | 2 +- docs/usage.md | 3 ++- docs/variables.md | 40 +++++++++++++++++++++------------ 6 files changed, 53 insertions(+), 19 deletions(-) diff --git a/docs/development/guidelines.md b/docs/development/guidelines.md index 7a842729..b3ca2709 100644 --- a/docs/development/guidelines.md +++ b/docs/development/guidelines.md @@ -20,7 +20,7 @@ is therefore easy to ensure some profile features such as: It also improves compatibilities and makes personalization easier thanks to the use of more variables. - + ## Guidelines !!! note diff --git a/docs/development/integration.md b/docs/development/integration.md index 81a024e2..92867b29 100644 --- a/docs/development/integration.md +++ b/docs/development/integration.md @@ -24,16 +24,22 @@ The test VMs are built using [`cloud-init`][cloud-init] (when available), [`pack [packer]: https://www.packer.io/ [vagrant]: https://www.vagrantup.com/ +### Requirements -### Build +* docker +* [packer] +* [vagrant] +* vagrant plugin install vagrant-libvirt !!! note You may need to edit some settings to fit your setup: - + - The libvirt configuration in `tests/Vagrantfile` - The default ssh key and ISO directory in `tests/packer/variables.pkr.hcl` +### Build + **Build an image** To build a VM image for development purpose, run the following from the `tests` directory: diff --git a/docs/install.md b/docs/install.md index 7f63ff37..642957d3 100644 --- a/docs/install.md +++ b/docs/install.md @@ -55,6 +55,14 @@ dpkg-buildpackage -b -d --no-sign sudo dpkg -i ../apparmor.d_*_all.deb ``` +!!! tip + + If you have `devscripts` installed, you can use the one liner: + ```sh + make dpkg + ``` + + ## :simple-suse: OpenSUSE @@ -97,6 +105,13 @@ sudo make profile-names... ``` So, you can install the additional profiles `wl-copy`, `xclip`, `pass-import`, and `child-pager` if desired. + +## Uninstall + +- :material-arch: Archlinux `sudo pacman -R apparmor.d` +- :material-ubuntu: Ubuntu & :material-debian: Debian `sudo apt purge apparmor.d` + + [aur]: https://aur.archlinux.org/packages/apparmor.d-git [repo]: https://repo.pujol.io/ [keys]: https://repo.pujol.io/gpgkey diff --git a/docs/issues.md b/docs/issues.md index f1542a53..b2d90e80 100644 --- a/docs/issues.md +++ b/docs/issues.md @@ -12,7 +12,7 @@ Known bugs are tracked on the meta issue **[#75](https://github.com/roddhjav/app However, there are some **major exceptions**: * `deny` rules are enforced even in complain mode, - * `attach_disconnected` (and `the mediate_deleted`) will break the program if they are required and missing in the profile, + * `attach_disconnected` (and `mediate_deleted`) will break the program if they are required and missing in the profile, * If apparmor does not find the profile to transition `rPx`. ### Pacman "could not get current working directory" diff --git a/docs/usage.md b/docs/usage.md index 277c23ac..34cb04a2 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -108,7 +108,7 @@ DENIED dnsmasq open /proc/cmdline comm=dnsmasq requested_mask=r denied_mask=r ### Help ``` -aa-log [-h] [--systemd] [--file file] [profile] +aa-log [-h] [--systemd] [--file file] [--rules] [profile] Review AppArmor generated messages in a colorful way. Supports logs from auditd, systemd, syslog as well as dbus session events. @@ -122,4 +122,5 @@ Options: -h, --help Show this help message and exit. -f, --file FILE Set a logfile or a suffix to the default log file. -s, --systemd Parse systemd logs from journalctl. + -r, --rules Convert the log into AppArmor rules. ``` diff --git a/docs/variables.md b/docs/variables.md index 2595d06f..54d32c6a 100644 --- a/docs/variables.md +++ b/docs/variables.md @@ -6,8 +6,8 @@ title: Variables References ### User directories -| Description | Name | Value | -|-------------|:----:|---------| +| Description | Name | Default Value | +|-------------|:----:|---------------| | Desktop | `@{XDG_DESKTOP_DIR}` | `Desktop` | | Download | `@{XDG_DOWNLOAD_DIR}` | `Downloads` | | Templates | `@{XDG_TEMPLATES_DIR}` | `Templates` | @@ -27,8 +27,8 @@ title: Variables References ### Dotfiles -| Description | Name | Value | -|-------------|:----:|---------| +| Description | Name | Default Value | +|-------------|:----:|---------------| | SSH | `@{XDG_SSH_DIR}` | `.ssh` | | GPG | `@{XDG_GPG_DIR}` | `.gnupg` | | Passwords | `@{XDG_PASSWORD_STORE_DIR}` | `.password-store` | @@ -41,8 +41,8 @@ title: Variables References ### Full configuration path -| Description | Name | Value | -|-------------|:----:|---------| +| Description | Name | Default Value | +|-------------|:----:|---------------| | Cache | `@{user_cache_dirs}` | `@{HOME}/@{XDG_CACHE_DIR}` | | Config | `@{user_config_dirs}` | `@{HOME}/@{XDG_CONFIG_DIR}` | | Share | `@{user_share_dirs}` | ` @{HOME}/@{XDG_DATA_DIR}` | @@ -55,8 +55,8 @@ title: Variables References ### Full user path -| Description | Name | Value | -|-------------|:----:|---------| +| Description | Name | Default Value | +|-------------|:----:|---------------| | Books | `@{user_books_dirs}` | `@{HOME}/@{XDG_BOOKS_DIR} @{MOUNTS}/@{XDG_BOOKS_DIR}` | | Documents | `@{user_documents_dirs}` | `@{HOME}/@{XDG_DOCUMENTS_DIR} @{MOUNTS}/@{XDG_DOCUMENTS_DIR}` | | Download | `@{user_download_dirs}` | `@{HOME}/@{XDG_DOWNLOAD_DIR} @{MOUNTS}/@{XDG_DOWNLOAD_DIR}` | @@ -79,18 +79,30 @@ title: Variables References Do not modify these variables unless you know what you are doing -| Description | Name | Value | -|-------------|:----:|---------| -| Root Home | `@{HOMEDIRS}` | `/home/` | -| Home directories | `@{HOME}` | `@{HOMEDIRS}/*/ /root/` | +**Helper variables** + +| Description | Name | Default Value | +|-------------|:----:|---------------| +| Integer (up to 10 digits) | `@{int}` | `[0-9]{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}{[0-9],}` | +| Any 6, 8 or 10 characters | `@{rand6}`, `@{rand8}`, `@{rand10}` | | +| Hexadecimal | `@{h}*@{h}` | | +| MD5 hash | `@{md5}` | | +| Universally unique identifier | `@{uuid}` | | | Current Process id | `@{pid}` | `[0-9]*` | | Processes ids | `@{pids}` | `[0-9]*` | | User id | `@{uid}` | `[0-9]*` | | Thread id | `@{tid}` | `[0-9]*` | +| Single hexadecimal character | `@{h}` | `[0-9a-fA-F]` | +| Single alphanumeric character | `@{c}` | `[0-9a-zA-Z]` | + +**System Paths** + +| Description | Name | Default Value | +|-------------|:----:|---------------| +| Root Home | `@{HOMEDIRS}` | `/home/` | +| Home directories | `@{HOME}` | `@{HOMEDIRS}/*/ /root/` | | Root Mountpoints | `@{MOUNTDIRS}` | `/media/ @{run}/media/ /mnt/` | | Mountpoints directories | `@{MOUNTS}` | `@{MOUNTDIRS}/*/` | -| Universally unique identifier | `@{uuid}` | `[0-9a-fA-F]*-[0-9a-fA-F]*-[0-9a-fA-F]*-[0-9a-fA-F]*-[0-9a-fA-F]*` | -| Hexadecimal | `@{hex}` | `[0-9a-fA-F]*` | | Bin | `@{bin}` | `/{usr/,}{s,}bin` | | Lib | `@{lib}` | `/{usr/,}lib{,exec,32,64}` | | multi-arch library | `@{multiarch}` | `*-linux-gnu*` |