mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
firstboot: Prompt for secret during firstboot welcome
- A freshly installed FreedomBox can be hijacked by a third party and an admin account can be created which can be used to inject malware or simply take over the instance. Password protecting the firstboot step is a good way to avoid this. A secret will be displayed to the user as soon as the Plinth package is installed, which they have to enter during firstboot welcome step. Also, writing this to a file in plinth's home in case the user loses it. - This protection is not applicable for images built by freedom-maker and for Amazon Machine Images. Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
d846987e8c
commit
ba9af6ddff
9 files changed
+113
-25
No files matched your search
Vendored
+1
@@ -51,6 +51,7 @@ Depends: ${python3:Depends}
|
||||
, ${misc:Depends}
|
||||
, ${plinth:Depends}
|
||||
, adduser
|
||||
, debconf
|
||||
, augeas-tools
|
||||
, e2fsprogs
|
||||
, fonts-lato
|
||||
|
||||
Vendored
+17
-5
@@ -2,6 +2,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Source debconf library.
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
daemonuser=plinth
|
||||
daemongroup=plinth
|
||||
|
||||
@@ -12,11 +15,20 @@ daemongroup=plinth
|
||||
sed -ie 's+-:ALL EXCEPT root fbx (admin) (sudo):ALL+-:ALL EXCEPT root fbx plinth (admin) (sudo):ALL+' /etc/security/access.conf
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
addgroup --system --quiet plinth
|
||||
adduser --system --quiet --ingroup plinth --no-create-home --home /var/lib/plinth plinth
|
||||
chown -R plinth: /var/lib/plinth /var/log/plinth
|
||||
;;
|
||||
configure)
|
||||
addgroup --system --quiet plinth
|
||||
adduser --system --quiet --ingroup plinth --no-create-home --home /var/lib/plinth plinth
|
||||
chown -R plinth: /var/lib/plinth /var/log/plinth
|
||||
|
||||
if [ ! -e '/var/lib/freedombox/is-freedombox-disk-image' ]; then
|
||||
umask 377
|
||||
cat /dev/urandom | base64 | head -c16 > /var/lib/plinth/firstboot-wizard-secret
|
||||
chown plinth:plinth /var/lib/plinth/firstboot-wizard-secret
|
||||
db_subst plinth/firstboot_wizard_secret secret $(cat /var/lib/plinth/firstboot-wizard-secret)
|
||||
db_input high plinth/firstboot_wizard_secret || true
|
||||
db_go
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
Template: plinth/firstboot_wizard_secret
|
||||
Type: note
|
||||
Description: FreedomBox first wizard secret - ${secret}
|
||||
Please save this string. You will be asked to enter this in the first screen
|
||||
after you launch the FreedomBox interface. In case you lose it, you can find
|
||||
it in the file /var/lib/plinth/firstboot-wizard-secret.
|
||||
.
|
||||
${secret}
|
||||
Reference in new issue
Block a user