-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Enable external security scanners by adding the scanner-pull
permission to a robot account
#11574
Comments
scanner-pull
permission to a robot accountscanner-pull
permission to a robot account
exposing Can we support creating such robot account in API? |
@danielpacak we hit the same issue when using interrogation services with Aqua where the images are not being pulled due to the pre-condition failed on a new image push which was not even scanned. |
If only supporting this requirement in API, it will break the regular operations via management consoles. Meanwhile, the API way is not very friendly to platform operators. |
Or explicitly add an option for robot account when creation to let admin aware of the case that if they'd like to use this robot account into the scanner platform they need to check that option to let the account acquire the capabilities of bypassing VULN checking. |
If you want reasonable UI flow, you should allow users to create account for scanner, it should happen on the scanner registration page. |
@rvennam-lbg Yes, I'm aware of the current limitations in Harbor & Aqua. We're trying to find the best way to enhance the robot account generation to cater for such cases. Do you have any specific requirements / preferences whether such robot account should have project / registry scope that you might share with us? |
@danielpacak We have multiple projects on Harbor that integrates with an Aqua instance. So, registry scope would be simpler for our usecase, but we can live with Project level robot accounts as well if that is simpler to implement. |
Taking into account all the feedback that we get so far, I'd sum up the requirements for the external scanner credentials as follows:
@steven-zou @reasonerjt @michmike @xaleeks @zhill @honeybajaj @rvennam-lbg Taking into account the above listed requirement, one more possibility is to add a new view called External Scanners under the Interrogation Services to manage such credentials: I'm looking forward to seeing your comments. |
@danielpacak This seems to me like the time to consider a 'Service Account' type that is a like a robot account but with explicitly managed credentials. Similar to what you propose, but not tied to scanning, that would just be a specific use-case. I think 'Interrogation Services' is a reasonable place to put it, but would call the section 'Service Accounts' instead of 'External Scanners', that gives flexibility as more interrogations become available. It would give a place to add more per-credential config like project vs registry scope, check bypasses, etc later on. |
thanks for the summary everyone. this is a good feature to have. Essentially we are:
|
Hey @michmike what about access to registry catalog? Would it be possible for such service account to list all repositories / tags in the registry? |
@danielpacak makes sense to include that. @xaleeks what do you think? |
Yep we can do that, this is still leveraging our current robot account in the background, so we can add those scopes to the jwt |
To keep everyone posted we met with @xaleeks and @steven-zou and our conclusion was as follows: "...There seems to be little utility in building global robot accounts scoped to all projects (would have been all or nothing right now) with a special set of permissions just for a specific class of scanners including aqua CSP, without a clear picture of how to extend that work to the final goal of being able to dynamically add / remove robot accounts out of projects. So that robots can behave like true service accounts with rbac, and with more differentiated access levels. So we are abandoning this temp solution for 2.1 and aiming to deliver this in full in v2.2..." Long story short we identified too many corner cases and too many opened questions to deliver such functionality without considering upcoming enhancement to Harbor authorization model and granular access controls to guard system functionality and settings |
This will be covered in this proposal goharbor/community#148 @danielpacak let me know if you see any issues |
We can close it as the system level robot is introduced in v2.2, just try with https://github.com/goharbor/harbor/releases/tag/v2.2.0-rc1. |
Problem statement
When a Harbor project is set as private and there's deployment security enabled some security tools, such as external vulnerability scanners, cannot pull images from the Harbor registry.
Only internal vulnerability scanners can bypass deployment security checks with a temporary robot account created by Harbor, which has the
scanner-pull
permission.For example, Aqua CSP, allows you to add Harbor registry integration where you're supposed to enter user or robot account credentials:
However, these credentials do not have enough permissions (i.e.
scanner-pull
) to pull the images for security assessment when the deployment security flag is on, hence the scans fail:In general, the problem described above, boils down to distinguish a docker pull requests, which are subject to deployment security, from docker pull requests initiated by trusted 3rd parties (e.g. external security scanners) that are supposed to bypass the security checker.
For more detailed explanation of 412 status code returned by Harbor consult https://github.com/danielpacak/danielpacak.io/blob/master/harbor/registry_authentication.adoc
Possible solution
One solution to the problem might be to add a
scanner-pull
permission to a robot account. This would allow creating dedicated robot accounts for integrating with external security scanners.We should be able to add robot accounts with the
scanner-pull
permission via Harbor API as well.Ideally we could also specify the expiry date for such credentials.
Architecture
There's no change in overall architecture of Harbor and its authorization service. We need to modify the logic of the token service to cater for the
scanner-pull
permission.Development plan
I think this problem impacts Harbor 1.10.x deployments and upcoming 2.x releases. We'd like to address the limitation ASAP. We're available to implement the change in code and test the functionality.
/cc @lizrice @jerbia @xaleeks @michmike
The text was updated successfully, but these errors were encountered: