-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.d.ts
209 lines (187 loc) · 4.84 KB
/
index.d.ts
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
declare module 'stig-manager-client-modules';
interface ApiCollectionBasic {
collectionId: string;
name: string;
}
interface ApiCollectionStig {
benchmarkId: string;
revisionStr: string;
benchmarkDate: string;
revisionPinned: boolean;
ruleCount: number;
}
interface ApiAsset {
assetId?: string;
name: string;
fqdn: string;
description: string;
ip: string;
mac: string;
noncomputing: boolean;
metadata: Object;
collection: ApiCollectionBasic;
labelIds: string[];
stigs: ApiCollectionStig[] | string[];
}
interface ApiStig {
benchmarkId: string;
revisionStr: string;
version: string;
release: string;
benchmarkDate: string;
status: string;
statusDate: string;
ruleCount: string;
collectionIds: string[];
}
interface ParsedTarget {
description: string;
fqdn: string;
ip: string;
mac: string;
metadata: Object;
name: string;
noncomputing: boolean;
}
interface ResultEngine {
checkContent?: ResultEngineCheckContent;
overrides?: ResultEngineOverride[]
product: string;
time?: string /* date-time */;
type: ResultEngineType;
version?: string
}
type ReviewResult = 'pass' | 'fail' | 'notapplicable' | 'notchecked' | 'unknown' | 'error' | 'notselected' | 'informational' | 'fixed';
type ReviewStatus = 'saved' | 'submitted' | 'accepted' | 'rejected' | null;
type ResultEngineType = 'scap' | 'script' | 'other';
interface ResultEngineCheckContent {
component: string;
location: string;
}
interface ResultEngineOverride {
authority: string;
newResult: ReviewResult;
oldResult: ReviewResult;
remark?: string;
time?: string /* date-time */;
}
interface ParsedReview {
comment: string;
detail: string;
result: ReviewResult;
resultEngine: ResultEngine | null;
ruleId: string;
status: ReviewStatus;
}
interface ParsedChecklistStats {
error: number;
fail: number;
fixed: number;
informational: number;
notapplicable: number;
notchecked: number;
noselected: number;
pass: number;
unknown: number;
}
interface ParsedChecklist {
benchmarkId: string;
reviews: ParsedReview[];
revisionStr: string;
stats: ParsedChecklistStats;
sourceRef: any;
}
interface ParseResult {
target: ParsedTarget;
errors?: string[]; // only used in the ckl parser
checklists: ParsedChecklist[];
sourceRef: any;
}
interface TaskObjectOptions {
createObjects: boolean;
collectionId: string;
strictRevisionCheck: boolean;
[key: string]: any;
}
interface TaskObjectParseResult extends ParseResult {
file: string;
}
interface TaskObjectParams {
apiAssets: ApiAsset[],
apiStigs: ApiStig[],
parsedResults: TaskObjectParseResult[],
options: TaskObjectOptions
}
interface TaskAssetChecklist extends ParsedChecklist {
newAssignment: boolean;
ignored?: boolean;
}
interface TaskAssetValue {
assetProps: ApiAsset;
checklists: Map<string, TaskAssetChecklist[]>;
checklistsIgnored: TaskAssetChecklist[];
hasNewAssignment: boolean;
knownAsset: boolean;
newAssignments: string[];
sourceRefs: any[];
}
interface TaskObjectError {
message: string;
target: ParsedTarget;
sourceRef: any;
}
declare class TaskObject {
constructor (options: TaskObjectParams);
apiAssets: ApiAsset[];
apiStigs: ApiStig[];
#assetNameMap: Map<string, ApiAsset>;
#benchmarkIdMap: Map<string, string[]>;
#cklHostnameMap: Map<string, ApiAsset[]>;
errors: TaskObjectError[];
parsedResults: TaskObjectParseResult[];
sourceRefs: any[];
taskAssets: Map<string, TaskAssetValue>;
}
type AutoStatus = 'null' | 'saved' | 'submitted' | 'accepted';
type Unreviewed = 'commented' | 'never' | 'always';
type UnreviewedCommented = 'informational' | 'notchecked';
type EmptyCommentDetailType = 'replace' | 'ignore' | 'import';
type RequiredType = 'always' | 'findings' | 'optional';
type EnabledType = 'always' | 'findings';
interface FieldOptions {
enabled: EnabledType;
required: RequiredType;
};
interface FieldSettings {
detail: FieldOptions;
comment: FieldOptions;
}
interface ImportOptions {
autoStatus: AutoStatus;
unreviewed: Unreviewed;
unreviewedCommented: UnreviewedCommented;
emptyDetail: EmptyCommentDetailType;
emptyComment: EmptyCommentDetailType;
allowCustom: boolean;
}
interface ParserParams {
data: string;
fieldSettings: FieldSettings;
allowAccept: boolean;
importOptions: ImportOptions;
sourceRef: any;
}
interface ImportOptions {
autoStatus: AutoStatus;
unreviewed: Unreviewed;
unreviewedCommented: UnreviewedCommented;
emptyDetail: EmptyCommentDetailType;
emptyComment: EmptyCommentDetailType;
allowCustom: boolean;
}
interface ScapBenchmarkMap {
[key: string]: string;
}
interface ParserXccdfParams extends ParserParams{
scapBenchmarkMap: ScapBenchmarkMap;
}