Repository navigation
[Feature]: Read-only / viewer role that's actually enforced (Policy authorization checks are currently stubbed to always-allow) #11070
ahliweb
started this conversation in
Feature Requests
Replies: 2 comments
🔗 Related PRs#6884 - fix: critical privilege escalation in team invitation system [merged] 📝 Issue PlannerCheck the box below or use the
🧪 Issue enrichment is currently in open beta.You can configure auto-planning by selecting labels in the issue_enrichment configuration. To disable automatic issue enrichment, add the following to your issue_enrichment:
auto_enrich:
enabled: false💬 Have feedback or questions? Drop into our discord! |
0 replies
|
Afaik this is already prepared for Coolify v4.2.0 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Request Type
New Feature
Description
Problem
We'd like to expose the Coolify dashboard on a public domain (behind our own reverse-proxy auth
layer) so a couple of people can check deployment/server status without needing an SSH tunnel every
time. Coolify already has a
rolecolumn onteam_user(owner/admin/member), which lookslike exactly the right primitive for this — give a viewer the
memberrole and expect them to berestricted to read-only.
In testing this, we found that role isn't actually enforced anywhere right now. Every Policy class
we checked has its real authorization logic commented out under an explicit
// Authorization temporarily disabledmarker, with the method unconditionallyreturn truebelow it — e.g.:
app/Policies/ApplicationPolicy.php—update(),delete(),manageEnvironment(),manageDeployments(),deploy()all commented-outisAdmin()checks, allreturn trueapp/Policies/ServerPolicy.php— same pattern onupdate()/delete()app/Policies/DatabasePolicy.php— same pattern onupdate()/delete()app/Policies/ServicePolicy.php— same pattern onupdate()/delete()app/Policies/EnvironmentVariablePolicy.php—update()/delete()justreturn true, nocommented-out check at all
So today, any team member — regardless of
role— has full write/delete access to every resource,including secrets (
EnvironmentVariablePolicy) and the server itself (ServerPolicy). Invitingsomeone as
membercurrently provides zero actual restriction.Separately (not a blocker for this request, just context for why a network-level workaround isn't
a good substitute): the UI funnels essentially every interaction — including ones that are purely
informational, like loading logs/metrics/tabs — through one shared
POST /livewire/updateendpoint, dispatched dynamically to whatever Livewire action the click maps to. That means there's
no way to approximate "read-only" by blocking a class of HTTP requests at a reverse proxy either;
doing so breaks nearly all interactivity, not just mutations.
Proposed solution
Re-enable the existing (currently commented-out)
isAdmin()/role checks in the Policy classes sothe
memberrole inteam_useractually restricts write access to view-only, matching what theUI/DB schema already imply. Concretely, for a
member:view*/viewAny— keep allowing (this is the whole point of a viewer role)update/delete/deploy/manageDeployments/manageEnvironment/forceDelete— restrict toisAdmin()(orowner/admin), as the commented-out code already suggests was the originalintent
ServerPolicy,DatabasePolicy,ServicePolicy,EnvironmentVariablePolicy, and any other Policy following this patternThis would let teams safely expose read access (dashboard status, logs, metrics) to more people —
auditors, other engineers, on-call viewers — without giving them the ability to redeploy, delete,
or read/rotate secrets, using infrastructure Coolify already has (the
rolecolumn, theisAdmin()helper, the Policy classes themselves) rather than requiring new plumbing.Happy to help test this against a real multi-app Coolify instance if useful — we found this while
trying to safely expose our dashboard.
All reactions