@greenarmor/ges 1.2.4 → 1.2.6
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/dist/commands/audit.js +17 -3
- package/dist/commands/control.js +8 -0
- package/dist/commands/fix.js +23 -8
- package/dist/commands/generate.js +12 -0
- package/dist/commands/hooks.js +13 -0
- package/dist/commands/init.js +22 -1
- package/dist/commands/policy.js +36 -1
- package/dist/commands/scan.js +8 -0
- package/dist/commands/score.js +8 -0
- package/dist/commands/validate.js +8 -0
- package/package.json +14 -14
package/dist/commands/audit.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized, readJsonFile, writeJsonFile } from "../utils/project.js";
|
|
3
|
+
import { recordActivity, loadControlsFromDisk } from "@greenarmor/ges-core";
|
|
3
4
|
import { getPacksForProjectType, getAllPacks } from "@greenarmor/ges-policy-engine";
|
|
4
5
|
import { generateScoreFile, formatScoreOutput } from "@greenarmor/ges-scoring-engine";
|
|
5
6
|
import { runAudit, runAuditIncremental, deduplicateFindings } from "@greenarmor/ges-audit-engine";
|
|
@@ -36,16 +37,21 @@ export const auditCommand = new Command("audit")
|
|
|
36
37
|
}
|
|
37
38
|
const findings = deduplicateFindings(rawFindings);
|
|
38
39
|
console.log("");
|
|
39
|
-
const
|
|
40
|
+
const configFrameworks = (config?.frameworks || ["GDPR", "OWASP"]);
|
|
40
41
|
const projectPacks = getPacksForProjectType(config?.project_type || "generic-web-application");
|
|
41
42
|
const packIds = new Set(projectPacks.map(p => p.id));
|
|
42
|
-
const fwLower = new Set(
|
|
43
|
+
const fwLower = new Set(configFrameworks.map(f => f.toLowerCase()));
|
|
43
44
|
const allPacks = getAllPacks();
|
|
44
45
|
for (const p of allPacks) {
|
|
45
46
|
if (fwLower.has(p.id))
|
|
46
47
|
packIds.add(p.id);
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
+
const memoryControls = allPacks.filter(p => packIds.has(p.id)).flatMap(p => p.controls);
|
|
50
|
+
const diskControls = loadControlsFromDisk(root);
|
|
51
|
+
const seenIds = new Set(memoryControls.map(c => c.id));
|
|
52
|
+
const extraFromDisk = diskControls.filter(c => !seenIds.has(c.id));
|
|
53
|
+
const controls = [...memoryControls, ...extraFromDisk];
|
|
54
|
+
const frameworks = [...new Set(controls.map(c => c.framework).filter(Boolean))];
|
|
49
55
|
const overrides = loadControlOverrides(root);
|
|
50
56
|
const updatedControls = applyControlOverrides(controls, overrides);
|
|
51
57
|
const auditedControls = updateControlsFromFindings(updatedControls, findings);
|
|
@@ -107,6 +113,14 @@ export const auditCommand = new Command("audit")
|
|
|
107
113
|
if (critical.length > 0) {
|
|
108
114
|
console.log(" !! Critical issues must be resolved before deployment. !!\n");
|
|
109
115
|
}
|
|
116
|
+
recordActivity(root, {
|
|
117
|
+
source: "cli",
|
|
118
|
+
action: "audit",
|
|
119
|
+
title: `Compliance audit completed`,
|
|
120
|
+
description: `Scanned ${scannedFiles} files, found ${findings.length} findings (${critical.length} critical, ${high.length} high, ${medium.length} medium, ${low.length} low). Overall score: ${scoreData.overall}%.`,
|
|
121
|
+
status: critical.length > 0 ? "failed" : findings.length > 0 ? "partial" : "success",
|
|
122
|
+
details: { findings_count: findings.length, score: scoreData.overall, files_scanned: scannedFiles },
|
|
123
|
+
});
|
|
110
124
|
if (options.ci && critical.length > 0) {
|
|
111
125
|
process.exit(1);
|
|
112
126
|
}
|
package/dist/commands/control.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized, readJsonFile, writeJsonFile } from "../utils/project.js";
|
|
3
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
3
4
|
import { getAllPacks } from "@greenarmor/ges-policy-engine";
|
|
4
5
|
import * as path from "node:path";
|
|
5
6
|
const VALID_STATUSES = ["pass", "fail", "warning", "not-applicable", "not-implemented"];
|
|
@@ -38,4 +39,11 @@ export const controlCommand = new Command("control")
|
|
|
38
39
|
console.log(` Reason: ${options.reason || `Manually set to ${normalizedStatus}`}`);
|
|
39
40
|
console.log(`\n Override saved to: ${overridePath}`);
|
|
40
41
|
console.log(` Run 'ges audit' to see the updated compliance score.\n`);
|
|
42
|
+
recordActivity(root, {
|
|
43
|
+
source: "cli",
|
|
44
|
+
action: "control_override",
|
|
45
|
+
title: `Control ${controlId} → ${normalizedStatus}`,
|
|
46
|
+
description: `Manually set control ${control.name} (${controlId}) to ${normalizedStatus}. Reason: ${options.reason || `Manually set to ${normalizedStatus}`}`,
|
|
47
|
+
details: { controls_affected: [controlId] },
|
|
48
|
+
});
|
|
41
49
|
});
|
package/dist/commands/fix.js
CHANGED
|
@@ -2,20 +2,27 @@ import { Command } from "commander";
|
|
|
2
2
|
import { ensureGESInitialized } from "../utils/project.js";
|
|
3
3
|
import { runAudit, deduplicateFindings } from "@greenarmor/ges-audit-engine";
|
|
4
4
|
import { createAutoFixPlan, applyAutoFixAction, getNpmInstallsFromActions } from "@greenarmor/ges-mcp-server";
|
|
5
|
-
import { appendFixHistory, createFixHistoryEntry } from "@greenarmor/ges-core";
|
|
5
|
+
import { appendFixHistory, createFixHistoryEntry, recordActivity, loadControlsFromDisk, loadControlOverrides, applyOverridesToControls } from "@greenarmor/ges-core";
|
|
6
6
|
import { getAllPacks } from "@greenarmor/ges-policy-engine";
|
|
7
7
|
import * as fs from "node:fs";
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
function loadProjectControls(root) {
|
|
10
10
|
try {
|
|
11
11
|
const configPath = path.join(root, ".ges", "config.json");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
let inMemoryControls = [];
|
|
13
|
+
if (fs.existsSync(configPath)) {
|
|
14
|
+
const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
15
|
+
const fwLower = new Set(config.frameworks.map((f) => f.toLowerCase()));
|
|
16
|
+
const allPacks = getAllPacks();
|
|
17
|
+
const filtered = allPacks.filter(pack => fwLower.has(pack.id.toLowerCase()));
|
|
18
|
+
inMemoryControls = filtered.flatMap((p) => p.controls);
|
|
19
|
+
}
|
|
20
|
+
const diskControls = loadControlsFromDisk(root);
|
|
21
|
+
const seenIds = new Set(inMemoryControls.map(c => c.id));
|
|
22
|
+
const extraFromDisk = diskControls.filter(c => !seenIds.has(c.id));
|
|
23
|
+
const controls = [...inMemoryControls, ...extraFromDisk];
|
|
24
|
+
const overrides = loadControlOverrides(root);
|
|
25
|
+
return applyOverridesToControls(controls, overrides);
|
|
19
26
|
}
|
|
20
27
|
catch {
|
|
21
28
|
return [];
|
|
@@ -154,6 +161,14 @@ export const fixCommand = new Command("fix")
|
|
|
154
161
|
console.log(" 2. Review changes: git diff");
|
|
155
162
|
console.log(" 3. Re-run audit: ges audit");
|
|
156
163
|
console.log("");
|
|
164
|
+
recordActivity(root, {
|
|
165
|
+
source: "cli",
|
|
166
|
+
action: "fix",
|
|
167
|
+
title: `Auto-fix ${dryRun ? "planned" : "applied"}: ${applied} fixes`,
|
|
168
|
+
description: `${dryRun ? "Planned" : "Applied"} ${applied} fix(es) across ${actions.length} action(s)${failed > 0 ? ` (${failed} failed)` : ""}. Scanned ${scannedFiles} files, ${findings.length} findings found.`,
|
|
169
|
+
status: failed > 0 ? "partial" : "success",
|
|
170
|
+
details: { fixes_applied: applied, findings_count: findings.length, files_scanned: scannedFiles },
|
|
171
|
+
});
|
|
157
172
|
if (options.ci && (findings.length > 0 && failed < findings.length) === false && findings.length > 0) {
|
|
158
173
|
process.exit(1);
|
|
159
174
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized, readJsonFile, writeFileSync } from "../utils/project.js";
|
|
3
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
3
4
|
import { generateComplianceDocs, generateSecurityDocs } from "@greenarmor/ges-doc-generator";
|
|
4
5
|
import { generateAllWorkflows } from "@greenarmor/ges-cicd-generator";
|
|
5
6
|
import { showNextStepsMenu } from "../utils/next-steps.js";
|
|
@@ -22,6 +23,8 @@ export const generateCommand = new Command("generate")
|
|
|
22
23
|
console.log(" Specify --docs, --workflows, or --all");
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
26
|
+
let docCount = 0;
|
|
27
|
+
let wfCount = 0;
|
|
25
28
|
if (doDocs) {
|
|
26
29
|
console.log(" Generating compliance documents...");
|
|
27
30
|
const complianceDocs = generateComplianceDocs(config.project_name, config.project_type);
|
|
@@ -33,6 +36,7 @@ export const generateCommand = new Command("generate")
|
|
|
33
36
|
for (const doc of securityDocs) {
|
|
34
37
|
writeFileSync(path.join(root, doc.filePath), doc.content);
|
|
35
38
|
}
|
|
39
|
+
docCount = complianceDocs.length + securityDocs.length;
|
|
36
40
|
console.log(" ✓ Documents generated");
|
|
37
41
|
}
|
|
38
42
|
if (doWorkflows) {
|
|
@@ -41,8 +45,16 @@ export const generateCommand = new Command("generate")
|
|
|
41
45
|
for (const wf of workflows) {
|
|
42
46
|
writeFileSync(path.join(root, wf.filePath), wf.content);
|
|
43
47
|
}
|
|
48
|
+
wfCount = workflows.length;
|
|
44
49
|
console.log(" ✓ Workflows generated");
|
|
45
50
|
}
|
|
46
51
|
console.log("");
|
|
52
|
+
recordActivity(root, {
|
|
53
|
+
source: "cli",
|
|
54
|
+
action: "generate",
|
|
55
|
+
title: `Generated ${docCount} docs, ${wfCount} workflows`,
|
|
56
|
+
description: `Regenerated ${doDocs ? `${docCount} documents` : ""}${doDocs && doWorkflows ? " and " : ""}${doWorkflows ? `${wfCount} CI/CD workflows` : ""} for ${config.project_name}.`,
|
|
57
|
+
details: { files_count: docCount + wfCount },
|
|
58
|
+
});
|
|
47
59
|
await showNextStepsMenu("generate");
|
|
48
60
|
});
|
package/dist/commands/hooks.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized } from "../utils/project.js";
|
|
3
3
|
import { installHooks, uninstallHooks } from "@greenarmor/ges-git-hooks";
|
|
4
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
4
5
|
export const hooksCommand = new Command("hooks")
|
|
5
6
|
.description("Manage GESF git hooks (pre-commit compliance enforcement)")
|
|
6
7
|
.addCommand(new Command("install")
|
|
@@ -24,6 +25,12 @@ export const hooksCommand = new Command("hooks")
|
|
|
24
25
|
console.log(" The hook will run 'ges audit' before allowing commits.");
|
|
25
26
|
console.log(" To bypass: git commit --no-verify");
|
|
26
27
|
console.log(" To remove: ges hooks uninstall\n");
|
|
28
|
+
recordActivity(root, {
|
|
29
|
+
source: "cli",
|
|
30
|
+
action: "hooks_install",
|
|
31
|
+
title: `Git hooks installed (${result.installed.length})`,
|
|
32
|
+
description: `Installed pre-commit hook that runs 'ges audit' before each commit.`,
|
|
33
|
+
});
|
|
27
34
|
}))
|
|
28
35
|
.addCommand(new Command("uninstall")
|
|
29
36
|
.description("Remove the GESF pre-commit hook")
|
|
@@ -37,4 +44,10 @@ export const hooksCommand = new Command("hooks")
|
|
|
37
44
|
console.log(` [!] ${s}`);
|
|
38
45
|
}
|
|
39
46
|
console.log("\n Pre-commit hook removed.\n");
|
|
47
|
+
recordActivity(root, {
|
|
48
|
+
source: "cli",
|
|
49
|
+
action: "hooks_uninstall",
|
|
50
|
+
title: `Git hooks removed`,
|
|
51
|
+
description: `Removed pre-commit hook.`,
|
|
52
|
+
});
|
|
40
53
|
}));
|
package/dist/commands/init.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Command } from "commander";
|
|
|
2
2
|
import { input, select, checkbox } from "../utils/prompts.js";
|
|
3
3
|
import { PROJECT_TYPES, FRAMEWORKS, DEFAULT_FRAMEWORKS, GES_DIR, COMPLIANCE_DIR, SECURITY_DIR, CONTROLS_DIR, POLICIES_DIR, CHECKLISTS_DIR, DOCS_DIR, REPORTS_DIR, } from "@greenarmor/ges-core";
|
|
4
4
|
import { CLI_VERSION } from "../utils/version.js";
|
|
5
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
5
6
|
import { getPacksForProjectType } from "@greenarmor/ges-policy-engine";
|
|
6
7
|
import { generateComplianceDocs, generateSecurityDocs, generateConfigJson, generateMetadataJson, generateFrameworkVersionJson, generateScoreJson, } from "@greenarmor/ges-doc-generator";
|
|
7
8
|
import { generateAllWorkflows } from "@greenarmor/ges-cicd-generator";
|
|
@@ -74,10 +75,22 @@ export const initCommand = new Command("init")
|
|
|
74
75
|
created_at: now,
|
|
75
76
|
version: CLI_VERSION,
|
|
76
77
|
};
|
|
77
|
-
const dirs = [GES_DIR, COMPLIANCE_DIR, SECURITY_DIR, CONTROLS_DIR, POLICIES_DIR, CHECKLISTS_DIR, DOCS_DIR, REPORTS_DIR];
|
|
78
|
+
const dirs = [GES_DIR, COMPLIANCE_DIR, SECURITY_DIR, CONTROLS_DIR, POLICIES_DIR, CHECKLISTS_DIR, DOCS_DIR, REPORTS_DIR, ".dev-logs"];
|
|
78
79
|
for (const dir of dirs) {
|
|
79
80
|
fs.mkdirSync(path.join(process.cwd(), dir), { recursive: true });
|
|
80
81
|
}
|
|
82
|
+
const gitignorePath = path.join(process.cwd(), ".gitignore");
|
|
83
|
+
const devLogsIgnore = ".dev-logs/\n";
|
|
84
|
+
if (fs.existsSync(gitignorePath)) {
|
|
85
|
+
const existing = fs.readFileSync(gitignorePath, "utf-8");
|
|
86
|
+
if (!existing.includes(".dev-logs/")) {
|
|
87
|
+
fs.appendFileSync(gitignorePath, `\n# GESF developer logs (not for remote)\n${devLogsIgnore}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
writeFileSync(gitignorePath, `# GESF developer logs (not for remote)\n${devLogsIgnore}\n`);
|
|
92
|
+
}
|
|
93
|
+
writeFileSync(path.join(process.cwd(), ".dev-logs", "README.md"), `# Developer Logs\n\nThis directory is for GESF development notes, session logs, AI recommendations, and release notes.\n\n**This directory is gitignored and intended for developers only. Do not submit to remote.**\n\n## Structure\n\n- \`session-*.md\` — Session logs\n- \`release-notes-*.md\` — Release notes\n- \`ai-recommendations/\` — Recommendations from AI assistants using the MCP server\n`);
|
|
81
94
|
const configJson = generateConfigJson(config);
|
|
82
95
|
writeFileSync(path.join(process.cwd(), configJson.filePath), configJson.content);
|
|
83
96
|
const metadata = generateMetadataJson(config);
|
|
@@ -113,10 +126,18 @@ export const initCommand = new Command("init")
|
|
|
113
126
|
console.log(" ✓ Security documents created");
|
|
114
127
|
console.log(" ✓ Control packs installed:", packs.map(p => p.id).join(", "));
|
|
115
128
|
console.log(" ✓ GitHub Actions workflows generated");
|
|
129
|
+
console.log(" ✓ Developer logs directory created (.dev-logs/)");
|
|
116
130
|
console.log(`\n GESF initialized for "${projectName}" (${projectType})`);
|
|
117
131
|
console.log(" Next steps:");
|
|
118
132
|
console.log(" 1. Review generated compliance documents");
|
|
119
133
|
console.log(" 2. Run 'ges audit' to evaluate your project");
|
|
120
134
|
console.log(" 3. Run 'ges score' to see your compliance score\n");
|
|
135
|
+
recordActivity(process.cwd(), {
|
|
136
|
+
source: "cli",
|
|
137
|
+
action: "init",
|
|
138
|
+
title: `Project initialized: ${projectName}`,
|
|
139
|
+
description: `Initialized GESF for ${projectType} project with frameworks: ${selectedFrameworks.join(", ")}. Installed ${packs.length} policy packs: ${packs.map(p => p.id).join(", ")}.`,
|
|
140
|
+
details: { packs_affected: packs.map(p => p.id), frameworks_added: selectedFrameworks.map((f) => String(f)) },
|
|
141
|
+
});
|
|
121
142
|
await showNextStepsMenu("init");
|
|
122
143
|
});
|
package/dist/commands/policy.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { getAllPacks, listPackIds } from "@greenarmor/ges-policy-engine";
|
|
3
3
|
import { ensureGESInitialized, writeFileSync } from "../utils/project.js";
|
|
4
|
+
import { addFrameworkToConfig, removeFrameworkFromConfig, recordActivity } from "@greenarmor/ges-core";
|
|
4
5
|
import { showNextStepsMenu } from "../utils/next-steps.js";
|
|
5
6
|
import * as fs from "node:fs";
|
|
6
7
|
import * as path from "node:path";
|
|
@@ -34,7 +35,24 @@ policyCmd
|
|
|
34
35
|
const packDir = path.join(root, "controls", pack.id);
|
|
35
36
|
fs.mkdirSync(packDir, { recursive: true });
|
|
36
37
|
writeFileSync(path.join(packDir, "controls.json"), JSON.stringify(pack.controls, null, 2));
|
|
37
|
-
|
|
38
|
+
const frameworksAdded = [];
|
|
39
|
+
for (const fw of pack.frameworks) {
|
|
40
|
+
if (addFrameworkToConfig(root, fw)) {
|
|
41
|
+
frameworksAdded.push(fw);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
console.log(`\n ✓ Installed policy pack: ${pack.id} (${pack.controls.length} controls)`);
|
|
45
|
+
if (frameworksAdded.length > 0) {
|
|
46
|
+
console.log(` ✓ Added ${frameworksAdded.join(", ")} to project frameworks in .ges/config.json`);
|
|
47
|
+
}
|
|
48
|
+
console.log(" ✓ Dashboard will now reflect this pack's controls\n");
|
|
49
|
+
recordActivity(root, {
|
|
50
|
+
source: "cli",
|
|
51
|
+
action: "policy_install",
|
|
52
|
+
title: `Installed pack: ${pack.name}`,
|
|
53
|
+
description: `Installed ${pack.controls.length} controls from ${pack.id} pack.${frameworksAdded.length > 0 ? ` Added ${frameworksAdded.join(", ")} to config frameworks.` : ""}`,
|
|
54
|
+
details: { packs_affected: [pack.id], frameworks_added: frameworksAdded },
|
|
55
|
+
});
|
|
38
56
|
await showNextStepsMenu("policy-install");
|
|
39
57
|
});
|
|
40
58
|
policyCmd
|
|
@@ -48,7 +66,24 @@ policyCmd
|
|
|
48
66
|
process.exit(1);
|
|
49
67
|
}
|
|
50
68
|
fs.rmSync(packDir, { recursive: true, force: true });
|
|
69
|
+
const packs = getAllPacks();
|
|
70
|
+
const pack = packs.find(p => p.id === packId);
|
|
71
|
+
if (pack) {
|
|
72
|
+
for (const fw of pack.frameworks) {
|
|
73
|
+
removeFrameworkFromConfig(root, fw);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
removeFrameworkFromConfig(root, packId.toUpperCase());
|
|
78
|
+
}
|
|
51
79
|
console.log(`\n ✓ Removed policy pack: ${packId}\n`);
|
|
80
|
+
recordActivity(root, {
|
|
81
|
+
source: "cli",
|
|
82
|
+
action: "policy_remove",
|
|
83
|
+
title: `Removed pack: ${packId}`,
|
|
84
|
+
description: `Removed ${packId} pack and its controls from the project.`,
|
|
85
|
+
details: { packs_affected: [packId] },
|
|
86
|
+
});
|
|
52
87
|
await showNextStepsMenu("policy-remove");
|
|
53
88
|
});
|
|
54
89
|
export const policyCommand = policyCmd;
|
package/dist/commands/scan.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized } from "../utils/project.js";
|
|
3
3
|
import { runAllScansWithSbom, formatScanResults, formatSbomResults, detectProject } from "@greenarmor/ges-scanner-integration";
|
|
4
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
4
5
|
import { showNextStepsMenu } from "../utils/next-steps.js";
|
|
5
6
|
export const scanCommand = new Command("scan")
|
|
6
7
|
.description("Run security scans")
|
|
@@ -18,6 +19,13 @@ export const scanCommand = new Command("scan")
|
|
|
18
19
|
const results = runAllScansWithSbom(detection);
|
|
19
20
|
console.log(formatScanResults(results));
|
|
20
21
|
console.log(formatSbomResults(results));
|
|
22
|
+
recordActivity(root, {
|
|
23
|
+
source: "cli",
|
|
24
|
+
action: "scan",
|
|
25
|
+
title: `Security scans completed (${results.length} tools)`,
|
|
26
|
+
description: `Ran ${results.length} scanner(s) for ${detail} ecosystem. ${results.filter(r => r.status === "pass").length} passed, ${results.filter(r => r.status === "fail").length} failed.`,
|
|
27
|
+
status: results.some(r => r.status === "fail") ? "partial" : "success",
|
|
28
|
+
});
|
|
21
29
|
if (options.ci) {
|
|
22
30
|
const failed = results.filter(r => r.status === "fail");
|
|
23
31
|
if (failed.length > 0) {
|
package/dist/commands/score.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized, readJsonFile } from "../utils/project.js";
|
|
3
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
3
4
|
import { formatScoreOutput } from "@greenarmor/ges-scoring-engine";
|
|
4
5
|
import { showNextStepsMenu } from "../utils/next-steps.js";
|
|
5
6
|
import * as path from "node:path";
|
|
@@ -22,5 +23,12 @@ export const scoreCommand = new Command("score")
|
|
|
22
23
|
console.log(formatScoreOutput(score));
|
|
23
24
|
console.log(` Last evaluated: ${score.evaluated_at}\n`);
|
|
24
25
|
}
|
|
26
|
+
recordActivity(root, {
|
|
27
|
+
source: "cli",
|
|
28
|
+
action: "score",
|
|
29
|
+
title: `Score displayed: ${score.overall}% (${score.overall_grade})`,
|
|
30
|
+
description: `Compliance score: ${score.overall}% (Grade ${score.overall_grade}) across ${Object.keys(score.frameworks).length} frameworks.`,
|
|
31
|
+
details: { score: score.overall },
|
|
32
|
+
});
|
|
25
33
|
await showNextStepsMenu("score");
|
|
26
34
|
});
|
|
@@ -2,6 +2,7 @@ import { Command } from "commander";
|
|
|
2
2
|
import { ensureGESInitialized, readJsonFile } from "../utils/project.js";
|
|
3
3
|
import { ProjectConfigSchema } from "@greenarmor/ges-core";
|
|
4
4
|
import { GES_DIR } from "@greenarmor/ges-core";
|
|
5
|
+
import { recordActivity } from "@greenarmor/ges-core";
|
|
5
6
|
import { showNextStepsMenu } from "../utils/next-steps.js";
|
|
6
7
|
import * as fs from "node:fs";
|
|
7
8
|
import * as path from "node:path";
|
|
@@ -59,6 +60,13 @@ export const validateCommand = new Command("validate")
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
console.log(hasErrors ? "\n Validation failed.\n" : "\n All validations passed.\n");
|
|
63
|
+
recordActivity(root, {
|
|
64
|
+
source: "cli",
|
|
65
|
+
action: "validate",
|
|
66
|
+
title: `Validation ${hasErrors ? "failed" : "passed"}`,
|
|
67
|
+
description: hasErrors ? "Configuration or directory structure has issues." : "All configuration, controls, and directories validated successfully.",
|
|
68
|
+
status: hasErrors ? "failed" : "success",
|
|
69
|
+
});
|
|
62
70
|
if (hasErrors)
|
|
63
71
|
process.exit(1);
|
|
64
72
|
await showNextStepsMenu("validate");
|
package/package.json
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
"ges": "./dist/cli.js"
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@greenarmor/ges-audit-engine": "1.2.
|
|
7
|
-
"@greenarmor/ges-cicd-generator": "1.2.
|
|
8
|
-
"@greenarmor/ges-compliance-engine": "1.2.
|
|
9
|
-
"@greenarmor/ges-core": "1.2.
|
|
10
|
-
"@greenarmor/ges-doc-generator": "1.2.
|
|
11
|
-
"@greenarmor/ges-git-hooks": "1.2.
|
|
12
|
-
"@greenarmor/ges-mcp-server": "1.2.
|
|
13
|
-
"@greenarmor/ges-policy-engine": "1.2.
|
|
14
|
-
"@greenarmor/ges-report-generator": "1.2.
|
|
15
|
-
"@greenarmor/ges-rules-engine": "1.2.
|
|
16
|
-
"@greenarmor/ges-scanner-integration": "1.2.
|
|
17
|
-
"@greenarmor/ges-scoring-engine": "1.2.
|
|
18
|
-
"@greenarmor/ges-web-dashboard": "1.2.
|
|
6
|
+
"@greenarmor/ges-audit-engine": "1.2.6",
|
|
7
|
+
"@greenarmor/ges-cicd-generator": "1.2.6",
|
|
8
|
+
"@greenarmor/ges-compliance-engine": "1.2.6",
|
|
9
|
+
"@greenarmor/ges-core": "1.2.6",
|
|
10
|
+
"@greenarmor/ges-doc-generator": "1.2.6",
|
|
11
|
+
"@greenarmor/ges-git-hooks": "1.2.6",
|
|
12
|
+
"@greenarmor/ges-mcp-server": "1.2.6",
|
|
13
|
+
"@greenarmor/ges-policy-engine": "1.2.6",
|
|
14
|
+
"@greenarmor/ges-report-generator": "1.2.6",
|
|
15
|
+
"@greenarmor/ges-rules-engine": "1.2.6",
|
|
16
|
+
"@greenarmor/ges-scanner-integration": "1.2.6",
|
|
17
|
+
"@greenarmor/ges-scoring-engine": "1.2.6",
|
|
18
|
+
"@greenarmor/ges-web-dashboard": "1.2.6",
|
|
19
19
|
"commander": "^13.0.0"
|
|
20
20
|
},
|
|
21
21
|
"description": "Green Engineering Standard Framework - Compliance-as-Code CLI",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"type": "module",
|
|
55
55
|
"types": "./dist/index.d.ts",
|
|
56
|
-
"version": "1.2.
|
|
56
|
+
"version": "1.2.6",
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsc",
|
|
59
59
|
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|