filegrc 0.11.1 → 0.12.1
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/model/index.js +22 -5
- package/model/v10.json +12133 -0
- package/model/v9.json +11647 -0
- package/package.json +1 -1
- package/src/agent.js +3 -0
- package/src/audit-populations.js +88 -0
- package/src/audit-preparation.js +7 -2
- package/src/cli.js +186 -13
- package/src/collection-review-integrity.js +118 -0
- package/src/collection-review.js +71 -7
- package/src/collection-scope.js +8 -0
- package/src/evidence-packet.js +328 -46
- package/src/files.js +364 -6
- package/src/git.js +1064 -149
- package/src/index.js +17 -1
- package/src/model-migration.js +221 -5
- package/src/obligations.js +834 -66
- package/src/policy-library/information-security-policy-v2.md +1 -1
- package/src/policy-library.js +85 -8
- package/src/program-path.js +11 -5
- package/src/program-readiness.js +84 -6
- package/src/reconciliation.js +332 -81
- package/src/reporting-route-integrity.js +542 -0
- package/src/reporting-route-sets.js +745 -0
- package/src/server.js +160 -47
- package/src/state.js +30 -8
- package/src/time.js +55 -0
- package/src/validate.js +978 -4
- package/src/web.js +488 -49
- package/src/workflow-history-integrity.js +872 -0
- package/src/workflow.js +36 -10
package/model/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
-
export const ACTIVE_MODEL_VERSION = "
|
|
4
|
-
export const SUPPORTED_MODEL_VERSIONS = Object.freeze(["2", "3", "4", "5", "6", "7", ACTIVE_MODEL_VERSION]);
|
|
3
|
+
export const ACTIVE_MODEL_VERSION = "10";
|
|
4
|
+
export const SUPPORTED_MODEL_VERSIONS = Object.freeze(["2", "3", "4", "5", "6", "7", "8", "9", ACTIVE_MODEL_VERSION]);
|
|
5
5
|
export const MODEL_CAPABILITY_VERSIONS = Object.freeze({
|
|
6
6
|
"guided-workflow": 3,
|
|
7
7
|
"program-scope": 4,
|
|
@@ -12,7 +12,11 @@ export const MODEL_CAPABILITY_VERSIONS = Object.freeze({
|
|
|
12
12
|
"governed-training-activation": 6,
|
|
13
13
|
"retention-schedule": 8,
|
|
14
14
|
"requirement-mappings": 8,
|
|
15
|
-
"custom-obligations": 8
|
|
15
|
+
"custom-obligations": 8,
|
|
16
|
+
"rolled-up-obligations": 9,
|
|
17
|
+
"temporal-collection-reviews": 9,
|
|
18
|
+
"reporting-routes": 9,
|
|
19
|
+
"reporting-route-sets": 10
|
|
16
20
|
});
|
|
17
21
|
|
|
18
22
|
export function modelSupports(modelOrVersion, capability) {
|
|
@@ -27,9 +31,9 @@ export function modelSupports(modelOrVersion, capability) {
|
|
|
27
31
|
export function loadModel(version = ACTIVE_MODEL_VERSION) {
|
|
28
32
|
const requested = String(version);
|
|
29
33
|
if (!SUPPORTED_MODEL_VERSIONS.includes(requested)) {
|
|
30
|
-
const migrationTarget = requested === "1" ? "2" : requested === "2" ? "3" : requested === "3" ? "4" : requested === "4" ? "5" : requested === "5" ? "6" : requested === "6" ? "7" : "8";
|
|
34
|
+
const migrationTarget = requested === "1" ? "2" : requested === "2" ? "3" : requested === "3" ? "4" : requested === "4" ? "5" : requested === "5" ? "6" : requested === "6" ? "7" : requested === "7" ? "8" : requested === "8" ? "9" : "10";
|
|
31
35
|
throw new Error(
|
|
32
|
-
`Unsupported data model version "${requested}". This filegrc release supports models v2
|
|
36
|
+
`Unsupported data model version "${requested}". This filegrc release supports models v2 through v10. `
|
|
33
37
|
+ `Run \`npx filegrc migrate --to-model ${migrationTarget} --preview --json\` from the workspace root.`
|
|
34
38
|
);
|
|
35
39
|
}
|
|
@@ -51,9 +55,22 @@ export function loadModel(version = ACTIVE_MODEL_VERSION) {
|
|
|
51
55
|
expandRegistryReference(model, field, `${objectType}.${name}`);
|
|
52
56
|
}
|
|
53
57
|
}
|
|
58
|
+
validateCollectionReviewPopulationRelations(model);
|
|
54
59
|
return model;
|
|
55
60
|
}
|
|
56
61
|
|
|
62
|
+
function validateCollectionReviewPopulationRelations(model) {
|
|
63
|
+
const field = model.resources["collection-review"]?.fields?.populationResourceIds;
|
|
64
|
+
if (!field) return;
|
|
65
|
+
const allowedTypes = new Set(field.relation || []);
|
|
66
|
+
const missingTypes = Object.keys(model.collectionReviews || {}).filter((type) => !allowedTypes.has(type));
|
|
67
|
+
if (missingTypes.length) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Collection Review population relationships do not allow configured resource types: ${missingTypes.join(", ")}.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
57
74
|
function expandRegistryReference(model, field, path) {
|
|
58
75
|
if (!field.registry) return;
|
|
59
76
|
const registry = model[field.registry];
|