harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Prevent vulnerable images from running not working for initial image pull though a Proxy Cache project

Open DASXCE opened this issue 4 years ago • 10 comments

Expected behavior and actual behavior: After creating a Proxy Cache project to DockerHub and configuring 'Prevent vulnerable images from running' the first image pull works even though the image has vulnerabilites. After a while(which may be related to #12721 ) subsequent pulls fail with a proper message 'cannot be pulled due to configured policy'. Expected was that the image will first be pulled into Harbor, scanned and then served to client running the pull command.

Steps to reproduce the problem:

  1. Create a Proxy Cache project for DockerHub
  2. Activate 'Prevent vulnerable images from running.' and set 'Prevent images with vulnerability severity of' to 'Low'
  3. Activate 'Automatically scan images on push'
  4. docker pull <<harbor_hostname>>/project_name/library/mysql:5

Versions: Please specify the versions of following systems.

  • harbor version: 2.1.0
  • docker engine version: 19.03.11-ol
  • docker-compose version: 1.25.5

Additional context:

N/A

DASXCE avatar Oct 12 '20 11:10 DASXCE

@DASXCE This is the design of proxy cache, when you use pull through cache you expect the data be served before it's in the storage of Harbor, in that case Harbor will not be able to scan the image with the incomplete image data.

If you want to make sure the image is scanned, you need to use pull-based replication.

reasonerjt avatar Oct 16 '20 07:10 reasonerjt

@a-mccarthy not sure if this is worth highlighting in the docs, your call.

xaleeks avatar Nov 28 '20 01:11 xaleeks

@a-mccarthy not sure if this is worth highlighting in the docs, your call.

Please add this to the docs as it is non-obvious and is still an issue in v2.2.0.

Understand that this use case is slightly outside of the proxy cache use case, but +1 for a feature to enable scan prior to serving the image. I would be okay with initial image pull failing with an error that says something like "image pending vulnerability scan. try back in XX seconds"

bmnave avatar Mar 16 '21 03:03 bmnave

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 18 '21 23:06 stale[bot]

+1

bmnave avatar Jun 19 '21 03:06 bmnave

+1

geowalrus4gh avatar Feb 21 '22 10:02 geowalrus4gh

+1

haiwu avatar Apr 01 '22 20:04 haiwu

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

github-actions[bot] avatar Jul 06 '22 09:07 github-actions[bot]

not stale

sathieu avatar Jul 06 '22 09:07 sathieu

I sincerely hope that something can be done to solve this issue. If it can't be solved, something needs to be added, prominently, to the documentation, describing methods for mitigation. Examples would be setting up admission controllers that do the actual vulnerability management.

Without either a fix or a conspicuously placed mitigation strategy, Harbor is a security threat just waiting to bite the unaware.

jsolbrig avatar Aug 08 '22 16:08 jsolbrig

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

github-actions[bot] avatar Oct 08 '22 09:10 github-actions[bot]

(Still) not stale

sathieu avatar Oct 08 '22 19:10 sathieu

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

github-actions[bot] avatar Dec 09 '22 09:12 github-actions[bot]

(still) not stale. Could it be marked as never-stale?

sathieu avatar Dec 09 '22 09:12 sathieu

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

github-actions[bot] avatar Feb 08 '23 09:02 github-actions[bot]

not-stale :disappointed:

sathieu avatar Feb 11 '23 16:02 sathieu

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

github-actions[bot] avatar Apr 14 '23 09:04 github-actions[bot]

not yet ...

sathieu avatar Apr 14 '23 09:04 sathieu

+1

AYDEV-FR avatar Apr 25 '23 22:04 AYDEV-FR