[HDX-1874] Enable MongoStore Compatibility Mode to Reduce MongoDB Permission Requirements
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 471
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 117
Description
HyperDX currently requires DDL permissions on MongoDB because connect-mongo automatically creates indexes on the sessions collection during startup. This creates an unnecessary security barrier for users running with minimal database permissions.
Solution
Enable MongoStore's compatibility mode to allow operation with read/write permissions only.
Benefits
- Allows HyperDX to run without DDL permissions
- Follows principle of least privilege
- Reduces deployment friction
- Backward compatible - no adverse effects expected
I don't think we need an environment variable for this since compatibility mode should work for all users. This issue has come up sporadically in edge cases where database permissions are tightly controlled.
We should test that this indeed allows for minimal db permissions.
Context: https://discord.com/channels/1149498480893640706/1149500035403350036/1382988702716002366
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the session-store initialization that uses connect-mongo and review how MongoStore options are configured. Enable compatibility mode there, then add or run a test using MongoDB permissions limited to reads and writes. Done means HyperDX starts and stores sessions without requiring DDL permissions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100