aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2022-04-19 08:09:51 -0400
committerLibravatar netblue30 <netblue30@protonmail.com>2022-04-19 08:09:51 -0400
commit37032636d46d3c592cbec1ae0a5781dfa4176d2a (patch)
tree494a040f58ffeedaf2e589aae4df17b4c7a02f53 /contrib
parentbuild(deps): bump actions/checkout from 3.0.0 to 3.0.1 (diff)
downloadfirejail-37032636d46d3c592cbec1ae0a5781dfa4176d2a.tar.gz
firejail-37032636d46d3c592cbec1ae0a5781dfa4176d2a.tar.zst
firejail-37032636d46d3c592cbec1ae0a5781dfa4176d2a.zip
resurecting welcome.sh
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/firejail-welcome.sh128
1 files changed, 0 insertions, 128 deletions
diff --git a/contrib/firejail-welcome.sh b/contrib/firejail-welcome.sh
deleted file mode 100755
index c9b6c450b..000000000
--- a/contrib/firejail-welcome.sh
+++ /dev/null
@@ -1,128 +0,0 @@
1#!/bin/bash
2
3# This file is part of Firejail project
4# Copyright (C) 2020-2022 Firejail Authors
5# License GPL v2
6
7if ! command -v zenity >/dev/null; then
8 echo "Please install zenity."
9 exit 1
10fi
11if ! command -v sudo >/dev/null; then
12 echo "Please install sudo."
13 exit 1
14fi
15
16export LANG=en_US.UTF8
17
18zenity --title=firejail-welcome.sh --text-info --width=750 --height=500 <<EOM
19Welcome to firejail!
20
21This is a quick setup guide for newbies.
22
23Profiles for programs can be found in /etc/firejail. Own customizations should go in a file named
24<profile-name>.local in ~/.config/firejal.
25
26Firejail's own configuration can be found at /etc/firejail/firejail.config.
27
28Please note that running this script a second time can set new options, but does not unset options
29set in a previous run.
30
31Website: https://firejail.wordpress.com
32Bug-Tracker: https://github.com/netblue30/firejail/issues
33Documentation:
34- https://github.com/netblue30/firejail/wiki
35- https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions
36- https://firejail.wordpress.com/documentation-2
37- man:firejail(1) and man:firejail-profile(5)
38
39PS: If you have any improvements for this script, open an issue or pull request.
40EOM
41[[ $? -eq 1 ]] && exit 0
42
43sed_scripts=()
44
45read -r -d $'\0' MSG_Q_BROWSER_DISABLE_U2F <<EOM
46<big><b>Should browsers be allowed to access u2f hardware?</b></big>
47EOM
48
49read -r -d $'\0' MSG_Q_BROWSER_ALLOW_DRM <<EOM
50<big><b>Should browsers be able to play DRM content?</b></big>
51
52\$HOME is noexec,nodev,nosuid by default for the most sandboxes. This means that executing programs which are located in \$HOME,
53is forbidden, the setuid attribute on files is ignored and device files inside \$HOME don't work. Browsers install proprietary
54DRM plug-ins such as Widevine under \$HOME by default. In order to use them, \$HOME must be mounted exec inside the sandbox to
55allow their execution. Clearly, this may help an attacker to start malicious code.
56
57NOTE: Other software written in an interpreter language such as bash, python or java can always be started from \$HOME.
58
59HINT: If <tt>/home</tt> has its own partition, you can mount it <tt>nodev,nosuid</tt> for all programs.
60EOM
61
62read -r -d $'\0' MSG_L_ADVANCED_OPTIONS <<EOM
63You maybe want to set some of these advanced options.
64EOM
65
66read -r -d $'\0' MSG_Q_RUN_FIRECFG <<EOM
67<big><b>Should most programs be started in firejail by default?</b></big>
68EOM
69
70read -r -d $'\0' MSG_I_ROOT_REQUIRED <<EOM
71In order to apply these changes, root privileges are required.
72You will now be asked to enter your password.
73EOM
74
75read -r -d $'\0' MSG_I_FINISH <<EOM
76🥳
77EOM
78
79if zenity --title=firejail-welcome.sh --question --ellipsize --text="$MSG_Q_BROWSER_DISABLE_U2F"; then
80 sed_scripts+=("-e s/# browser-disable-u2f yes/browser-disable-u2f no/")
81fi
82
83if zenity --title=firejail-welcome.sh --question --ellipsize --text="$MSG_Q_BROWSER_ALLOW_DRM"; then
84 sed_scripts+=("-e s/# browser-allow-drm no/browser-allow-drm yes/")
85fi
86
87advanced_options=$(zenity --title=firejail-welcome.sh --list --width=800 --height=200 \
88 --text="$MSG_L_ADVANCED_OPTIONS" --multiple --checklist --separator=" " \
89 --column="" --column=Option --column=Description <<EOM
90
91force-nonewprivs
92Always set nonewprivs, this is a strong mitigation against exploits in firejail. However some programs like chromium or wireshark maybe don't work anymore.
93
94restricted-network
95Restrict all network related commands except 'net none' to root only.
96
97seccomp-error-action=kill
98Kill programs which violate seccomp rules (default: return a error).
99EOM
100)
101
102if [[ $advanced_options == *force-nonewprivs* ]]; then
103 sed_scripts+=("-e s/# force-nonewprivs no/force-nonewprivs yes/")
104fi
105if [[ $advanced_options == *restricted-network* ]]; then
106 sed_scripts+=("-e s/# restricted-network no/restricted-network yes/")
107fi
108if [[ $advanced_options == *seccomp-error-action=kill* ]]; then
109 sed_scripts+=("-e s/# seccomp-error-action EPERM/seccomp-error-action kill/")
110fi
111
112if zenity --title=firejail-welcome.sh --question --ellipsize --text="$MSG_Q_RUN_FIRECFG"; then
113 run_firecfg=true
114fi
115
116zenity --title=firejail-welcome.sh --info --ellipsize --text="$MSG_I_ROOT_REQUIRED"
117
118passwd=$(zenity --title=firejail-welcome.sh --password --cancel-label=OK)
119if [[ -n "${sed_scripts[*]}" ]]; then
120 sudo -S -p "" -- sed -i "${sed_scripts[@]}" /etc/firejail/firejail.config <<<"$passwd" || { zenity --title=firejail-welcome.sh --error; exit 1; };
121fi
122if [[ "$run_firecfg" == "true" ]]; then
123 sudo -S -p "" -- firecfg <<<"$passwd" || { zenity --title=firejail-welcome.sh --error; exit 1; };
124fi
125sudo -k
126unset passwd
127
128zenity --title=firejail-welcome.sh --info --icon-name=security-medium-symbolic --text="$MSG_I_FINISH"