nsauditor-ai 0.2.27 → 0.2.29

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/cli.mjs +51 -0
  3. 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 connector trio complete (Secureframe) + cross-framework report-quality leak closure (Enterprise 0.32.2).** Enterprise now ships the **Secureframe** GRC push connector completing the **Vanta · Drata · Secureframe** trio at the same early-access opt-in shapeand closes a **cross-framework leak** in the Enterprise compliance reports' "Why this violates" rationales: an internal `Inherits from soc2.json` note, bare foreign control-ids, and cross-framework routing-maps no longer leak a **foreign** framework's name into a HIPAA / PCI / ISO / NIST / CIS / GDPR Report on Compliance. Matrix-neutral, no new plugins. See the **[GRC Connectors](#grc-connectors-vanta-drata-secureframe)** section below, and **[CHANGELOG.md](./CHANGELOG.md)** for the full per-release history.
20
+ **RDS false-negative depth pass, part 2 (CE 0.2.29 / Enterprise 0.32.4).** No CE code change this cycle — a paired bump for Enterprise 0.32.4, a **matrix-neutral** RDS false-negative-and-report-quality depth pass on plugin 1140: **RDS Proxy client↔proxy TLS** (a proxy with `RequireTLS` off accepts cleartext client connections — a transit leg distinct from the DB-engine SSL parameter now a fail-closed HIGH), a new **retained / cross-region-replicated automated-backup at-rest surface** (an unencrypted automated backup that survives instance/cluster deletion, invisible to the live-resource and snapshot scans, is now caught), the **Aurora cluster-member double-audit closure** (a provisioned Aurora cluster's members no longer double-report the cluster-scoped SSL / Multi-AZ settings as instance-level false positives), and a **cross-framework report-quality leak closure** (a renderer backstop strips foreign framework control-ids out of the violation prose that renders into every framework report). 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsauditor-ai",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "Modular AI-assisted network security audit platform — Community Edition",
5
5
  "type": "module",
6
6
  "private": false,