Commit Graph

438 Commits

Author SHA1 Message Date
stonezdj(Daojun Zhang)
ec8d692fe6
Add scanner info and report_id to sbom_overview on listing artifact (#20358)
Add scan_status and report_id when scan has a failed task

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-25 17:00:35 +08:00
Shengwen YU
2af02f3b25
fix: update image reference to "@" in audit log when pushing & deleting images (#20348)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-04-24 16:05:14 +08:00
stonezdj(Daojun Zhang)
c80e9bf477
Add 422 in the swagger.yaml (#20344)
change log level with no content message
  fix time in sbom accessory
  fixes #20342 #20332 #20328

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-24 09:57:46 +08:00
stonezdj(Daojun Zhang)
b7d4bf0d07
Log and skip adapter ping error when retrieve adapter capability (#20314)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-22 09:43:04 +00:00
stonezdj(Daojun Zhang)
0d9dc4b4a4
Add enableCapabilities to extraAttrs for stop (#20299)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-19 07:36:56 +00:00
Ikko Eltociear Ashimine
4fd11ce072
refactor: update controller.go (#20297)
minor fix

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: MinerYang <yminer@vmware.com>
2024-04-18 14:26:03 +08:00
stonezdj(Daojun Zhang)
2ea7d09412
skip to log scan sbom accessory for sbom accessory (#20290)
Avoid to log the generate SBOM failure message when the artifact is SBOM in webhook event

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-17 14:51:11 +00:00
stonezdj(Daojun Zhang)
fb2e0042d0
Rename scan request type (#20288)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2024-04-17 09:52:50 +00:00
stonezdj(Daojun Zhang)
654aa8edcf
Add generate SBOM feature (#20251)
* Add SBOM scan feature

  Add scan handler for sbom
  Delete previous sbom accessory before the job service

Signed-off-by: stonezdj <daojunz@vmware.com>

* fix issue

Signed-off-by: stonezdj <stone.zhang@broadcom.com>

---------

Signed-off-by: stonezdj <daojunz@vmware.com>
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-16 13:34:19 +00:00
Shengwen YU
91efec1e2a
fix: update the image reference format for audit log when pulling image (#20278)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2024-04-16 11:11:59 +08:00
MinerYang
7465a29919
add SBOM icon (#20270)
Signed-off-by: yminer <yminer@vmware.com>
2024-04-12 20:12:46 +08:00
MinerYang
e9d2f50669
update mockery to v2.42.2 (#20258)
Signed-off-by: yminer <yminer@vmware.com>
2024-04-11 03:37:59 +00:00
stonezdj(Daojun Zhang)
5d7c668028
Support list artifact with_sbom_overview option (#20244)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-10 14:47:45 +00:00
stonezdj(Daojun Zhang)
89995075a7
Update swagger API to display SBOM content in addition API (#20234)
complete task #20066

Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-10 12:39:25 +00:00
stonezdj(Daojun Zhang)
2e7db335b3
Add auto generate SBOM on push feature (#20250)
Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2024-04-09 09:30:53 +00:00
Wang Yan
461a5fa50d
add stop sbom scanning API (#20200)
* add stop sbom scanning API

1. [UI] support to stop sbom scanning #20200
2. add type for stop scanning api, make it able to support both vulnerability and sbom.
3. refactor the db query to support multiple extra attributes.

Signed-off-by: wang yan <wangyan@vmware.com>
Signed-off-by: xuelichao <xuel@vmware.com>
Co-authored-by: xuelichao <xuel@vmware.com>
2024-04-09 16:07:47 +08:00
stonezdj(Daojun Zhang)
be648ea47f
Refactor scan job service make it easy to add new scan type (#20177)
Signed-off-by: stonezdj <daojunz@vmware.com>
Signed-off-by: stonezdj(Daojun Zhang) <stonezdj@gmail.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-09 16:05:30 +08:00
guangwu
ff1a5056d7
fix: close blob io ReadCloser (#20225)
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2024-04-09 14:27:46 +08:00
stonezdj(Daojun Zhang)
dd76fe47ce
Add SBOM scan REST API (#20215)
Update swagger API for generate SBOM

Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-03 08:38:09 +00:00
Taras Katkov
da3c85be5a
fix image name extraction (#18992)
* Update replication.go

It also could be 'library/bitnami/fluentd:1.13.3-debian-10-r0' so we need to split resource to only 2 parts - possible namespace and image name which may include slashes for example -
namespace: library, image: bitnami/fluentd:1.13.3-debian-10-r0

Signed-off-by: Taras Katkov <tkatkov@gmail.com>

* Update replication_test.go

Adding namespace and resource extraction tests.

Signed-off-by: Taras Katkov <tkatkov@gmail.com>

* Reformat only

Signed-off-by: Taras Katkov <tkatkov@gmail.com>

---------

Signed-off-by: Taras Katkov <tkatkov@gmail.com>
2024-03-30 13:41:50 +00:00
Todd Whiteman
06f53368cd
ScanAll should only log an error when an error occurs (#20087)
Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2024-03-27 15:15:14 +08:00
stonezdj(Daojun Zhang)
80a9c688fc
panic due to mark retention task error (#20161)
panic due to mark retention task error

fixes #20129

Signed-off-by: stonezdj <daojunz@vmware.com>
2024-03-26 04:52:17 +00:00
MinerYang
f7a3392020
Update deletion for index type of accessory (#20073)
update delete for index accessory

Signed-off-by: yminer <yminer@vmware.com>

revert error code

update lint and comments
2024-03-13 14:46:11 +08:00
MinerYang
a269b4f31c
Update support for artifactType for both manifest and index (#20030)
add artifact_type for artifact model to support artifactType filter

Signed-off-by: yminer <yminer@vmware.com>

add 2.11 sql schema & update index artifactType omitted

Signed-off-by: yminer <yminer@vmware.com>

update UT

update migrate sql for artifact_type

Signed-off-by: yminer <yminer@vmware.com>

remove debug line
2024-03-12 13:52:56 +00:00
Wang Yan
dbe9790147
add generate sbom object utility (#20097)
* add generate sbom object utility

Leverage the go-containerregistry to generate the oci object for sbom and add it as an accessory of the subject artifact.

Signed-off-by: wang yan <wangyan@vmware.com>

* remove vendor

Signed-off-by: wang yan <wangyan@vmware.com>

* resolve comments

Signed-off-by: wang yan <wangyan@vmware.com>

* fix ut

Signed-off-by: wang yan <wangyan@vmware.com>

* resolve comments

Signed-off-by: wang yan <wangyan@vmware.com>

* remove the todo comments

Signed-off-by: wang yan <wangyan@vmware.com>

---------

Signed-off-by: wang yan <wangyan@vmware.com>
2024-03-12 12:27:34 +08:00
Shuaiyi
f17d90fadf
Log ensureArtifact ConflictErr (#19294)
* Log ensureArtifact ConflictErr

Signed-off-by: Shuaiyi Liu <liushuaiyi@gmail.com>

* Log ensureArtifact ConflictErr

Signed-off-by: Shuaiyi Liu <liushuaiyi@gmail.com>

---------

Signed-off-by: Shuaiyi Liu <liushuaiyi@gmail.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2024-01-15 18:39:01 +08:00
Yang Jiao
eb125419cc
Add verification that robot account duration is not 0 (#19829)
Signed-off-by: Yang Jiao <yang.jiao@broadcom.com>
2024-01-15 13:25:56 +08:00
stonezdj(Daojun Zhang)
891f6785f2
Cache image list with digest key (#19801)
fixes #19429

Signed-off-by: stonezdj <daojunz@vmware.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-01-11 06:55:35 +00:00
MinerYang
b38de22054
bump golang 1.21.5 & fix golangci-lint error (#19722)
bump golang 1.21.5

update golangci-lint && fix revive error

fix white space lint

Signed-off-by: yminer <yminer@vmware.com>
2023-12-19 09:41:26 +08:00
Maksym Trofimenko
996e57b511
Feature: GDPR compliant audit logs (#17396) 2023-11-20 21:31:22 +01:00
stonezdj(Daojun Zhang)
307a3121aa
Return empty result when no scanner configured (#19577)
fixes #19534

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-11-17 07:29:19 +00:00
stonezdj(Daojun Zhang)
3f6c0298fe
Add oidc provider name to systeminfo API (#19575)
fixes #13198

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-11-15 11:00:39 +08:00
Chlins Zhang
f6d5bf2e0f
perf: optimize the trigger retention API (#19533)
Enhance the API for triggering retention by optimizing it from synchronous to asynchronous to solve the problem of slow response in the case of a large number of tasks.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-11-09 07:45:01 +00:00
Wang Yan
5c02fd807e
add permission api (#19543)
The permission api targets to return the full set of permissons for robot to use.
And only system and project admin have the access

Signed-off-by: wang yan <wangyan@vmware.com>
2023-11-09 09:47:07 +08:00
stonezdj(Daojun Zhang)
da949bfc3f
Delete project member when delete project (#19523)
Signed-off-by: stonezdj <daojunz@vmware.com>
2023-11-08 20:51:21 +08:00
Daniel Jiang
3f7c605cf5
[WIP] Remove vendor folder from harbor code base (#19508)
* Remove vendor folder from harbor code base

Signed-off-by: Daniel Jiang <jiangd@vmware.com>

* debug ut failure

* debug failure

* debug failure

---------

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2023-11-05 14:37:25 +08:00
stonezdj(Daojun Zhang)
7b0beed934
Delete tag retention rule and tag immutable rule when deleting project (#19390)
fixes #18250

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-10-24 04:28:16 +00:00
Chlins Zhang
99b40bf764
feat: enhance the replication webhook payload (#19433)
Add the new filed 'references' to the replication webhook payload, which
can help user better know the replicated artifact tags or digests.
(references is the lists of the artifact tag name or digest if no tag)

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-10-23 03:29:30 +00:00
MinerYang
6fd4a2bd37
update default processor for unknwon type config (#19372)
update OCI-Subject header

Signed-off-by: yminer <yminer@vmware.com>

update default processor & add ut for artifact icon

update ut coverage
2023-09-21 15:19:42 +08:00
Chlins Zhang
c7e25295fe
fix: support customize cache db for business (#19182)
Support to configure the customized redis db for cache layer and other
misc business for core, by default the behavior is same with
previous(stored in db 0).

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-18 11:04:16 +08:00
Shengwen YU
88c6018950
fix: cron string validation (#19071)
fix: cron string validation (the 1st field of a cron string must be 0 when there are 6 fields)

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2023-08-09 10:22:54 +08:00
Shengwen YU
90de9092ce
fix: add storage_limit check (#19095)
fix: add storage_limit check (add ValidateQuotaLimit as a general method to validate quota limit value)

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2023-08-09 09:37:07 +08:00
Chlins Zhang
a036e4a7b0
fix: skip to delete scan reports if the digest still referenced (#19110)
fix: skip to delete scan reports if the digest still referenced by other artifacts

Avoid to delete the scan reports in case the artifact deleted but still
referenced by the other artifacts.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-07 14:00:26 +08:00
stonezdj(Daojun Zhang)
3de778e9f1
Fix incorrect artifact and scanned artifact count issue (#19106)
* Fix incorrect artifact and scanned artifact count issue

  fixes #19009 #19020 #19013

Signed-off-by: stonezdj <daojunz@vmware.com>

* fix issue

Signed-off-by: stonezdj <daojunz@vmware.com>

---------

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-08-07 08:40:26 +08:00
Chlins Zhang
8ff095d68f
feat: add the configuration for quota update provider (#18928)
Add the related configurations for the quota update provider to the
harbor.yml.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-07-24 16:28:19 +08:00
Chlins Zhang
94c76002a2
refactor: remove duplicated artifact deletion handler (#18959)
Remove the duplicated artifact deletion event handler and enhance the
internal artifact onDelete method.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-07-24 13:38:39 +08:00
Shengwen YU
9091661539
fix: replication policy cron setting - the 1st field must be 0; the Minutes field cannot be * (#18923)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2023-07-20 17:55:48 +08:00
Chlins Zhang
970bdab936
fix: correct the operator in the webhook payload (#18906)
Fix the incorrect or meaningless operator in the webhook payload.

Fixes: #18438

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-07-19 15:40:29 +08:00
stonezdj(Daojun Zhang)
d4aa9b13c4
Add vulnerability search API (#18924)
use q.Query to pass all query conditions

Signed-off-by: stonezdj <daojunz@vmware.com>
2023-07-19 10:17:14 +08:00
Wang Yan
d745ad9175
fix gc schedule issue (#18934)
fixes #18881

Save workers settings into the metadata of the garbage collection schedule

Signed-off-by: wang yan <wangyan@vmware.com>
2023-07-17 15:28:21 +08:00