package/wpewebkit: add option to enable sandboxing support
authorAdrian Perez de Castro <aperez@igalia.com>
Sat, 14 Dec 2019 14:22:16 +0000 (16:22 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 15 Dec 2019 20:33:56 +0000 (21:33 +0100)
Add an option to enable WebKit's sandbox, which uses kernel
namespaces to isolate the processes used for Web content rendering
(WebKitWebProcess) and network/disk access (WebKitNetworkProcess).

The reason to have an option is that it needs additional dependencies
(bubblewrap, xdg-dbus-proxy, libseccomp), and that some users may
choose to deploy alternative solution (for example: putting all
of WebKit inside its own container, using systemd-nspawn or the
like).

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
[Peter: select libseccomp]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/wpewebkit/Config.in
package/wpewebkit/wpewebkit.mk

index f1460db20e1e580a1a83b0db272cac0c7afb9876..cc73cce324ca89d235045af7b607720c03b659a4 100644 (file)
@@ -63,6 +63,21 @@ config BR2_PACKAGE_WPEWEBKIT
 
 if BR2_PACKAGE_WPEWEBKIT
 
+config BR2_PACKAGE_WPEWEBKIT_SANDBOX
+       bool "sandboxing support"
+       depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS # libseccomp
+       depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12 # libseccomp
+       select BR2_PACKAGE_BUBBLEWRAP # runtime
+       select BR2_PACKAGE_XDG_DBUS_PROXY # runtime
+       select BR2_PACKAGE_LIBSECCOMP
+       help
+         Enable sandboxing of the processes used for network operation,
+         disk asccess, and Web content rendering.
+
+comment "sandboxing supports needs a toolchain w/ headers >= 3.12"
+       depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS
+       depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+
 config BR2_PACKAGE_WPEWEBKIT_MULTIMEDIA
        bool "multimedia support"
        select BR2_PACKAGE_GSTREAMER1
index c90e2d14219d353d69802895031eeec00ae5f38a..d732938b57a2825d80ed056d37bc97f2ce2d06e4 100644 (file)
@@ -20,8 +20,18 @@ WPEWEBKIT_CONF_OPTS = \
        -DPORT=WPE \
        -DENABLE_ACCESSIBILITY=OFF \
        -DENABLE_API_TESTS=OFF \
-       -DENABLE_BUBBLEWRAP_SANDBOX=OFF \
-       -DENABLE_MINIBROWSER=OFF
+       -DENABLE_MINIBROWSER=OFF \
+       -DSILENCE_CROSS_COMPILATION_NOTICES=ON
+
+ifeq ($(BR2_PACKAGE_WPEWEBKIT_SANDBOX),y)
+WPEWEBKIT_CONF_OPTS += \
+       -DENABLE_BUBBLEWRAP_SANDBOX=ON \
+       -DBWRAP_EXECUTABLE=/usr/bin/bwrap \
+       -DDBUS_PROXY_EXECUTABLE=/usr/bin/xdg-dbus-proxy
+WPEWEBKIT_DEPENDENCIES += libseccomp
+else
+WPEWEBKIT_CONF_OPTS += -DENABLE_BUBBLEWRAP_SANDBOX=OFF
+endif
 
 ifeq ($(BR2_PACKAGE_WPEWEBKIT_MULTIMEDIA),y)
 WPEWEBKIT_CONF_OPTS += \