nsauditor-ai 0.2.27 → 0.2.28
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/README.md +1 -1
- package/cli.mjs +51 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ NSAuditor AI is the open-source core of a privacy-first security intelligence pl
|
|
|
17
17
|
|
|
18
18
|
## What's New
|
|
19
19
|
|
|
20
|
-
**GRC
|
|
20
|
+
**GRC-push startup preflight + RDS cluster-level SSL enforcement (CE 0.2.28 / Enterprise 0.32.3).** The CE CLI now **fails fast** on a bad GRC configuration — a wrong token, control-map, or provider is caught at scan **startup** (before the full multi-region scan) instead of only at push time, a real per-org fix for MSP/MSSP operators. Paired Enterprise 0.32.3 is a **matrix-neutral** RDS false-negative depth pass: plugin 1140 now audits the Aurora **cluster** parameter group (`DescribeDBClusterParameters`), closing a cleartext false-negative on **instance-less Aurora Serverless v1** clusters the instance-level SSL check never saw, and applies **staged-parameter (`ParameterApplyStatus`) discipline** so a set-but-not-yet-applied `rds.force_ssl` / `pgaudit` is no longer affirmed as effective. No new plugins, all seven coverage matrices unchanged. See **[CHANGELOG.md](./CHANGELOG.md)** for the full per-release history.
|
|
21
21
|
|
|
22
22
|
→ See a sample EE scan output: **[walk-through with synthetic Acme Corp AWS account](https://www.nsauditor.com/ai/docs/sample-scan/)** (no signup required)
|
|
23
23
|
|
package/cli.mjs
CHANGED
|
@@ -883,6 +883,43 @@ function maxSeverityInConclusion(conclusion) {
|
|
|
883
883
|
return max;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
+
/**
|
|
887
|
+
* CLI GRC-push startup preflight. Gates on the SAME condition the push itself runs
|
|
888
|
+
* under — a `scan` that requests a compliance framework — so a framework-less recon
|
|
889
|
+
* scan or a non-scan command with a globally-set `COMPLIANCE_GRC_PROVIDER` is NEVER
|
|
890
|
+
* hard-failed at startup (the push is gated by `runCompliancePhase` returning null
|
|
891
|
+
* with no frameworks — `nsauditor-ai-ee/utils/compliance_phase.mjs`). When a push IS
|
|
892
|
+
* configured, validate the config now via EE's `preflightGrcConfig` so a bad token /
|
|
893
|
+
* control-map / provider / redaction mode fails IMMEDIATELY instead of after a full
|
|
894
|
+
* scan (a real per-org UX gap for an MSP). GRC push is an EE feature, so:
|
|
895
|
+
* - not a scan / no framework / GRC not requested → no-op (never imports EE);
|
|
896
|
+
* - EE unavailable → skip silently (no EE ⇒ no push ⇒ nothing to preflight;
|
|
897
|
+
* mirrors the enrichScan EE-optional pattern);
|
|
898
|
+
* - EE too old to export the fn → skip;
|
|
899
|
+
* - a `GrcConfigError` from preflightGrcConfig PROPAGATES so main() can
|
|
900
|
+
* fail-fast (exit 1) with the module's token-free message.
|
|
901
|
+
* @param {object} env - process.env (or a test env)
|
|
902
|
+
* @param {object} [opts] - { cmd, frameworks, importEE(test seam) }
|
|
903
|
+
* @returns {Promise<{ran:boolean, reason?:string}>}
|
|
904
|
+
*/
|
|
905
|
+
export async function preflightGrcIfRequested(env, opts = {}) {
|
|
906
|
+
const { cmd, frameworks, importEE } = opts;
|
|
907
|
+
if (cmd !== 'scan') return { ran: false, reason: 'not-scan' };
|
|
908
|
+
if (!String(frameworks ?? '').trim()) return { ran: false, reason: 'no-frameworks' };
|
|
909
|
+
if (!String(env?.COMPLIANCE_GRC_PROVIDER ?? '').trim()) return { ran: false, reason: 'not-requested' };
|
|
910
|
+
let ee;
|
|
911
|
+
try {
|
|
912
|
+
ee = importEE ? await importEE() : await import('@nsasoft/nsauditor-ai-ee');
|
|
913
|
+
} catch {
|
|
914
|
+
return { ran: false, reason: 'ee-unavailable' };
|
|
915
|
+
}
|
|
916
|
+
if (typeof ee?.preflightGrcConfig !== 'function') return { ran: false, reason: 'ee-too-old' };
|
|
917
|
+
// Config fail-fast. The zero-map guard runs UNSCOPED (frameworks not threaded) —
|
|
918
|
+
// safe (no false-fails); a per-framework-empty map still warns+no_ops at push time.
|
|
919
|
+
await ee.preflightGrcConfig(env);
|
|
920
|
+
return { ran: true };
|
|
921
|
+
}
|
|
922
|
+
|
|
886
923
|
export async function main() {
|
|
887
924
|
const args = await parseArgs(process.argv);
|
|
888
925
|
const { cmd, host, plugins, insecureHttps, hostFile, parallel, failOn, outputFormat, watch, intervalMinutes, webhookUrl, alertSeverity, ports, compliance, complianceScope, awsRegion } = args;
|
|
@@ -1062,6 +1099,20 @@ Docs: https://www.nsauditor.com/ai/ | Pricing: https://www.nsauditor.com/ai/
|
|
|
1062
1099
|
process.exit(1);
|
|
1063
1100
|
}
|
|
1064
1101
|
|
|
1102
|
+
// GRC-push startup preflight (EE 0.32.x): if this scan would push (a `scan` with a
|
|
1103
|
+
// compliance framework + COMPLIANCE_GRC_PROVIDER set), validate the config NOW (after
|
|
1104
|
+
// --env load) so a bad token / control-map / provider fails fast instead of after a
|
|
1105
|
+
// full scan. The helper gates on the exact push condition (so a framework-less recon
|
|
1106
|
+
// scan / non-scan command is never hard-failed) + silently skips if EE isn't installed.
|
|
1107
|
+
try {
|
|
1108
|
+
await preflightGrcIfRequested(process.env, { cmd, frameworks: args.compliance ?? process.env.COMPLIANCE_FRAMEWORKS });
|
|
1109
|
+
} catch (err) {
|
|
1110
|
+
// GrcConfigError (bad token/map/provider/redaction). The module's message is
|
|
1111
|
+
// token-free by construction; surface it and fail-fast.
|
|
1112
|
+
console.error(`Error: GRC push config invalid — ${err.message}`);
|
|
1113
|
+
process.exit(1);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1065
1116
|
// Build the AWS region intent AFTER env load so AWS_REGION (.env/shell) is visible.
|
|
1066
1117
|
// Explicit --aws-region fail-fasts on an unknown region.
|
|
1067
1118
|
let awsRegionIntent = null;
|