Skip to content

Secure initial Roller setup with one-time operator token - #189

Open
snoopdave wants to merge 7 commits into
apache:masterfrom
snoopdave:secure-initial-setup-token
Open

snoopdave wants to merge 7 commits into
apache:masterfrom
snoopdave:secure-initial-setup-token

Conversation

@snoopdave

@snoopdave snoopdave commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Require a cryptographically secure, one-time operator token before Roller initial setup, database installation actions, and first-user registration.
  • Bind redemption to a browser session, expire it after 60 minutes, and prevent token exposure through URLs or rendered responses.
  • Permanently close bootstrap access after the first administrator is committed, including after account deletion or disablement.
  • Gate SSO auto-provisioning during bootstrap and document the operator workflow.
  • On upgrade, the database upgrade screen is not shown unless there is an actual database upgrade to be done.

Validation

  • mvn -pl app -DskipTests compile
  • Focused BootstrapSecurityTest and InstallTest
  • git diff --check

New log messages

Here's what the new seucurity code looks like in roller.log:

Screenshot 2026-09-13 at 3 24 05 PM

New security code page

And here's the new securoty code page:

Screenshot 2026-09-13 at 3 24 31 PM

Release consideration

If we do an RC4, we should consider including this PR in that release candidate.

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR-Review: 1 inline blocking comment posted.

|| uri.endsWith("/bootstrap-token!redeem.rol"));
boolean installer = uri != null && (tokenPage || uri.contains("/roller-ui/install/")
|| uri.endsWith("/roller-ui/register.rol")
|| uri.endsWith("/roller-ui/register!save.rol")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐞Codex Issue: Blocking: The gate only matches /register.rol and /register!save.rol, but Struts dynamic method invocation also exposes URLs such as /register!execute.rol and /register!activate.rol. Those direct routes can reach the initial registration flow without the token. Gate the resolved register action/method (or reject all register methods while bootstrap is incomplete) and add regression coverage for every allowed method.

@snoopdave

Copy link
Copy Markdown
Contributor Author

PR-Review: General Issues

The following issue needs action but is not tied to one changed line:

  • 🐞Codex Issue: Important: The new bootstrap security logic has only a completion-state unit test. Add focused tests for successful and replayed redemption, expiry, session binding, invalid methods, concurrent redemption, restart behavior, and direct Struts route variants before merging.

@snoopdave

Copy link
Copy Markdown
Contributor Author

Need to test this on the 5.2 -> 6.1.6 upgrade, that is the last actual DB schema change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant