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

sbom_overview still get sbom_digest when this sbom artifact do not exist in this repository #20445

Closed
MinerYang opened this issue May 17, 2024 · 0 comments · Fixed by #20473
Closed

Comments

@MinerYang
Copy link
Contributor

If you are reporting a problem, please make sure the following information are provided:

Expected behavior and actual behavior:
sbom_overview should return null when this sbom_digest do not exist in this project/repository

Steps to reproduce the problem:

  • Step1 push image golang:1.22.3 to repo library/golang
  • Step2 push same image to another repo test/golang, then manually generate SBOM
  • Step3 query db
registry=# select id , project_id, repository_name, digest, type from artifact where repository_name='test/golang';
 id | project_id | repository_name |                                 digest                                  | type
----+------------+-----------------+-------------------------------------------------------------------------+-------
  5 |          2 | test/golang     | sha256:aafa9c9a2b8a759dad5372dce120441462eb110cf5a1b1c9862769f453be7bcd | IMAGE
  6 |          2 | test/golang     | sha256:ecc2d24dba2835db0cb39de61d2e9b0a6b968a1052d0651408203d9eb7e2da2d | SBOM
(2 rows)

registry=#
registry=# select id , project_id, repository_name, digest, type from artifact where repository_name='library/golang';
 id | project_id | repository_name |                                 digest                                  | type
----+------------+-----------------+-------------------------------------------------------------------------+-------
  1 |          1 | library/golang  | sha256:aafa9c9a2b8a759dad5372dce120441462eb110cf5a1b1c9862769f453be7bcd | IMAGE
(1 row)
  • Step 4 click into artifact library/golang repository, will get sbom_overview with sbom_digest sha256:ecc2d24dba2835db0cb39de61d2e9b0a6b968a1052d0651408203d9eb7e2da2d
Screenshot 2024-05-17 at 16 20 57
  • Step 5 click SBOM details for artifact library/golang:1.22.3, will get 404 error
 [/lib/http/error.go:62]: {"errors":[{"code":"NOT_FOUND","message":"artifact library/golang@sha256:ecc2d24dba2835db0cb39de61d2e9b0a6b968a1052d0651408203d9eb7e2da2d not found"}]}
Screenshot 2024-05-17 at 16 22 37
  • Step6 repeat same action for artifact test/golang:1.22.3, SBOM details could get successfully
Screenshot 2024-05-17 at 16 29 34

Versions:
Please specify the versions of following systems.

  • harbor version: v2.11.0-8ccf98a2
stonezdj added a commit to stonezdj/harbor that referenced this issue May 23, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit to stonezdj/harbor that referenced this issue May 23, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit to stonezdj/harbor that referenced this issue May 23, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit to stonezdj/harbor that referenced this issue May 23, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit to stonezdj/harbor that referenced this issue May 24, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit to stonezdj/harbor that referenced this issue May 24, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit to stonezdj/harbor that referenced this issue May 24, 2024
  fixes goharbor#20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit that referenced this issue May 24, 2024
fixes #20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit that referenced this issue May 24, 2024
…#20482)

Add sbom_report table to store sbom related information

  fixes #20445
  Refactor scan/base_controller.go
  Move MakeReportPlaceholder, GetReportPlaceholder, GetSummary to vul and sbom scanHandler

Signed-off-by: stonezdj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants