-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.Fixes #18819 2.Add Security Hub page as a new tab for Interrogation Services Signed-off-by: AllForNothing <sshijun@vmware.com>
- Loading branch information
AllForNothing
committed
Jul 19, 2023
1 parent
79e8c39
commit 8758a35
Showing
44 changed files
with
2,114 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
...e/left-side-nav/interrogation-services/vulnerability-database/security-hub.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<app-vulnerability-summary | ||
(searchCVE)="searchCVE($event)" | ||
(searchRepo)="searchRepo($event)"></app-vulnerability-summary> | ||
<h1 appScrollSection="{{ vulId }}">{{ 'SECURITY_HUB.VUL' | translate }}</h1> | ||
|
||
<clr-datagrid | ||
[clrDgLoading]="loading" | ||
(clrDgRefresh)="clrDgRefresh($event, options)"> | ||
<clr-dg-action-bar class="action-bar"> | ||
<app-vulnerability-filter | ||
[loading]="loading" | ||
(search)="search($event)"></app-vulnerability-filter> | ||
<span class="refresh-btn" (click)="refresh()"> | ||
<clr-icon shape="refresh"></clr-icon> | ||
</span> | ||
</clr-dg-action-bar> | ||
<clr-dg-column class="min-width">{{ | ||
'SECURITY_HUB.CVE_ID' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-column class="min-width">{{ | ||
'SECURITY_HUB.REPO_NAME' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-column class="min-width">{{ | ||
'P2P_PROVIDER.DIGEST' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-column>{{ 'AUDIT_LOG.TAGS' | translate }}</clr-dg-column> | ||
<clr-dg-column>{{ 'VULNERABILITY.GRID.CVSS3' | translate }}</clr-dg-column> | ||
<clr-dg-column>{{ | ||
'VULNERABILITY.GRID.COLUMN_SEVERITY' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-column class="min-width">{{ | ||
'VULNERABILITY.PACKAGE' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-column>{{ | ||
'VULNERABILITY.GRID.COLUMN_VERSION' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-column>{{ | ||
'VULNERABILITY.GRID.COLUMN_FIXED' | translate | ||
}}</clr-dg-column> | ||
<clr-dg-placeholder | ||
>{{ 'SECURITY_HUB.NO_VUL' | translate }} | ||
</clr-dg-placeholder> | ||
<clr-dg-row *ngFor="let c of vul" [clrDgItem]="c"> | ||
<clr-dg-cell class="min-width"> | ||
<span *ngIf="!c?.links || c?.links?.length === 0">{{ | ||
c.cve_id | ||
}}</span> | ||
<a | ||
rel="noopener noreferrer" | ||
*ngIf="c?.links && c?.links.length === 1" | ||
href="{{ c?.links[0] }}" | ||
target="_blank" | ||
>{{ c.cve_id }}</a | ||
> | ||
<span *ngIf="c?.links && c?.links.length > 1"> | ||
{{ c.cve_id }} | ||
<clr-signpost> | ||
<clr-signpost-content *clrIfOpen> | ||
<div class="mt-5px" *ngFor="let link of c?.links"> | ||
<a | ||
rel="noopener noreferrer" | ||
href="{{ link }}" | ||
target="_blank" | ||
>{{ link }}</a | ||
> | ||
</div> | ||
</clr-signpost-content> | ||
</clr-signpost> | ||
</span> | ||
</clr-dg-cell> | ||
<clr-dg-cell class="ellipsis min-width" title="{{ c.repository_name }}"> | ||
<a | ||
href="javascript:void(0)" | ||
[routerLink]="getRepoLink(c.project_id, c.repository_name)" | ||
>{{ c.repository_name }}</a | ||
> | ||
</clr-dg-cell> | ||
<clr-dg-cell class="ellipsis min-width" title="{{ c?.digest }}"> | ||
<a | ||
href="javascript:void(0)" | ||
[routerLink]=" | ||
getDigestLink(c.project_id, c.repository_name, c.digest) | ||
" | ||
>{{ c?.digest?.slice(0, 15) }}</a | ||
> | ||
</clr-dg-cell> | ||
<clr-dg-cell class="ellipsis" title="{{ c.tags?.join(', ') }}">{{ | ||
c.tags?.join(', ') | ||
}}</clr-dg-cell> | ||
<clr-dg-cell>{{ c.cvss_v3_score }}</clr-dg-cell> | ||
<clr-dg-cell [ngSwitch]="c.severity"> | ||
<span | ||
*ngSwitchCase="'Critical'" | ||
class="label label-critical no-border" | ||
>{{ severityText(c.severity) | translate }}</span | ||
> | ||
<span *ngSwitchCase="'High'" class="label label-danger no-border">{{ | ||
severityText(c.severity) | translate | ||
}}</span> | ||
<span | ||
*ngSwitchCase="'Medium'" | ||
class="label label-medium no-border" | ||
>{{ severityText(c.severity) | translate }}</span | ||
> | ||
<span *ngSwitchCase="'Low'" class="label label-low no-border">{{ | ||
severityText(c.severity) | translate | ||
}}</span> | ||
<span *ngSwitchCase="'None'" class="label label-none no-border">{{ | ||
severityText(c.severity) | translate | ||
}}</span> | ||
<span *ngSwitchDefault>{{ | ||
severityText(c.severity) | translate | ||
}}</span> | ||
</clr-dg-cell> | ||
<clr-dg-cell class="ellipsis" title="{{ c.package }}">{{ | ||
c.package | ||
}}</clr-dg-cell> | ||
<clr-dg-cell class="ellipsis" title="{{ c.version }}">{{ | ||
c.version | ||
}}</clr-dg-cell> | ||
<clr-dg-cell class="ellipsis" title="{{ c.fixed_version }}">{{ | ||
c.fixed_version | ||
}}</clr-dg-cell> | ||
<clr-dg-row-detail *clrIfExpanded> | ||
{{ 'VULNERABILITY.GRID.COLUMN_DESCRIPTION' | translate }}: | ||
{{ c.desc }} | ||
</clr-dg-row-detail> | ||
</clr-dg-row> | ||
<clr-dg-footer> | ||
<span class="mr-1" | ||
>{{ total === -1 ? '1000+' : total }} | ||
{{ 'SECURITY_HUB.CVE' | translate }}</span | ||
> | ||
<clr-dg-pagination | ||
#pagination | ||
[clrDgTotalItems]="total === -1 ? maxNum : total" | ||
[clrDgPageSize]="pageSize" | ||
[(clrDgPage)]="currentPage"> | ||
<clr-dg-page-size [clrPageSizeOptions]="[10, 25, 50]">{{ | ||
'PAGINATION.PAGE_SIZE' | translate | ||
}}</clr-dg-page-size> | ||
</clr-dg-pagination> | ||
</clr-dg-footer> | ||
</clr-datagrid> |
66 changes: 66 additions & 0 deletions
66
...e/left-side-nav/interrogation-services/vulnerability-database/security-hub.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.flex { | ||
display: flex; | ||
} | ||
|
||
.label-critical { | ||
background:red; | ||
color:#621501; | ||
} | ||
|
||
|
||
.label-danger { | ||
background:#e64524!important; | ||
color:#621501!important; | ||
} | ||
|
||
.label-medium { | ||
background-color: orange; | ||
color:#621501; | ||
} | ||
|
||
.label-low { | ||
background: #007CBB; | ||
color:#cab6b1; | ||
} | ||
|
||
.label-none { | ||
background-color: grey; | ||
color:#bad7ba; | ||
} | ||
|
||
.no-border { | ||
border: none; | ||
} | ||
|
||
|
||
.action-bar { | ||
display: flex; | ||
align-items: flex-end; | ||
justify-content: space-between; | ||
} | ||
|
||
.refresh-btn { | ||
margin-right: 2rem; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
color: #007CBB; | ||
} | ||
} | ||
|
||
.repo-name { | ||
min-width: 10rem; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
|
||
.ellipsis { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
|
||
.min-width { | ||
min-width: 9rem !important; | ||
} |
Oops, something went wrong.