diff options
author | Armin Kuster <akuster808@gmail.com> | 2022-06-18 10:31:21 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2022-06-23 18:47:59 -0700 |
commit | fec94e6ce42cb3754f4d6d89cd85102d9e669648 (patch) | |
tree | 45cae499cfe7716ba4700cee81db8982765ff01a | |
parent | 6dedb1de7017f8c6afa61dacfdfc409dfc6cecad (diff) | |
download | meta-security-fec94e6ce42cb3754f4d6d89cd85102d9e669648.tar.gz |
firejail: Add new package
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | recipes-security/Firejail/firejail/exclude_seccomp_util_compiles.patch | 45 | ||||
-rw-r--r-- | recipes-security/Firejail/firejail_0.9.70.bb | 61 |
2 files changed, 106 insertions, 0 deletions
diff --git a/recipes-security/Firejail/firejail/exclude_seccomp_util_compiles.patch b/recipes-security/Firejail/firejail/exclude_seccomp_util_compiles.patch new file mode 100644 index 0000000..a32720a --- /dev/null +++ b/recipes-security/Firejail/firejail/exclude_seccomp_util_compiles.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | Exclude all the seccomp files to run during build. | ||
2 | |||
3 | Upstream-Status: Inappropriate [embedded specific] | ||
4 | There are some files that need to run to generate the appropriate files | ||
5 | we are currently doing this on the target. | ||
6 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
7 | |||
8 | Index: git/Makefile.in | ||
9 | =================================================================== | ||
10 | --- git.orig/Makefile.in | ||
11 | +++ git/Makefile.in | ||
12 | @@ -34,7 +34,6 @@ MYDIRS = src/lib $(MAN_SRC) $(COMPLETION | ||
13 | MYLIBS = src/libpostexecseccomp/libpostexecseccomp.so src/libtrace/libtrace.so src/libtracelog/libtracelog.so | ||
14 | COMPLETIONS = src/zsh_completion/_firejail src/bash_completion/firejail.bash_completion | ||
15 | MANPAGES = firejail.1 firemon.1 firecfg.1 firejail-profile.5 firejail-login.5 firejail-users.5 jailcheck.1 | ||
16 | -SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.block_secondary seccomp.mdwx seccomp.mdwx.32 | ||
17 | ALL_ITEMS = $(APPS) $(SBOX_APPS) $(SBOX_APPS_NON_DUMPABLE) $(MYLIBS) | ||
18 | |||
19 | .PHONY: all_items $(ALL_ITEMS) | ||
20 | @@ -52,7 +51,7 @@ $(MANPAGES): src/man | ||
21 | |||
22 | man: $(MANPAGES) | ||
23 | |||
24 | -filters: $(SECCOMP_FILTERS) $(SBOX_APPS_NON_DUMPABLE) | ||
25 | +filters: $(SBOX_APPS_NON_DUMPABLE) | ||
26 | seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize | ||
27 | src/fseccomp/fseccomp default seccomp | ||
28 | src/fsec-optimize/fsec-optimize seccomp | ||
29 | @@ -81,7 +80,6 @@ clean: | ||
30 | done | ||
31 | $(MAKE) -C test clean | ||
32 | rm -f $(MANPAGES) $(MANPAGES:%=%.gz) firejail*.rpm | ||
33 | - rm -f $(SECCOMP_FILTERS) | ||
34 | rm -f test/utils/index.html* | ||
35 | rm -f test/utils/wget-log | ||
36 | rm -f test/utils/firejail-test-file* | ||
37 | @@ -119,7 +117,7 @@ endif | ||
38 | # libraries and plugins | ||
39 | install -m 0755 -d $(DESTDIR)$(libdir)/firejail | ||
40 | install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/firecfg/firejail-welcome.sh | ||
41 | - install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) | ||
42 | + install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) | ||
43 | install -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS) | ||
44 | install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats | ||
45 | # plugins w/o read permission (non-dumpable) | ||
diff --git a/recipes-security/Firejail/firejail_0.9.70.bb b/recipes-security/Firejail/firejail_0.9.70.bb new file mode 100644 index 0000000..fc9066b --- /dev/null +++ b/recipes-security/Firejail/firejail_0.9.70.bb | |||
@@ -0,0 +1,61 @@ | |||
1 | # | ||
2 | # Copyright 2022 Armin Kuster <akuster808@gmail.com> | ||
3 | # | ||
4 | SUMMARY = "Linux namespaces and seccomp-bpf sandbox" | ||
5 | DESCRIPTION = "Firejail is a SUID sandbox program that reduces the risk of security breaches \ | ||
6 | by restricting the running environment of untrusted applications using Linux namespaces, \ | ||
7 | seccomp-bpf and Linux capabilities." | ||
8 | |||
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
10 | LICENSE = "GPL-2.0-only" | ||
11 | |||
12 | SRCREV = "b4b08d21cd95725c9d55dfdb6987fcc6d7893247" | ||
13 | SRC_URI = "git://github.com/netblue30/firejail.git;protocol=https;branch=master \ | ||
14 | file://exclude_seccomp_util_compiles.patch \ | ||
15 | " | ||
16 | |||
17 | DEPENDS = "libseccomp" | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | |||
21 | inherit autotools-brokensep pkgconfig bash-completion features_check | ||
22 | |||
23 | REQUIRED_DISTRO_FEATURES = "seccomp" | ||
24 | |||
25 | PACKAGECONFIG ?= "" | ||
26 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'apparmor', 'apparmor', '', d)}" | ||
27 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" | ||
28 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" | ||
29 | |||
30 | PACKAGECONFIG[apparmor] = "--enable-apparmor, --disable-apparmor, apparmor, apparmor" | ||
31 | PACKAGECONFIG[selinux] = "--enable-selinux, --disable-selinux, libselinux" | ||
32 | PACKAGECONFIG[x11] = " --enable-x11, --disable-x11, " | ||
33 | PACKAGECONFIG[dbusproxy] = ", --disable-dbusproxy, " | ||
34 | PACKAGECONFIG[notmpfs] = ", --disable-usertmpfs ," | ||
35 | PACKAGECONFIG[nofiretunnel] = ", --disable-firetunnel , " | ||
36 | PACKAGECONFIG[noprivatehome] = ", --disable-private-home, " | ||
37 | PACKAGECONFIG[nochroot] = ", --disable-chroot, " | ||
38 | PACKAGECONFIG[nonetwork] = ", --disable-network, " | ||
39 | PACKAGECONFIG[nouserns] = ", --disable-userns, " | ||
40 | PACKAGECONFIG[nofiletransfer] = ", --disable-file-transfer, " | ||
41 | PACKAGECONFIG[nosuid] = ", --disable-suid, " | ||
42 | |||
43 | EXTRA_OECONF = "--disable-man --enable-busybox-workaround" | ||
44 | |||
45 | PACKAGES:append = " ${PN}-vim ${PN}-zsh" | ||
46 | |||
47 | FILES:${PN}-vim = "${datadir}/vim/" | ||
48 | FILES:${PN}-zsh = "${datadir}/zsh/" | ||
49 | |||
50 | pkg_postinst_ontarget:${PN} () { | ||
51 | ${libdir}/${BPN}/fseccomp default ${libdir}/${BPN}/seccomp | ||
52 | ${libdir}/${BPN}/fsec-optimize ${libdir}/${BPN}/seccomp | ||
53 | ${libdir}/${BPN}/fseccomp default ${libdir}/${BPN}/seccomp.debug allow-debuggers | ||
54 | ${libdir}/${BPN}/fsec-optimize ${libdir}/${BPN}/seccomp.debug | ||
55 | ${libdir}/${BPN}/fseccomp secondary 32 ${libdir}/${BPN}/seccomp.32 | ||
56 | ${libdir}/${BPN}/fsec-optimize ${libdir}/${BPN}/seccomp.32 | ||
57 | ${libdir}/${BPN}/fseccomp secondary block ${libdir}/${BPN}/seccomp.block_secondary | ||
58 | ${libdir}/${BPN}/fseccomp memory-deny-write-execute ${libdir}/${BPN}/seccomp.mdwx | ||
59 | } | ||
60 | |||
61 | RDEPENDS:${PN} = "bash" | ||