@kopexa/grc 0.0.2
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/LICENSE +201 -0
- package/dist/asset/index.d.mts +2 -0
- package/dist/asset/index.d.ts +2 -0
- package/dist/asset/index.js +19 -0
- package/dist/asset/index.mjs +1 -0
- package/dist/chunk-7754RETD.mjs +57 -0
- package/dist/chunk-B47KDUYY.mjs +26 -0
- package/dist/chunk-BFZPRJQT.mjs +1 -0
- package/dist/chunk-GF3WJZVI.mjs +141 -0
- package/dist/chunk-GFABGXAO.mjs +1 -0
- package/dist/chunk-KNGEZZFI.mjs +157 -0
- package/dist/chunk-TICWEZUI.mjs +1 -0
- package/dist/chunk-TW3S4OE2.mjs +251 -0
- package/dist/common/compliance/compliance-badge.d.mts +33 -0
- package/dist/common/compliance/compliance-badge.d.ts +33 -0
- package/dist/common/compliance/compliance-badge.js +103 -0
- package/dist/common/compliance/compliance-badge.mjs +13 -0
- package/dist/common/compliance/index.d.mts +2 -0
- package/dist/common/compliance/index.d.ts +2 -0
- package/dist/common/compliance/index.js +104 -0
- package/dist/common/compliance/index.mjs +13 -0
- package/dist/common/compliance/messages.d.mts +20 -0
- package/dist/common/compliance/messages.d.ts +20 -0
- package/dist/common/compliance/messages.js +49 -0
- package/dist/common/compliance/messages.mjs +7 -0
- package/dist/common/impact/impact-card.d.mts +35 -0
- package/dist/common/impact/impact-card.d.ts +35 -0
- package/dist/common/impact/impact-card.js +551 -0
- package/dist/common/impact/impact-card.mjs +10 -0
- package/dist/common/impact/index.d.mts +5 -0
- package/dist/common/impact/index.d.ts +5 -0
- package/dist/common/impact/index.js +564 -0
- package/dist/common/impact/index.mjs +24 -0
- package/dist/common/impact/messages.d.mts +128 -0
- package/dist/common/impact/messages.d.ts +128 -0
- package/dist/common/impact/messages.js +164 -0
- package/dist/common/impact/messages.mjs +7 -0
- package/dist/common/impact/scales.d.mts +46 -0
- package/dist/common/impact/scales.d.ts +46 -0
- package/dist/common/impact/scales.js +319 -0
- package/dist/common/impact/scales.mjs +16 -0
- package/dist/common/index.d.mts +6 -0
- package/dist/common/index.d.ts +6 -0
- package/dist/common/index.js +640 -0
- package/dist/common/index.mjs +35 -0
- package/dist/control/index.d.mts +2 -0
- package/dist/control/index.d.ts +2 -0
- package/dist/control/index.js +19 -0
- package/dist/control/index.mjs +1 -0
- package/dist/incident/index.d.mts +2 -0
- package/dist/incident/index.d.ts +2 -0
- package/dist/incident/index.js +19 -0
- package/dist/incident/index.mjs +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +640 -0
- package/dist/index.mjs +35 -0
- package/dist/risk/index.d.mts +2 -0
- package/dist/risk/index.d.ts +2 -0
- package/dist/risk/index.js +19 -0
- package/dist/risk/index.mjs +1 -0
- package/dist/vendor/index.d.mts +2 -0
- package/dist/vendor/index.d.ts +2 -0
- package/dist/vendor/index.js +19 -0
- package/dist/vendor/index.mjs +1 -0
- package/package.json +66 -0
- package/src/asset/index.ts +4 -0
- package/src/common/compliance/compliance-badge.tsx +110 -0
- package/src/common/compliance/index.ts +8 -0
- package/src/common/compliance/messages.ts +20 -0
- package/src/common/impact/impact-card.tsx +367 -0
- package/src/common/impact/index.ts +14 -0
- package/src/common/impact/messages.ts +141 -0
- package/src/common/impact/scales.ts +191 -0
- package/src/common/index.ts +4 -0
- package/src/control/index.ts +4 -0
- package/src/incident/index.ts +4 -0
- package/src/index.ts +20 -0
- package/src/risk/index.ts +4 -0
- package/src/vendor/index.ts +4 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { defineMessages } from "@kopexa/i18n";
|
|
2
|
+
|
|
3
|
+
export const messages = defineMessages({
|
|
4
|
+
// Card titles
|
|
5
|
+
title_cia: {
|
|
6
|
+
id: "grc.impact.title_cia",
|
|
7
|
+
defaultMessage: "CIA Impact",
|
|
8
|
+
},
|
|
9
|
+
title_ciaa: {
|
|
10
|
+
id: "grc.impact.title_ciaa",
|
|
11
|
+
defaultMessage: "CIAA Impact",
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
// Dimensions
|
|
15
|
+
confidentiality: {
|
|
16
|
+
id: "grc.impact.confidentiality",
|
|
17
|
+
defaultMessage: "Confidentiality",
|
|
18
|
+
},
|
|
19
|
+
integrity: {
|
|
20
|
+
id: "grc.impact.integrity",
|
|
21
|
+
defaultMessage: "Integrity",
|
|
22
|
+
},
|
|
23
|
+
availability: {
|
|
24
|
+
id: "grc.impact.availability",
|
|
25
|
+
defaultMessage: "Availability",
|
|
26
|
+
},
|
|
27
|
+
authenticity: {
|
|
28
|
+
id: "grc.impact.authenticity",
|
|
29
|
+
defaultMessage: "Authenticity",
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// Justification
|
|
33
|
+
justification: {
|
|
34
|
+
id: "grc.impact.justification",
|
|
35
|
+
defaultMessage: "Justification",
|
|
36
|
+
},
|
|
37
|
+
justification_hint: {
|
|
38
|
+
id: "grc.impact.justification_hint",
|
|
39
|
+
defaultMessage: "(highest impact: {level})",
|
|
40
|
+
},
|
|
41
|
+
justification_placeholder: {
|
|
42
|
+
id: "grc.impact.justification_placeholder",
|
|
43
|
+
defaultMessage: "Enter justification for the chosen impact values...",
|
|
44
|
+
},
|
|
45
|
+
no_justification: {
|
|
46
|
+
id: "grc.impact.no_justification",
|
|
47
|
+
defaultMessage: "No justification provided",
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// Actions
|
|
51
|
+
edit: {
|
|
52
|
+
id: "grc.impact.edit",
|
|
53
|
+
defaultMessage: "Edit",
|
|
54
|
+
},
|
|
55
|
+
cancel: {
|
|
56
|
+
id: "grc.impact.cancel",
|
|
57
|
+
defaultMessage: "Cancel",
|
|
58
|
+
},
|
|
59
|
+
save: {
|
|
60
|
+
id: "grc.impact.save",
|
|
61
|
+
defaultMessage: "Save",
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// Risk Scale (default)
|
|
65
|
+
risk_0: {
|
|
66
|
+
id: "grc.impact.scale.risk.0",
|
|
67
|
+
defaultMessage: "Not rated",
|
|
68
|
+
},
|
|
69
|
+
risk_1: {
|
|
70
|
+
id: "grc.impact.scale.risk.1",
|
|
71
|
+
defaultMessage: "Negligible",
|
|
72
|
+
},
|
|
73
|
+
risk_2: {
|
|
74
|
+
id: "grc.impact.scale.risk.2",
|
|
75
|
+
defaultMessage: "Low",
|
|
76
|
+
},
|
|
77
|
+
risk_3: {
|
|
78
|
+
id: "grc.impact.scale.risk.3",
|
|
79
|
+
defaultMessage: "Medium",
|
|
80
|
+
},
|
|
81
|
+
risk_4: {
|
|
82
|
+
id: "grc.impact.scale.risk.4",
|
|
83
|
+
defaultMessage: "High",
|
|
84
|
+
},
|
|
85
|
+
risk_5: {
|
|
86
|
+
id: "grc.impact.scale.risk.5",
|
|
87
|
+
defaultMessage: "Critical",
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// Process Scale
|
|
91
|
+
process_0: {
|
|
92
|
+
id: "grc.impact.scale.process.0",
|
|
93
|
+
defaultMessage: "Not rated",
|
|
94
|
+
},
|
|
95
|
+
process_1: {
|
|
96
|
+
id: "grc.impact.scale.process.1",
|
|
97
|
+
defaultMessage: "Insignificant",
|
|
98
|
+
},
|
|
99
|
+
process_2: {
|
|
100
|
+
id: "grc.impact.scale.process.2",
|
|
101
|
+
defaultMessage: "Low",
|
|
102
|
+
},
|
|
103
|
+
process_3: {
|
|
104
|
+
id: "grc.impact.scale.process.3",
|
|
105
|
+
defaultMessage: "Relevant",
|
|
106
|
+
},
|
|
107
|
+
process_4: {
|
|
108
|
+
id: "grc.impact.scale.process.4",
|
|
109
|
+
defaultMessage: "Important",
|
|
110
|
+
},
|
|
111
|
+
process_5: {
|
|
112
|
+
id: "grc.impact.scale.process.5",
|
|
113
|
+
defaultMessage: "Vital",
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
// Asset Scale
|
|
117
|
+
asset_0: {
|
|
118
|
+
id: "grc.impact.scale.asset.0",
|
|
119
|
+
defaultMessage: "Not classified",
|
|
120
|
+
},
|
|
121
|
+
asset_1: {
|
|
122
|
+
id: "grc.impact.scale.asset.1",
|
|
123
|
+
defaultMessage: "Insignificant",
|
|
124
|
+
},
|
|
125
|
+
asset_2: {
|
|
126
|
+
id: "grc.impact.scale.asset.2",
|
|
127
|
+
defaultMessage: "Low",
|
|
128
|
+
},
|
|
129
|
+
asset_3: {
|
|
130
|
+
id: "grc.impact.scale.asset.3",
|
|
131
|
+
defaultMessage: "Medium",
|
|
132
|
+
},
|
|
133
|
+
asset_4: {
|
|
134
|
+
id: "grc.impact.scale.asset.4",
|
|
135
|
+
defaultMessage: "High",
|
|
136
|
+
},
|
|
137
|
+
asset_5: {
|
|
138
|
+
id: "grc.impact.scale.asset.5",
|
|
139
|
+
defaultMessage: "Business Critical",
|
|
140
|
+
},
|
|
141
|
+
});
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Impact Level Scale Configuration
|
|
3
|
+
*
|
|
4
|
+
* Different contexts (Risk vs Process vs Asset) use different terminology:
|
|
5
|
+
* - Risk: Negligible → Critical
|
|
6
|
+
* - Process: Insignificant → Vital
|
|
7
|
+
* - Asset: Insignificant → Business Critical
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { MessageDescriptor } from "react-intl";
|
|
11
|
+
import { messages } from "./messages";
|
|
12
|
+
|
|
13
|
+
/** Impact level 0-5 as per schema */
|
|
14
|
+
export type ImpactLevel = 0 | 1 | 2 | 3 | 4 | 5;
|
|
15
|
+
|
|
16
|
+
export interface ImpactLevelConfig {
|
|
17
|
+
/** i18n message descriptor for the label */
|
|
18
|
+
message: MessageDescriptor;
|
|
19
|
+
/** Fallback label (used when no IntlProvider) */
|
|
20
|
+
fallbackLabel: string;
|
|
21
|
+
color: string;
|
|
22
|
+
bgColor: string;
|
|
23
|
+
barColor: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ImpactScaleConfig = Record<ImpactLevel, ImpactLevelConfig>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Risk Scale (default) - Used for Risk assessments
|
|
30
|
+
* Not rated → Negligible → Low → Medium → High → Critical
|
|
31
|
+
*/
|
|
32
|
+
export const riskScale: ImpactScaleConfig = {
|
|
33
|
+
0: {
|
|
34
|
+
message: messages.risk_0,
|
|
35
|
+
fallbackLabel: "Not rated",
|
|
36
|
+
color: "text-muted-foreground",
|
|
37
|
+
bgColor: "bg-muted",
|
|
38
|
+
barColor: "bg-muted",
|
|
39
|
+
},
|
|
40
|
+
1: {
|
|
41
|
+
message: messages.risk_1,
|
|
42
|
+
fallbackLabel: "Negligible",
|
|
43
|
+
color: "text-green-700",
|
|
44
|
+
bgColor: "bg-green-100",
|
|
45
|
+
barColor: "bg-green-500",
|
|
46
|
+
},
|
|
47
|
+
2: {
|
|
48
|
+
message: messages.risk_2,
|
|
49
|
+
fallbackLabel: "Low",
|
|
50
|
+
color: "text-lime-700",
|
|
51
|
+
bgColor: "bg-lime-100",
|
|
52
|
+
barColor: "bg-lime-500",
|
|
53
|
+
},
|
|
54
|
+
3: {
|
|
55
|
+
message: messages.risk_3,
|
|
56
|
+
fallbackLabel: "Medium",
|
|
57
|
+
color: "text-yellow-700",
|
|
58
|
+
bgColor: "bg-yellow-100",
|
|
59
|
+
barColor: "bg-yellow-500",
|
|
60
|
+
},
|
|
61
|
+
4: {
|
|
62
|
+
message: messages.risk_4,
|
|
63
|
+
fallbackLabel: "High",
|
|
64
|
+
color: "text-orange-700",
|
|
65
|
+
bgColor: "bg-orange-100",
|
|
66
|
+
barColor: "bg-orange-500",
|
|
67
|
+
},
|
|
68
|
+
5: {
|
|
69
|
+
message: messages.risk_5,
|
|
70
|
+
fallbackLabel: "Critical",
|
|
71
|
+
color: "text-red-700",
|
|
72
|
+
bgColor: "bg-red-100",
|
|
73
|
+
barColor: "bg-red-500",
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Process Scale - Used for Business Process classifications
|
|
79
|
+
* Not rated → Insignificant → Low → Relevant → Important → Vital
|
|
80
|
+
*/
|
|
81
|
+
export const processScale: ImpactScaleConfig = {
|
|
82
|
+
0: {
|
|
83
|
+
message: messages.process_0,
|
|
84
|
+
fallbackLabel: "Not rated",
|
|
85
|
+
color: "text-muted-foreground",
|
|
86
|
+
bgColor: "bg-muted",
|
|
87
|
+
barColor: "bg-muted",
|
|
88
|
+
},
|
|
89
|
+
1: {
|
|
90
|
+
message: messages.process_1,
|
|
91
|
+
fallbackLabel: "Insignificant",
|
|
92
|
+
color: "text-green-700",
|
|
93
|
+
bgColor: "bg-green-100",
|
|
94
|
+
barColor: "bg-green-500",
|
|
95
|
+
},
|
|
96
|
+
2: {
|
|
97
|
+
message: messages.process_2,
|
|
98
|
+
fallbackLabel: "Low",
|
|
99
|
+
color: "text-lime-700",
|
|
100
|
+
bgColor: "bg-lime-100",
|
|
101
|
+
barColor: "bg-lime-500",
|
|
102
|
+
},
|
|
103
|
+
3: {
|
|
104
|
+
message: messages.process_3,
|
|
105
|
+
fallbackLabel: "Relevant",
|
|
106
|
+
color: "text-yellow-700",
|
|
107
|
+
bgColor: "bg-yellow-100",
|
|
108
|
+
barColor: "bg-yellow-500",
|
|
109
|
+
},
|
|
110
|
+
4: {
|
|
111
|
+
message: messages.process_4,
|
|
112
|
+
fallbackLabel: "Important",
|
|
113
|
+
color: "text-orange-700",
|
|
114
|
+
bgColor: "bg-orange-100",
|
|
115
|
+
barColor: "bg-orange-500",
|
|
116
|
+
},
|
|
117
|
+
5: {
|
|
118
|
+
message: messages.process_5,
|
|
119
|
+
fallbackLabel: "Vital",
|
|
120
|
+
color: "text-red-700",
|
|
121
|
+
bgColor: "bg-red-100",
|
|
122
|
+
barColor: "bg-red-500",
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Asset Scale - Used for Asset criticality
|
|
128
|
+
* Not classified → Insignificant → Low → Medium → High → Business Critical
|
|
129
|
+
*/
|
|
130
|
+
export const assetScale: ImpactScaleConfig = {
|
|
131
|
+
0: {
|
|
132
|
+
message: messages.asset_0,
|
|
133
|
+
fallbackLabel: "Not classified",
|
|
134
|
+
color: "text-muted-foreground",
|
|
135
|
+
bgColor: "bg-muted",
|
|
136
|
+
barColor: "bg-muted",
|
|
137
|
+
},
|
|
138
|
+
1: {
|
|
139
|
+
message: messages.asset_1,
|
|
140
|
+
fallbackLabel: "Insignificant",
|
|
141
|
+
color: "text-green-700",
|
|
142
|
+
bgColor: "bg-green-100",
|
|
143
|
+
barColor: "bg-green-500",
|
|
144
|
+
},
|
|
145
|
+
2: {
|
|
146
|
+
message: messages.asset_2,
|
|
147
|
+
fallbackLabel: "Low",
|
|
148
|
+
color: "text-lime-700",
|
|
149
|
+
bgColor: "bg-lime-100",
|
|
150
|
+
barColor: "bg-lime-500",
|
|
151
|
+
},
|
|
152
|
+
3: {
|
|
153
|
+
message: messages.asset_3,
|
|
154
|
+
fallbackLabel: "Medium",
|
|
155
|
+
color: "text-yellow-700",
|
|
156
|
+
bgColor: "bg-yellow-100",
|
|
157
|
+
barColor: "bg-yellow-500",
|
|
158
|
+
},
|
|
159
|
+
4: {
|
|
160
|
+
message: messages.asset_4,
|
|
161
|
+
fallbackLabel: "High",
|
|
162
|
+
color: "text-orange-700",
|
|
163
|
+
bgColor: "bg-orange-100",
|
|
164
|
+
barColor: "bg-orange-500",
|
|
165
|
+
},
|
|
166
|
+
5: {
|
|
167
|
+
message: messages.asset_5,
|
|
168
|
+
fallbackLabel: "Business Critical",
|
|
169
|
+
color: "text-red-700",
|
|
170
|
+
bgColor: "bg-red-100",
|
|
171
|
+
barColor: "bg-red-500",
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** Available impact levels for iteration */
|
|
176
|
+
export const impactLevels: ImpactLevel[] = [0, 1, 2, 3, 4, 5];
|
|
177
|
+
|
|
178
|
+
/** Preset scale types */
|
|
179
|
+
export type ImpactScalePreset = "risk" | "process" | "asset";
|
|
180
|
+
|
|
181
|
+
/** Get scale by preset name */
|
|
182
|
+
export function getScale(preset: ImpactScalePreset): ImpactScaleConfig {
|
|
183
|
+
switch (preset) {
|
|
184
|
+
case "process":
|
|
185
|
+
return processScale;
|
|
186
|
+
case "asset":
|
|
187
|
+
return assetScale;
|
|
188
|
+
default:
|
|
189
|
+
return riskScale;
|
|
190
|
+
}
|
|
191
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @kopexa/grc - GRC (Governance, Risk, Compliance) Components
|
|
3
|
+
*
|
|
4
|
+
* This package provides reusable components for building GRC applications.
|
|
5
|
+
*
|
|
6
|
+
* Domains:
|
|
7
|
+
* - common: Shared components (CIA Driver, etc.)
|
|
8
|
+
* - risk: Risk management components
|
|
9
|
+
* - vendor: Vendor/Third-party management
|
|
10
|
+
* - control: Control management
|
|
11
|
+
* - asset: Asset management
|
|
12
|
+
* - incident: Incident management
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// Common components
|
|
16
|
+
export * from "./common";
|
|
17
|
+
|
|
18
|
+
// Domain-specific components (re-export for convenience)
|
|
19
|
+
// These can also be imported directly from their subpaths:
|
|
20
|
+
// import { ... } from "@kopexa/grc/risk"
|