-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about Role-Permissions: How to restrict a user with snapshot permission to one Instance? #31
Comments
When I look at the role I created, the resources section is empty. So it is validated when creating the role (the id has to be a TAG id), but afterwards it is somehow dropped.
And then I tried to update the user to have both roles, but then I get an error message, that a user can have only 1 Role, which is in contradiction to the statements in the API description:
So, I think, I am doing something fundamentally wrong... |
Another try to combine both permissions in one role:
now I see only one instance with |
Hello, sorry for the late response. We fixed the issue, that snapshots of an instances where not guarded by the Tag on that instance. What you did with creating the Tag, then assigning it to the instance and adding it to a role in the resourcePermissions was correct. Currently we only allow one role per user, we hope that most of the use cases can be covered by adding specific api endpoints and tags to a role. We where planning on allowing multiple roles per user in the future, so the API as well as the cli tool already expect an array of roles. |
thanks for the fix. Here is the user config:
Logging in with this user:
Getting snapshots for an instance, which is not tagged with SNAPINST:
That is better than before. But rolling back the same instance to an old snapshot is not forbidden:
Also creating a new snapshot for the instance is possible:
But deleting the newly created snapshot is forbidden:
Another function, which I use is to restart the instance (not snapshot related) is also possible for all instances:
So, it is getting better, but still something to do ;-) |
Hello, |
Hi @ngotzmann , we are getting closer... :-) All snapshot related commands are now restricted as expected.
|
Hi, the issue is fixed now in the new version: v1.4.9 |
How to configure roles is not well documented, especially how apiPermissions and resourcePermissions work together.
I want to create a user, who is allowed to create and restore snapshots only for one special instance and not for any other instance.
I have three VPS instances 100123456, 100123457 and 100123458.
The "snapshotmanager" user should be allowed to create snapshots for instance 100123456, but not for the other instances.
What I did:
Now I tried if the user is really restricted to the instance tagged with SNAPINST:
That is as expected. The role only grants access to the snapshots api and not to the get instance endpoint.
That is as expected.
Now I try to get the snapshots for another instance (which is not tagged with "SNAPINST"):
That is not, what I wanted. The user should not have access to this instance.
I tried it another way, to hard-code the instance id in the path, when defining the role, but that is not accepted:
So, my question is:
How do I configure a user to get access to snapshots only for one instance?
The text was updated successfully, but these errors were encountered: