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

Allow Robot Accounts to Manage Robots with Full Permissions #21251

Open
melak-cmd opened this issue Nov 26, 2024 · 4 comments
Open

Allow Robot Accounts to Manage Robots with Full Permissions #21251

melak-cmd opened this issue Nov 26, 2024 · 4 comments
Labels

Comments

@melak-cmd
Copy link

melak-cmd commented Nov 26, 2024

Expected behavior and actual behavior:

When you have a Robot account system with the following permissions:

Project [Create, List]
Robot Account [Create, Delete, List, Read]

And you check the "Cover all projects" option, along with selecting the Repository [Pull] action, the expected behavior is that the Robot account should be able to perform all the specified actions across all projects.

However, the actual behavior you are observing is that the Robot account is not able to perform the selected actions as expected :

{"errors":[{"code":"DENIED","message":"permission scope is invalid. It must be equal to or more restrictive than the creator robot's permissions: robot$crossplane"}]}

Steps to reproduce the problem:

curl -k -X 'POST' 'https:///api/v2.0/robots' -u 'robot$crossplane:' -H 'Content-Type: application/json' -d '{"name": "puller","description": "puller","level": "system","duration": -1,"permissions": [{"kind": "project","namespace": "dev","access":[{"resource": "repository","action": "pull"}]}]}'

Versions:
Please specify the versions of the following systems:

  • Harbor version: v2.12.0-9da38ae0

Additional context:

@melak-cmd melak-cmd reopened this Nov 28, 2024
@stonezdj
Copy link
Contributor

stonezdj commented Dec 2, 2024

For security consideration, the created robot account's permission should never exceed the creator robot account. as you can see in the error log: permission scope is invalid. It must be equal to or more restrictive than the creator robot's permissions: robot$crossplane
Robot account A has no permission of pull repository, so it can not create a robot account with pull repository permission

@melak-cmd
Copy link
Author

For security consideration, the created robot account's permission should never exceed the creator robot account. as you can see in the error log: permission scope is invalid. It must be equal to or more restrictive than the creator robot's permissions: robot$crossplane Robot account A has no permission of pull repository, so it can not create a robot account with pull repository permission

Okay, but if you select only project-by-project, this will work fine.

@reasonerjt
Copy link
Contributor

Closing the issue b/c it's working as designed.

@flbla
Copy link
Contributor

flbla commented Dec 2, 2024

Hi,
I disagree, the Robot A has the permission to pull on any repositories of any projects, it's configure with "Cover all projects".
As Robot A can pull any repositories of any projects
Robot B should be able to pull only a specific project.
Pull on a single project is "equal to or more restrictive than the creator robot" which can pull on ANY projects

@flbla flbla reopened this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants