Commit Graph

43 Commits

Author SHA1 Message Date
Simon McVittie
db77992b28 doc: Update flatpak-metadata(5) for #5155
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-17 17:57:43 +00:00
Simon McVittie
8bf4dbcae9 doc: have-kernel-module-* was added in 1.13.1
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-03 12:34:26 -08:00
Patrick Griffis
49a829cc0b Add have-kernel-module conditional
This is useful for extensions that apply to specific hardware.
2022-01-22 07:39:00 -06:00
Simon McVittie
cb47d83b72 run: Add option to share /dev/shm between instances of an app-ID
Similar to /tmp, applications might well use /dev/shm as an IPC
rendezvous between instances, which wouldn't have worked without
--device=shm until now.

Because /dev/shm has specific characteristics (in particular it's
meant to always be a tmpfs), we offload the actual storage into a
subdirectory of the real /dev/shm. Because /dev/shm is a shared
directory between all uids, we have to be extra-careful how we
do this, which is why the test coverage here is important.

This is done on an opt-in basis because of its extra complexity.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-04-16 08:57:20 +02:00
Simon McVittie
3ebf371fc2 run: Allow caller to replace /app and/or /usr
The pressure-vessel container tool in Steam will want to use this, to
replace /usr with a Steam Runtime container supplied by the Steam CDN,
instead of using the same Flatpak runtime that is used to run the Steam
client and non-containerized games.

If a custom /usr is used, the "official" Flatpak runtime is still the
one reflected in the metadata. It is also mounted at /run/parent,
with all its extensions, so that pressure-vessel has the option of using
its graphics drivers (by populating the custom /usr with symlinks into
/run/parent and/or /run/host).

When doing this, we need to put an empty directory on /app, because
the real /app expects to be run on top of the real runtime. It would
also be reasonable to substitute a custom replacement for /app, so
I've included support for that too.

Partially addresses #3797.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-04-07 09:52:50 +02:00
Simon McVittie
d0d5794621 doc: Mention some typical tags
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-01-21 14:18:21 +01:00
Simon McVittie
4108e02245 context: Add --unset-env option and a corresponding override
This follows up from GHSA-4ppf-fxf6-vxg2 to fix missing functionality
that I noticed while resolving that vulnerability, but is not required
for fixing the vulnerability.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-01-14 09:33:24 +01:00
Simon McVittie
09424423b9 context: Normalize home/path to ~/path, and ~ to home
Historically we didn't accept them, but there's no real reason why not.
They're normalized to the form in which earlier Flatpak releases would
want to see them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-08-27 17:48:50 +02:00
Jan Tojnar
eb57c7c07b Unify DocBook DTDs
Previously, there were three different DTDs used. Let's switch to a single one.

We will go with 4.5, since it is latest version that does not have any backwards incompatible changes.
2020-08-10 15:14:38 +02:00
Simon McVittie
fe2536b844 exports: Add host-etc and host-os keywords
These are subsets of the host keyword, which provide access to operating
system files but not to users' personal files.

In particular, the experimental support for namespace-based sandboxes
in the Steam Runtime[1] uses the graphics stack from the host system,
which requires access to the host /usr/libQUAL, /libQUAL (even if the
host OS has undergone the /usr merge, the canonical paths of ELF
interpreters start with /lib), /etc/ld.so.cache, and for some libraries
on Debian-based systems, /etc/alternatives. It will not be possible to
do similar things in Flatpak without either allowing full host
filesystem access (which exposes personal files, and in any case cannot
be done by the Steam app because it is incompatible with --persist=.),
or adding the ability to expose /usr and related directories without
including the rest of the host filesystem.

To the best of my knowledge, host-etc is not necessary for anything;
I've mainly provided it for symmetry, since it's the other significant
thing that we mount in /run/host and cannot get via --filesystem=/path.

Some notes on the security/privacy implications of the new keywords:

- Neither new keyword allows anything that was not already allowed
  by "host".
- Neither new keyword can allow anything that was not already allowed
  to the user outside the sandbox.
