Do not create the default admin account with a known password #10

Closed
opened 2026-10-12 14:29:33 +02:00 by pepa · 0 comments
Owner

Part of preparing the app for hosting many customers as one container per customer.

Problem

On first start create_admin (src/backend/user.rs) creates the user admin with the password admin whenever no admin exists. Every new customer instance is therefore reachable from the internet with known credentials until somebody changes the password.

Suggested fix

One of:

  • take the initial admin password (or its hash) from the configuration or an environment variable and refuse to start without it when no admin exists, or
  • generate a random password on first start and write it to the log once, or
  • keep a default but force a password change on first login.

The first option fits automated provisioning best.

Done when

  • A fresh instance cannot be logged into with admin / admin.
  • README describes how the first admin account is set up.
Part of preparing the app for hosting many customers as one container per customer. ## Problem On first start `create_admin` (`src/backend/user.rs`) creates the user `admin` with the password `admin` whenever no admin exists. Every new customer instance is therefore reachable from the internet with known credentials until somebody changes the password. ## Suggested fix One of: - take the initial admin password (or its hash) from the configuration or an environment variable and refuse to start without it when no admin exists, or - generate a random password on first start and write it to the log once, or - keep a default but force a password change on first login. The first option fits automated provisioning best. ## Done when - A fresh instance cannot be logged into with `admin` / `admin`. - README describes how the first admin account is set up.
pepa closed this issue 2026-10-12 15:43:38 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ITsolved/rezervovator#10