@intellectual-frontiers/grc 0.0.0-stage → 0.1.0
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 +21 -0
- package/README.md +8 -2
- package/dist/assess.d.ts +247 -0
- package/dist/assess.js +289 -0
- package/dist/attest.d.ts +164 -0
- package/dist/attest.js +213 -0
- package/dist/evidence.d.ts +212 -0
- package/dist/evidence.js +453 -0
- package/dist/grc.d.ts +356 -0
- package/dist/grc.js +487 -0
- package/dist/host/grc.d.ts +159 -0
- package/dist/host/grc.js +358 -0
- package/dist/host/mod.d.ts +14 -0
- package/dist/host/mod.js +15 -0
- package/dist/host/sign.d.ts +141 -0
- package/dist/host/sign.js +282 -0
- package/dist/mod.d.ts +19 -0
- package/dist/mod.js +20 -0
- package/dist/ocsf-types.auto.d.ts +4374 -0
- package/dist/ocsf-types.auto.js +24 -0
- package/dist/ocsf.d.ts +160 -0
- package/dist/ocsf.js +257 -0
- package/dist/oscal.d.ts +356 -0
- package/dist/oscal.js +513 -0
- package/package.json +87 -4
- package/src/assess.ts +472 -0
- package/src/attest.ts +354 -0
- package/src/evidence.ts +551 -0
- package/src/grc.ts +771 -0
- package/src/host/grc.ts +435 -0
- package/src/host/mod.ts +15 -0
- package/src/host/sign.ts +364 -0
- package/src/mod.ts +20 -0
- package/src/ocsf-types.auto.ts +4680 -0
- package/src/ocsf.ts +471 -0
- package/src/oscal.ts +850 -0
package/dist/oscal.d.ts
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { type Risk } from "./assess.js";
|
|
2
|
+
import { type Assessment, type ControlRef, type ControlSummary, type Instant } from "./grc.js";
|
|
3
|
+
import { type Uuid } from "@intellectual-frontiers/crypto/uuid";
|
|
4
|
+
/** The OSCAL version written. */
|
|
5
|
+
export declare const OSCAL_VERSION = "1.2.3";
|
|
6
|
+
/** NIST SP 800-30 Rev. 1, the system a risk's likelihood, impact and level facets are named in. */
|
|
7
|
+
export declare const SP800_30 = "https://doi.org/10.6028/NIST.SP.800-30r1";
|
|
8
|
+
/** The `identifier-type` of a system id that is a UUID. */
|
|
9
|
+
export declare const RFC4122 = "https://ietf.org/rfc/rfc4122";
|
|
10
|
+
/** An OSCAL property: a name, a value, and the namespace the name is defined in where it is not OSCAL's. */
|
|
11
|
+
export type OscalProp = {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly ns?: string;
|
|
15
|
+
};
|
|
16
|
+
/** An OSCAL party: the organization a document is by. */
|
|
17
|
+
export type OscalParty = {
|
|
18
|
+
readonly uuid: Uuid;
|
|
19
|
+
readonly type: "organization" | "person";
|
|
20
|
+
readonly name: string;
|
|
21
|
+
};
|
|
22
|
+
/** An OSCAL document's metadata. */
|
|
23
|
+
export type OscalMetadata = {
|
|
24
|
+
readonly title: string;
|
|
25
|
+
readonly "last-modified": Instant;
|
|
26
|
+
readonly version: string;
|
|
27
|
+
readonly "oscal-version": typeof OSCAL_VERSION;
|
|
28
|
+
readonly parties?: readonly OscalParty[];
|
|
29
|
+
};
|
|
30
|
+
/** A back-matter resource. */
|
|
31
|
+
export type OscalResource = {
|
|
32
|
+
readonly uuid: Uuid;
|
|
33
|
+
readonly title: string;
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
readonly props?: readonly OscalProp[];
|
|
36
|
+
readonly rlinks?: readonly {
|
|
37
|
+
readonly href: string;
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
/** A document's back matter. */
|
|
41
|
+
export type OscalBackMatter = {
|
|
42
|
+
readonly resources: readonly OscalResource[];
|
|
43
|
+
};
|
|
44
|
+
/** An inventory item: a subject of an assessment. */
|
|
45
|
+
export type OscalInventoryItem = {
|
|
46
|
+
readonly uuid: Uuid;
|
|
47
|
+
readonly description: string;
|
|
48
|
+
readonly props: readonly OscalProp[];
|
|
49
|
+
};
|
|
50
|
+
/** A reference from an observation to the subject it observed. */
|
|
51
|
+
export type OscalSubjectReference = {
|
|
52
|
+
readonly "subject-uuid": Uuid;
|
|
53
|
+
readonly type: "inventory-item";
|
|
54
|
+
readonly title: string;
|
|
55
|
+
};
|
|
56
|
+
/** Evidence an observation relied on, here the SHA-256 of a piece of evidence. */
|
|
57
|
+
export type OscalRelevantEvidence = {
|
|
58
|
+
readonly description: string;
|
|
59
|
+
readonly props: readonly OscalProp[];
|
|
60
|
+
};
|
|
61
|
+
/** An observation: one finding of one control on one subject. */
|
|
62
|
+
export type OscalObservation = {
|
|
63
|
+
readonly uuid: Uuid;
|
|
64
|
+
readonly title: string;
|
|
65
|
+
readonly description: string;
|
|
66
|
+
readonly props: readonly OscalProp[];
|
|
67
|
+
readonly methods: readonly ("EXAMINE" | "INTERVIEW" | "TEST" | "UNKNOWN")[];
|
|
68
|
+
readonly types: readonly string[];
|
|
69
|
+
readonly subjects: readonly OscalSubjectReference[];
|
|
70
|
+
readonly "relevant-evidence"?: readonly OscalRelevantEvidence[];
|
|
71
|
+
readonly collected: Instant;
|
|
72
|
+
readonly remarks?: string;
|
|
73
|
+
};
|
|
74
|
+
/** The status of an OSCAL finding's target. */
|
|
75
|
+
export type OscalTargetStatus = {
|
|
76
|
+
readonly state: "satisfied" | "not-satisfied";
|
|
77
|
+
readonly reason?: "pass" | "fail" | "other";
|
|
78
|
+
};
|
|
79
|
+
/** An OSCAL finding: what the observations say of one control. */
|
|
80
|
+
export type OscalFinding = {
|
|
81
|
+
readonly uuid: Uuid;
|
|
82
|
+
readonly title: string;
|
|
83
|
+
readonly description: string;
|
|
84
|
+
readonly props: readonly OscalProp[];
|
|
85
|
+
readonly target: {
|
|
86
|
+
readonly type: "objective-id";
|
|
87
|
+
readonly "target-id": string;
|
|
88
|
+
readonly status: OscalTargetStatus;
|
|
89
|
+
};
|
|
90
|
+
readonly "related-observations"?: readonly {
|
|
91
|
+
readonly "observation-uuid": Uuid;
|
|
92
|
+
}[];
|
|
93
|
+
};
|
|
94
|
+
/** The controls a result reviewed. */
|
|
95
|
+
export type OscalReviewedControls = {
|
|
96
|
+
readonly "control-selections": readonly ({
|
|
97
|
+
readonly "include-controls": readonly {
|
|
98
|
+
readonly "control-id": string;
|
|
99
|
+
}[];
|
|
100
|
+
} | {
|
|
101
|
+
readonly "include-all": Readonly<Record<string, never>>;
|
|
102
|
+
})[];
|
|
103
|
+
};
|
|
104
|
+
/** One result of an assessment. */
|
|
105
|
+
export type OscalResult = {
|
|
106
|
+
readonly uuid: Uuid;
|
|
107
|
+
readonly title: string;
|
|
108
|
+
readonly description: string;
|
|
109
|
+
readonly start: Instant;
|
|
110
|
+
readonly "local-definitions"?: {
|
|
111
|
+
readonly "inventory-items": readonly OscalInventoryItem[];
|
|
112
|
+
};
|
|
113
|
+
readonly "reviewed-controls": OscalReviewedControls;
|
|
114
|
+
readonly observations?: readonly OscalObservation[];
|
|
115
|
+
readonly findings?: readonly OscalFinding[];
|
|
116
|
+
};
|
|
117
|
+
/** An OSCAL assessment-results document. */
|
|
118
|
+
export type OscalAssessmentResults = {
|
|
119
|
+
readonly "assessment-results": {
|
|
120
|
+
readonly uuid: Uuid;
|
|
121
|
+
readonly metadata: OscalMetadata;
|
|
122
|
+
readonly "import-ap": {
|
|
123
|
+
readonly href: string;
|
|
124
|
+
};
|
|
125
|
+
readonly results: readonly OscalResult[];
|
|
126
|
+
readonly "back-matter"?: OscalBackMatter;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
/** The status of an OSCAL risk. */
|
|
130
|
+
export type OscalRiskStatus = "open" | "investigating" | "remediating" | "deviation-requested" | "deviation-approved" | "closed";
|
|
131
|
+
/** A characterization of a risk: who made it, and its facets. */
|
|
132
|
+
export type OscalCharacterization = {
|
|
133
|
+
readonly origin: {
|
|
134
|
+
readonly actors: readonly {
|
|
135
|
+
readonly type: "party";
|
|
136
|
+
readonly "actor-uuid": Uuid;
|
|
137
|
+
}[];
|
|
138
|
+
};
|
|
139
|
+
readonly facets: readonly {
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly system: string;
|
|
142
|
+
readonly value: string;
|
|
143
|
+
}[];
|
|
144
|
+
};
|
|
145
|
+
/** An OSCAL risk. */
|
|
146
|
+
export type OscalRisk = {
|
|
147
|
+
readonly uuid: Uuid;
|
|
148
|
+
readonly title: string;
|
|
149
|
+
readonly description: string;
|
|
150
|
+
readonly statement: string;
|
|
151
|
+
readonly props?: readonly OscalProp[];
|
|
152
|
+
readonly status: OscalRiskStatus;
|
|
153
|
+
readonly characterizations?: readonly OscalCharacterization[];
|
|
154
|
+
readonly "related-observations"?: readonly {
|
|
155
|
+
readonly "observation-uuid": Uuid;
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
/** An item of a plan of action and milestones. */
|
|
159
|
+
export type OscalPoamItem = {
|
|
160
|
+
readonly uuid: Uuid;
|
|
161
|
+
readonly title: string;
|
|
162
|
+
readonly description: string;
|
|
163
|
+
readonly props?: readonly OscalProp[];
|
|
164
|
+
readonly "related-observations"?: readonly {
|
|
165
|
+
readonly "observation-uuid": Uuid;
|
|
166
|
+
}[];
|
|
167
|
+
readonly "related-risks": readonly {
|
|
168
|
+
readonly "risk-uuid": Uuid;
|
|
169
|
+
}[];
|
|
170
|
+
};
|
|
171
|
+
/** An OSCAL plan-of-action-and-milestones document. */
|
|
172
|
+
export type OscalPoam = {
|
|
173
|
+
readonly "plan-of-action-and-milestones": {
|
|
174
|
+
readonly uuid: Uuid;
|
|
175
|
+
readonly metadata: OscalMetadata;
|
|
176
|
+
readonly "local-definitions"?: {
|
|
177
|
+
readonly "inventory-items": readonly OscalInventoryItem[];
|
|
178
|
+
};
|
|
179
|
+
readonly observations?: readonly OscalObservation[];
|
|
180
|
+
readonly risks?: readonly OscalRisk[];
|
|
181
|
+
readonly "poam-items": readonly OscalPoamItem[];
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
/** A catalog control a component implements, and how. */
|
|
185
|
+
export type OscalImplementedRequirement = {
|
|
186
|
+
readonly uuid: Uuid;
|
|
187
|
+
readonly "control-id": string;
|
|
188
|
+
readonly description: string;
|
|
189
|
+
readonly props: readonly OscalProp[];
|
|
190
|
+
};
|
|
191
|
+
/** A component's implementation of the controls of one catalog. */
|
|
192
|
+
export type OscalControlImplementation = {
|
|
193
|
+
readonly uuid: Uuid;
|
|
194
|
+
readonly source: string;
|
|
195
|
+
readonly description: string;
|
|
196
|
+
readonly "implemented-requirements": readonly OscalImplementedRequirement[];
|
|
197
|
+
};
|
|
198
|
+
/** The types of a defined component (OSCAL 1.2.3 `defined-component/type`; 1.2 added `region`, `zone`, `resource-container` and `network`). */
|
|
199
|
+
export declare const OSCAL_COMPONENT_TYPES: readonly ["interconnection", "software", "hardware", "service", "policy", "physical", "process-procedure", "plan", "guidance", "standard", "validation", "region", "zone", "resource-container", "network"];
|
|
200
|
+
/** The type of a component. */
|
|
201
|
+
export type OscalComponentType = (typeof OSCAL_COMPONENT_TYPES)[number];
|
|
202
|
+
/** A component of a component definition. */
|
|
203
|
+
export type OscalDefinedComponent = {
|
|
204
|
+
readonly uuid: Uuid;
|
|
205
|
+
readonly type: OscalComponentType;
|
|
206
|
+
readonly title: string;
|
|
207
|
+
readonly description: string;
|
|
208
|
+
readonly props?: readonly OscalProp[];
|
|
209
|
+
readonly "control-implementations"?: readonly OscalControlImplementation[];
|
|
210
|
+
};
|
|
211
|
+
/** An OSCAL component-definition document. */
|
|
212
|
+
export type OscalComponentDefinition = {
|
|
213
|
+
readonly "component-definition": {
|
|
214
|
+
readonly uuid: Uuid;
|
|
215
|
+
readonly metadata: OscalMetadata;
|
|
216
|
+
readonly components: readonly OscalDefinedComponent[];
|
|
217
|
+
readonly "back-matter"?: OscalBackMatter;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
/** How far a control is implemented. */
|
|
221
|
+
export type OscalImplementationState = "implemented" | "partial" | "planned" | "alternative" | "not-applicable";
|
|
222
|
+
/** An SSP's statement of one catalog control. */
|
|
223
|
+
export type OscalSspRequirement = {
|
|
224
|
+
readonly uuid: Uuid;
|
|
225
|
+
readonly "control-id": string;
|
|
226
|
+
readonly props: readonly OscalProp[];
|
|
227
|
+
readonly "by-components": readonly {
|
|
228
|
+
readonly "component-uuid": Uuid;
|
|
229
|
+
readonly uuid: Uuid;
|
|
230
|
+
readonly description: string;
|
|
231
|
+
readonly "implementation-status": {
|
|
232
|
+
readonly state: OscalImplementationState;
|
|
233
|
+
};
|
|
234
|
+
}[];
|
|
235
|
+
};
|
|
236
|
+
/** An OSCAL system-security-plan document, minimal: the system, its users and components, and how far each control is implemented. */
|
|
237
|
+
export type OscalSsp = {
|
|
238
|
+
readonly "system-security-plan": {
|
|
239
|
+
readonly uuid: Uuid;
|
|
240
|
+
readonly metadata: OscalMetadata;
|
|
241
|
+
readonly "import-profile": {
|
|
242
|
+
readonly href: string;
|
|
243
|
+
};
|
|
244
|
+
readonly "system-characteristics": {
|
|
245
|
+
readonly "system-ids": readonly {
|
|
246
|
+
readonly "identifier-type": string;
|
|
247
|
+
readonly id: string;
|
|
248
|
+
}[];
|
|
249
|
+
readonly "system-name": string;
|
|
250
|
+
readonly description: string;
|
|
251
|
+
readonly "system-information": {
|
|
252
|
+
readonly "information-types": readonly {
|
|
253
|
+
readonly uuid: Uuid;
|
|
254
|
+
readonly title: string;
|
|
255
|
+
readonly description: string;
|
|
256
|
+
}[];
|
|
257
|
+
};
|
|
258
|
+
readonly status: {
|
|
259
|
+
readonly state: "operational" | "under-development" | "under-major-modification" | "disposition" | "other";
|
|
260
|
+
};
|
|
261
|
+
readonly "authorization-boundary": {
|
|
262
|
+
readonly description: string;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
readonly "system-implementation": {
|
|
266
|
+
readonly users: readonly {
|
|
267
|
+
readonly uuid: Uuid;
|
|
268
|
+
readonly title: string;
|
|
269
|
+
}[];
|
|
270
|
+
readonly components: readonly {
|
|
271
|
+
readonly uuid: Uuid;
|
|
272
|
+
readonly type: "this-system";
|
|
273
|
+
readonly title: string;
|
|
274
|
+
readonly description: string;
|
|
275
|
+
readonly status: {
|
|
276
|
+
readonly state: "operational";
|
|
277
|
+
};
|
|
278
|
+
}[];
|
|
279
|
+
readonly "inventory-items"?: readonly OscalInventoryItem[];
|
|
280
|
+
};
|
|
281
|
+
readonly "control-implementation": {
|
|
282
|
+
readonly description: string;
|
|
283
|
+
readonly "implemented-requirements": readonly OscalSspRequirement[];
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
/** Any document this module writes. */
|
|
288
|
+
export type OscalDocument = OscalAssessmentResults | OscalPoam | OscalComponentDefinition | OscalSsp;
|
|
289
|
+
/** What every document needs: the namespace of its UUIDs, its metadata, and the namespace of the properties this module names. */
|
|
290
|
+
export type OscalOptions = {
|
|
291
|
+
/** The namespace every `uuid` is a version 5 UUID in. */
|
|
292
|
+
readonly namespace: Uuid;
|
|
293
|
+
readonly lastModified: Instant;
|
|
294
|
+
readonly version: string;
|
|
295
|
+
/** The namespace (a URI) of the properties this module defines: `outcome`, `status`, `severity`, `control`, `sha256`, ... */
|
|
296
|
+
readonly propNamespace: string;
|
|
297
|
+
/** The document's title; each function has a default. */
|
|
298
|
+
readonly title?: string;
|
|
299
|
+
/** The organization the document is by, as a party. */
|
|
300
|
+
readonly organization?: string;
|
|
301
|
+
/** The OSCAL `control-id` of a catalog control; by default its id as the catalog has it. */
|
|
302
|
+
readonly controlId?: (ref: ControlRef) => string;
|
|
303
|
+
/** The `href` of a catalog (a control implementation's `source`); by default a back-matter resource of the document. */
|
|
304
|
+
readonly catalogHref?: (catalog: string) => string;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* An assessment as OSCAL assessment results: one result, its subjects as inventory items, each finding an observation, and each control
|
|
308
|
+
* reviewed (each catalog control the assessment's controls implement, or a control that implements none) an OSCAL finding whose target is
|
|
309
|
+
* satisfied or not by the join of the outcomes of the newest findings of its controls. `assessmentPlan` is the `import-ap` href; by default
|
|
310
|
+
* a back-matter resource that stands for the plan.
|
|
311
|
+
*/
|
|
312
|
+
export declare function assessmentResults(a: Assessment, o: OscalOptions & {
|
|
313
|
+
readonly assessmentPlan?: string;
|
|
314
|
+
}): Promise<OscalAssessmentResults>;
|
|
315
|
+
/**
|
|
316
|
+
* A plan of action and milestones: for each finding whose outcome is `fail`, `warn`, `gap`, `error` or `accepted`, an observation, a risk
|
|
317
|
+
* (`open`, or `deviation-approved` where a waiver accepted it) and a POA&M item; and for each risk of a register given, a risk with its
|
|
318
|
+
* NIST SP 800-30 likelihood, impact and level as facets and a POA&M item. A finding's risk and item are named by its control and subject
|
|
319
|
+
* (not its time), so the same open finding keeps its UUIDs from one assessment to the next.
|
|
320
|
+
*/
|
|
321
|
+
export declare function poam(a: Assessment, risks: readonly Risk[], o: OscalOptions): Promise<OscalPoam>;
|
|
322
|
+
/** The component a component definition describes. */
|
|
323
|
+
export type ComponentInput = {
|
|
324
|
+
readonly id: string;
|
|
325
|
+
readonly title: string;
|
|
326
|
+
readonly description: string;
|
|
327
|
+
readonly type?: OscalComponentType;
|
|
328
|
+
readonly version?: string;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* A component definition of one component: for each catalog its controls implement (in the catalogs' order), a control implementation
|
|
332
|
+
* whose implemented requirements are those catalog controls, each saying which controls implement it. A catalog's `source` is
|
|
333
|
+
* `catalogHref`'s, or a back-matter resource that stands for it.
|
|
334
|
+
*/
|
|
335
|
+
export declare function componentDefinition(controls: readonly ControlSummary[], component: ComponentInput, o: OscalOptions): Promise<OscalComponentDefinition>;
|
|
336
|
+
/** The system a security plan describes, and the profile (baseline) it imports. */
|
|
337
|
+
export type SystemInput = {
|
|
338
|
+
readonly id: string;
|
|
339
|
+
readonly name: string;
|
|
340
|
+
readonly description: string;
|
|
341
|
+
readonly profile: string;
|
|
342
|
+
readonly boundary?: string;
|
|
343
|
+
readonly informationType?: {
|
|
344
|
+
readonly title: string;
|
|
345
|
+
readonly description: string;
|
|
346
|
+
};
|
|
347
|
+
readonly user?: string;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* A minimal system security plan of what is implemented: the system as one `this-system` component, the assessment's subjects as its
|
|
351
|
+
* inventory, and each catalog control its controls implement (or control that implements none) with its implementation status from the
|
|
352
|
+
* coverage of the newest findings of its controls.
|
|
353
|
+
*/
|
|
354
|
+
export declare function systemSecurityPlan(a: Assessment, system: SystemInput, o: OscalOptions): Promise<OscalSsp>;
|
|
355
|
+
/** A document as OSCAL JSON text: two-space indents and a final newline, its members in the order this module writes them. */
|
|
356
|
+
export declare function renderOscal(doc: OscalDocument): string;
|