- "host-os" allows enumeration of the installed packages on the host
  system, and often their version numbers too. A malicious app could
  use this to look for exploitable security vulnerabilities on the
  host system. An app could also use this for fingerprinting, although
  this is not a regression, because the systemd/D-Bus machine ID,
  MAC addresses, hostname, kernel boot UUID, DMI product ID and many
  other unique or relatively unique properties are already available
  inside the sandbox.
- "host-os" allows read access, and possibly write access (if the user
  has it outside the sandbox, for example members of group 'staff' in
  older Debian installations), to /usr/local.
- "host-etc" allows reading configuration files whose contents might
  be considered sensitive, such as /etc/passwd.

[1] https://steamcommunity.com/app/221410/discussions/0/1638675549018366706/

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-02-14 15:41:59 +01:00
Alexander Larsson
b735344644 Correct filename in docs 2020-01-17 11:47:04 +01:00
Alexander Larsson
39903eab40 Add --device=shm permission
This new permission exposes the host /dev, which is normally not visible
even with --device=all, as it is not really a device node but rather
a bunch of shared memory blocks available on the host.

This access is needed by jack, as explained at:
https://github.com/flatpak/flatpak/issues/1509

Long term I think a better solution for pro audio (like pipewire) is
a better solution, but for now we should at least allow jack apps to work.
2020-01-17 11:47:04 +01:00
Jan Grulich
a61f61870e Add support for CUPS socket 2019-12-13 17:56:22 +01:00
Alexander Larsson
5026f01153 Support multiple versions in required-flatpak metadata key
Support a list of versions that are supported. This will be useful
for e.g. the extra_data for extensions once that is backported to
1.2, because that will require it to say that it is supported for
> 1.2.5 in the 1.2 series and > 1.4.2 otherwise.

Closes: #3112
Approved by: alexlarsson
2019-09-18 14:55:38 +00:00
Matthew Leeds
c474c941c0 doc/flatpak-metadata: Fix a couple typos
Closes: #3096
Approved by: alexlarsson
2019-09-13 07:18:05 +00:00
Ryan Gonzalez
da62f665da doc: Document ExtensionOf.runtime
Closes: #2954
Approved by: alexlarsson
2019-06-12 06:23:07 +00:00
Valentin David
8ce289b4c3 Add support for PCSC socket
Closes: #2778
Approved by: alexlarsson
2019-04-12 06:37:44 +00:00
Matthew Leeds
c6d511268a doc/flatpak-metadata: Link to fd.o spec consistently
Avoid linking to the same fd.o spec just linked to a few lines above,
and rearrange things to be more readable.

Closes: #2606
Approved by: matthiasclasen
2019-01-17 02:25:10 +00:00
Patrick Griffis
5bbdb0628e doc: Update download-if/enable-if docs
Closes: #1436
Approved by: matthiasclasen
2018-11-17 23:42:49 +00:00
Alexander Larsson
35b92d7237 Support --allow=canbus for AF_CAN access
This fixes https://github.com/flatpak/flatpak/issues/2176

Closes: #2179
Approved by: alexlarsson
2018-10-03 14:31:30 +00:00
Matthias Clasen
be36b88def Document all known .flatpak-info keys
Some of the keys in the Instance group were missing.
Add them to the man page.

Closes: #2051
Approved by: alexlarsson
2018-08-31 06:58:32 +00:00
Matthew Leeds
59997dd126 doc: Document the autoprune-unless metadata key 2018-07-27 12:47:08 -07:00
Matthew Leeds
012e47cb7d doc: Uncomment and tweak P2P docs
Now that P2P support is enabled unconditionally, uncomment the
P2P-related parts of the man pages.

Closes: #1803
Approved by: alexlarsson
2018-06-20 08:05:02 +00:00
Joonas Sarajärvi
59ecad0f29 Add ssh-auth socket support
SSH authentication sockets can be placed in a number of places, so it
is difficult for applications to just mount a fixed directory or
directories, hoping that SSH_AUTH_SOCK points somewhere inside the
mounted content.

