-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathtypes.ts
More file actions
183 lines (164 loc) · 3.72 KB
/
Copy pathtypes.ts
File metadata and controls
183 lines (164 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
export const SECURITY_MAP_SCHEMA_VERSION = "1.0.0";
export type NodeType =
| "asset"
| "component"
| "attack-surface"
| "threat"
| "control"
| "response"
| "guidance"
| "incident";
export type EdgeType =
| "contains"
| "depends-on"
| "exposes"
| "targets"
| "mitigates"
| "protects"
| "detects"
| "responds-to"
| "documented-by"
| "demonstrated-by"
| "evaluated-by"
| "related-to";
export type MapStatus = "proposed" | "reviewed" | "deprecated";
export type ControlClass =
| "preventive"
| "detective"
| "corrective"
| "recovery"
| "governance";
export type Severity = "contextual" | "low" | "medium" | "high" | "critical";
export type AssessmentState =
| "not-assessed"
| "not-applicable"
| "missing"
| "planned"
| "partially-implemented"
| "implemented"
| "verified";
export interface EvidenceSource {
url: string;
title: string;
publisher: string;
}
export interface LossRecord {
currency: string;
amount?: number;
amountMin?: number;
amountMax?: number;
asOf: string;
uncertainty: string;
source: string;
}
export interface SecurityMapNode {
id: string;
type: NodeType;
title: string;
summary: string;
domains: string[];
status: MapStatus;
tags: string[];
roles?: string[];
lifecycle?: string[];
controlClass?: ControlClass;
assessmentEligible?: boolean;
severity?: Severity;
severityBasis?: string;
href?: string;
aliases?: string[];
framework?: string;
sources?: EvidenceSource[];
deprecatedBy?: string;
date?: string;
datePrecision?: "day" | "month" | "year" | "range";
dateEnd?: string;
loss?: LossRecord;
}
export interface SecurityMapEdge {
id: string;
source: string;
target: string;
type: EdgeType;
rationale?: string;
status: MapStatus;
sources?: EvidenceSource[];
}
export interface TaxonomyTerm {
id: string;
title: string;
summary?: string;
prefix?: string;
direction?: string;
}
export interface SecurityMapView {
id: string;
title: string;
summary: string;
kind?: "overview" | "entry";
focusNodeId?: string;
domain?: string;
visibleTypes?: NodeType[];
entryNodeIds?: string[];
}
export interface SecurityMapGraph {
schemaVersion: string;
title: string;
license: string;
sourceRepository: string;
nodes: SecurityMapNode[];
edges: SecurityMapEdge[];
taxonomies: {
domains: TaxonomyTerm[];
roles: TaxonomyTerm[];
lifecycle: TaxonomyTerm[];
nodeTypes: TaxonomyTerm[];
edgeTypes: TaxonomyTerm[];
controlClasses: TaxonomyTerm[];
severities: TaxonomyTerm[];
statuses: TaxonomyTerm[];
};
views: SecurityMapView[];
}
export const ASSESSMENT_STATES: AssessmentState[] = [
"not-assessed",
"not-applicable",
"missing",
"planned",
"partially-implemented",
"implemented",
"verified",
];
export const ASSESSMENT_STATE_LABELS: Record<AssessmentState, string> = {
"not-assessed": "Not assessed",
"not-applicable": "Not applicable",
missing: "Missing",
planned: "Planned",
"partially-implemented": "Partially implemented",
implemented: "Implemented",
verified: "Verified",
};
export const NODE_TYPE_LABELS: Record<NodeType, string> = {
asset: "Asset",
component: "Component",
"attack-surface": "Attack surface",
threat: "Threat",
control: "Control",
response: "Response",
guidance: "Guidance",
incident: "Incident",
};
export const EDGE_TYPE_LABELS: Record<EdgeType, string> = {
contains: "contains",
"depends-on": "depends on",
exposes: "exposes",
targets: "targets",
mitigates: "mitigates",
protects: "protects",
detects: "detects",
"responds-to": "responds to",
"documented-by": "documented by",
"demonstrated-by": "demonstrated by",
"evaluated-by": "evaluated by",
"related-to": "related to",
};