@devtron-labs/devtron-fe-common-lib 0.3.6 → 0.3.9-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Common/index.d.ts +0 -1
- package/dist/Pages/App/AppConfigurations/utils.d.ts +1 -1
- package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
- package/dist/Shared/Components/ImageCardAccordion/types.d.ts +4 -1
- package/dist/Shared/Components/Security/SecurityModal/SecurityModal.d.ts +14 -0
- package/dist/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/InfoCard.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/Table.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/components/index.d.ts +3 -0
- package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +100 -0
- package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +4 -0
- package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -0
- package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +3 -0
- package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +56 -0
- package/dist/Shared/Components/Security/SecurityModal/index.d.ts +6 -0
- package/dist/Shared/Components/Security/SecurityModal/service.d.ts +3 -0
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +262 -0
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +34 -0
- package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +3 -0
- package/dist/Shared/Components/Security/SecuritySummaryCard/index.d.ts +1 -0
- package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +11 -0
- package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/Vulnerabilities.d.ts +1 -1
- package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/index.d.ts +1 -0
- package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/service.d.ts +1 -1
- package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +26 -0
- package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +6 -0
- package/dist/Shared/Components/Security/index.d.ts +4 -0
- package/dist/Shared/Components/Security/utils.d.ts +4 -0
- package/dist/Shared/Components/index.d.ts +1 -1
- package/dist/Shared/constants.d.ts +4 -0
- package/dist/Shared/types.d.ts +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-J3JDChT2.js → cssMode-BQyEMz-L.js} +1 -1
- package/dist/{freemarker2-Dtusk9e3.js → freemarker2-Bj0DygAe.js} +1 -1
- package/dist/{handlebars-D8pkowq2.js → handlebars-CHNNn0wb.js} +1 -1
- package/dist/{html-x3avb0CM.js → html-ryEQ_Yz_.js} +1 -1
- package/dist/{htmlMode-CLS66t_u.js → htmlMode-vvcEHwY9.js} +1 -1
- package/dist/{index-oPBCZYbb.js → index-CpSdT1pU.js} +32191 -30603
- package/dist/index.js +494 -481
- package/dist/{javascript-ftMnqw_O.js → javascript-BgyyM4XW.js} +1 -1
- package/dist/{jsonMode-CXcupX1c.js → jsonMode-P-vuI-Fp.js} +1 -1
- package/dist/{liquid-CIkh7QAQ.js → liquid-C2fqEGvd.js} +1 -1
- package/dist/{mdx-BnDg1g8Y.js → mdx-2aw84pOi.js} +1 -1
- package/dist/{python-Bm0f2fYo.js → python-BuTQ7kSf.js} +1 -1
- package/dist/{razor-DCUpFwGp.js → razor-DGlu_XPP.js} +1 -1
- package/dist/{tsMode-7d4Dwa-2.js → tsMode-BqungwBn.js} +1 -1
- package/dist/{typescript-CcwmuWSe.js → typescript-BI6arj9L.js} +1 -1
- package/dist/{xml-BmaGE9Ro.js → xml-CiL6lgOI.js} +1 -1
- package/dist/{yaml-nuLunV1x.js → yaml-BDBCgdGm.js} +1 -1
- package/package.json +4 -3
- package/dist/Common/Security/ScanVulnerabilitiesTable.d.ts +0 -2
- package/dist/Common/Security/types.d.ts +0 -4
- package/dist/Shared/Components/Vulnerabilities/constants.d.ts +0 -4
- package/dist/Shared/Components/Vulnerabilities/types.d.ts +0 -7
- package/dist/Shared/Components/Vulnerabilities/utils.d.ts +0 -4
package/dist/Common/index.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ export { default as GenericFilterEmptyState } from './EmptyState/GenericFilterEm
|
|
|
28
28
|
export * from './SearchBar';
|
|
29
29
|
export * from './SortableTableHeaderCell';
|
|
30
30
|
export { default as Toggle } from './Toggle/Toggle';
|
|
31
|
-
export { default as ScanVulnerabilitiesTable } from './Security/ScanVulnerabilitiesTable';
|
|
32
31
|
export { default as StyledRadioGroup } from './RadioGroup/RadioGroup';
|
|
33
32
|
export * from './CIPipeline.Types';
|
|
34
33
|
export * from './Policy.Types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeploymentStageType } from '../../../Shared/constants';
|
|
2
|
-
export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "
|
|
2
|
+
export declare const getDeploymentStageTitle: (stage: DeploymentStageType) => "-" | "pre-deployment" | "post-deployment" | "deployment";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ImageCardAccordionProps } from './types';
|
|
2
|
-
declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, }: ImageCardAccordionProps) => JSX.Element;
|
|
2
|
+
declare const ImageCardAccordion: ({ isSecurityModuleInstalled, artifactId, applicationId, environmentId, changesCard, isScanned, isScanEnabled, SecurityModalSidebar, getSecurityScan, }: ImageCardAccordionProps) => JSX.Element;
|
|
3
3
|
export default ImageCardAccordion;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { CDModalTabType, VulnerabilityType } from '../../../Common';
|
|
2
|
+
import { CDModalTabType, ResponseType, VulnerabilityType } from '../../../Common';
|
|
3
3
|
import { MaterialSecurityInfoType } from '../../types';
|
|
4
|
+
import { ApiResponseResultType, AppDetailsPayload, SidebarPropsType } from '../Security';
|
|
4
5
|
export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
|
|
5
6
|
isSecurityModuleInstalled: boolean;
|
|
6
7
|
artifactId: number;
|
|
@@ -9,6 +10,8 @@ export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
|
|
|
9
10
|
changesCard: ReactNode;
|
|
10
11
|
isScanned: boolean;
|
|
11
12
|
isScanEnabled: boolean;
|
|
13
|
+
SecurityModalSidebar: React.FC<SidebarPropsType>;
|
|
14
|
+
getSecurityScan: (props: Pick<AppDetailsPayload, 'appId' | 'envId' | 'artifactId'>) => Promise<ResponseType<ApiResponseResultType>>;
|
|
12
15
|
}
|
|
13
16
|
export interface SecurityDetailsType {
|
|
14
17
|
vulnerabilities: VulnerabilityType[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SecurityModalPropsType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* NOTE: the security modal is split into 3 sections - ImageScan, CodeScan & Kubernetes Manifest;
|
|
5
|
+
* Each category has 1 or more subCategories from the set (Vulnerability, License, MisConfigurations & ExposedSecrets)
|
|
6
|
+
* Since each combination of category & subCategory results in the data being visualized through InfoCard & Table
|
|
7
|
+
* the components are declared & called only once and only the data (props) passed to these components differ
|
|
8
|
+
* between the different configurations of category & subCategory. Some row elements from some combinations
|
|
9
|
+
* of Category & SubCategory can allow users to view that particular data in detail (taking user to detailView)
|
|
10
|
+
* So to showcase the detail data, the data is set into detailViewData property of ModalState.
|
|
11
|
+
* For further detail please refer the types to understand the Api Response and workflow of the modal component.
|
|
12
|
+
* */
|
|
13
|
+
declare const SecurityModal: React.FC<SecurityModalPropsType>;
|
|
14
|
+
export default SecurityModal;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { OpenDetailViewButtonProps } from '../types';
|
|
3
|
+
declare const OpenDetailViewButton: ({ children, detailViewData, setDetailViewData, }: PropsWithChildren<OpenDetailViewButtonProps>) => JSX.Element;
|
|
4
|
+
export default OpenDetailViewButton;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ApiResponseResultType, CodeScan, DetailViewDataType, EmptyStateType, InfoCardPropsType, OpenDetailViewButtonProps, SecurityModalStateType, StatusType, TablePropsType } from '../types';
|
|
2
|
+
export declare const getCodeScanVulnerabilities: (data: CodeScan["vulnerability"]) => {
|
|
3
|
+
headers: ({
|
|
4
|
+
headerText: string;
|
|
5
|
+
isSortable: boolean;
|
|
6
|
+
width: number;
|
|
7
|
+
compareFunc?: undefined;
|
|
8
|
+
defaultSortOrder?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
headerText: string;
|
|
11
|
+
isSortable: boolean;
|
|
12
|
+
width: number;
|
|
13
|
+
compareFunc: (a: import('../types').SeveritiesDTO, b: import('../types').SeveritiesDTO) => number;
|
|
14
|
+
defaultSortOrder: import('../types').SortOrderEnum;
|
|
15
|
+
})[];
|
|
16
|
+
rows: {
|
|
17
|
+
id: number;
|
|
18
|
+
expandableComponent: any;
|
|
19
|
+
cells: {
|
|
20
|
+
component: JSX.Element;
|
|
21
|
+
cellContent: string;
|
|
22
|
+
}[];
|
|
23
|
+
}[];
|
|
24
|
+
defaultSortIndex: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const getCodeScanLicense: (data: CodeScan["license"]) => {
|
|
27
|
+
headers: ({
|
|
28
|
+
headerText: string;
|
|
29
|
+
isSortable: boolean;
|
|
30
|
+
width: number;
|
|
31
|
+
compareFunc?: undefined;
|
|
32
|
+
defaultSortOrder?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
headerText: string;
|
|
35
|
+
isSortable: boolean;
|
|
36
|
+
width: number;
|
|
37
|
+
compareFunc: (a: import('../types').SeveritiesDTO, b: import('../types').SeveritiesDTO) => number;
|
|
38
|
+
defaultSortOrder: import('../types').SortOrderEnum;
|
|
39
|
+
})[];
|
|
40
|
+
rows: {
|
|
41
|
+
id: number;
|
|
42
|
+
expandableComponent: any;
|
|
43
|
+
cells: {
|
|
44
|
+
component: JSX.Element;
|
|
45
|
+
cellContent: string;
|
|
46
|
+
}[];
|
|
47
|
+
}[];
|
|
48
|
+
defaultSortIndex: number;
|
|
49
|
+
};
|
|
50
|
+
export declare const getCodeScanMisconfigurations: (data: CodeScan["misConfigurations"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], lastScanTimeString: string, status: StatusType["status"], scanToolName: StatusType["scanToolName"]) => {
|
|
51
|
+
headers: ({
|
|
52
|
+
headerText: string;
|
|
53
|
+
isSortable: boolean;
|
|
54
|
+
width: number;
|
|
55
|
+
compareFunc?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
headerText: string;
|
|
58
|
+
isSortable: boolean;
|
|
59
|
+
width: number;
|
|
60
|
+
compareFunc: (a: Record<import('../types').SeveritiesDTO, number>, b: Record<import('../types').SeveritiesDTO, number>) => number;
|
|
61
|
+
})[];
|
|
62
|
+
rows: {
|
|
63
|
+
id: number;
|
|
64
|
+
expandableComponent: any;
|
|
65
|
+
cells: ({
|
|
66
|
+
component: JSX.Element;
|
|
67
|
+
cellContent: string;
|
|
68
|
+
} | {
|
|
69
|
+
component: JSX.Element;
|
|
70
|
+
cellContent: Partial<Record<import('../types').SeveritiesDTO, number>>;
|
|
71
|
+
})[];
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
export declare const getCodeScanExposedSecrets: (data: CodeScan["exposedSecrets"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"], lastScanTimeString: string, status: StatusType["status"], scanToolName: StatusType["scanToolName"]) => {
|
|
75
|
+
headers: ({
|
|
76
|
+
headerText: string;
|
|
77
|
+
isSortable: boolean;
|
|
78
|
+
width: number;
|
|
79
|
+
compareFunc?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
headerText: string;
|
|
82
|
+
isSortable: boolean;
|
|
83
|
+
width: number;
|
|
84
|
+
compareFunc: (a: Record<import('../types').SeveritiesDTO, number>, b: Record<import('../types').SeveritiesDTO, number>) => number;
|
|
85
|
+
})[];
|
|
86
|
+
rows: {
|
|
87
|
+
id: number;
|
|
88
|
+
expandableComponent: any;
|
|
89
|
+
cells: ({
|
|
90
|
+
component: JSX.Element;
|
|
91
|
+
cellContent: string;
|
|
92
|
+
} | {
|
|
93
|
+
component: JSX.Element;
|
|
94
|
+
cellContent: Partial<Record<import('../types').SeveritiesDTO, number>>;
|
|
95
|
+
})[];
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
98
|
+
export declare const getCodeScanTableData: (data: CodeScan, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"]) => TablePropsType;
|
|
99
|
+
export declare const getCodeScanInfoCardData: (data: CodeScan, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
|
100
|
+
export declare const getCodeScanEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ApiResponseResultType, DetailViewDataType, SecurityModalStateType } from '../types';
|
|
2
|
+
export declare const getEmptyStateValues: (data: ApiResponseResultType, category: SecurityModalStateType["category"], subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => import('../types').EmptyStateType;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DetailViewDataType, ImageScan, SecurityModalStateType, TablePropsType, InfoCardPropsType, EmptyStateType, ApiResponseResultType, OpenDetailViewButtonProps } from '../types';
|
|
2
|
+
export declare const getImageScanTableData: (data: ImageScan, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"]) => TablePropsType;
|
|
3
|
+
export declare const getImageScanInfoCardData: (data: ImageScan, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
|
4
|
+
export declare const getImageScanEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { InfoCardPropsType, ApiResponseResultType, SecurityModalStateType } from '../types';
|
|
2
|
+
export declare const getInfoCardData: (data: ApiResponseResultType, category: SecurityModalStateType["category"], subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ApiResponseResultType, DetailViewDataType, EmptyStateType, InfoCardPropsType, KubernetesManifest, OpenDetailViewButtonProps, SecurityModalStateType, TablePropsType } from '../types';
|
|
2
|
+
export declare const getKubernetesManifestTableData: (data: KubernetesManifest, subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"]) => TablePropsType;
|
|
3
|
+
export declare const getKubernetesManifestInfoCardData: (data: KubernetesManifest, subCategory: SecurityModalStateType["subCategory"]) => InfoCardPropsType;
|
|
4
|
+
export declare const getKubernetesManifestEmptyState: (data: ApiResponseResultType, subCategory: SecurityModalStateType["subCategory"], detailViewData: DetailViewDataType) => EmptyStateType;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ApiResponseResultType, OpenDetailViewButtonProps, SecurityModalStateType, TablePropsType } from '../types';
|
|
2
|
+
export declare const getTableData: (data: ApiResponseResultType, category: SecurityModalStateType["category"], subCategory: SecurityModalStateType["subCategory"], setDetailViewData: OpenDetailViewButtonProps["setDetailViewData"]) => TablePropsType;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SeveritiesDTO, SortOrderEnum, EmptyStateType, StatusType } from './types';
|
|
2
|
+
export declare const DEFAULT_SECURITY_MODAL_STATE: {
|
|
3
|
+
category: "imageScan";
|
|
4
|
+
subCategory: "vulnerability";
|
|
5
|
+
detailViewData: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const CATEGORY_LABELS: {
|
|
8
|
+
readonly IMAGE_SCAN: "Image Scan";
|
|
9
|
+
readonly CODE_SCAN: "Code Scan";
|
|
10
|
+
readonly KUBERNETES_MANIFEST: "Kubernetes Manifest";
|
|
11
|
+
};
|
|
12
|
+
export declare const SUB_CATEGORY_LABELS: {
|
|
13
|
+
readonly VULNERABILITIES: "Vulnerability";
|
|
14
|
+
readonly LICENSE: "License Risks";
|
|
15
|
+
readonly MISCONFIGURATIONS: "Misconfigurations";
|
|
16
|
+
readonly EXPOSED_SECRETS: "Exposed Secrets";
|
|
17
|
+
};
|
|
18
|
+
export declare const SEVERITIES: {
|
|
19
|
+
readonly CRITICAL: {
|
|
20
|
+
readonly label: "Critical";
|
|
21
|
+
readonly color: "#B21212";
|
|
22
|
+
};
|
|
23
|
+
readonly HIGH: {
|
|
24
|
+
readonly label: "High";
|
|
25
|
+
readonly color: "#F33E3E";
|
|
26
|
+
};
|
|
27
|
+
readonly MEDIUM: {
|
|
28
|
+
readonly label: "Medium";
|
|
29
|
+
readonly color: "#FF7E5B";
|
|
30
|
+
};
|
|
31
|
+
readonly LOW: {
|
|
32
|
+
readonly label: "Low";
|
|
33
|
+
readonly color: "#FFB549";
|
|
34
|
+
};
|
|
35
|
+
readonly UNKNOWN: {
|
|
36
|
+
readonly label: "Unknown";
|
|
37
|
+
readonly color: "#B1B7BC";
|
|
38
|
+
};
|
|
39
|
+
readonly fail: {
|
|
40
|
+
readonly label: "Failures";
|
|
41
|
+
readonly color: "#F33E3E";
|
|
42
|
+
};
|
|
43
|
+
readonly success: {
|
|
44
|
+
readonly label: "Successes";
|
|
45
|
+
readonly color: "#1DAD70";
|
|
46
|
+
};
|
|
47
|
+
readonly exceptions: {
|
|
48
|
+
readonly label: "Exceptions";
|
|
49
|
+
readonly color: "#B1B7BC";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const ORDERED_SEVERITY_KEYS: readonly [SeveritiesDTO.CRITICAL, SeveritiesDTO.HIGH, SeveritiesDTO.MEDIUM, SeveritiesDTO.LOW, SeveritiesDTO.UNKNOWN, SeveritiesDTO.FAILURES, SeveritiesDTO.EXCEPTIONS, SeveritiesDTO.SUCCESSES];
|
|
53
|
+
export declare const SEVERITY_DEFAULT_SORT_ORDER = SortOrderEnum['DESC'];
|
|
54
|
+
export declare const SCAN_FAILED_EMPTY_STATE: EmptyStateType;
|
|
55
|
+
export declare const SCAN_IN_PROGRESS_EMPTY_STATE: EmptyStateType;
|
|
56
|
+
export declare const MAP_SCAN_TOOL_NAME_TO_SCAN_TOOL_ID: Record<StatusType['scanToolName'], number>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as SecurityModal } from './SecurityModal';
|
|
2
|
+
export { getSecurityScanSeveritiesCount, getTotalVulnerabilityCount, parseGetResourceScanDetailsResponse, parseExecutionDetailResponse, } from './utils';
|
|
3
|
+
export type { AppDetailsPayload, ExecutionDetailsPayload, ApiResponseResultType, SidebarPropsType, SidebarDataChildType, SidebarDataType, GetResourceScanDetailsPayloadType, GetResourceScanDetailsResponseType, } from './types';
|
|
4
|
+
export { SIDEBAR_DATA } from './config';
|
|
5
|
+
export { CATEGORY_LABELS } from './constants';
|
|
6
|
+
export { getExecutionDetails } from './service';
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { GenericEmptyStateType } from '../../../../Common/Types';
|
|
3
|
+
import { LastExecutionResultType, NodeType, Nodes } from '../../../types';
|
|
4
|
+
import { SegmentedBarChartProps } from '../../../../Common/SegmentedBarChart';
|
|
5
|
+
import { ServerErrors } from '../../../../Common/ServerError';
|
|
6
|
+
export interface GetResourceScanDetailsPayloadType {
|
|
7
|
+
name: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
group: string;
|
|
10
|
+
version: string;
|
|
11
|
+
kind: Nodes | NodeType;
|
|
12
|
+
clusterId: number;
|
|
13
|
+
appId?: string;
|
|
14
|
+
appType?: number;
|
|
15
|
+
deploymentType?: number;
|
|
16
|
+
isAppDetailView?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AppDetailsPayload {
|
|
19
|
+
appId?: number | string;
|
|
20
|
+
envId?: number | string;
|
|
21
|
+
installedAppId?: number | string;
|
|
22
|
+
artifactId?: number | string;
|
|
23
|
+
installedAppVersionHistoryId?: number | string;
|
|
24
|
+
}
|
|
25
|
+
export interface ExecutionDetailsPayload extends Partial<Pick<AppDetailsPayload, 'appId' | 'envId'>> {
|
|
26
|
+
imageScanDeployInfoId?: number | string;
|
|
27
|
+
artifactId?: number | string;
|
|
28
|
+
}
|
|
29
|
+
export declare const CATEGORIES: {
|
|
30
|
+
readonly IMAGE_SCAN: "imageScan";
|
|
31
|
+
readonly CODE_SCAN: "codeScan";
|
|
32
|
+
readonly KUBERNETES_MANIFEST: "kubernetesManifest";
|
|
33
|
+
};
|
|
34
|
+
export declare const SUB_CATEGORIES: {
|
|
35
|
+
readonly VULNERABILITIES: "vulnerability";
|
|
36
|
+
readonly LICENSE: "license";
|
|
37
|
+
readonly MISCONFIGURATIONS: "misConfigurations";
|
|
38
|
+
readonly EXPOSED_SECRETS: "exposedSecrets";
|
|
39
|
+
};
|
|
40
|
+
export declare enum SortOrderEnum {
|
|
41
|
+
'ASC' = 1,
|
|
42
|
+
'DESC' = -1
|
|
43
|
+
}
|
|
44
|
+
export type TableRowCellType = {
|
|
45
|
+
component: React.ReactNode | JSX.Element;
|
|
46
|
+
cellContent: string | object;
|
|
47
|
+
};
|
|
48
|
+
export type TableHeaderCellType = {
|
|
49
|
+
headerText: string;
|
|
50
|
+
isSortable: boolean;
|
|
51
|
+
width: number;
|
|
52
|
+
compareFunc?: (a: TableRowCellType['cellContent'], b: TableRowCellType['cellContent']) => number;
|
|
53
|
+
defaultSortOrder?: SortOrderEnum;
|
|
54
|
+
};
|
|
55
|
+
export interface TableRowType {
|
|
56
|
+
id: string | number;
|
|
57
|
+
cells: Array<TableRowCellType>;
|
|
58
|
+
expandableComponent: React.ReactNode | JSX.Element;
|
|
59
|
+
}
|
|
60
|
+
export interface TablePropsType {
|
|
61
|
+
headers: Array<TableHeaderCellType>;
|
|
62
|
+
rows: Array<TableRowType>;
|
|
63
|
+
defaultSortIndex?: number;
|
|
64
|
+
hasExpandableRows?: boolean;
|
|
65
|
+
headerTopPosition?: number;
|
|
66
|
+
}
|
|
67
|
+
export type TableSortStateType = {
|
|
68
|
+
index: number;
|
|
69
|
+
order: SortOrderEnum;
|
|
70
|
+
};
|
|
71
|
+
export interface InfoCardPropsType {
|
|
72
|
+
entities: SegmentedBarChartProps['entities'];
|
|
73
|
+
lastScanTimeString?: string;
|
|
74
|
+
scanToolId?: number;
|
|
75
|
+
}
|
|
76
|
+
export interface StatusType {
|
|
77
|
+
status: 'Completed' | 'Running' | 'Failed' | 'Progressing';
|
|
78
|
+
StartedOn: string;
|
|
79
|
+
scanToolName: 'TRIVY' | 'CLAIR';
|
|
80
|
+
}
|
|
81
|
+
export type DetailViewDataType = {
|
|
82
|
+
titlePrefix: string;
|
|
83
|
+
title: string;
|
|
84
|
+
status: StatusType['status'];
|
|
85
|
+
} & TablePropsType & InfoCardPropsType;
|
|
86
|
+
export type SecurityModalStateType = {
|
|
87
|
+
category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
|
|
88
|
+
subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
|
|
89
|
+
detailViewData: DetailViewDataType[];
|
|
90
|
+
};
|
|
91
|
+
export interface SidebarPropsType {
|
|
92
|
+
isHelmApp: boolean;
|
|
93
|
+
modalState: SecurityModalStateType;
|
|
94
|
+
setModalState: React.Dispatch<React.SetStateAction<SecurityModalStateType>>;
|
|
95
|
+
isExternalCI: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare enum SeveritiesDTO {
|
|
98
|
+
CRITICAL = "CRITICAL",
|
|
99
|
+
HIGH = "HIGH",
|
|
100
|
+
MEDIUM = "MEDIUM",
|
|
101
|
+
LOW = "LOW",
|
|
102
|
+
UNKNOWN = "UNKNOWN",
|
|
103
|
+
FAILURES = "fail",
|
|
104
|
+
SUCCESSES = "success",
|
|
105
|
+
EXCEPTIONS = "exceptions"
|
|
106
|
+
}
|
|
107
|
+
type Summary<T extends 'severities' | 'status'> = Record<T, Partial<Record<SeveritiesDTO, number>>>;
|
|
108
|
+
type GenericGroupType<T> = {
|
|
109
|
+
list: T[];
|
|
110
|
+
};
|
|
111
|
+
type GenericGroupTypeWithSummary<T> = {
|
|
112
|
+
summary: Summary<'severities'>;
|
|
113
|
+
} & GenericGroupType<T>;
|
|
114
|
+
type GenericGroupTypeWithMisConfSummary<T> = {
|
|
115
|
+
misConfSummary: Summary<'status'>;
|
|
116
|
+
} & GenericGroupType<T>;
|
|
117
|
+
export interface CodeScanVulnerabilityType {
|
|
118
|
+
cveId: string;
|
|
119
|
+
severity: SeveritiesDTO;
|
|
120
|
+
package: string;
|
|
121
|
+
currentVersion: string;
|
|
122
|
+
fixedInVersion: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ImageScanVulnerabilityType extends CodeScanVulnerabilityType {
|
|
125
|
+
target?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ImageScanVulnerabilityListType extends StatusType {
|
|
128
|
+
image: string;
|
|
129
|
+
summary: Summary<'severities'>;
|
|
130
|
+
list: ImageScanVulnerabilityType[];
|
|
131
|
+
}
|
|
132
|
+
export interface CodeScanLicenseType {
|
|
133
|
+
classification: string;
|
|
134
|
+
severity: string;
|
|
135
|
+
license: string;
|
|
136
|
+
package: string;
|
|
137
|
+
source: string;
|
|
138
|
+
}
|
|
139
|
+
export interface ImageScanLicenseListType extends StatusType {
|
|
140
|
+
image: string;
|
|
141
|
+
summary: Summary<'severities'>;
|
|
142
|
+
list: CodeScanLicenseType[];
|
|
143
|
+
}
|
|
144
|
+
export type ImageScan = {
|
|
145
|
+
[SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<ImageScanVulnerabilityListType>;
|
|
146
|
+
[SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<ImageScanLicenseListType>;
|
|
147
|
+
};
|
|
148
|
+
export interface Line {
|
|
149
|
+
number: number;
|
|
150
|
+
content: string;
|
|
151
|
+
isCause: boolean;
|
|
152
|
+
truncated: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface CauseMetadata {
|
|
155
|
+
startLine: number;
|
|
156
|
+
EndLine: number;
|
|
157
|
+
lines?: Line[];
|
|
158
|
+
}
|
|
159
|
+
export interface CodeScanMisconfigurationsDetailListType {
|
|
160
|
+
id: string;
|
|
161
|
+
title: string;
|
|
162
|
+
message: string;
|
|
163
|
+
resolution: string;
|
|
164
|
+
status: string;
|
|
165
|
+
severity: string;
|
|
166
|
+
causeMetadata: CauseMetadata;
|
|
167
|
+
}
|
|
168
|
+
export interface CodeScanMisconfigurationsListType {
|
|
169
|
+
filePath: string;
|
|
170
|
+
link: string;
|
|
171
|
+
type: string;
|
|
172
|
+
misConfSummary: Summary<'status'>;
|
|
173
|
+
summary: Summary<'severities'>;
|
|
174
|
+
list: CodeScanMisconfigurationsDetailListType[];
|
|
175
|
+
}
|
|
176
|
+
export interface CodeScanExposedSecretsDetailListType {
|
|
177
|
+
severity: string;
|
|
178
|
+
ruleId: string;
|
|
179
|
+
category: string;
|
|
180
|
+
startLine: number;
|
|
181
|
+
EndLine: number;
|
|
182
|
+
title: string;
|
|
183
|
+
lines: Line[];
|
|
184
|
+
}
|
|
185
|
+
export interface CodeScanExposedSecretsListType {
|
|
186
|
+
filePath: string;
|
|
187
|
+
link: string;
|
|
188
|
+
summary: Summary<'severities'>;
|
|
189
|
+
list: CodeScanExposedSecretsDetailListType[];
|
|
190
|
+
}
|
|
191
|
+
export type CodeScan = {
|
|
192
|
+
[SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<CodeScanVulnerabilityType>;
|
|
193
|
+
[SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<CodeScanLicenseType>;
|
|
194
|
+
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
|
195
|
+
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
|
196
|
+
} & StatusType;
|
|
197
|
+
export type KubernetesManifest = {
|
|
198
|
+
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
|
199
|
+
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
|
200
|
+
} & StatusType;
|
|
201
|
+
export type ApiResponseResultType = {
|
|
202
|
+
scanned: boolean;
|
|
203
|
+
[CATEGORIES.IMAGE_SCAN]: ImageScan;
|
|
204
|
+
[CATEGORIES.CODE_SCAN]: CodeScan;
|
|
205
|
+
[CATEGORIES.KUBERNETES_MANIFEST]: KubernetesManifest;
|
|
206
|
+
};
|
|
207
|
+
interface SecurityModalBaseProps extends Partial<Pick<SidebarPropsType, 'isExternalCI'>> {
|
|
208
|
+
isLoading: boolean;
|
|
209
|
+
error: ServerErrors;
|
|
210
|
+
responseData: ApiResponseResultType;
|
|
211
|
+
handleModalClose: (event?: React.MouseEvent<HTMLElement>) => void;
|
|
212
|
+
Sidebar: React.FC<SidebarPropsType>;
|
|
213
|
+
isHelmApp?: boolean;
|
|
214
|
+
isResourceScan?: boolean;
|
|
215
|
+
isSecurityScanV2Enabled: boolean;
|
|
216
|
+
}
|
|
217
|
+
export type SecurityModalPropsType = SecurityModalBaseProps;
|
|
218
|
+
export interface IndexedTextDisplayPropsType {
|
|
219
|
+
title: string;
|
|
220
|
+
lines: Line[];
|
|
221
|
+
link: string;
|
|
222
|
+
}
|
|
223
|
+
export type SidebarDataChildType = {
|
|
224
|
+
label: string;
|
|
225
|
+
value: {
|
|
226
|
+
category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
|
|
227
|
+
subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
export type SidebarDataType = {
|
|
231
|
+
label: string;
|
|
232
|
+
isExpanded: boolean;
|
|
233
|
+
children: NonNullable<SidebarDataChildType[]>;
|
|
234
|
+
hideInHelmApp?: boolean;
|
|
235
|
+
};
|
|
236
|
+
export type EmptyStateType = Pick<GenericEmptyStateType, 'image' | 'SvgImage' | 'subTitle' | 'title' | 'children'>;
|
|
237
|
+
export declare const VulnerabilityState: {
|
|
238
|
+
readonly [-1]: "Failed";
|
|
239
|
+
readonly 0: "Progressing";
|
|
240
|
+
readonly 1: "Completed";
|
|
241
|
+
};
|
|
242
|
+
export interface ImageVulnerabilityType {
|
|
243
|
+
image: string;
|
|
244
|
+
state: keyof typeof VulnerabilityState;
|
|
245
|
+
error?: string;
|
|
246
|
+
scanResult: LastExecutionResultType | null;
|
|
247
|
+
}
|
|
248
|
+
export interface VulnerabilityCountType {
|
|
249
|
+
unknownVulnerabilitiesCount: number;
|
|
250
|
+
lowVulnerabilitiesCount: number;
|
|
251
|
+
mediumVulnerabilitiesCount: number;
|
|
252
|
+
highVulnerabilitiesCount: number;
|
|
253
|
+
criticalVulnerabilitiesCount: number;
|
|
254
|
+
}
|
|
255
|
+
export interface GetResourceScanDetailsResponseType extends VulnerabilityCountType {
|
|
256
|
+
imageVulnerabilities: ImageVulnerabilityType[];
|
|
257
|
+
}
|
|
258
|
+
export interface OpenDetailViewButtonProps {
|
|
259
|
+
detailViewData: DetailViewDataType;
|
|
260
|
+
setDetailViewData: (detailViewData: DetailViewDataType) => void;
|
|
261
|
+
}
|
|
262
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ApiResponseResultType, SeveritiesDTO, GetResourceScanDetailsResponseType, ImageScanVulnerabilityType, ImageVulnerabilityType, VulnerabilityCountType } from './types';
|
|
2
|
+
import { SEVERITIES } from './constants';
|
|
3
|
+
export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
|
|
4
|
+
color: "#B1B7BC" | "#B21212" | "#F33E3E" | "#FF7E5B" | "#FFB549" | "#1DAD70";
|
|
5
|
+
label: "Critical" | "High" | "Medium" | "Low" | "Unknown" | "Failures" | "Successes" | "Exceptions";
|
|
6
|
+
value: number;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const stringifySeverities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => string;
|
|
9
|
+
export declare const getSeverityWeight: (severity: SeveritiesDTO) => number;
|
|
10
|
+
export declare const compareSeverity: (a: SeveritiesDTO, b: SeveritiesDTO) => number;
|
|
11
|
+
export declare const getSecurityScanSeveritiesCount: (data: ApiResponseResultType) => {
|
|
12
|
+
critical: number;
|
|
13
|
+
high: number;
|
|
14
|
+
medium: number;
|
|
15
|
+
low: number;
|
|
16
|
+
unknown: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const compareSeverities: (a: Record<SeveritiesDTO, number>, b: Record<SeveritiesDTO, number>) => number;
|
|
19
|
+
export declare const getScanCompletedEmptyState: (scanToolId: number) => {
|
|
20
|
+
SvgImage: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
|
21
|
+
title: string;
|
|
22
|
+
children: JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
export declare const compareStringAndObject: (a: string | object, b: string | object) => number;
|
|
25
|
+
export declare const parseExecutionDetailResponse: (scanResult: any) => ApiResponseResultType;
|
|
26
|
+
export declare const parseGetResourceScanDetailsResponse: (data: GetResourceScanDetailsResponseType) => ApiResponseResultType;
|
|
27
|
+
export declare const getTotalVulnerabilityCount: (scannedResult: ImageVulnerabilityType[]) => VulnerabilityCountType;
|
|
28
|
+
export declare const groupByTarget: (list: ImageScanVulnerabilityType[]) => {
|
|
29
|
+
source: string;
|
|
30
|
+
list: ImageScanVulnerabilityType[];
|
|
31
|
+
summary: {
|
|
32
|
+
severities: Partial<Record<SeveritiesDTO, number>>;
|
|
33
|
+
};
|
|
34
|
+
}[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SecuritySummaryCardProps } from './types';
|
|
2
|
+
declare const SecuritySummaryCard: ({ severityCount, scanToolId, rootClassName, isHelmApp, SecurityModalSidebar, responseData, isSecurityScanV2Enabled, }: SecuritySummaryCardProps) => JSX.Element;
|
|
3
|
+
export default SecuritySummaryCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SecuritySummaryCard } from './SecuritySummaryCard';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SeverityCount } from '../../../types';
|
|
2
|
+
import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types';
|
|
3
|
+
import { ApiResponseResultType } from '../SecurityModal';
|
|
4
|
+
export type SecuritySummaryCardProps = {
|
|
5
|
+
severityCount: SeverityCount;
|
|
6
|
+
scanToolId: number;
|
|
7
|
+
rootClassName?: string;
|
|
8
|
+
isHelmApp?: boolean;
|
|
9
|
+
isSecurityScanV2Enabled: boolean;
|
|
10
|
+
responseData: ApiResponseResultType;
|
|
11
|
+
} & Pick<ImageCardAccordionProps, 'SecurityModalSidebar'>;
|
package/dist/Shared/Components/{Vulnerabilities → Security/Vulnerabilities}/Vulnerabilities.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { VulnerabilitiesProps } from './types';
|
|
2
|
-
declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, }: VulnerabilitiesProps) => JSX.Element;
|
|
2
|
+
declare const Vulnerabilities: ({ isScanned, isScanEnabled, artifactId, applicationId, environmentId, setVulnerabilityCount, SecurityModalSidebar, getSecurityScan, }: VulnerabilitiesProps) => JSX.Element;
|
|
3
3
|
export default Vulnerabilities;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LastExecutionResponseType } from '
|
|
1
|
+
import { LastExecutionResponseType } from '../../../types';
|
|
2
2
|
export declare function getLastExecutionByArtifactAppEnv(artifactId: string | number, appId: number | string, envId: number | string): Promise<LastExecutionResponseType>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ResponseType } from '../../../../Common/Types';
|
|
2
|
+
import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types';
|
|
3
|
+
import { MaterialSecurityInfoType } from '../../../types';
|
|
4
|
+
import { ApiResponseResultType } from '../SecurityModal';
|
|
5
|
+
import { getLastExecutionByArtifactAppEnv } from './service';
|
|
6
|
+
export interface VulnerabilitiesProps extends MaterialSecurityInfoType, Pick<ImageCardAccordionProps, 'SecurityModalSidebar' | 'getSecurityScan'> {
|
|
7
|
+
artifactId: number;
|
|
8
|
+
applicationId: number;
|
|
9
|
+
environmentId: number;
|
|
10
|
+
setVulnerabilityCount: React.Dispatch<React.SetStateAction<number>>;
|
|
11
|
+
}
|
|
12
|
+
export interface UseGetSecurityVulnerabilitiesProps extends Pick<ImageCardAccordionProps, 'getSecurityScan'> {
|
|
13
|
+
artifactId: string;
|
|
14
|
+
appId: string;
|
|
15
|
+
envId: string;
|
|
16
|
+
isScanned: boolean;
|
|
17
|
+
isScanEnabled: boolean;
|
|
18
|
+
isScanV2Enabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface UseGetSecurityVulnerabilitiesReturnType {
|
|
21
|
+
scanDetailsLoading: boolean;
|
|
22
|
+
scanResultResponse: ResponseType<ApiResponseResultType>;
|
|
23
|
+
executionDetailsResponse: Awaited<ReturnType<typeof getLastExecutionByArtifactAppEnv>>;
|
|
24
|
+
scanDetailsError: any;
|
|
25
|
+
reloadScanDetails: () => void;
|
|
26
|
+
}
|