diff options
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 6 | ||||
-rw-r--r-- | .gitignore | 15 | ||||
-rw-r--r-- | Makefile | 46 | ||||
-rw-r--r-- | RELNOTES | 4 | ||||
-rw-r--r-- | etc/inc/disable-programs.inc | 1 | ||||
-rw-r--r-- | etc/profile-a-l/ani-cli.profile | 2 | ||||
-rw-r--r-- | etc/profile-a-l/feh.profile | 12 | ||||
-rw-r--r-- | etc/profile-m-z/server.profile | 2 | ||||
-rw-r--r-- | src/firejail/firejail.h | 1 | ||||
-rw-r--r-- | src/firejail/fs_hostname.c | 2 | ||||
-rw-r--r-- | src/firejail/main.c | 5 | ||||
-rw-r--r-- | src/firejail/preproc.c | 4 | ||||
-rw-r--r-- | src/firejail/profile.c | 4 | ||||
-rw-r--r-- | src/firejail/sandbox.c | 18 | ||||
-rw-r--r-- | src/fnettrace/Makefile | 3 | ||||
-rw-r--r-- | src/fnettrace/static-ip-map.txt | 1 | ||||
-rw-r--r-- | src/include/rundefs.h | 2 | ||||
-rw-r--r-- | src/man/Makefile | 25 | ||||
-rw-r--r-- | src/man/firecfg.1.in (renamed from src/man/firecfg.txt) | 0 | ||||
-rw-r--r-- | src/man/firejail-login.5.in (renamed from src/man/firejail-login.txt) | 0 | ||||
-rw-r--r-- | src/man/firejail-profile.5.in (renamed from src/man/firejail-profile.txt) | 0 | ||||
-rw-r--r-- | src/man/firejail-users.5.in (renamed from src/man/firejail-users.txt) | 0 | ||||
-rw-r--r-- | src/man/firejail.1.in (renamed from src/man/firejail.txt) | 0 | ||||
-rw-r--r-- | src/man/firemon.1.in (renamed from src/man/firemon.txt) | 0 | ||||
-rw-r--r-- | src/man/jailcheck.1.in (renamed from src/man/jailcheck.txt) | 0 | ||||
-rwxr-xr-x | src/man/mkman.sh (renamed from mkman.sh) | 8 |
26 files changed, 102 insertions, 59 deletions
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9b82ab240..1c4c952f5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml | |||
@@ -93,7 +93,7 @@ jobs: | |||
93 | 93 | ||
94 | # Initializes the CodeQL tools for scanning. | 94 | # Initializes the CodeQL tools for scanning. |
95 | - name: Initialize CodeQL | 95 | - name: Initialize CodeQL |
96 | uses: github/codeql-action/init@f6e388ebf0efc915c6c5b165b019ee61a6746a38 | 96 | uses: github/codeql-action/init@46ed16ded91731b2df79a2893d3aea8e9f03b5c4 |
97 | with: | 97 | with: |
98 | languages: ${{ matrix.language }} | 98 | languages: ${{ matrix.language }} |
99 | # If you wish to specify custom queries, you can do so here or in a config file. | 99 | # If you wish to specify custom queries, you can do so here or in a config file. |
@@ -104,7 +104,7 @@ jobs: | |||
104 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | 104 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
105 | # If this step fails, then you should remove it and run the build manually (see below) | 105 | # If this step fails, then you should remove it and run the build manually (see below) |
106 | - name: Autobuild | 106 | - name: Autobuild |
107 | uses: github/codeql-action/autobuild@f6e388ebf0efc915c6c5b165b019ee61a6746a38 | 107 | uses: github/codeql-action/autobuild@46ed16ded91731b2df79a2893d3aea8e9f03b5c4 |
108 | 108 | ||
109 | # âšī¸ Command-line programs to run using the OS shell. | 109 | # âšī¸ Command-line programs to run using the OS shell. |
110 | # đ https://git.io/JvXDl | 110 | # đ https://git.io/JvXDl |
@@ -118,4 +118,4 @@ jobs: | |||
118 | # make release | 118 | # make release |
119 | 119 | ||
120 | - name: Perform CodeQL Analysis | 120 | - name: Perform CodeQL Analysis |
121 | uses: github/codeql-action/analyze@f6e388ebf0efc915c6c5b165b019ee61a6746a38 | 121 | uses: github/codeql-action/analyze@46ed16ded91731b2df79a2893d3aea8e9f03b5c4 |
diff --git a/.gitignore b/.gitignore index aae7b817d..2285c3e5d 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -6,9 +6,9 @@ | |||
6 | *.rpm | 6 | *.rpm |
7 | *.gcda | 7 | *.gcda |
8 | *.gcno | 8 | *.gcno |
9 | *.gz | ||
9 | *.DS_Store | 10 | *.DS_Store |
10 | .directory | 11 | .directory |
11 | *.man | ||
12 | .vscode | 12 | .vscode |
13 | /firejail-*/ | 13 | /firejail-*/ |
14 | autom4te.cache/ | 14 | autom4te.cache/ |
@@ -20,14 +20,6 @@ contrib/syntax/files/example | |||
20 | contrib/syntax/files/firejail-profile.lang | 20 | contrib/syntax/files/firejail-profile.lang |
21 | contrib/syntax/files/firejail.vim | 21 | contrib/syntax/files/firejail.vim |
22 | firejail-*.tar.xz | 22 | firejail-*.tar.xz |
23 | firejail-login.5 | ||
24 | firejail-profile.5 | ||
25 | firejail-config.5 | ||
26 | firejail-users.5 | ||
27 | firejail.1 | ||
28 | firemon.1 | ||
29 | firecfg.1 | ||
30 | jailcheck.1 | ||
31 | src/fnettrace-dns/fnettrace-dns | 23 | src/fnettrace-dns/fnettrace-dns |
32 | src/fnettrace-sni/fnettrace-sni | 24 | src/fnettrace-sni/fnettrace-sni |
33 | src/fnettrace-icmp/fnettrace-icmp | 25 | src/fnettrace-icmp/fnettrace-icmp |
@@ -61,7 +53,12 @@ seccomp.64 | |||
61 | seccomp.block_secondary | 53 | seccomp.block_secondary |
62 | seccomp.mdwx | 54 | seccomp.mdwx |
63 | seccomp.mdwx.32 | 55 | seccomp.mdwx.32 |
56 | seccomp.namespaces | ||
57 | seccomp.namespaces.32 | ||
64 | aclocal.m4 | 58 | aclocal.m4 |
65 | __pycache__ | 59 | __pycache__ |
66 | *.pyc | 60 | *.pyc |
67 | *.pyo | 61 | *.pyo |
62 | src/fnettrace/static-ip-map | ||
63 | src/man/*.1 | ||
64 | src/man/*.5 | ||
@@ -4,7 +4,6 @@ ROOT = . | |||
4 | 4 | ||
5 | ifneq ($(HAVE_MAN),no) | 5 | ifneq ($(HAVE_MAN),no) |
6 | MAN_TARGET = man | 6 | MAN_TARGET = man |
7 | MAN_SRC = src/man | ||
8 | endif | 7 | endif |
9 | 8 | ||
10 | ifneq ($(HAVE_CONTRIB_INSTALL),no) | 9 | ifneq ($(HAVE_CONTRIB_INSTALL),no) |
@@ -19,11 +18,15 @@ SBOX_APPS_NON_DUMPABLE = src/fcopy/fcopy src/fldd/fldd src/fnet/fnet src/fnetfil | |||
19 | SBOX_APPS_NON_DUMPABLE += src/fsec-optimize/fsec-optimize src/fsec-print/fsec-print src/fseccomp/fseccomp | 18 | SBOX_APPS_NON_DUMPABLE += src/fsec-optimize/fsec-optimize src/fsec-print/fsec-print src/fseccomp/fseccomp |
20 | SBOX_APPS_NON_DUMPABLE += src/fnettrace/fnettrace src/fnettrace-dns/fnettrace-dns src/fnettrace-sni/fnettrace-sni | 19 | SBOX_APPS_NON_DUMPABLE += src/fnettrace/fnettrace src/fnettrace-dns/fnettrace-dns src/fnettrace-sni/fnettrace-sni |
21 | SBOX_APPS_NON_DUMPABLE += src/fnettrace-icmp/fnettrace-icmp | 20 | SBOX_APPS_NON_DUMPABLE += src/fnettrace-icmp/fnettrace-icmp |
22 | MYDIRS = src/lib $(MAN_SRC) $(COMPLETIONDIRS) | 21 | MYDIRS = src/lib $(COMPLETIONDIRS) |
23 | MYLIBS = src/libpostexecseccomp/libpostexecseccomp.so src/libtrace/libtrace.so src/libtracelog/libtracelog.so | 22 | MYLIBS = src/libpostexecseccomp/libpostexecseccomp.so src/libtrace/libtrace.so src/libtracelog/libtracelog.so |
24 | COMPLETIONS = src/zsh_completion/_firejail src/bash_completion/firejail.bash_completion | 23 | COMPLETIONS = src/zsh_completion/_firejail src/bash_completion/firejail.bash_completion |
25 | SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.block_secondary seccomp.mdwx seccomp.mdwx.32 | 24 | SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.block_secondary seccomp.mdwx seccomp.mdwx.32 seccomp.namespaces seccomp.namespaces.32 |
26 | MANPAGES = firejail.1 firemon.1 firecfg.1 firejail-profile.5 firejail-login.5 firejail-users.5 jailcheck.1 | 25 | |
26 | MANPAGES1_IN := $(sort $(wildcard src/man/*.1.in)) | ||
27 | MANPAGES5_IN := $(sort $(wildcard src/man/*.5.in)) | ||
28 | MANPAGES1_GZ := $(MANPAGES1_IN:.in=.gz) | ||
29 | MANPAGES5_GZ := $(MANPAGES5_IN:.in=.gz) | ||
27 | 30 | ||
28 | SYSCALL_HEADERS := $(sort $(wildcard src/include/syscall*.h)) | 31 | SYSCALL_HEADERS := $(sort $(wildcard src/include/syscall*.h)) |
29 | 32 | ||
@@ -49,7 +52,7 @@ config.mk config.sh: | |||
49 | @printf 'error: run ./configure to generate %s\n' "$@" >&2 | 52 | @printf 'error: run ./configure to generate %s\n' "$@" >&2 |
50 | @false | 53 | @false |
51 | 54 | ||
52 | .PHONY: all_items $(ALL_ITEMS) | 55 | .PHONY: all_items |
53 | all_items: $(ALL_ITEMS) | 56 | all_items: $(ALL_ITEMS) |
54 | $(ALL_ITEMS): $(MYDIRS) | 57 | $(ALL_ITEMS): $(MYDIRS) |
55 | $(MAKE) -C $(dir $@) | 58 | $(MAKE) -C $(dir $@) |
@@ -60,7 +63,7 @@ $(MYDIRS): | |||
60 | $(MAKE) -C $@ | 63 | $(MAKE) -C $@ |
61 | 64 | ||
62 | .PHONY: filters | 65 | .PHONY: filters |
63 | filters: $(SECCOMP_FILTERS) $(SBOX_APPS_NON_DUMPABLE) | 66 | filters: $(SECCOMP_FILTERS) |
64 | seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize | 67 | seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize |
65 | src/fseccomp/fseccomp default seccomp | 68 | src/fseccomp/fseccomp default seccomp |
66 | src/fsec-optimize/fsec-optimize seccomp | 69 | src/fsec-optimize/fsec-optimize seccomp |
@@ -82,11 +85,15 @@ seccomp.mdwx: src/fseccomp/fseccomp | |||
82 | seccomp.mdwx.32: src/fseccomp/fseccomp | 85 | seccomp.mdwx.32: src/fseccomp/fseccomp |
83 | src/fseccomp/fseccomp memory-deny-write-execute.32 seccomp.mdwx.32 | 86 | src/fseccomp/fseccomp memory-deny-write-execute.32 seccomp.mdwx.32 |
84 | 87 | ||
85 | $(MANPAGES): src/man config.mk | 88 | seccomp.namespaces: src/fseccomp/fseccomp |
86 | ./mkman.sh $(VERSION) src/man/$(basename $@).man $@ | 89 | src/fseccomp/fseccomp restrict-namespaces seccomp.namespaces cgroup,ipc,net,mnt,pid,time,user,uts |
90 | |||
91 | seccomp.namespaces.32: src/fseccomp/fseccomp | ||
92 | src/fseccomp/fseccomp restrict-namespaces seccomp.namespaces.32 cgroup,ipc,net,mnt,pid,time,user,uts | ||
87 | 93 | ||
88 | .PHONY: man | 94 | .PHONY: man |
89 | man: $(MANPAGES) | 95 | man: |
96 | $(MAKE) -C src/man | ||
90 | 97 | ||
91 | # Makes all targets in contrib/ | 98 | # Makes all targets in contrib/ |
92 | .PHONY: contrib | 99 | .PHONY: contrib |
@@ -156,9 +163,10 @@ clean: | |||
156 | for dir in $$(dirname $(ALL_ITEMS)) $(MYDIRS); do \ | 163 | for dir in $$(dirname $(ALL_ITEMS)) $(MYDIRS); do \ |
157 | $(MAKE) -C $$dir clean; \ | 164 | $(MAKE) -C $$dir clean; \ |
158 | done | 165 | done |
166 | $(MAKE) -C src/man clean | ||
159 | $(MAKE) -C test clean | 167 | $(MAKE) -C test clean |
160 | rm -f $(SECCOMP_FILTERS) | 168 | rm -f $(SECCOMP_FILTERS) |
161 | rm -f $(MANPAGES) $(MANPAGES:%=%.gz) firejail*.rpm | 169 | rm -f firejail*.rpm |
162 | rm -f $(SYNTAX_FILES) | 170 | rm -f $(SYNTAX_FILES) |
163 | rm -f src/fnettrace/static-ip-map | 171 | rm -f src/fnettrace/static-ip-map |
164 | rm -f test/utils/index.html* | 172 | rm -f test/utils/index.html* |
@@ -248,15 +256,8 @@ endif | |||
248 | ifneq ($(HAVE_MAN),no) | 256 | ifneq ($(HAVE_MAN),no) |
249 | # man pages | 257 | # man pages |
250 | install -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 | 258 | install -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 |
251 | for man in $(MANPAGES); do \ | 259 | install -m 0644 $(MANPAGES1_GZ) $(DESTDIR)$(mandir)/man1/ |
252 | rm -f $$man.gz; \ | 260 | install -m 0644 $(MANPAGES5_GZ) $(DESTDIR)$(mandir)/man5/ |
253 | gzip -9n $$man; \ | ||
254 | case "$$man" in \ | ||
255 | *.1) install -m 0644 $$man.gz $(DESTDIR)$(mandir)/man1/; ;; \ | ||
256 | *.5) install -m 0644 $$man.gz $(DESTDIR)$(mandir)/man5/; ;; \ | ||
257 | esac; \ | ||
258 | done | ||
259 | rm -f $(MANPAGES) $(MANPAGES:%=%.gz) | ||
260 | endif | 261 | endif |
261 | # bash completion | 262 | # bash completion |
262 | install -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions | 263 | install -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions |
@@ -284,10 +285,8 @@ uninstall: config.mk | |||
284 | rm -f $(DESTDIR)$(bindir)/jailcheck | 285 | rm -f $(DESTDIR)$(bindir)/jailcheck |
285 | rm -fr $(DESTDIR)$(libdir)/firejail | 286 | rm -fr $(DESTDIR)$(libdir)/firejail |
286 | rm -fr $(DESTDIR)$(datarootdir)/doc/firejail | 287 | rm -fr $(DESTDIR)$(datarootdir)/doc/firejail |
287 | for man in $(MANPAGES); do \ | 288 | rm -f $(addprefix $(DESTDIR)$(mandir)/man1/,$(notdir $(MANPAGES1_GZ))) |
288 | rm -f $(DESTDIR)$(mandir)/man5/$$man*; \ | 289 | rm -f $(addprefix $(DESTDIR)$(mandir)/man5/,$(notdir $(MANPAGES5_GZ))) |
289 | rm -f $(DESTDIR)$(mandir)/man1/$$man*; \ | ||
290 | done | ||
291 | rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail | 290 | rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail |
292 | rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon | 291 | rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon |
293 | rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg | 292 | rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg |
@@ -312,7 +311,6 @@ install.sh \ | |||
312 | m4 \ | 311 | m4 \ |
313 | mkdeb.sh \ | 312 | mkdeb.sh \ |
314 | mketc.sh \ | 313 | mketc.sh \ |
315 | mkman.sh \ | ||
316 | platform \ | 314 | platform \ |
317 | src | 315 | src |
318 | 316 | ||
@@ -6,6 +6,7 @@ firejail (0.9.73) baseline; urgency=low | |||
6 | overwritten using --hostname command | 6 | overwritten using --hostname command |
7 | * feature: add IPv6 support for --net.print option | 7 | * feature: add IPv6 support for --net.print option |
8 | * feature: QUIC (HTTP/3) support in --nettrace | 8 | * feature: QUIC (HTTP/3) support in --nettrace |
9 | * feature: use seccomp filters build at install time for --restrict-namespaces | ||
9 | * modif: Stop forwarding own double-dash to the shell (#5599 #5600) | 10 | * modif: Stop forwarding own double-dash to the shell (#5599 #5600) |
10 | * modif: Prevent sandbox name (--name=) and host name (--hostname=) | 11 | * modif: Prevent sandbox name (--name=) and host name (--hostname=) |
11 | from containing only digits (#5578 #5741) | 12 | from containing only digits (#5578 #5741) |
@@ -29,6 +30,9 @@ firejail (0.9.73) baseline; urgency=low | |||
29 | * build: remove -mretpoline and NO_EXTRA_CFLAGS (#5859) | 30 | * build: remove -mretpoline and NO_EXTRA_CFLAGS (#5859) |
30 | * build: disable all built-in implicit make rules (#5864) | 31 | * build: disable all built-in implicit make rules (#5864) |
31 | * build: organize and standardize make vars and targets (#5866) | 32 | * build: organize and standardize make vars and targets (#5866) |
33 | * build: fix seccomp filters and man pages always being rebuilt when running | ||
34 | make | ||
35 | * build: simplify code related to man pages (#5898) | ||
32 | * ci: always update the package db before installing packages (#5742) | 36 | * ci: always update the package db before installing packages (#5742) |
33 | * ci: fix codeql unable to download its own bundle (#5783) | 37 | * ci: fix codeql unable to download its own bundle (#5783) |
34 | * ci: split configure/build/install commands on gitlab (#5784) | 38 | * ci: split configure/build/install commands on gitlab (#5784) |
diff --git a/etc/inc/disable-programs.inc b/etc/inc/disable-programs.inc index 33bcbc51b..f95ddf2fa 100644 --- a/etc/inc/disable-programs.inc +++ b/etc/inc/disable-programs.inc | |||
@@ -433,6 +433,7 @@ blacklist ${HOME}/.config/equalx | |||
433 | blacklist ${HOME}/.config/evince | 433 | blacklist ${HOME}/.config/evince |
434 | blacklist ${HOME}/.config/evolution | 434 | blacklist ${HOME}/.config/evolution |
435 | blacklist ${HOME}/.config/falkon | 435 | blacklist ${HOME}/.config/falkon |
436 | blacklist ${HOME}/.config/feh | ||
436 | blacklist ${HOME}/.config/filezilla | 437 | blacklist ${HOME}/.config/filezilla |
437 | blacklist ${HOME}/.config/flameshot | 438 | blacklist ${HOME}/.config/flameshot |
438 | blacklist ${HOME}/.config/flaska.net | 439 | blacklist ${HOME}/.config/flaska.net |
diff --git a/etc/profile-a-l/ani-cli.profile b/etc/profile-a-l/ani-cli.profile index f05653719..613f74ce5 100644 --- a/etc/profile-a-l/ani-cli.profile +++ b/etc/profile-a-l/ani-cli.profile | |||
@@ -30,7 +30,7 @@ noprinters | |||
30 | notv | 30 | notv |
31 | 31 | ||
32 | disable-mnt | 32 | disable-mnt |
33 | private-bin ani-cli,aria2c,cat,cp,curl,cut,ffmpeg,fzf,grep,head,mkdir,mv,nl,nohup,patch,sed,sh,sort,tail,tput,tr,uname,wc | 33 | private-bin ani-cli,aria2c,cat,cp,curl,cut,ffmpeg,fzf,grep,head,mkdir,mv,nl,nohup,patch,printf,rm,rofi,sed,sh,sort,tail,tput,tr,uname,wc |
34 | #private-cache | 34 | #private-cache |
35 | private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg | 35 | private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg |
36 | private-tmp | 36 | private-tmp |
diff --git a/etc/profile-a-l/feh.profile b/etc/profile-a-l/feh.profile index 82b3f7645..2efd10ba2 100644 --- a/etc/profile-a-l/feh.profile +++ b/etc/profile-a-l/feh.profile | |||
@@ -7,23 +7,33 @@ include feh.local | |||
7 | # Persistent global definitions | 7 | # Persistent global definitions |
8 | include globals.local | 8 | include globals.local |
9 | 9 | ||
10 | noblacklist ${HOME}/.config/feh | ||
11 | |||
10 | include disable-common.inc | 12 | include disable-common.inc |
11 | include disable-devel.inc | 13 | include disable-devel.inc |
12 | include disable-exec.inc | 14 | include disable-exec.inc |
13 | include disable-interpreters.inc | 15 | include disable-interpreters.inc |
16 | include disable-proc.inc | ||
14 | include disable-programs.inc | 17 | include disable-programs.inc |
15 | include disable-shell.inc | 18 | include disable-shell.inc |
16 | 19 | ||
20 | include whitelist-run-common.inc | ||
21 | include whitelist-runuser-common.inc | ||
22 | |||
17 | # Add the next line to your feh.local to enable network access. | 23 | # Add the next line to your feh.local to enable network access. |
18 | #include feh-network.inc.profile | 24 | #include feh-network.inc.profile |
19 | 25 | ||
26 | apparmor | ||
20 | caps.drop all | 27 | caps.drop all |
28 | ipc-namespace | ||
29 | machine-id | ||
21 | net none | 30 | net none |
22 | no3d | 31 | no3d |
23 | nodvd | 32 | nodvd |
24 | nogroups | 33 | nogroups |
25 | noinput | 34 | noinput |
26 | nonewprivs | 35 | nonewprivs |
36 | noprinters | ||
27 | noroot | 37 | noroot |
28 | nosound | 38 | nosound |
29 | notv | 39 | notv |
@@ -31,6 +41,8 @@ nou2f | |||
31 | novideo | 41 | novideo |
32 | protocol unix | 42 | protocol unix |
33 | seccomp | 43 | seccomp |
44 | seccomp.block-secondary | ||
45 | tracelog | ||
34 | 46 | ||
35 | private-bin feh,jpegexiforient,jpegtran | 47 | private-bin feh,jpegexiforient,jpegtran |
36 | private-cache | 48 | private-cache |
diff --git a/etc/profile-m-z/server.profile b/etc/profile-m-z/server.profile index 5b71fe6c3..05170267b 100644 --- a/etc/profile-m-z/server.profile +++ b/etc/profile-m-z/server.profile | |||
@@ -93,4 +93,4 @@ dbus-user none | |||
93 | # deterministic-shutdown | 93 | # deterministic-shutdown |
94 | # memory-deny-write-execute | 94 | # memory-deny-write-execute |
95 | # read-only ${HOME} | 95 | # read-only ${HOME} |
96 | restrict-namespaces | 96 | # restrict-namespaces |
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index d85b470e6..c791913ea 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h | |||
@@ -357,6 +357,7 @@ extern int arg_deterministic_exit_code; // always exit with first child's exit s | |||
357 | extern int arg_deterministic_shutdown; // shut down the sandbox if first child dies | 357 | extern int arg_deterministic_shutdown; // shut down the sandbox if first child dies |
358 | extern int arg_keep_fd_all; // inherit all file descriptors to sandbox | 358 | extern int arg_keep_fd_all; // inherit all file descriptors to sandbox |
359 | extern int arg_netlock; // netlocker | 359 | extern int arg_netlock; // netlocker |
360 | extern int arg_restrict_namespaces; | ||
360 | 361 | ||
361 | typedef enum { | 362 | typedef enum { |
362 | DBUS_POLICY_ALLOW, // Allow unrestricted access to the bus | 363 | DBUS_POLICY_ALLOW, // Allow unrestricted access to the bus |
diff --git a/src/firejail/fs_hostname.c b/src/firejail/fs_hostname.c index cddf3c903..29f805e1a 100644 --- a/src/firejail/fs_hostname.c +++ b/src/firejail/fs_hostname.c | |||
@@ -152,7 +152,7 @@ void fs_mount_hosts_file(void) { | |||
152 | // check /etc/hosts file | 152 | // check /etc/hosts file |
153 | struct stat s; | 153 | struct stat s; |
154 | if (stat("/etc/hosts", &s) == -1) | 154 | if (stat("/etc/hosts", &s) == -1) |
155 | goto errexit; | 155 | return; |
156 | // owned by root | 156 | // owned by root |
157 | if (s.st_uid != 0) | 157 | if (s.st_uid != 0) |
158 | goto errexit; | 158 | goto errexit; |
diff --git a/src/firejail/main.c b/src/firejail/main.c index 732ca93c2..45b199db4 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -165,6 +165,7 @@ int arg_tab = 0; | |||
165 | int login_shell = 0; | 165 | int login_shell = 0; |
166 | int just_run_the_shell = 0; | 166 | int just_run_the_shell = 0; |
167 | int arg_netlock = 0; | 167 | int arg_netlock = 0; |
168 | int arg_restrict_namespaces = 0; | ||
168 | 169 | ||
169 | int parent_to_child_fds[2]; | 170 | int parent_to_child_fds[2]; |
170 | int child_to_parent_fds[2]; | 171 | int child_to_parent_fds[2]; |
@@ -1508,8 +1509,10 @@ int main(int argc, char **argv, char **envp) { | |||
1508 | exit_err_feature("seccomp"); | 1509 | exit_err_feature("seccomp"); |
1509 | } | 1510 | } |
1510 | else if (strcmp(argv[i], "--restrict-namespaces") == 0) { | 1511 | else if (strcmp(argv[i], "--restrict-namespaces") == 0) { |
1511 | if (checkcfg(CFG_SECCOMP)) | 1512 | if (checkcfg(CFG_SECCOMP)) { |
1513 | arg_restrict_namespaces = 1; | ||
1512 | profile_list_augment(&cfg.restrict_namespaces, "cgroup,ipc,net,mnt,pid,time,user,uts"); | 1514 | profile_list_augment(&cfg.restrict_namespaces, "cgroup,ipc,net,mnt,pid,time,user,uts"); |
1515 | } | ||
1513 | else | 1516 | else |
1514 | exit_err_feature("seccomp"); | 1517 | exit_err_feature("seccomp"); |
1515 | } | 1518 | } |
diff --git a/src/firejail/preproc.c b/src/firejail/preproc.c index 6055ec95b..e0c11a005 100644 --- a/src/firejail/preproc.c +++ b/src/firejail/preproc.c | |||
@@ -96,12 +96,16 @@ void preproc_mount_mnt_dir(void) { | |||
96 | if (set_perms(RUN_SECCOMP_PROTOCOL, getuid(), getgid(), 0644)) | 96 | if (set_perms(RUN_SECCOMP_PROTOCOL, getuid(), getgid(), 0644)) |
97 | errExit("set_perms"); | 97 | errExit("set_perms"); |
98 | if (cfg.restrict_namespaces) { | 98 | if (cfg.restrict_namespaces) { |
99 | copy_file(PATH_SECCOMP_NAMESPACES, RUN_SECCOMP_NS, getuid(), getgid(), 0644); // root needed | ||
100 | copy_file(PATH_SECCOMP_NAMESPACES_32, RUN_SECCOMP_NS_32, getuid(), getgid(), 0644); // root needed | ||
101 | #if 0 | ||
99 | create_empty_file_as_root(RUN_SECCOMP_NS, 0644); | 102 | create_empty_file_as_root(RUN_SECCOMP_NS, 0644); |
100 | if (set_perms(RUN_SECCOMP_NS, getuid(), getgid(), 0644)) | 103 | if (set_perms(RUN_SECCOMP_NS, getuid(), getgid(), 0644)) |
101 | errExit("set_perms"); | 104 | errExit("set_perms"); |
102 | create_empty_file_as_root(RUN_SECCOMP_NS_32, 0644); | 105 | create_empty_file_as_root(RUN_SECCOMP_NS_32, 0644); |
103 | if (set_perms(RUN_SECCOMP_NS_32, getuid(), getgid(), 0644)) | 106 | if (set_perms(RUN_SECCOMP_NS_32, getuid(), getgid(), 0644)) |
104 | errExit("set_perms"); | 107 | errExit("set_perms"); |
108 | #endif | ||
105 | } | 109 | } |
106 | create_empty_file_as_root(RUN_SECCOMP_POSTEXEC, 0644); | 110 | create_empty_file_as_root(RUN_SECCOMP_POSTEXEC, 0644); |
107 | if (set_perms(RUN_SECCOMP_POSTEXEC, getuid(), getgid(), 0644)) | 111 | if (set_perms(RUN_SECCOMP_POSTEXEC, getuid(), getgid(), 0644)) |
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index ae881664b..07449f646 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -1088,8 +1088,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
1088 | 1088 | ||
1089 | // restrict-namespaces | 1089 | // restrict-namespaces |
1090 | if (strcmp(ptr, "restrict-namespaces") == 0) { | 1090 | if (strcmp(ptr, "restrict-namespaces") == 0) { |
1091 | if (checkcfg(CFG_SECCOMP)) | 1091 | if (checkcfg(CFG_SECCOMP)) { |
1092 | arg_restrict_namespaces = 1; | ||
1092 | profile_list_augment(&cfg.restrict_namespaces, "cgroup,ipc,net,mnt,pid,time,user,uts"); | 1093 | profile_list_augment(&cfg.restrict_namespaces, "cgroup,ipc,net,mnt,pid,time,user,uts"); |
1094 | } | ||
1093 | else | 1095 | else |
1094 | warning_feature_disabled("seccomp"); | 1096 | warning_feature_disabled("seccomp"); |
1095 | return 0; | 1097 | return 0; |
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index 19ac8d9ec..538f5be67 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c | |||
@@ -987,12 +987,8 @@ int sandbox(void* sandbox_arg) { | |||
987 | //**************************** | 987 | //**************************** |
988 | // hosts and hostname | 988 | // hosts and hostname |
989 | //**************************** | 989 | //**************************** |
990 | // if (cfg.hostname) | ||
991 | fs_hostname(); | 990 | fs_hostname(); |
992 | 991 | ||
993 | // if (cfg.hosts_file) | ||
994 | // fs_mount_hosts_file(); | ||
995 | |||
996 | //**************************** | 992 | //**************************** |
997 | // /etc overrides from the network namespace | 993 | // /etc overrides from the network namespace |
998 | //**************************** | 994 | //**************************** |
@@ -1215,7 +1211,19 @@ int sandbox(void* sandbox_arg) { | |||
1215 | seccomp_load(RUN_SECCOMP_MDWX_32); | 1211 | seccomp_load(RUN_SECCOMP_MDWX_32); |
1216 | } | 1212 | } |
1217 | 1213 | ||
1218 | if (cfg.restrict_namespaces) { | 1214 | if (arg_restrict_namespaces) { |
1215 | if (arg_seccomp_error_action != EPERM) { | ||
1216 | seccomp_filter_namespaces(true, cfg.restrict_namespaces); | ||
1217 | seccomp_filter_namespaces(false, cfg.restrict_namespaces); | ||
1218 | } | ||
1219 | |||
1220 | if (arg_debug) | ||
1221 | printf("Install namespaces filter\n"); | ||
1222 | seccomp_load(RUN_SECCOMP_NS); // install filter | ||
1223 | seccomp_load(RUN_SECCOMP_NS_32); | ||
1224 | |||
1225 | } | ||
1226 | else if (cfg.restrict_namespaces) { | ||
1219 | seccomp_filter_namespaces(true, cfg.restrict_namespaces); | 1227 | seccomp_filter_namespaces(true, cfg.restrict_namespaces); |
1220 | seccomp_filter_namespaces(false, cfg.restrict_namespaces); | 1228 | seccomp_filter_namespaces(false, cfg.restrict_namespaces); |
1221 | 1229 | ||
diff --git a/src/fnettrace/Makefile b/src/fnettrace/Makefile index 9748a3b47..68a4cbdc0 100644 --- a/src/fnettrace/Makefile +++ b/src/fnettrace/Makefile | |||
@@ -11,6 +11,3 @@ include $(ROOT)/src/prog.mk | |||
11 | all: $(TARGET) static-ip-map | 11 | all: $(TARGET) static-ip-map |
12 | static-ip-map: static-ip-map.txt fnettrace | 12 | static-ip-map: static-ip-map.txt fnettrace |
13 | ./fnettrace --squash-map=static-ip-map.txt > static-ip-map | 13 | ./fnettrace --squash-map=static-ip-map.txt > static-ip-map |
14 | |||
15 | |||
16 | |||
diff --git a/src/fnettrace/static-ip-map.txt b/src/fnettrace/static-ip-map.txt index 92c55d148..2742e71c5 100644 --- a/src/fnettrace/static-ip-map.txt +++ b/src/fnettrace/static-ip-map.txt | |||
@@ -359,6 +359,7 @@ | |||
359 | 172.105.128.0/23 Linode | 359 | 172.105.128.0/23 Linode |
360 | 360 | ||
361 | # Akamai | 361 | # Akamai |
362 | 2.16.0.0/13 Akamai | ||
362 | 23.0.0.0/12 Akamai | 363 | 23.0.0.0/12 Akamai |
363 | 23.32.0.0/11 Akamai | 364 | 23.32.0.0/11 Akamai |
364 | 23.64.0.0/14 Akamai | 365 | 23.64.0.0/14 Akamai |
diff --git a/src/include/rundefs.h b/src/include/rundefs.h index 7fc0f21f3..d36851a4e 100644 --- a/src/include/rundefs.h +++ b/src/include/rundefs.h | |||
@@ -79,6 +79,8 @@ | |||
79 | #define PATH_SECCOMP_DEBUG_32 LIBDIR "/firejail/seccomp.debug32" // 32bit arch debug filter built during make | 79 | #define PATH_SECCOMP_DEBUG_32 LIBDIR "/firejail/seccomp.debug32" // 32bit arch debug filter built during make |
80 | #define PATH_SECCOMP_MDWX LIBDIR "/firejail/seccomp.mdwx" // filter for memory-deny-write-execute built during make | 80 | #define PATH_SECCOMP_MDWX LIBDIR "/firejail/seccomp.mdwx" // filter for memory-deny-write-execute built during make |
81 | #define PATH_SECCOMP_MDWX_32 LIBDIR "/firejail/seccomp.mdwx.32" | 81 | #define PATH_SECCOMP_MDWX_32 LIBDIR "/firejail/seccomp.mdwx.32" |
82 | #define PATH_SECCOMP_NAMESPACES LIBDIR "/firejail/seccomp.namespaces" // filter for restrict-namespaces | ||
83 | #define PATH_SECCOMP_NAMESPACES_32 LIBDIR "/firejail/seccomp.namespaces.32" | ||
82 | #define PATH_SECCOMP_BLOCK_SECONDARY LIBDIR "/firejail/seccomp.block_secondary" // secondary arch blocking filter built during make | 84 | #define PATH_SECCOMP_BLOCK_SECONDARY LIBDIR "/firejail/seccomp.block_secondary" // secondary arch blocking filter built during make |
83 | 85 | ||
84 | #define RUN_DEV_DIR RUN_MNT_DIR "/dev" | 86 | #define RUN_DEV_DIR RUN_MNT_DIR "/dev" |
diff --git a/src/man/Makefile b/src/man/Makefile index 197f76192..526ed7fcb 100644 --- a/src/man/Makefile +++ b/src/man/Makefile | |||
@@ -2,14 +2,25 @@ | |||
2 | ROOT = ../.. | 2 | ROOT = ../.. |
3 | -include $(ROOT)/config.mk | 3 | -include $(ROOT)/config.mk |
4 | 4 | ||
5 | MOD_DIR := $(ROOT)/src/man | ||
6 | MANPAGES_IN := $(sort $(wildcard $(MOD_DIR)/*.in)) | ||
7 | MANPAGES_GZ := $(MANPAGES_IN:.in=.gz) | ||
8 | TARGET = $(MANPAGES_GZ) | ||
9 | |||
5 | .PHONY: all | 10 | .PHONY: all |
6 | all: firecfg.man firejail.man firejail-login.man firejail-users.man firejail-profile.man firemon.man jailcheck.man | 11 | all: $(TARGET) |
7 | 12 | ||
8 | %.man: %.txt $(ROOT)/config.mk | 13 | # foo.1: foo.1.in |
9 | gawk -f ./preproc.awk -- $(MANFLAGS) < $< > $@ | 14 | $(MOD_DIR)/%: $(MOD_DIR)/%.in $(ROOT)/config.mk |
15 | @printf 'Generating %s from %s\n' $@ $< | ||
16 | @gawk -f $(MOD_DIR)/preproc.awk -- $(MANFLAGS) <$< | \ | ||
17 | $(MOD_DIR)/mkman.sh $(VERSION) >$@ | ||
10 | 18 | ||
11 | .PHONY: clean | 19 | # foo.1.gz: foo.1 |
12 | clean:; rm -fr *.man | 20 | $(MOD_DIR)/%.gz: $(MOD_DIR)/% |
21 | @printf 'Generating %s from %s\n' $@ $< | ||
22 | @rm -f $@ | ||
23 | @gzip -n9 $< | ||
13 | 24 | ||
14 | .PHONY: distclean | 25 | .PHONY: clean |
15 | distclean: clean | 26 | clean:; rm -f *.1 *.5 *.gz |
diff --git a/src/man/firecfg.txt b/src/man/firecfg.1.in index 42add6a41..42add6a41 100644 --- a/src/man/firecfg.txt +++ b/src/man/firecfg.1.in | |||
diff --git a/src/man/firejail-login.txt b/src/man/firejail-login.5.in index f03fc3c37..f03fc3c37 100644 --- a/src/man/firejail-login.txt +++ b/src/man/firejail-login.5.in | |||
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.5.in index fa294d888..fa294d888 100644 --- a/src/man/firejail-profile.txt +++ b/src/man/firejail-profile.5.in | |||
diff --git a/src/man/firejail-users.txt b/src/man/firejail-users.5.in index 7aa151680..7aa151680 100644 --- a/src/man/firejail-users.txt +++ b/src/man/firejail-users.5.in | |||
diff --git a/src/man/firejail.txt b/src/man/firejail.1.in index 19fc94ebd..19fc94ebd 100644 --- a/src/man/firejail.txt +++ b/src/man/firejail.1.in | |||
diff --git a/src/man/firemon.txt b/src/man/firemon.1.in index fb0cf1175..fb0cf1175 100644 --- a/src/man/firemon.txt +++ b/src/man/firemon.1.in | |||
diff --git a/src/man/jailcheck.txt b/src/man/jailcheck.1.in index e889ea91b..e889ea91b 100644 --- a/src/man/jailcheck.txt +++ b/src/man/jailcheck.1.in | |||
diff --git a/mkman.sh b/src/man/mkman.sh index 58a44ecda..0302e0778 100755 --- a/mkman.sh +++ b/src/man/mkman.sh | |||
@@ -5,8 +5,10 @@ | |||
5 | 5 | ||
6 | set -e | 6 | set -e |
7 | 7 | ||
8 | sed "s/VERSION/$1/g" "$2" > "$3" | ||
9 | MONTH="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b)" | 8 | MONTH="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b)" |
10 | sed -i "s/MONTH/$MONTH/g" "$3" | ||
11 | YEAR="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y)" | 9 | YEAR="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y)" |
12 | sed -i "s/YEAR/$YEAR/g" "$3" | 10 | |
11 | sed \ | ||
12 | -e "s/VERSION/$1/g" \ | ||
13 | -e "s/MONTH/$MONTH/g" \ | ||
14 | -e "s/YEAR/$YEAR/g" | ||