Closes: #1764
Approved by: alexlarsson
2018-06-19 07:11:36 +00:00
Alexander Larsson
7739209a74 context: Add --allow=bluetooth
This gives access to AF_BLUETOOTH sockets in the seccomp rules. You additionally
need to give network access for the sockets to really work, because the
kernel doesn't (yet) namespace bluetooth sockets.

Closes: #1721
Approved by: alexlarsson
2018-05-28 13:06:50 +00:00
Sam Spilsbury
0cfcb90ed8 builtins-build: Search for best matching tagged extension when building extension
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Sam Spilsbury
b6d1a20223 flatpak-utils: Remove tag from extension name before adding it
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Alexander Larsson
f33fac310c Add fallback-x11 socket permission
This means use x11 if no alternative is present, and should be used
for applications that support both X11 and wayland, but want to be
sandboxed when running under a wayland compositor (but still want to
run under an X server).

Closes: #1416
Approved by: alexlarsson
2018-02-14 09:19:56 +00:00
Alexander Larsson
440389bc8e Add locale-subset property of extensions to match *.Locale behaviour
This way other types of extensions can also be subset by locale.
For instance, documentation.
2017-09-21 16:39:53 +02:00
Simon McVittie
2496dbb336 flatpak-metadata(5): Document when each field was introduced
This is useful for Flatpak runtime and app authors who want to know
which features they can use when targeting a particular branch,
or if they do not have a particular branch in mind, what value they
should put in the required-flatpak field.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-09-20 09:11:07 +02:00
Philip Withnall
c4819af5a0 common: Support collection IDs for related refs and extensions
Add support for collection IDs to the code which finds and pulls
related refs and other extensions.

Currently, related refs must have the same collection ID as the parent
ref — this is the most likely scenario anyway. In future, it should be
possible to extend the code to support pulling related refs from other
collections.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-18 14:23:03 +02:00
Simon McVittie
33caac29d2 flatpak-metadata(5): Add very brief documentation for Policy groups
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 18:05:48 +01:00
Simon McVittie
b5023ffe87 flatpak-metadata(5): Document the Instance group
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Simon McVittie
6856ca18bc flatpak-metadata(5): Document missing keys
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Simon McVittie
b552d8995b flatpak-metadata(5): Document /.flatpak-info
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Matthias Clasen
172d7ad9db Use clearer terminology in docs about extensions
Differentiate between the 'extension point' (definition of
a place where extensions can be mounted) and the 'extension'
(a runtime matching an extension point).
2017-05-08 11:28:55 +02:00
Matthias Clasen
ca40b26ce7 More metadata docs
Document the ExtensionOf and Extra Data groups.
2017-04-19 09:09:36 +02:00
Matthias Clasen
e0067ef2d0 document more metadata keys
A bunch of keys got added in code recently, and the
flatpak-metadata(5) man page has not been kept up-to-date.
2017-03-27 08:59:06 +02:00
Alexander Larsson
a07a146827 Allow filesystem options for xdg-[config,cache,data] for the regular xdg dirs
This means you can give access to e.g. ~/.config/dconf as --xdg-config/dconf
which then also respects XDG_CONFIG_DIR settings.
2016-11-14 18:58:44 +01:00
Alexander Larsson
2dd9b8627a Add support for --filesystem=XXX:create
This means the same as XXX:rw, but if the location doesn't exist
a directory is created there.
2016-11-14 18:58:44 +01:00
Alexander Larsson
c9c35133c3 Add support for --device=kvm
Solves: https://github.com/flatpak/flatpak/issues/332
2016-09-30 16:46:51 +02:00
Alexander Larsson
de7445b0b5 doc/flatpak-metadata: Add some extra clarifications 2016-07-01 11:23:38 +02:00
Matthias Clasen
a1ef27cafb Document the metadata format
This is useful information that should be available in a
single place.
2016-06-30 20:16:48 -04:00