Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 66 additions & 64 deletions admin/webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions admin/webapp/websrc/app/common/api/risks-http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,16 @@ export class RisksHttpService {
);
}

postAssetsViewData(queryId: string, lastModifiedTime: number, includeNoVulAssets: boolean = false) {
postAssetsViewData(
queryId: string,
lastModifiedTime: number,
includeNoVulAssets: boolean = false
) {
return GlobalVariable.http.patch<any>(
PathConstant.ASSETS_VULS_URL,
{
last_modified_timestamp: lastModifiedTime,
include_no_vul_assets: includeNoVulAssets
include_no_vul_assets: includeNoVulAssets,
},
{ params: { queryId: queryId } }
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ export class ContainersService {
].join(',');

const csvRows = vulnerabilities.map(vul => {
const { image_name, tags } = this.splitImageNameAndTag(vul.workload_image);
const { image_name, tags } = this.splitImageNameAndTag(
vul.workload_image
);
const digest = vul.workload_image_digest || '';
const workload_name = vul.workload_name || '';
const namespace = vul.workload_domain || '';
Expand Down
35 changes: 6 additions & 29 deletions admin/webapp/websrc/app/common/types/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,20 @@ export type PolicyMode = 'Discover' | 'Monitor' | 'Protect' | '';
export type ProfileBaseline = 'basic' | 'zero-drift';

export type ScannerAutoscaleStrategy =
| 'immediate'
| 'delayed'
| 'disabled'
| 'n/a'
| '';
'immediate' | 'delayed' | 'disabled' | 'n/a' | '';

export type VulnerabilityView =
| 'all'
| 'containers'
| 'infrastructure'
| 'registry';
'all' | 'containers' | 'infrastructure' | 'registry';

export type DataOps = 'add' | 'edit' | 'delete';

export type VulQueryPublishedTimeOption = 'all' | 'before' | 'after';

export type VulQueryPackageTypeOption =
| 'all'
| 'withFix'
| 'withoutFix'
| 'withFixAll';
'all' | 'withFix' | 'withoutFix' | 'withFixAll';

export type VulQuerySeverityTypeOption =
| 'all'
| 'critical'
| 'high'
| 'medium'
| 'low';
'all' | 'critical' | 'high' | 'medium' | 'low';

export type VulQueryScoreTypeOption = 'v2' | 'v3';

Expand All @@ -47,21 +33,12 @@ export type VulQueryOrderByColumnOption =
| 'impact';

export type ImageQueryOrderByColumnOption =
| 'repository'
| 'imageid'
| 'createdat'
| 'os'
| 'size'
| 'scannedat';
'repository' | 'imageid' | 'createdat' | 'os' | 'size' | 'scannedat';

export type OrderByOption = 'desc' | 'asc';

export type LastModifiedDateOption =
| 'all'
| 'twoweeks'
| 'onemonth'
| 'threemonths'
| 'custom';
'all' | 'twoweeks' | 'onemonth' | 'threemonths' | 'custom';

export type CfgType = 'ground' | 'user_created' | '';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as forge from 'node-forge';
import forge from 'node-forge';
import * as moment from 'moment';

export enum CertificateKeyAlgorithmType {
Expand Down
7 changes: 1 addition & 6 deletions admin/webapp/websrc/app/common/types/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,7 @@ export interface Role {
}

export type ApikeyExpiration =
| 'never'
| 'onehour'
| 'oneday'
| 'onemonth'
| 'oneyear'
| 'hours';
'never' | 'onehour' | 'oneday' | 'onemonth' | 'oneyear' | 'hours';

export interface Apikey {
expiration_type: ApikeyExpiration;
Expand Down
5 changes: 2 additions & 3 deletions admin/webapp/websrc/app/frame/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ export class HeaderComponent implements OnInit, OnDestroy {
this.email = this.localStorage.get(
GlobalConstant.LOCAL_STORAGE_TOKEN
)?.emailHash;
this.username = this.localStorage.get(
GlobalConstant.LOCAL_STORAGE_TOKEN
)?.token?.username;
this.username = this.localStorage.get(GlobalConstant.LOCAL_STORAGE_TOKEN)
?.token?.username;
const role = this.localStorage.get(GlobalConstant.LOCAL_STORAGE_TOKEN)
?.token?.role;
this.displayRole = role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
ComplianceProfileData,
complianceProfileEntries,
ComplianceProfileTemplateData,
DomainGetResponse,
} from '@common/types';
import type { DomainGetResponse } from '@common/types';
import { MapConstant } from '@common/constants/map.constant';
import { AuthUtilsService } from '@common/utils/auth.utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { Permission, PermissionOption, Role } from '@common/types';
import { Permission } from '@common/types';
import type { PermissionOption, Role } from '@common/types';
import { TranslateService } from '@ngx-translate/core';

export interface PermissionDialogOption extends PermissionOption {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,26 @@
"
[attr.data-index]="i">
<td class="print-cell" style="width: 30%">
<div>{{ reportPage === 'vulnerabilities' ? image.name : image.image_name }}</div>
<div *ngIf="reportPage === 'vulnerabilities'" class="text-muted small" style="word-break: break-all;">
<div>
{{ reportPage === 'vulnerabilities' ? image.name : image.image_name }}
</div>
<div
*ngIf="reportPage === 'vulnerabilities'"
class="text-muted small"
style="word-break: break-all">
{{ image.digest }}
</div>
</td>
<td
*ngIf="reportPage === 'vulnerabilities'"
class="print-cell" style="width: 10%">
class="print-cell"
style="width: 10%">
<div>{{ image.cvedb_version }}</div>
<div class="text-muted small">
{{ 'scan.report.gridHeader.CVE_DB_LAST_UPDATED' | translate }}
</div>
<div class="text-muted small">
{{ image.cvedb_create_time | date:'yyyy-MM-dd HH:mm:ss' }}
{{ image.cvedb_create_time | date: 'yyyy-MM-dd HH:mm:ss' }}
</div>
</td>
<td
Expand All @@ -96,7 +102,11 @@
*ngIf="reportPage === 'vulnerabilities'"
class="print-cell"
style="width: 60%">
<ng-container *ngIf="image.critical + image.high + image.medium + image.low > 0; else noVulns">
<ng-container
*ngIf="
image.critical + image.high + image.medium + image.low > 0;
else noVulns
">
<span
*ngFor="let item of image.vulnerabilities"
class="margin-right-s text-{{ item.split('_')[0] }}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@
</div>
<div
*ngIf="
platform.critical + platform.high + platform.medium + platform.low ===
platform.critical +
platform.high +
platform.medium +
platform.low ===
0
">
<span class="text-success">0</span>
Expand All @@ -103,7 +106,10 @@
</div>
<div
*ngIf="
platform.critical + platform.high + platform.medium + platform.low ===
platform.critical +
platform.high +
platform.medium +
platform.low ===
0
">
<span class="text-success">{{
Expand Down
Loading
Loading