@aisdlc/cli 4.2.0 → 4.3.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/dist/index.js +132 -58
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -27,17 +27,21 @@ import {
|
|
|
27
27
|
// src/commands/verify.ts
|
|
28
28
|
import pc from "picocolors";
|
|
29
29
|
import * as path from "path";
|
|
30
|
+
import * as readline from "readline/promises";
|
|
30
31
|
import {
|
|
31
32
|
writeReportFileIfChanged,
|
|
32
33
|
checkGherkinInSync,
|
|
33
34
|
verifyArtifactDuplicates,
|
|
34
35
|
verifyArtifactsSchemas,
|
|
35
36
|
verifyLicenses,
|
|
37
|
+
verifyLicensesAsync,
|
|
36
38
|
verifyPdacGraph,
|
|
37
39
|
verifyPrivacy,
|
|
38
40
|
verifyProgressiveFriction,
|
|
39
41
|
verifyQualityGate,
|
|
40
42
|
verifySast,
|
|
43
|
+
verifySastAsync,
|
|
44
|
+
SarifIngestionError,
|
|
41
45
|
verifySecrets,
|
|
42
46
|
verifyTasksGovernance,
|
|
43
47
|
verifyTestingCoverage,
|
|
@@ -47,6 +51,19 @@ import {
|
|
|
47
51
|
serializeSarifDocument,
|
|
48
52
|
writeSecuritySarifReport
|
|
49
53
|
} from "@aisdlc/core";
|
|
54
|
+
function createTtyConfirmInstall() {
|
|
55
|
+
return async (spec) => {
|
|
56
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
57
|
+
try {
|
|
58
|
+
const answer = await rl.question(
|
|
59
|
+
`Tool "${spec.tool}" is not installed. Run "${spec.displayCommand}"? [y/N] `
|
|
60
|
+
);
|
|
61
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
62
|
+
} finally {
|
|
63
|
+
rl.close();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
50
67
|
function isJsonOutput(options = {}) {
|
|
51
68
|
if (options.json !== void 0) {
|
|
52
69
|
return Boolean(options.json);
|
|
@@ -463,18 +480,23 @@ function buildLicenseVerifyInput(options, rootDir) {
|
|
|
463
480
|
depth: options.depth,
|
|
464
481
|
generateSbom: options.sbom !== void 0 ? Boolean(options.sbom) : void 0,
|
|
465
482
|
sbomPath: typeof options.sbom === "string" ? options.sbom : void 0,
|
|
483
|
+
sbomInputPath: options.sbomInput,
|
|
466
484
|
generateNotices: options.notices !== void 0 ? Boolean(options.notices) : void 0,
|
|
467
485
|
noticesPath: typeof options.notices === "string" ? options.notices : void 0,
|
|
468
|
-
scanVulnerabilities: options.vuln !== void 0 ? Boolean(options.vuln) : void 0
|
|
486
|
+
scanVulnerabilities: options.vuln !== void 0 ? Boolean(options.vuln) : void 0,
|
|
487
|
+
nonInteractive: options.nonInteractive,
|
|
488
|
+
noInstallPrompt: options.noInstallPrompt,
|
|
489
|
+
ci: options.ci,
|
|
490
|
+
confirmInstall: createTtyConfirmInstall()
|
|
469
491
|
};
|
|
470
492
|
}
|
|
471
|
-
function
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
493
|
+
function finalizeLicensesOutput(result, options, useJson) {
|
|
494
|
+
if (result.warnings && result.warnings.length > 0 && !options.silent) {
|
|
495
|
+
for (const warning of result.warnings) {
|
|
496
|
+
process.stderr.write(`[SBOM WARNING] ${warning}
|
|
497
|
+
`);
|
|
498
|
+
}
|
|
476
499
|
}
|
|
477
|
-
const result = verifyLicenses(buildLicenseVerifyInput(options, rootDir));
|
|
478
500
|
if (useJson) {
|
|
479
501
|
emitLicensesJson(result);
|
|
480
502
|
} else if (!options.silent) {
|
|
@@ -482,6 +504,15 @@ function runVerifyLicenses(options = {}) {
|
|
|
482
504
|
}
|
|
483
505
|
return result.success;
|
|
484
506
|
}
|
|
507
|
+
async function runVerifyLicensesAsync(options = {}) {
|
|
508
|
+
const rootDir = options.root || process.cwd();
|
|
509
|
+
const useJson = isJsonOutput(options);
|
|
510
|
+
if (!options.silent && !useJson) {
|
|
511
|
+
console.log(pc.bold(pc.cyan("\n\u{1F50D} [AI-SDLC] Verifying Open Source License Compliance (SCA)...")));
|
|
512
|
+
}
|
|
513
|
+
const result = await verifyLicensesAsync(buildLicenseVerifyInput(options, rootDir));
|
|
514
|
+
return finalizeLicensesOutput(result, options, useJson);
|
|
515
|
+
}
|
|
485
516
|
function buildPdacViolations(result) {
|
|
486
517
|
const drifts = result.drifts.map((d) => ({
|
|
487
518
|
sourceId: d.sourceId,
|
|
@@ -827,7 +858,8 @@ function emitSastJson(result) {
|
|
|
827
858
|
type: v.type,
|
|
828
859
|
severity: v.severity,
|
|
829
860
|
message: v.message
|
|
830
|
-
}))
|
|
861
|
+
})),
|
|
862
|
+
...result.warnings?.length ? { warnings: result.warnings } : {}
|
|
831
863
|
};
|
|
832
864
|
console.log(JSON.stringify(payload, null, 2));
|
|
833
865
|
}
|
|
@@ -860,23 +892,44 @@ function handleSastOutput(result, options, useSarif, useJson) {
|
|
|
860
892
|
return result.success;
|
|
861
893
|
}
|
|
862
894
|
if (!options.silent) {
|
|
895
|
+
for (const warning of result.warnings ?? []) {
|
|
896
|
+
process.stderr.write(`[SAST WARNING] ${warning}
|
|
897
|
+
`);
|
|
898
|
+
}
|
|
863
899
|
printSastConsole(result);
|
|
864
900
|
}
|
|
865
901
|
return result.success;
|
|
866
902
|
}
|
|
867
|
-
function
|
|
903
|
+
function buildSastAsyncInput(rootDir, options) {
|
|
904
|
+
return {
|
|
905
|
+
rootDir,
|
|
906
|
+
semgrep: options.semgrep,
|
|
907
|
+
minSeverity: options.minSeverity,
|
|
908
|
+
sarifPaths: options.sarif,
|
|
909
|
+
orchestrate: options.orchestrate,
|
|
910
|
+
nonInteractive: options.nonInteractive,
|
|
911
|
+
noInstallPrompt: options.noInstallPrompt,
|
|
912
|
+
ci: options.ci,
|
|
913
|
+
confirmInstall: createTtyConfirmInstall()
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
async function runVerifySastAsync(options = {}) {
|
|
868
917
|
const rootDir = options.root || process.cwd();
|
|
869
918
|
const useJson = isJsonOutput(options);
|
|
870
919
|
const useSarif = isSarifOutput(options);
|
|
871
920
|
if (!options.silent && !useJson && !useSarif) {
|
|
872
921
|
console.log(pc.bold(pc.cyan("\n\u{1F6E1}\uFE0F [AI-SDLC] Verifying Shift-Left SAST Security (Injections & OWASP Top 10)...")));
|
|
873
922
|
}
|
|
874
|
-
|
|
875
|
-
rootDir,
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
923
|
+
try {
|
|
924
|
+
const result = await verifySastAsync(buildSastAsyncInput(rootDir, options));
|
|
925
|
+
return handleSastOutput(result, options, useSarif, useJson);
|
|
926
|
+
} catch (err) {
|
|
927
|
+
if (err instanceof SarifIngestionError) {
|
|
928
|
+
if (!options.silent) console.error(pc.red(`\u2716 ${err.message}`));
|
|
929
|
+
return false;
|
|
930
|
+
}
|
|
931
|
+
throw err;
|
|
932
|
+
}
|
|
880
933
|
}
|
|
881
934
|
function buildSecurityViolations(resultSecrets, resultSast) {
|
|
882
935
|
const secretViolations = resultSecrets.findings.map((f) => ({
|
|
@@ -916,7 +969,7 @@ function writeSuppressionsAuditReport(rootDir, suppressions) {
|
|
|
916
969
|
const targetPath = path.join(rootDir, "reports", "SUPPRESSIONS_AUDIT.md");
|
|
917
970
|
writeReportFileIfChanged(targetPath, generateSuppressionsAuditReport(suppressions));
|
|
918
971
|
}
|
|
919
|
-
function
|
|
972
|
+
async function executeSecurityVerifiersAsync(rootDir, options) {
|
|
920
973
|
const entropyThreshold = options.entropy !== void 0 ? Number(options.entropy) : void 0;
|
|
921
974
|
const resultSecrets = verifySecrets({
|
|
922
975
|
rootDir,
|
|
@@ -925,11 +978,7 @@ function executeSecurityVerifiers(rootDir, options) {
|
|
|
925
978
|
gitleaks: options.gitleaks,
|
|
926
979
|
entropyThreshold
|
|
927
980
|
});
|
|
928
|
-
const resultSast =
|
|
929
|
-
rootDir,
|
|
930
|
-
semgrep: options.semgrep,
|
|
931
|
-
minSeverity: options.minSeverity
|
|
932
|
-
});
|
|
981
|
+
const resultSast = await verifySastAsync(buildSastAsyncInput(rootDir, options));
|
|
933
982
|
return { resultSecrets, resultSast };
|
|
934
983
|
}
|
|
935
984
|
function printSecurityConsoleSummary(silent, hasExpired) {
|
|
@@ -947,6 +996,19 @@ function persistSecuritySarif(rootDir, resultSecrets, resultSast, customOutput)
|
|
|
947
996
|
const targetPath = customOutput || path.join(rootDir, "reports", "security.sarif");
|
|
948
997
|
writeSecuritySarifReport(targetPath, doc);
|
|
949
998
|
}
|
|
999
|
+
function printSecurityConsole(resultSecrets, resultSast, silent, hasExpired) {
|
|
1000
|
+
if (!silent) {
|
|
1001
|
+
console.log(pc.bold(pc.cyan("\n\u{1F510} [AI-SDLC] Verifying Deterministic Secrets and Credentials Detection (Gitleaks Gate)...")));
|
|
1002
|
+
printSecretsConsole(resultSecrets);
|
|
1003
|
+
console.log(pc.bold(pc.cyan("\n\u{1F6E1}\uFE0F [AI-SDLC] Verifying Shift-Left SAST Security (Injections & OWASP Top 10)...")));
|
|
1004
|
+
for (const warning of resultSast.warnings ?? []) {
|
|
1005
|
+
process.stderr.write(`[SAST WARNING] ${warning}
|
|
1006
|
+
`);
|
|
1007
|
+
}
|
|
1008
|
+
printSastConsole(resultSast);
|
|
1009
|
+
}
|
|
1010
|
+
printSecurityConsoleSummary(silent, hasExpired);
|
|
1011
|
+
}
|
|
950
1012
|
function handleSecurityOutput(options, resultSecrets, resultSast, isOk, hasExpired) {
|
|
951
1013
|
if (isSarifOutput(options)) {
|
|
952
1014
|
if (!options.output) {
|
|
@@ -962,18 +1024,13 @@ function handleSecurityOutput(options, resultSecrets, resultSast, isOk, hasExpir
|
|
|
962
1024
|
emitSecurityJson(resultSecrets, resultSast, isOk);
|
|
963
1025
|
return isOk;
|
|
964
1026
|
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
printSecurityConsoleSummary(options.silent, hasExpired);
|
|
968
|
-
return okS && okA && !hasExpired;
|
|
1027
|
+
printSecurityConsole(resultSecrets, resultSast, options.silent, hasExpired);
|
|
1028
|
+
return isOk;
|
|
969
1029
|
}
|
|
970
|
-
function
|
|
1030
|
+
async function runVerifySecurityAsync(options = {}) {
|
|
971
1031
|
const rootDir = options.root || process.cwd();
|
|
972
|
-
const { resultSecrets, resultSast } =
|
|
973
|
-
const allSuppressions = [
|
|
974
|
-
...resultSecrets.suppressions || [],
|
|
975
|
-
...resultSast.suppressions || []
|
|
976
|
-
];
|
|
1032
|
+
const { resultSecrets, resultSast } = await executeSecurityVerifiersAsync(rootDir, options);
|
|
1033
|
+
const allSuppressions = [...resultSecrets.suppressions || [], ...resultSast.suppressions || []];
|
|
977
1034
|
writeSuppressionsAuditReport(rootDir, allSuppressions);
|
|
978
1035
|
persistSecuritySarif(rootDir, resultSecrets, resultSast, options.output);
|
|
979
1036
|
const hasExpired = allSuppressions.some((s) => s.status === "expired");
|
|
@@ -1099,22 +1156,27 @@ function runVerifyPrivacy(options = {}) {
|
|
|
1099
1156
|
}
|
|
1100
1157
|
return result.success;
|
|
1101
1158
|
}
|
|
1102
|
-
function
|
|
1159
|
+
function collectSyncNonAsyncGates(options, root, isSilent) {
|
|
1103
1160
|
return {
|
|
1104
1161
|
quality: { success: runVerifyQuality({ ...options, root, silent: isSilent, json: false }) },
|
|
1105
1162
|
traceability: { success: runVerifyTraceability({ root, silent: isSilent, json: false }) },
|
|
1106
1163
|
governance: { success: runVerifyGovernance({ root, silent: isSilent, json: false }) },
|
|
1107
1164
|
testing: { success: runVerifyTesting({ root, silent: isSilent, json: false }) },
|
|
1108
1165
|
gherkin: { success: runVerifyGherkin({ root, silent: isSilent, json: false }) },
|
|
1109
|
-
licenses: { success: runVerifyLicenses({ root, silent: isSilent, json: false }) },
|
|
1110
1166
|
pdac: { success: runVerifyPdac({ root, silent: isSilent, json: false }) },
|
|
1111
1167
|
schemas: { success: runVerifySchemas({ root, silent: isSilent, json: false }) },
|
|
1112
1168
|
duplicates: { success: runVerifyDuplicates({ root, silent: isSilent, json: false }) },
|
|
1113
1169
|
friction: { success: runVerifyFriction({ root, silent: isSilent, json: false }) },
|
|
1114
|
-
security: { success: runVerifySecurity({ root, silent: isSilent, json: false }) },
|
|
1115
1170
|
privacy: { success: runVerifyPrivacy({ root, silent: isSilent, json: false }) }
|
|
1116
1171
|
};
|
|
1117
1172
|
}
|
|
1173
|
+
async function collectAllGatesAsync(options, root, isSilent) {
|
|
1174
|
+
return {
|
|
1175
|
+
...collectSyncNonAsyncGates(options, root, isSilent),
|
|
1176
|
+
licenses: { success: await runVerifyLicensesAsync({ root, silent: isSilent, json: false }) },
|
|
1177
|
+
security: { success: await runVerifySecurityAsync({ root, silent: isSilent, json: false }) }
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1118
1180
|
function resolveVerifyAllExitCode(allPassed, gatesSummary) {
|
|
1119
1181
|
if (allPassed) return 0;
|
|
1120
1182
|
if (!gatesSummary.security?.success) return 4;
|
|
@@ -1165,16 +1227,7 @@ function printVerifyAllSummaryTable(gatesSummary, allPassed) {
|
|
|
1165
1227
|
console.log(pc.bold(pc.red("\n\u26D4 FINAL VERDICT: BLOCKED BY DETECTED VIOLATIONS (EXIT 1)\n")));
|
|
1166
1228
|
}
|
|
1167
1229
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const useJson = isJsonOutput(options);
|
|
1170
|
-
const isSilent = Boolean(options.silent || useJson);
|
|
1171
|
-
if (!isSilent) {
|
|
1172
|
-
console.log(pc.bold(pc.magenta("================================================================")));
|
|
1173
|
-
console.log(pc.bold(pc.magenta(" AI-SDLC: FULL QUALITY GATES AND GOVERNANCE SUITE ")));
|
|
1174
|
-
console.log(pc.bold(pc.magenta("================================================================")));
|
|
1175
|
-
}
|
|
1176
|
-
const root = options.root || process.cwd();
|
|
1177
|
-
const gatesSummary = collectAllGates(options, root, isSilent);
|
|
1230
|
+
function finalizeVerifyAll(gatesSummary, options, useJson) {
|
|
1178
1231
|
const allPassed = Object.values(gatesSummary).every((g) => g.success);
|
|
1179
1232
|
if (useJson) {
|
|
1180
1233
|
emitVerifyAllJson(gatesSummary, allPassed);
|
|
@@ -1185,6 +1238,18 @@ function runVerifyAll(options = {}) {
|
|
|
1185
1238
|
}
|
|
1186
1239
|
return allPassed;
|
|
1187
1240
|
}
|
|
1241
|
+
async function runVerifyAllAsync(options = {}) {
|
|
1242
|
+
const useJson = isJsonOutput(options);
|
|
1243
|
+
const isSilent = Boolean(options.silent || useJson);
|
|
1244
|
+
if (!isSilent) {
|
|
1245
|
+
console.log(pc.bold(pc.magenta("================================================================")));
|
|
1246
|
+
console.log(pc.bold(pc.magenta(" AI-SDLC: FULL QUALITY GATES AND GOVERNANCE SUITE ")));
|
|
1247
|
+
console.log(pc.bold(pc.magenta("================================================================")));
|
|
1248
|
+
}
|
|
1249
|
+
const root = options.root || process.cwd();
|
|
1250
|
+
const gatesSummary = await collectAllGatesAsync(options, root, isSilent);
|
|
1251
|
+
return finalizeVerifyAll(gatesSummary, options, useJson);
|
|
1252
|
+
}
|
|
1188
1253
|
|
|
1189
1254
|
// src/commands/check.ts
|
|
1190
1255
|
function runAutoFix(rootDir, silent) {
|
|
@@ -1529,7 +1594,7 @@ function runCheck(options = {}) {
|
|
|
1529
1594
|
}
|
|
1530
1595
|
|
|
1531
1596
|
// src/commands/gherkin.ts
|
|
1532
|
-
import * as
|
|
1597
|
+
import * as readline2 from "readline";
|
|
1533
1598
|
import pc3 from "picocolors";
|
|
1534
1599
|
import {
|
|
1535
1600
|
extractGherkinFeatures as extractGherkinFeatures2,
|
|
@@ -1575,7 +1640,7 @@ function runGherkinExtract(options = {}) {
|
|
|
1575
1640
|
}
|
|
1576
1641
|
function defaultConfirmInstall(question) {
|
|
1577
1642
|
return new Promise((resolve3) => {
|
|
1578
|
-
const rl =
|
|
1643
|
+
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
1579
1644
|
rl.question(question, (answer) => {
|
|
1580
1645
|
rl.close();
|
|
1581
1646
|
const normalized = answer.trim().toLowerCase();
|
|
@@ -1773,7 +1838,7 @@ function runGitDetectAuthor(options = {}) {
|
|
|
1773
1838
|
}
|
|
1774
1839
|
|
|
1775
1840
|
// src/commands/init.ts
|
|
1776
|
-
import * as
|
|
1841
|
+
import * as readline3 from "readline/promises";
|
|
1777
1842
|
import { initProject } from "@aisdlc/core";
|
|
1778
1843
|
import pc5 from "picocolors";
|
|
1779
1844
|
var CI_MENU = [
|
|
@@ -1802,7 +1867,7 @@ function parseCiChoice(answer) {
|
|
|
1802
1867
|
return trimmed in CI_CHOICE_MAP ? CI_CHOICE_MAP[trimmed] : trimmed;
|
|
1803
1868
|
}
|
|
1804
1869
|
async function promptForCi() {
|
|
1805
|
-
const rl =
|
|
1870
|
+
const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
|
|
1806
1871
|
console.log(CI_MENU);
|
|
1807
1872
|
try {
|
|
1808
1873
|
const answer = await rl.question(pc5.bold("\nWhich CI/CD provider do you wish to configure? [1-5] (default 1): "));
|
|
@@ -1825,7 +1890,7 @@ var ARCH_MENU = [
|
|
|
1825
1890
|
" 3) " + pc5.gray("None") + " (No architecture templates)"
|
|
1826
1891
|
].join("\n");
|
|
1827
1892
|
async function promptForArchitecture() {
|
|
1828
|
-
const rl =
|
|
1893
|
+
const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
|
|
1829
1894
|
console.log(ARCH_MENU);
|
|
1830
1895
|
try {
|
|
1831
1896
|
const answer = await rl.question(pc5.bold("\nWhich architecture granularity level do you wish to configure? [1-3] (default 1): "));
|
|
@@ -1858,7 +1923,7 @@ function parseAgentsChoice(answer) {
|
|
|
1858
1923
|
return !trimmed ? "all" : map[trimmed] || trimmed;
|
|
1859
1924
|
}
|
|
1860
1925
|
async function promptForAgents() {
|
|
1861
|
-
const rl =
|
|
1926
|
+
const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
|
|
1862
1927
|
console.log(AGENTS_MENU);
|
|
1863
1928
|
try {
|
|
1864
1929
|
const answer = await rl.question(pc5.bold("\nWhich agents do you wish to deploy? [1-7 or comma-separated list] (default 1): "));
|
|
@@ -2781,8 +2846,8 @@ program.command("check").description("Unified pre-flight command: validates Qual
|
|
|
2781
2846
|
process.exit(passed ? 0 : 1);
|
|
2782
2847
|
});
|
|
2783
2848
|
var verifyCommand = program.command("verify").description("Run deterministic verifiers for quality, traceability, governance, and licenses");
|
|
2784
|
-
verifyCommand.command("all", { isDefault: true }).description("Run the full quality and governance suite (Quality Gate + RTM + Tasks + Tests + Licenses + PDaC + Schemas + Duplicates + Security + Privacy)").option("-r, --root <path>", "Project root directory").option("-p, --policy <path>", "Path to quality-policy.yaml").option("-C, --max-cyclomatic <number>", "Maximum Cyclomatic Complexity threshold").option("-K, --max-cognitive <number>", "Maximum Cognitive Complexity threshold").option("-M, --min-maintainability <number>", "Minimum Maintainability threshold (0-100)").option("-L, --max-lines <number>", "Maximum lines per function threshold").option("-m, --mode <mode>", "Enforcement mode: STRICT or PERMISSIVE").option("--no-vuln", "Disable dependency vulnerability scanning").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text or json").action((opts) => {
|
|
2785
|
-
const passed =
|
|
2849
|
+
verifyCommand.command("all", { isDefault: true }).description("Run the full quality and governance suite (Quality Gate + RTM + Tasks + Tests + Licenses + PDaC + Schemas + Duplicates + Security + Privacy)").option("-r, --root <path>", "Project root directory").option("-p, --policy <path>", "Path to quality-policy.yaml").option("-C, --max-cyclomatic <number>", "Maximum Cyclomatic Complexity threshold").option("-K, --max-cognitive <number>", "Maximum Cognitive Complexity threshold").option("-M, --min-maintainability <number>", "Minimum Maintainability threshold (0-100)").option("-L, --max-lines <number>", "Maximum lines per function threshold").option("-m, --mode <mode>", "Enforcement mode: STRICT or PERMISSIVE").option("--no-vuln", "Disable dependency vulnerability scanning").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text or json").action(async (opts) => {
|
|
2850
|
+
const passed = await runVerifyAllAsync({
|
|
2786
2851
|
root: opts.root,
|
|
2787
2852
|
policy: opts.policy,
|
|
2788
2853
|
maxCyclomatic: opts.maxCyclomatic,
|
|
@@ -2831,8 +2896,8 @@ verifyCommand.command("gherkin").description("Verify BDD synchronization between
|
|
|
2831
2896
|
const passed = runVerifyGherkin({ root: opts.root, json: opts.json, format: opts.format });
|
|
2832
2897
|
process.exit(passed ? 0 : 1);
|
|
2833
2898
|
});
|
|
2834
|
-
verifyCommand.command("licenses").description("Verify OSS license compliance against license-policy.yaml (dynamic SCA and SBOM)").option("-r, --root <path>", "Project root directory").option("-p, --policy <path>", "Path to license-policy.yaml").option("-m, --manifest <path>", "Path to license-manifest.yaml").option("--no-dynamic", "Disable dynamic scanning and require static manifest file").option("--sbom [path]", "Generate CycloneDX 1.5 JSON standard SBOM file").option("--notices [path]", "Generate THIRD_PARTY_NOTICES.md legal notices and attributions file").option("--tool <tool>", "SCA tool: native, trivy, syft", "native").option("--depth <depth>", "Analysis depth: direct or transitive", "transitive").option("--vuln", "Scan for known vulnerabilities (CVE/GHSA) in dependencies").option("--no-vuln", "Disable dependency vulnerability scanning").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text or json").action((opts) => {
|
|
2835
|
-
const passed =
|
|
2899
|
+
verifyCommand.command("licenses").description("Verify OSS license compliance against license-policy.yaml (dynamic SCA and SBOM)").option("-r, --root <path>", "Project root directory").option("-p, --policy <path>", "Path to license-policy.yaml").option("-m, --manifest <path>", "Path to license-manifest.yaml").option("--no-dynamic", "Disable dynamic scanning and require static manifest file").option("--sbom [path]", "Generate CycloneDX 1.5 JSON standard SBOM file").option("--sbom-input <path>", "Ingest an existing CycloneDX 1.x or SPDX 2.x SBOM JSON file to fill license gaps").option("--notices [path]", "Generate THIRD_PARTY_NOTICES.md legal notices and attributions file").option("--tool <tool>", "SCA tool: native, trivy, syft", "native").option("--depth <depth>", "Analysis depth: direct or transitive", "transitive").option("--vuln", "Scan for known vulnerabilities (CVE/GHSA) in dependencies").option("--no-vuln", "Disable dependency vulnerability scanning").option("--non-interactive", "Run in non-interactive mode without tool install prompts").option("--no-install-prompt", "Disable interactive tool install prompt").option("--ci", "Run in non-interactive CI mode").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text or json").action(async (opts) => {
|
|
2900
|
+
const passed = await runVerifyLicensesAsync({
|
|
2836
2901
|
root: opts.root,
|
|
2837
2902
|
policy: opts.policy,
|
|
2838
2903
|
manifest: opts.manifest,
|
|
@@ -2840,8 +2905,12 @@ verifyCommand.command("licenses").description("Verify OSS license compliance aga
|
|
|
2840
2905
|
tool: opts.tool,
|
|
2841
2906
|
depth: opts.depth,
|
|
2842
2907
|
sbom: opts.sbom,
|
|
2908
|
+
sbomInput: opts.sbomInput,
|
|
2843
2909
|
notices: opts.notices,
|
|
2844
2910
|
vuln: opts.vuln,
|
|
2911
|
+
nonInteractive: opts.nonInteractive,
|
|
2912
|
+
noInstallPrompt: opts.installPrompt === false,
|
|
2913
|
+
ci: opts.ci,
|
|
2845
2914
|
json: opts.json,
|
|
2846
2915
|
format: opts.format
|
|
2847
2916
|
});
|
|
@@ -2859,8 +2928,8 @@ verifyCommand.command("duplicates").description("Audit duplicate requirements, I
|
|
|
2859
2928
|
const passed = runVerifyDuplicates({ root: opts.root, similarity: opts.similarity, json: opts.json, format: opts.format });
|
|
2860
2929
|
process.exit(passed ? 0 : 1);
|
|
2861
2930
|
});
|
|
2862
|
-
verifyCommand.command("security").description("Unified security verification: deterministic secrets detection (Gitleaks) and shift-left SAST").option("-r, --root <path>", "Project root directory").option("-d, --diff", "Scan only lines added in the current branch git diff").option("-b, --base <branch>", "Base branch for git diff calculation (default: origin/main or HEAD)").option("-g, --gitleaks", "Delegate or contrast with native Gitleaks binary if available").option("-s, --semgrep", "Delegate to Semgrep CLI if installed").option("-e, --entropy <number>", "Minimum Shannon entropy threshold (0.0 to 8.0)", "4.3").option("-m, --min-severity <level>", "Minimum severity for SAST failure: CRITICAL, HIGH, MEDIUM", "HIGH").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text, json, or sarif").option("-o, --output <path>", "Output SARIF report file path (default: reports/security.sarif)").action((opts) => {
|
|
2863
|
-
const passed =
|
|
2931
|
+
verifyCommand.command("security").description("Unified security verification: deterministic secrets detection (Gitleaks) and shift-left SAST").option("-r, --root <path>", "Project root directory").option("-d, --diff", "Scan only lines added in the current branch git diff").option("-b, --base <branch>", "Base branch for git diff calculation (default: origin/main or HEAD)").option("-g, --gitleaks", "Delegate or contrast with native Gitleaks binary if available").option("-s, --semgrep", "Delegate to Semgrep CLI if installed").option("-e, --entropy <number>", "Minimum Shannon entropy threshold (0.0 to 8.0)", "4.3").option("-m, --min-severity <level>", "Minimum severity for SAST failure: CRITICAL, HIGH, MEDIUM", "HIGH").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text, json, or sarif").option("-o, --output <path>", "Output SARIF report file path (default: reports/security.sarif)").action(async (opts) => {
|
|
2932
|
+
const passed = await runVerifySecurityAsync({
|
|
2864
2933
|
root: opts.root,
|
|
2865
2934
|
diff: opts.diff,
|
|
2866
2935
|
base: opts.base,
|
|
@@ -2887,11 +2956,16 @@ verifyCommand.command("secrets").description("Verify absence of exposed credenti
|
|
|
2887
2956
|
});
|
|
2888
2957
|
process.exit(passed ? 0 : 4);
|
|
2889
2958
|
});
|
|
2890
|
-
verifyCommand.command("sast").description("Shift-left static application security testing (SAST) for critical patterns (SQLi, exec, SSRF)").option("-r, --root <path>", "Project root directory").option("-s, --semgrep", "Delegate to Semgrep CLI if installed").option("-m, --min-severity <level>", "Minimum severity for failure: CRITICAL, HIGH, MEDIUM", "HIGH").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text, json, or sarif").option("-o, --output <path>", "Output file path (e.g. reports/sast.sarif)").action((opts) => {
|
|
2891
|
-
const passed =
|
|
2959
|
+
verifyCommand.command("sast").description("Shift-left static application security testing (SAST) for critical patterns (SQLi, exec, SSRF)").option("-r, --root <path>", "Project root directory").option("-s, --semgrep", "Delegate to Semgrep CLI if installed").option("-m, --min-severity <level>", "Minimum severity for failure: CRITICAL, HIGH, MEDIUM", "HIGH").option("--sarif <paths...>", "Ingest external OASIS SARIF v2.1.0 report(s) for deterministic SAST evaluation").option("--orchestrate", "Auto-detect project ecosystems and orchestrate native SAST CLIs via SARIF").option("--non-interactive", "Run in non-interactive mode without tool install prompts").option("--no-install-prompt", "Disable interactive tool install prompt").option("--ci", "Run in non-interactive CI mode").option("--json", "Emit verification results in structured JSON format").option("-F, --format <format>", "Output format: text, json, or sarif").option("-o, --output <path>", "Output file path (e.g. reports/sast.sarif)").action(async (opts) => {
|
|
2960
|
+
const passed = await runVerifySastAsync({
|
|
2892
2961
|
root: opts.root,
|
|
2893
2962
|
semgrep: opts.semgrep,
|
|
2894
2963
|
minSeverity: opts.minSeverity,
|
|
2964
|
+
sarif: opts.sarif,
|
|
2965
|
+
orchestrate: opts.orchestrate,
|
|
2966
|
+
nonInteractive: opts.nonInteractive,
|
|
2967
|
+
noInstallPrompt: opts.installPrompt === false,
|
|
2968
|
+
ci: opts.ci,
|
|
2895
2969
|
json: opts.json,
|
|
2896
2970
|
format: opts.format,
|
|
2897
2971
|
output: opts.output
|