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

Harbor integration fails when deployment security is enabled #37

Closed
lbg-raghu-vennam opened this issue Apr 11, 2020 · 9 comments · Fixed by #50
Closed

Harbor integration fails when deployment security is enabled #37

lbg-raghu-vennam opened this issue Apr 11, 2020 · 9 comments · Fixed by #50
Assignees
Labels
enhancement New feature or request

Comments

@lbg-raghu-vennam
Copy link

This is linked to the issue opened at goharbor/harbor#11574 where we are seeing the same behaviour with interrogation services configured with Aqua are also failing to pull the images to scan.

Is there any specific configuration to be used to the deployment to be still able to pull the images for scanning?

@danielpacak
Copy link
Contributor

danielpacak commented Apr 14, 2020

This is linked to the issue opened at goharbor/harbor#11574 where we are seeing the same behaviour with interrogation services configured with Aqua are also failing to pull the images to scan.

Is there any specific configuration to be used to the deployment to be still able to pull the images for scanning?

Hi @rvennam-lbg . Thank you for filing the issue. As you pointed out this is related to robot account permissions and the scannercli binary ignoring the robot account credentials.

I'm working also with the product team at Aqua to pass the robot account credentials from authorization property of a scan request down to the Aqua CSP scanner.

scannercli \
  ... \
  --registry-username=$ROBOT_ACCOUNT_NAME
  --registry-password=$ROBOT_ACCOUNT_PASSWORD

As of today, the only solution to that is, unfortunately, disabling deployment security in Harbor.

@danielpacak danielpacak self-assigned this Apr 14, 2020
@danielpacak danielpacak added the enhancement New feature or request label Apr 14, 2020
@honeybajaj
Copy link

Thanks @danielpacak, can you kindly suggest if any help is required to expedite implementation, as we have a key requirement on this feature within our container workflow.

@danielpacak
Copy link
Contributor

danielpacak commented Apr 15, 2020

Thanks @danielpacak, can you kindly suggest if any help is required to expedite implementation, as we have a key requirement on this feature within our container workflow.

@honeybajaj There're two parts of it:

  1. Allow scannercli to accept robot account credentials generated by Harbor - we're going to work on that very soon and delivery ASAP
  2. Contribute to Harbor spec described in Enable external security scanners by adding the scanner-pull permission to a robot account goharbor/harbor#11574 and find the best UI / API experience to generate robot account with extended scope for such integration as external vulnerability scanners. Any feedback from the ops / end users stand point would be invaluable to ship it faster

@honeybajaj
Copy link

@danielpacak One more feature request or it might automatically get enabled is integration with acknowledge feature on Aqua. So, if an admin or security engineer acknowledge a vulnerability for an image in Aqua, will Harbor understands that and allow an image to run.
Example being an image with 1 high vulnerability which gets acknowledge on Aqua, will Harbor deployment security - prevent vulnerable image severity set to High, will allow it pull/push.

@danielpacak
Copy link
Contributor

@danielpacak One more feature request or it might automatically get enabled is integration with acknowledge feature on Aqua. So, if an admin or security engineer acknowledge a vulnerability for an image in Aqua, will Harbor understands that and allow an image to run.
Example being an image with 1 high vulnerability which gets acknowledge on Aqua, will Harbor deployment security - prevent vulnerable image severity set to High, will allow it pull/push.

Yes. That's a great feedback @honeybajaj We'll take that into account and follow up.

@danielpacak danielpacak pinned this issue Apr 24, 2020
@honeybajaj
Copy link

@danielpacak Do you have a view on when this feature will become available for consumption/testing. Thanks for all your help.

@danielpacak
Copy link
Contributor

@danielpacak Do you have a view on when this feature will become available for consumption/testing. Thanks for all your help.

@honeybajaj We have a PR ready with the fix in the adapter service waiting for review #50 - I believe we can merge it soon.

However, in order to test it with Harbor we have to wait for the Aqua release train. I will let you know as soon as I get possible release date from the product team. They're heads down adding new flags to scannercli, i.e. --registry-username and --registry-password to override registry credentials set in Aqua management console.

danielpacak added a commit that referenced this issue Jun 5, 2020
…li (#50)

Pass Robot Account credentials generated by Harbor for each scan
request through to the scannercli command as --registry-username
and --registry-password flags.

This feature is enabled by setting the value of the
SCANNER_CLI_OVERRIDE_REGISTRY_CREDENTIALS to true.

It has to be enable explicitly as not every version of scannercli
accepts the --registry-username and --registry-password flags.

Resolves: #37

Co-authored-by: Simarpreet Singh <[email protected]>
Signed-off-by: Daniel Pacak <[email protected]>
@danielpacak
Copy link
Contributor

@honeybajaj I've tested the code with a dev build version of Aqua CSP. Everything works as expected. I'll close this issue shortly once we have the official release and exact version number.

@danielpacak
Copy link
Contributor

@honeybajaj @rvennam-lbg If this adapter service is used with Aqua version >= 4.6.20181 (4.6 update 16), it can bypass Harbor's deployment security proxy. For more details consult https://github.com/aquasecurity/harbor-scanner-aqua#error-failed-getting-image-manifest-412-precondition-failed

@danielpacak danielpacak changed the title Harbor interragation fails when deployment security is enabled Harbor integration fails when deployment security is enabled Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants