r/PostgreSQL • u/lostinspaz • 2d ago
Tools Beta test of user account admin tool
This may be completely niche, so probably not of interest to EVERYONE... but I wish a tool like this existed for me. It didn't, as far as I could tell... so I wrote it :-)
In case there are any others who might benefit from it, I thought I'd share it as open source.
https://github.com/ppbrown/postgres-user-control
It's available both as a standalone app, or a container (build yourself, or use my helm chart to pull my image)
The problem:
While standard application creds are somewhat fixed and static, we had a situation where a semi-large group of people (20+) required different levels of access to different postgres instances.
Furthermore, we had a need to sometimes grant temporary access to certain people, at certain times. And then revoke it.
All while ensuring that these access changes got logged, and user actions get logged too.
Plus at the same time, I wanted to migrate humans over to using some kind of SSO type login to the database, rather than manually fed passwords.
---
In theory, I might have chosen some ansible or terraform approach, but thats not very readable at a glance. This is.
I welcome people's constructive comments. Even, "you could have just used [this other tool] instead"
2
u/AutoModerator 2d ago
AI Policy:
Linux is not one of those anti-AI projects, and if somebody has issues with that, they can do the open-source thing and fork it. Or just walk away., Linus Torvalds.
Mod decisions will be based on the quality of the content, not who or what generated it.
Sub Resources:
Youtube Channel
Free Postgres Webinars and Workshops
Discord: People, Postgres, Data
Join us, we have cookies and nice people.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Discordbothost 1d ago
I'd test expiry for someone who already has permanent access to the same role. After the temporary grant ends, check that the cleanup leaves their permanent access intact.
0
u/MongooseWonderful198 2d ago
The failure case I’d test first is temporary access across downtime. Grant a role for 15 minutes, stop this service before expiry, wait, then restart it. PostgreSQL’s password
VALID UNTILdoes not expire role membership, so the tool needs an authoritative expiry record and a startup reconciliation that revokes overdue grants.I’d also make the audit show both the requested expiry and the actual revoke time. That distinguishes “the grant was configured correctly” from “the scheduler was alive when it needed to act,” which is the part operators will care about during an incident.