@devtron-labs/devtron-fe-common-lib 0.3.5-beta-2 → 0.3.5-beta-3
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/Constants.d.ts +2 -0
- package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
- package/dist/Common/CustomInput/Types.d.ts +1 -1
- package/dist/Common/DeleteComponentModal/types.d.ts +1 -4
- package/dist/Common/Helper.d.ts +6 -0
- 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 +1 -0
- 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/Sidebar.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 +4 -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 +4 -0
- package/dist/Shared/Components/Security/SecurityModal/service.d.ts +5 -0
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +269 -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 +16 -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 +25 -0
- package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +13 -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/Hooks/index.d.ts +0 -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-uwn3xArb.js → cssMode-C2DbOm5G.js} +1 -1
- package/dist/{freemarker2-CaMhuqPe.js → freemarker2-DIAXDvZh.js} +1 -1
- package/dist/{handlebars-CTnClFcN.js → handlebars-BNSBHLYi.js} +1 -1
- package/dist/{html-dSNw58aO.js → html-BYhqChCC.js} +1 -1
- package/dist/{htmlMode-YCmi4Oec.js → htmlMode-Yi80fKa_.js} +1 -1
- package/dist/{index-CQ_tnSZb.js → index-B_5eS34k.js} +34557 -32957
- package/dist/index.js +336 -328
- package/dist/{javascript-BOjyNMQb.js → javascript-qbJFaknq.js} +1 -1
- package/dist/{jsonMode-Wch8DjET.js → jsonMode-BIO3_Bhv.js} +1 -1
- package/dist/{liquid-yOyHP9Wm.js → liquid-BhQxjMmC.js} +1 -1
- package/dist/{mdx-CkdjZgHK.js → mdx-BcxpAgOj.js} +1 -1
- package/dist/{python-CuKcH7j4.js → python-lNzFF1gZ.js} +1 -1
- package/dist/{razor-CMkeVh_3.js → razor-Bt-aSObe.js} +1 -1
- package/dist/{tsMode-C6w4n8l9.js → tsMode-Dp7Djl6H.js} +1 -1
- package/dist/{typescript-isK37BH_.js → typescript-VVpDVimM.js} +1 -1
- package/dist/{xml-BlWNjX_p.js → xml-w67VngZW.js} +1 -1
- package/dist/{yaml-BFN6QLOY.js → yaml-DLRfXLkQ.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/Shared/Hooks/useForm/index.d.ts +0 -2
- package/dist/Shared/Hooks/useForm/useForm.d.ts +0 -71
- package/dist/Shared/Hooks/useForm/useForm.types.d.ts +0 -69
- package/dist/Shared/Hooks/useForm/useForm.utils.d.ts +0 -10
|
@@ -85,6 +85,8 @@ export declare const ROUTES: {
|
|
|
85
85
|
PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
|
|
86
86
|
PLUGIN_GLOBAL_LIST_V2: string;
|
|
87
87
|
PLUGIN_GLOBAL_LIST_TAGS: string;
|
|
88
|
+
K8S_RESOURCE_SECURITY: string;
|
|
89
|
+
SCAN_RESULT: string;
|
|
88
90
|
PLUGIN_LIST_MIN: string;
|
|
89
91
|
DEPLOYMENT_CHARTS_LIST: string;
|
|
90
92
|
USER_LIST_MIN: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CustomInputProps } from './Types';
|
|
2
|
-
export declare const CustomInput: ({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText,
|
|
2
|
+
export declare const CustomInput: ({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText, handleOnBlur, readOnly, noTrim, onKeyPress, defaultValue, onKeyDown, required, additionalErrorInfo, inputWrapClassName, inputProps, }: CustomInputProps) => JSX.Element;
|
|
@@ -17,7 +17,7 @@ export interface CustomInputProps {
|
|
|
17
17
|
rootClassName?: string;
|
|
18
18
|
error?: string[] | string;
|
|
19
19
|
helperText?: ReactNode;
|
|
20
|
-
|
|
20
|
+
handleOnBlur?: (e: any) => void;
|
|
21
21
|
readOnly?: boolean;
|
|
22
22
|
noTrim?: boolean;
|
|
23
23
|
onKeyPress?: (e: any) => void;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export interface DeleteComponentProps {
|
|
2
|
-
|
|
3
|
-
* @deprecated - Delete component internally handles loading for the `Delete Button`.
|
|
4
|
-
*/
|
|
5
|
-
setDeleting?: (boolean: any) => void;
|
|
2
|
+
setDeleting: (boolean: any) => void;
|
|
6
3
|
toggleConfirmation: any;
|
|
7
4
|
deleteComponent: (any: any) => Promise<any>;
|
|
8
5
|
title: string;
|
package/dist/Common/Helper.d.ts
CHANGED
|
@@ -22,6 +22,12 @@ export declare const refresh: () => void;
|
|
|
22
22
|
export declare const reportIssue: () => void;
|
|
23
23
|
export declare function useEffectAfterMount(cb: any, dependencies: any): void;
|
|
24
24
|
export declare function getCookie(sKey: any): string;
|
|
25
|
+
export declare function useForm(stateSchema: any, validationSchema: {}, callback: any): {
|
|
26
|
+
state: any;
|
|
27
|
+
disable: boolean;
|
|
28
|
+
handleOnChange: (event: any) => void;
|
|
29
|
+
handleOnSubmit: (event: any) => void;
|
|
30
|
+
};
|
|
25
31
|
export declare function handleUTCTime(ts: string, isRelativeTime?: boolean): string;
|
|
26
32
|
export declare function useSearchString(): UseSearchString;
|
|
27
33
|
export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) => void;
|
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, isScanV2Enabled, }: ImageCardAccordionProps) => JSX.Element;
|
|
3
3
|
export default ImageCardAccordion;
|
|
@@ -9,6 +9,7 @@ export interface ImageCardAccordionProps extends MaterialSecurityInfoType {
|
|
|
9
9
|
changesCard: ReactNode;
|
|
10
10
|
isScanned: boolean;
|
|
11
11
|
isScanEnabled: boolean;
|
|
12
|
+
isScanV2Enabled: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface SecurityDetailsType {
|
|
14
15
|
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,5 @@
|
|
|
1
|
+
import { ResponseType } from '../../../../Common/Types';
|
|
2
|
+
import { ApiResponseResultType, GetResourceScanDetailsPayloadType, SecurityModalPropsType } from './types';
|
|
3
|
+
export declare const getExecutionDetails: (executionDetailPayload: SecurityModalPropsType["executionDetailsPayload"]) => Promise<ResponseType<ApiResponseResultType>>;
|
|
4
|
+
export declare const getResourceScanDetails: ({ name, namespace, clusterId, group, version, kind, appId, appType, deploymentType, isAppDetailView, }: GetResourceScanDetailsPayloadType) => Promise<ResponseType<ApiResponseResultType>>;
|
|
5
|
+
export declare const getSecurityScan: ({ appId, envId, installedAppId, artifactId, installedAppVersionHistoryId, }: SecurityModalPropsType["appDetailsPayload"]) => Promise<ResponseType<ApiResponseResultType>>;
|
|
@@ -0,0 +1,269 @@
|
|
|
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
|
+
export interface GetResourceScanDetailsPayloadType {
|
|
6
|
+
name: string;
|
|
7
|
+
namespace: string;
|
|
8
|
+
group: string;
|
|
9
|
+
version: string;
|
|
10
|
+
kind: Nodes | NodeType;
|
|
11
|
+
clusterId: number;
|
|
12
|
+
appId?: string;
|
|
13
|
+
appType?: number;
|
|
14
|
+
deploymentType?: number;
|
|
15
|
+
isAppDetailView?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface SecurityModalBaseProps {
|
|
18
|
+
handleModalClose: (event?: React.MouseEvent<HTMLElement>) => void;
|
|
19
|
+
isExternalCI?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AppDetailsPayload {
|
|
22
|
+
appId?: number | string;
|
|
23
|
+
envId?: number | string;
|
|
24
|
+
installedAppId?: number | string;
|
|
25
|
+
artifactId?: number | string;
|
|
26
|
+
installedAppVersionHistoryId?: number | string;
|
|
27
|
+
}
|
|
28
|
+
export interface ExecutionDetailsPayload extends Partial<Pick<AppDetailsPayload, 'appId' | 'envId'>> {
|
|
29
|
+
imageScanDeployInfoId?: number | string;
|
|
30
|
+
artifactId?: number | string;
|
|
31
|
+
}
|
|
32
|
+
interface SecurityModalAppDetailsPropsType {
|
|
33
|
+
appDetailsPayload: AppDetailsPayload;
|
|
34
|
+
resourceScanPayload?: never;
|
|
35
|
+
executionDetailsPayload?: never;
|
|
36
|
+
}
|
|
37
|
+
interface SecurityModalResourceScanPropsType {
|
|
38
|
+
appDetailsPayload?: never;
|
|
39
|
+
resourceScanPayload: GetResourceScanDetailsPayloadType;
|
|
40
|
+
executionDetailsPayload?: never;
|
|
41
|
+
}
|
|
42
|
+
interface SecurityModalExecutionDetailsPropsType {
|
|
43
|
+
appDetailsPayload?: never;
|
|
44
|
+
resourceScanPayload?: never;
|
|
45
|
+
executionDetailsPayload: ExecutionDetailsPayload;
|
|
46
|
+
}
|
|
47
|
+
export type SecurityModalPropsType = SecurityModalBaseProps & (SecurityModalAppDetailsPropsType | SecurityModalResourceScanPropsType | SecurityModalExecutionDetailsPropsType);
|
|
48
|
+
export declare const CATEGORIES: {
|
|
49
|
+
readonly IMAGE_SCAN: "imageScan";
|
|
50
|
+
readonly CODE_SCAN: "codeScan";
|
|
51
|
+
readonly KUBERNETES_MANIFEST: "kubernetesManifest";
|
|
52
|
+
};
|
|
53
|
+
export declare const SUB_CATEGORIES: {
|
|
54
|
+
readonly VULNERABILITIES: "vulnerability";
|
|
55
|
+
readonly LICENSE: "license";
|
|
56
|
+
readonly MISCONFIGURATIONS: "misConfigurations";
|
|
57
|
+
readonly EXPOSED_SECRETS: "exposedSecrets";
|
|
58
|
+
};
|
|
59
|
+
export declare enum SortOrderEnum {
|
|
60
|
+
'ASC' = 1,
|
|
61
|
+
'DESC' = -1
|
|
62
|
+
}
|
|
63
|
+
export type TableRowCellType = {
|
|
64
|
+
component: React.ReactNode | JSX.Element;
|
|
65
|
+
cellContent: string | object;
|
|
66
|
+
};
|
|
67
|
+
export type TableHeaderCellType = {
|
|
68
|
+
headerText: string;
|
|
69
|
+
isSortable: boolean;
|
|
70
|
+
width: number;
|
|
71
|
+
compareFunc?: (a: TableRowCellType['cellContent'], b: TableRowCellType['cellContent']) => number;
|
|
72
|
+
defaultSortOrder?: SortOrderEnum;
|
|
73
|
+
};
|
|
74
|
+
export interface TableRowType {
|
|
75
|
+
id: string | number;
|
|
76
|
+
cells: Array<TableRowCellType>;
|
|
77
|
+
expandableComponent: React.ReactNode | JSX.Element;
|
|
78
|
+
}
|
|
79
|
+
export interface TablePropsType {
|
|
80
|
+
headers: Array<TableHeaderCellType>;
|
|
81
|
+
rows: Array<TableRowType>;
|
|
82
|
+
defaultSortIndex?: number;
|
|
83
|
+
hasExpandableRows?: boolean;
|
|
84
|
+
headerTopPosition?: number;
|
|
85
|
+
}
|
|
86
|
+
export type TableSortStateType = {
|
|
87
|
+
index: number;
|
|
88
|
+
order: SortOrderEnum;
|
|
89
|
+
};
|
|
90
|
+
export interface InfoCardPropsType {
|
|
91
|
+
entities: SegmentedBarChartProps['entities'];
|
|
92
|
+
lastScanTimeString?: string;
|
|
93
|
+
scanToolId?: number;
|
|
94
|
+
}
|
|
95
|
+
export interface StatusType {
|
|
96
|
+
status: 'Completed' | 'Running' | 'Failed' | 'Progressing';
|
|
97
|
+
StartedOn: string;
|
|
98
|
+
scanToolName: 'TRIVY' | 'CLAIR';
|
|
99
|
+
}
|
|
100
|
+
export type DetailViewDataType = {
|
|
101
|
+
titlePrefix: string;
|
|
102
|
+
title: string;
|
|
103
|
+
status: StatusType['status'];
|
|
104
|
+
} & TablePropsType & InfoCardPropsType;
|
|
105
|
+
export type SecurityModalStateType = {
|
|
106
|
+
category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
|
|
107
|
+
subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
|
|
108
|
+
detailViewData: DetailViewDataType[];
|
|
109
|
+
};
|
|
110
|
+
export interface SidebarPropsType extends Pick<SecurityModalBaseProps, 'isExternalCI'> {
|
|
111
|
+
isHelmApp: boolean;
|
|
112
|
+
modalState: SecurityModalStateType;
|
|
113
|
+
setModalState: React.Dispatch<React.SetStateAction<SecurityModalStateType>>;
|
|
114
|
+
}
|
|
115
|
+
export declare enum SeveritiesDTO {
|
|
116
|
+
CRITICAL = "CRITICAL",
|
|
117
|
+
HIGH = "HIGH",
|
|
118
|
+
MEDIUM = "MEDIUM",
|
|
119
|
+
LOW = "LOW",
|
|
120
|
+
UNKNOWN = "UNKNOWN",
|
|
121
|
+
FAILURES = "fail",
|
|
122
|
+
SUCCESSES = "success",
|
|
123
|
+
EXCEPTIONS = "exceptions"
|
|
124
|
+
}
|
|
125
|
+
type Summary<T extends 'severities' | 'status'> = Record<T, Partial<Record<SeveritiesDTO, number>>>;
|
|
126
|
+
type GenericGroupType<T> = {
|
|
127
|
+
list: T[];
|
|
128
|
+
};
|
|
129
|
+
type GenericGroupTypeWithSummary<T> = {
|
|
130
|
+
summary: Summary<'severities'>;
|
|
131
|
+
} & GenericGroupType<T>;
|
|
132
|
+
type GenericGroupTypeWithMisConfSummary<T> = {
|
|
133
|
+
misConfSummary: Summary<'status'>;
|
|
134
|
+
} & GenericGroupType<T>;
|
|
135
|
+
export interface CodeScanVulnerabilityType {
|
|
136
|
+
cveId: string;
|
|
137
|
+
severity: SeveritiesDTO;
|
|
138
|
+
package: string;
|
|
139
|
+
currentVersion: string;
|
|
140
|
+
fixedInVersion: string;
|
|
141
|
+
}
|
|
142
|
+
export interface ImageScanVulnerabilityType extends CodeScanVulnerabilityType {
|
|
143
|
+
target?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface ImageScanVulnerabilityListType extends StatusType {
|
|
146
|
+
image: string;
|
|
147
|
+
summary: Summary<'severities'>;
|
|
148
|
+
list: ImageScanVulnerabilityType[];
|
|
149
|
+
}
|
|
150
|
+
export interface CodeScanLicenseType {
|
|
151
|
+
classification: string;
|
|
152
|
+
severity: string;
|
|
153
|
+
license: string;
|
|
154
|
+
package: string;
|
|
155
|
+
source: string;
|
|
156
|
+
}
|
|
157
|
+
export interface ImageScanLicenseListType extends StatusType {
|
|
158
|
+
image: string;
|
|
159
|
+
summary: Summary<'severities'>;
|
|
160
|
+
list: CodeScanLicenseType[];
|
|
161
|
+
}
|
|
162
|
+
export type ImageScan = {
|
|
163
|
+
[SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<ImageScanVulnerabilityListType>;
|
|
164
|
+
[SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<ImageScanLicenseListType>;
|
|
165
|
+
};
|
|
166
|
+
export interface Line {
|
|
167
|
+
number: number;
|
|
168
|
+
content: string;
|
|
169
|
+
isCause: boolean;
|
|
170
|
+
truncated: boolean;
|
|
171
|
+
}
|
|
172
|
+
export interface CauseMetadata {
|
|
173
|
+
startLine: number;
|
|
174
|
+
EndLine: number;
|
|
175
|
+
lines?: Line[];
|
|
176
|
+
}
|
|
177
|
+
export interface CodeScanMisconfigurationsDetailListType {
|
|
178
|
+
id: string;
|
|
179
|
+
title: string;
|
|
180
|
+
message: string;
|
|
181
|
+
resolution: string;
|
|
182
|
+
status: string;
|
|
183
|
+
severity: string;
|
|
184
|
+
causeMetadata: CauseMetadata;
|
|
185
|
+
}
|
|
186
|
+
export interface CodeScanMisconfigurationsListType {
|
|
187
|
+
filePath: string;
|
|
188
|
+
link: string;
|
|
189
|
+
type: string;
|
|
190
|
+
misConfSummary: Summary<'status'>;
|
|
191
|
+
summary: Summary<'severities'>;
|
|
192
|
+
list: CodeScanMisconfigurationsDetailListType[];
|
|
193
|
+
}
|
|
194
|
+
export interface CodeScanExposedSecretsDetailListType {
|
|
195
|
+
severity: string;
|
|
196
|
+
ruleId: string;
|
|
197
|
+
category: string;
|
|
198
|
+
startLine: number;
|
|
199
|
+
EndLine: number;
|
|
200
|
+
title: string;
|
|
201
|
+
lines: Line[];
|
|
202
|
+
}
|
|
203
|
+
export interface CodeScanExposedSecretsListType {
|
|
204
|
+
filePath: string;
|
|
205
|
+
link: string;
|
|
206
|
+
summary: Summary<'severities'>;
|
|
207
|
+
list: CodeScanExposedSecretsDetailListType[];
|
|
208
|
+
}
|
|
209
|
+
export type CodeScan = {
|
|
210
|
+
[SUB_CATEGORIES.VULNERABILITIES]: GenericGroupTypeWithSummary<CodeScanVulnerabilityType>;
|
|
211
|
+
[SUB_CATEGORIES.LICENSE]: GenericGroupTypeWithSummary<CodeScanLicenseType>;
|
|
212
|
+
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
|
213
|
+
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
|
214
|
+
} & StatusType;
|
|
215
|
+
export type KubernetesManifest = {
|
|
216
|
+
[SUB_CATEGORIES.MISCONFIGURATIONS]: GenericGroupTypeWithMisConfSummary<CodeScanMisconfigurationsListType>;
|
|
217
|
+
[SUB_CATEGORIES.EXPOSED_SECRETS]: GenericGroupTypeWithSummary<CodeScanExposedSecretsListType>;
|
|
218
|
+
} & StatusType;
|
|
219
|
+
export type ApiResponseResultType = {
|
|
220
|
+
scanned: boolean;
|
|
221
|
+
[CATEGORIES.IMAGE_SCAN]: ImageScan;
|
|
222
|
+
[CATEGORIES.CODE_SCAN]: CodeScan;
|
|
223
|
+
[CATEGORIES.KUBERNETES_MANIFEST]: KubernetesManifest;
|
|
224
|
+
};
|
|
225
|
+
export interface IndexedTextDisplayPropsType {
|
|
226
|
+
title: string;
|
|
227
|
+
lines: Line[];
|
|
228
|
+
link: string;
|
|
229
|
+
}
|
|
230
|
+
export type SidebarDataChildType = {
|
|
231
|
+
label: string;
|
|
232
|
+
value: {
|
|
233
|
+
category: (typeof CATEGORIES)[keyof typeof CATEGORIES];
|
|
234
|
+
subCategory: (typeof SUB_CATEGORIES)[keyof typeof SUB_CATEGORIES];
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
export type SidebarDataType = {
|
|
238
|
+
label: string;
|
|
239
|
+
isExpanded: boolean;
|
|
240
|
+
children: NonNullable<SidebarDataChildType[]>;
|
|
241
|
+
hideInHelmApp?: boolean;
|
|
242
|
+
};
|
|
243
|
+
export type EmptyStateType = Pick<GenericEmptyStateType, 'image' | 'SvgImage' | 'subTitle' | 'title' | 'children'>;
|
|
244
|
+
export declare const VulnerabilityState: {
|
|
245
|
+
readonly [-1]: "Failed";
|
|
246
|
+
readonly 0: "Progressing";
|
|
247
|
+
readonly 1: "Completed";
|
|
248
|
+
};
|
|
249
|
+
export interface ImageVulnerabilityType {
|
|
250
|
+
image: string;
|
|
251
|
+
state: keyof typeof VulnerabilityState;
|
|
252
|
+
error?: string;
|
|
253
|
+
scanResult: LastExecutionResultType | null;
|
|
254
|
+
}
|
|
255
|
+
export interface VulnerabilityCountType {
|
|
256
|
+
unknownVulnerabilitiesCount: number;
|
|
257
|
+
lowVulnerabilitiesCount: number;
|
|
258
|
+
mediumVulnerabilitiesCount: number;
|
|
259
|
+
highVulnerabilitiesCount: number;
|
|
260
|
+
criticalVulnerabilitiesCount: number;
|
|
261
|
+
}
|
|
262
|
+
export interface GetResourceScanDetailsResponseType extends VulnerabilityCountType {
|
|
263
|
+
imageVulnerabilities: ImageVulnerabilityType[];
|
|
264
|
+
}
|
|
265
|
+
export interface OpenDetailViewButtonProps {
|
|
266
|
+
detailViewData: DetailViewDataType;
|
|
267
|
+
setDetailViewData: (detailViewData: DetailViewDataType) => void;
|
|
268
|
+
}
|
|
269
|
+
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 @@
|
|
|
1
|
+
export { default as SecuritySummaryCard } from './SecuritySummaryCard';
|