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

Modified to check the expiration time of the allowlist when determining the vulnerability of an artifact #18106

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

hyeyoung-leee
Copy link
Contributor

@hyeyoung-leee hyeyoung-leee commented Jan 17, 2023

The allowlist is applied even after the expiration time has passed.

Signed-off-by: hyeyoung-leee [email protected]

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #18078

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • [ x ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Merging #18106 (2be6e4b) into main (1238384) will decrease coverage by 23.24%.
The diff coverage is n/a.

❗ Current head 2be6e4b differs from pull request most recent head 3226b77. Consider uploading reports for the commit 3226b77 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #18106       +/-   ##
===========================================
- Coverage   67.49%   44.26%   -23.24%     
===========================================
  Files         970      232      -738     
  Lines      106079    12808    -93271     
  Branches     2649     2582       -67     
===========================================
- Hits        71602     5669    -65933     
+ Misses      30645     6858    -23787     
+ Partials     3832      281     -3551     
Flag Coverage Δ
unittests 44.26% <ø> (-23.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...d/worker-card/donut-chart/donut-chart.component.ts 48.57% <0.00%> (-11.43%) ⬇️
...audit-log-purge/history/purge-history.component.ts 40.69% <0.00%> (-5.82%) ⬇️
...oute-reuse-strategy/harbor-route-reuse-strategy.ts 28.26% <0.00%> (-1.16%) ⬇️
...ice-dashboard/worker-list/worker-list.component.ts 50.00% <0.00%> (-0.71%) ⬇️
...ject/p2p-provider/task-list/task-list.component.ts 53.14% <0.00%> (-0.38%) ⬇️
src/portal/src/app/shared/units/utils.ts 61.58% <0.00%> (-0.23%) ⬇️
...al/src/app/base/project/webhook/webhook.service.ts 100.00% <0.00%> (ø)
...oject/webhook/add-webhook/add-webhook.component.ts 50.00% <0.00%> (ø)
src/controller/p2p/preheat/enforcer.go
src/controller/scan/base_controller.go
... and 748 more

@hyeyoung-leee hyeyoung-leee force-pushed the issue/18078 branch 2 times, most recently from 82b0052 to 85077a7 Compare January 20, 2023 07:49
@zyyw zyyw added the release-note/update Update or Fix label Feb 28, 2023
Copy link
Contributor

@zyyw zyyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@zyyw zyyw requested review from stonezdj and removed request for stonezdj March 2, 2023 02:55
}
} else {
for _, v := range vuls {
if allowlist.Contains(v.ID) {
Copy link
Member

@chlins chlins Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If change this line to if !allowlistIsExpired && allowlist.Contains(v.ID) {}, then line 818-824 can be removed as logic duplicated with line 835-837?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hyeyoung-leee could you please update the code to resolve this comment? thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chlins @zyyw
Thanks for the comment.
I updated the code based on the comment.

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

…ng the vulnerability of an artifact

Signed-off-by: hyeyoung-lee <[email protected]>
@zyyw zyyw merged commit 2c287cf into goharbor:main Mar 8, 2023
@OrlinVasilev
Copy link
Member

@hyeyoung-leee Congratulations on your first merged PR on Harbor :) Welcome to the Club :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/update Update or Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ask about the expiration time of the CVE whitelists
8 participants