Skip to content

Conversation

@meghansh-pf9
Copy link
Contributor

@meghansh-pf9 meghansh-pf9 commented Dec 12, 2025

What this PR does / why we need it

This PR introduces an explicit 18-hour inactivity-based session expiration mechanism for the UI that uses Basic Authentication. Previously, Basic Auth sessions could persist indefinitely or be governed by less explicit browser/OS behavior. To enhance security and resource management, a Lua script has been integrated into the Nginx configuration. This script explicitly tracks user activity and invalidates the session credential after 18 hours of continuous inactivity, forcing the user to re-authenticate and thereby ensuring that access is revoked for dormant sessions.

fixes #1263

Testing done

Screen.Recording.2025-12-12.at.2.25.25.PM.mov

please add testing details (logs, screenshots, etc.)

Summary by Bito

  • Implements an 18-hour inactivity-based session expiration mechanism for the UI, enhancing security by ensuring that sessions are invalidated after a period of inactivity.
  • Replaces the existing Nginx setup with OpenResty, allowing for Lua scripting to track user activity.
  • Updates to the Dockerfile, Nginx configuration, and the startup script to support the new session management functionality.
  • Overall, the changes enhance security through session management improvements and involve updates to configurations in the Dockerfile and Nginx setup.

@meghansh-pf9 meghansh-pf9 force-pushed the private/main/megh/logout-nginx branch from 58196b4 to e4ab81e Compare December 12, 2025 10:12
Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

Other comments (2)
  • ui/default.conf (33-33) You're using `ngx.ERR` log level for informational messages like "Session Stable Renewing the session". Consider using `ngx.INFO` or `ngx.DEBUG` for these non-error messages to keep your error logs clean.
  • ui/default.conf (64-64) Similarly, use `ngx.INFO` or `ngx.DEBUG` instead of `ngx.ERR` for the login success message.

💡 To request another review, post a new comment with "/windsurf-review".

ui/default.conf Outdated
Comment on lines 34 to 35
ngx.header["Set-Cookie"] = "auth_session=" .. now
.. "; Path=/; HttpOnly; Secure; SameSite=Lax"
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using SameSite=Strict instead of SameSite=Lax for the auth_session cookie. The Strict setting provides better protection against CSRF attacks by preventing the cookie from being sent in cross-site requests, which is appropriate for authentication cookies.

@meghansh-pf9 meghansh-pf9 force-pushed the private/main/megh/logout-nginx branch from e4ab81e to bccbc46 Compare December 12, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement 18-Hour Inactivity Session Timeout for UI session

2 participants