Skip to contentSkip to conversation

firejail: new package

PATCH New Chris Frederick 3 participants 3 messages Oct 26, 2016 – Mar 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firejail: new package

Firejail Security Sandbox
https://firejail.wordpress.com/

Lightweight application sandboxing system using seccomp and kernel namespaces.

---
 DEVELOPERS                     |  3 +++
 package/Config.in              |  1 +
 package/firejail/Config.in     | 17 +++++++++++++++++
 package/firejail/firejail.hash |  2 ++
 package/firejail/firejail.mk   | 27 +++++++++++++++++++++++++++
 5 files changed, 50 insertions(+)
 create mode 100644 package/firejail/Config.in
 create mode 100644 package/firejail/firejail.hash
 create mode 100644 package/firejail/firejail.mk
DEVELOPERS +3 -0
index 16d9b55..3dcd0e2 100644
@@ -291,6 +291,9 @@ F:	package/libdvbsi/
 F:	package/libsvg/
 F:	package/libsvg-cairo/
 
+N:	Chris Frederick (chrisf at cdf123.net)
+F:	package/firejail/
+
 N:	Chris Packham <[email protected]>
 F:	package/eventlog/
 F:	package/micropython/
package/Config.in +1 -0
index 9399f63..be20478 100644
@@ -1710,6 +1710,7 @@ menu "System tools"
 	source "package/efibootmgr/Config.in"
 	source "package/efivar/Config.in"
 	source "package/emlog/Config.in"
+	source "package/firejail/Config.in"
 	source "package/ftop/Config.in"
 	source "package/getent/Config.in"
 	source "package/htop/Config.in"
package/firejail/Config.in new file +17 -0
new file mode 100644
index 0000000..45fc496
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_FIREJAIL
+	bool "firejail"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  Firejail is a SUID program that reduces the risk of security
+	  breaches by restricting the running environment of untrusted
+	  applications using Linux namespaces and seccomp-bpf. It
+	  allows a process and all its descendants to have their own
+	  private view of the globally shared kernel resources, such
+	  as the network stack, process table, mount table.
+
+	  https://firejail.wordpress.com/
+
+comment "firejail needs a glibc toolchain"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
package/firejail/firejail.hash new file +2 -0
new file mode 100644
index 0000000..dc2eb80
@@ -0,0 +1,2 @@
+# From http://download.sourceforge.net/firejail/firejail-0.9.42.asc
+sha256 4f3bceee973b84fdf13a5d5ab0060d140ecc8e42c19c945e7fb93f0fd8499b47  firejail-0.9.42.tar.xz
package/firejail/firejail.mk new file +27 -0
new file mode 100644
index 0000000..3926e8a
@@ -0,0 +1,27 @@
+################################################################################
+#
+# firejail
+#
+################################################################################
+
+FIREJAIL_VERSION = 0.9.42
+FIREJAIL_SITE = http://download.sourceforge.net/firejail
+FIREJAIL_SOURCE = firejail-$(FIREJAIL_VERSION).tar.xz
+FIREJAIL_LICENSE = GPLv2+
+FIREJAIL_LICENSE_FILES = COPYING
+FIREJAIL_MAKE_OPTS = ARCH=$(BR2_ARCH) CC="$(TARGET_CC)" \
+	USERCOMPILE="$(TARGET_CFLAGS)" USERLINK="$(TARGET_LDFLAGS)"
+
+FIREJAIL_CONF_OPTS = \
+	--enable-bind \
+	--enable-busybox-workaround \
+	--enable-file-transfer \
+	--enable-network \
+	--enable-seccomp \
+	--enable-userns
+
+define FIREJAIL_PERMISSIONS
+	/usr/bin/firejail f 4755 0 0 - - - - -
+endef
+
+$(eval $(autotools-package))
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/1 firejail: new package

Hi Chris,

Le 26/10/2016 ? 19:22, Chris Frederick a ?crit :

Quoted 23 lines

Firejail Security Sandbox
https://firejail.wordpress.com/

Lightweight application sandboxing system using seccomp and kernel namespaces.

---
 DEVELOPERS                     |  3 +++
 package/Config.in              |  1 +
 package/firejail/Config.in     | 17 +++++++++++++++++
 package/firejail/firejail.hash |  2 ++
 package/firejail/firejail.mk   | 27 +++++++++++++++++++++++++++
 5 files changed, 50 insertions(+)
 create mode 100644 package/firejail/Config.in
 create mode 100644 package/firejail/firejail.hash
 create mode 100644 package/firejail/firejail.mk
DEVELOPERS +0 -0
index 16d9b55..3dcd0e2 100644

DEVELOPERS F: package/libdvbsi/ · line 296

Quoted 6 lines
DEVELOPERS +3 -0
@@ -291,6 +291,9 @@ F:	package/libdvbsi/
 F:	package/libsvg/
 F:	package/libsvg-cairo/
 
+N:	Chris Frederick (chrisf at cdf123.net)
+F:	package/firejail/
+

We usually prefer adding a new DEVELOPERS entry in a separate patch.

Quoted 21 lines
DEVELOPERS +0 -0
 N:	Chris Packham <[email protected]>
 F:	package/eventlog/
 F:	package/micropython/
package/Config.in +1 -0
index 9399f63..be20478 100644
@@ -1710,6 +1710,7 @@ menu "System tools"
 	source "package/efibootmgr/Config.in"
 	source "package/efivar/Config.in"
 	source "package/emlog/Config.in"
+	source "package/firejail/Config.in"
 	source "package/ftop/Config.in"
 	source "package/getent/Config.in"
 	source "package/htop/Config.in"
package/firejail/Config.in new file +0 -0
new file mode 100644
index 0000000..45fc496

package/firejail/Config.in line 5

Quoted 5 lines
package/firejail/Config.in new file +5 -0
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_FIREJAIL
+	bool "firejail"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_USES_GLIBC

Why it depends on glibc ?

package/firejail/Config.in line 17

Quoted 12 lines
package/firejail/Config.in new file +12 -0
+	help
+	  Firejail is a SUID program that reduces the risk of security
+	  breaches by restricting the running environment of untrusted
+	  applications using Linux namespaces and seccomp-bpf. It
+	  allows a process and all its descendants to have their own
+	  private view of the globally shared kernel resources, such
+	  as the network stack, process table, mount table.
+
+	  https://firejail.wordpress.com/
+
+comment "firejail needs a glibc toolchain"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC

Package dependencies must be propagated to the comment dependencies:

comment "firejail needs a glibc toolchain w/ threads"

	depends on BR2_USE_MMU
	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_TOOLCHAIN_HAS_THREADS
Quoted 16 lines
package/firejail/firejail.hash new file +2 -0
new file mode 100644
index 0000000..dc2eb80
@@ -0,0 +1,2 @@
+# From 
+sha256 4f3bceee973b84fdf13a5d5ab0060d140ecc8e42c19c945e7fb93f0fd8499b47  firejail-0.9.42.tar.xz
package/firejail/firejail.mk new file +2 -0
new file mode 100644
index 0000000..3926e8a
@@ -0,0 +1,27 @@
+################################################################################
+#

package/firejail/firejail.mk line 12

Quoted 10 lines
package/firejail/firejail.mk new file +10 -0
+# firejail
+#
+################################################################################
+
+FIREJAIL_VERSION = 0.9.42
+FIREJAIL_SITE = http://download.sourceforge.net/firejail
+FIREJAIL_SOURCE = firejail-$(FIREJAIL_VERSION).tar.xz
+FIREJAIL_LICENSE = GPLv2+
+FIREJAIL_LICENSE_FILES = COPYING
+FIREJAIL_MAKE_OPTS = ARCH=$(BR2_ARCH) CC="$(TARGET_CC)" \

ARCH is not defined in the Makefile.

package/firejail/firejail.mk line 13

Quoted 1 line
package/firejail/firejail.mk new file +1 -0
+	USERCOMPILE="$(TARGET_CFLAGS)" USERLINK="$(TARGET_LDFLAGS)"

Same of USERCOMPILE and USERLINK which are not defined in the Makefile.

Actually, setting FIREJAIL_MAKE_OPTS seems not useful at all.

package/firejail/firejail.mk line 17

Quoted 4 lines
package/firejail/firejail.mk new file +4 -0
+
+FIREJAIL_CONF_OPTS = \
+	--enable-bind \
+	--enable-busybox-workaround \

This option should depends on BR2_PACKAGE_BUSYBOX.

Best regards,
Romain

Quoted 11 lines
package/firejail/firejail.mk new file +10 -0
+	--enable-file-transfer \
+	--enable-network \
+	--enable-seccomp \
+	--enable-userns
+
+define FIREJAIL_PERMISSIONS
+	/usr/bin/firejail f 4755 0 0 - - - - -
+endef
+
+$(eval $(autotools-package))
#2 lore raw

PATCH 1/1 firejail: new package

In reply to Chris Frederick

Hello,

Quoted 7 lines · Chris Frederick

Firejail Security Sandbox
https://firejail.wordpress.com/

Lightweight application sandboxing system using seccomp and kernel namespaces.

Quoted 10 lines
---
 DEVELOPERS                     |  3 +++
 package/Config.in              |  1 +
 package/firejail/Config.in     | 17 +++++++++++++++++
 package/firejail/firejail.hash |  2 ++
 package/firejail/firejail.mk   | 27 +++++++++++++++++++++++++++
 5 files changed, 50 insertions(+)
 create mode 100644 package/firejail/Config.in
 create mode 100644 package/firejail/firejail.hash
 create mode 100644 package/firejail/firejail.mk

Thanks, I've applied to the master branch, with the following changes:

[Thomas:
- Fix DEVELOPERS entry: use <> around the e-mail address instead of ()
- firejail builds fine with musl, so only exclude uclibc, which fails to build with EM_ARM undeclared
- Update to upstream version 0.9.44.8.
- Remove FIREJAIL_MAKE_OPTS, as suggested by Romain Naour.
- Pass --enable-busybox-workaround only if Busybox is enabled, as suggested by Romain Naour.]

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com