Skip to content
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

Problem with endpoint_info permission on Back-End side #2677

Closed
ct-anaalbic opened this issue Aug 9, 2019 · 6 comments
Closed

Problem with endpoint_info permission on Back-End side #2677

ct-anaalbic opened this issue Aug 9, 2019 · 6 comments
Assignees
Labels
Bug This is a bug or an unexpected behaviour. Fix it!

Comments

@ct-anaalbic
Copy link
Contributor

Describe the bug
On GUI side, if user which not have endpoint_info permission try to find endpoint without account permission, it will not work. Also if the same user try to edit or delete endpoint in every case it won't be possible. But in tests, scenario like this is passed.

To Reproduce
Steps to reproduce the behavior:

  1. Login as kapua-sys or any other user that has proper permissions
  2. Create user user1
  3. Create role role1
  4. Create endpoint endpoint1
  5. Create permission with domain endpoint_info, and add permission to the role role1
  6. Add role1 to the user user1
  7. Logout
  8. Login as user user1
  9. Try to find, edit or delete endpoint endpoint1

Expected behavior
This scenario can not be reproduced on GUI side (if user has account permission he can see endopoint in settings tab, but can't add or delete endpoint). In Cucumber test scenarios, this is possible.

Screenshots
Screenshot1 (GUI - User has account and endpoint permissions and he can see endpoint - deployment info, but can't add new one, or delete and edit existing endpoint)
image

Screenshot2 (Cucumber Test Scenario - find, edit and delete endpoint steps passed when user has only endpoint_info permission)
image

Version of Kapua
develop Kapua

Type of deployment
[ ] Local Vagrant deployment
[ ] Docker
[ ] Openshift (in its variants)
[ ] Others

Main component affected
[ ] Console (in case of console please report info on which browser you encountered the problem)
[ ] REST API
[ ] Message Broker
[ ] - Others

Additional context
I am not sure but is this really a issue?

@ct-anaalbic ct-anaalbic changed the title Problem with endpoint_info permission on back end side Problem with endpoint_info permission on Back-End side Aug 9, 2019
@Coduz Coduz self-assigned this Aug 28, 2019
@Coduz
Copy link
Contributor

Coduz commented Aug 30, 2019

Hi @ct-anaalbic ,

Uhmmm it seems like a corner case. All you said is true.
But this is due to the fact that the Settings view is reserved to user with account:view permission.

A strange thing is that the user1 is able to edit and delete since permission required to perform those actions are:
update: AUTHORIZATION_SERVICE.checkPermission(PERMISSION_FACTORY.newPermission(EndpointInfoDomains.ENDPOINT_INFO_DOMAIN, Actions.write, null));

delete:
AUTHORIZATION_SERVICE.checkPermission(PERMISSION_FACTORY.newPermission(EndpointInfoDomains.ENDPOINT_INFO_DOMAIN, Actions.delete, null));

So both require admin access or at least a permission like endpoint_info:*:*

I can see that the permission on the test are created with the scopeId but not the targetScopeId.
This likely means that permission assigned to that role are:
endpoint_info:read:*
endpoint_info:write:*
endpoint_info:delete:*

Could you please check?

Regards,

Alberto

@ct-anaalbic
Copy link
Contributor Author

Hi @Coduz,

Yes, I will check this.

Regards,
Ana

@ct-anaalbic
Copy link
Contributor Author

ct-anaalbic commented Sep 3, 2019

Hi @Coduz,

I checked this. If role permissions are created with scopeId, than permissions which are assigned to role are:
endpoint_info:read:*
endpoint_info:write:*
endpoint_info:delete:*

But can the user modify or add endpoints in any case? On GUI user is not able to work completely with endpoints. User only can see endpoints if has permissions with endpoint_info and account domain, but adding or deleting endpoints is disabled in every case. In test scenario all actions with endpoints have passed only with endpoint_info permission (adding endpoint, deleting endpoint and so on).

Regards,

Ana

@ct-anaalbic
Copy link
Contributor Author

I just tried to delete or edit endpoint with user which has endpoint_info permissions created with targetScopeId. On this way, only searching for endpoints are enabled. Other actions, like editing or adding endpoints are not allowed. Maybe this is the solution?

Regards,

Ana

@Coduz
Copy link
Contributor

Coduz commented Sep 13, 2019

Hi @ct-anaalbic ,

Sorry for the long awaiting.

The endpoint can be only edited by kapua-sys. This is because the host name usually must match a DNS record or a specific IP of the deployment.
So this is something that a regular user should not be able to manage.

Instead this info must be available to all user since they are meant to be of public domain to know which is the broke URL for example.

Regards,

Alberto

@Coduz Coduz added the Bug This is a bug or an unexpected behaviour. Fix it! label Oct 1, 2019
@ct-anaalbic
Copy link
Contributor Author

I closed this because issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug or an unexpected behaviour. Fix it!
Projects
None yet
Development

No branches or pull requests

2 participants