@node9/policy-engine 1.67.3 → 1.67.5

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.d.mts CHANGED
@@ -153,6 +153,21 @@ declare function matchSensitivePath(resolvedPath: string, originalPath: string):
153
153
  declare function sensitivePathMatch(originalPath: string): DlpMatch;
154
154
  /** Exposed so the proxy can apply the same patterns directly if needed. */
155
155
  declare const SENSITIVE_PATH_REGEXES: readonly RegExp[];
156
+ /**
157
+ * The bounds scanArgs works within, published so callers can tell "scanned
158
+ * clean" apart from "never looked". A caller that must FAIL CLOSED on an
159
+ * unscanned value (e.g. the audit writer, which would otherwise persist an
160
+ * unexamined credential in plaintext) needs these to decide whether the scan
161
+ * actually covered its input. Exported rather than duplicated at the call
162
+ * site so the two can never drift apart.
163
+ */
164
+ declare const DLP_SCAN_LIMITS: {
165
+ /** Max characters examined per individual string field; the remainder of an
166
+ * oversized string is NOT scanned. */
167
+ readonly maxStringBytes: 100000;
168
+ /** Max nesting depth walked; anything deeper is NOT scanned. */
169
+ readonly maxDepth: 5;
170
+ };
156
171
  /**
157
172
  * Recursively scans an args value for known secret patterns.
158
173
  * Handles nested objects, arrays, and JSON-encoded strings.
@@ -1155,4 +1170,4 @@ declare function previewArgs(input: Record<string, unknown>, max: number): strin
1155
1170
  /** Engine version stamped on audit entries for future drift detection. */
1156
1171
  declare const ENGINE_VERSION = "1.4.0";
1157
1172
 
1158
- export { AST_FS_REGEX_RULES, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, COST_PER_LOOP_ITER_USD, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, DEFAULT_EGRESS_ALLOWLIST, DESTRUCTIVE_OP_RE, DLP_PATTERNS, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LoopWindowEvaluation, PRIVILEGE_ESCALATION_RE, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, type ScanFinding, type ScanSignals, type ScanSummary, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestination, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type ToolCallEntry, type ToolCallRecord, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, checkDangerousSql, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, dedupeCanonicalFindings, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateSmartConditions, extractAllSshHosts, extractCanonicalFindings, extractNetworkTargets, extractPositionalArgs, extractSessionLevelFindings, extractShellDestinations, getCompiledRegex, getNestedValue, hostMatches, isBashTool, isIgnoredTool, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, matchSensitivePath, matchesPattern, narrativeRuleLabel, normalizeCommandForPolicy, parseAllSshHostsFromCommand, parseDestHost, previewArgs, redactText, resolvePinned, scanArgs, scanInjection, scanText, sensitivePathMatch, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, validateOverrides, validateRegex, validateShieldDefinition };
1173
+ export { AST_FS_REGEX_RULES, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, COST_PER_LOOP_ITER_USD, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, DEFAULT_EGRESS_ALLOWLIST, DESTRUCTIVE_OP_RE, DLP_PATTERNS, DLP_SCAN_LIMITS, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LoopWindowEvaluation, PRIVILEGE_ESCALATION_RE, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, type ScanFinding, type ScanSignals, type ScanSummary, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestination, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type ToolCallEntry, type ToolCallRecord, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, checkDangerousSql, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, dedupeCanonicalFindings, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateSmartConditions, extractAllSshHosts, extractCanonicalFindings, extractNetworkTargets, extractPositionalArgs, extractSessionLevelFindings, extractShellDestinations, getCompiledRegex, getNestedValue, hostMatches, isBashTool, isIgnoredTool, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, matchSensitivePath, matchesPattern, narrativeRuleLabel, normalizeCommandForPolicy, parseAllSshHostsFromCommand, parseDestHost, previewArgs, redactText, resolvePinned, scanArgs, scanInjection, scanText, sensitivePathMatch, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, validateOverrides, validateRegex, validateShieldDefinition };
package/dist/index.d.ts CHANGED
@@ -153,6 +153,21 @@ declare function matchSensitivePath(resolvedPath: string, originalPath: string):
153
153
  declare function sensitivePathMatch(originalPath: string): DlpMatch;
154
154
  /** Exposed so the proxy can apply the same patterns directly if needed. */
155
155
  declare const SENSITIVE_PATH_REGEXES: readonly RegExp[];
156
+ /**
157
+ * The bounds scanArgs works within, published so callers can tell "scanned
158
+ * clean" apart from "never looked". A caller that must FAIL CLOSED on an
159
+ * unscanned value (e.g. the audit writer, which would otherwise persist an
160
+ * unexamined credential in plaintext) needs these to decide whether the scan
161
+ * actually covered its input. Exported rather than duplicated at the call
162
+ * site so the two can never drift apart.
163
+ */
164
+ declare const DLP_SCAN_LIMITS: {
165
+ /** Max characters examined per individual string field; the remainder of an
166
+ * oversized string is NOT scanned. */
167
+ readonly maxStringBytes: 100000;
168
+ /** Max nesting depth walked; anything deeper is NOT scanned. */
169
+ readonly maxDepth: 5;
170
+ };
156
171
  /**
157
172
  * Recursively scans an args value for known secret patterns.
158
173
  * Handles nested objects, arrays, and JSON-encoded strings.
@@ -1155,4 +1170,4 @@ declare function previewArgs(input: Record<string, unknown>, max: number): strin
1155
1170
  /** Engine version stamped on audit entries for future drift detection. */
1156
1171
  declare const ENGINE_VERSION = "1.4.0";
1157
1172
 
1158
- export { AST_FS_REGEX_RULES, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, COST_PER_LOOP_ITER_USD, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, DEFAULT_EGRESS_ALLOWLIST, DESTRUCTIVE_OP_RE, DLP_PATTERNS, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LoopWindowEvaluation, PRIVILEGE_ESCALATION_RE, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, type ScanFinding, type ScanSignals, type ScanSummary, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestination, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type ToolCallEntry, type ToolCallRecord, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, checkDangerousSql, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, dedupeCanonicalFindings, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateSmartConditions, extractAllSshHosts, extractCanonicalFindings, extractNetworkTargets, extractPositionalArgs, extractSessionLevelFindings, extractShellDestinations, getCompiledRegex, getNestedValue, hostMatches, isBashTool, isIgnoredTool, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, matchSensitivePath, matchesPattern, narrativeRuleLabel, normalizeCommandForPolicy, parseAllSshHostsFromCommand, parseDestHost, previewArgs, redactText, resolvePinned, scanArgs, scanInjection, scanText, sensitivePathMatch, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, validateOverrides, validateRegex, validateShieldDefinition };
1173
+ export { AST_FS_REGEX_RULES, type AuditEntryForClassify, BASH_TOOL_NAMES, BUILTIN_SHIELDS, type BlastEnvFinding, type BlastFinding, type BlastResult, type BlastSummary, CANONICAL_EXTRACTOR_HASH, CANONICAL_EXTRACTOR_VERSION, COST_PER_LOOP_ITER_USD, type CanonicalAgent, type CanonicalFinding, type CanonicalFindingType, type CanonicalSourceType, DEFAULT_EGRESS_ALLOWLIST, DESTRUCTIVE_OP_RE, DLP_PATTERNS, DLP_SCAN_LIMITS, type DlpMatch, ENGINE_VERSION, type EgressPolicy, type EgressVerdict, type ExtractContext, FILE_TOOLS, FLAGS_WITH_VALUES, type FsOpVerdict, type InjectionConfidence, type InjectionContext, type InjectionMatch, LONG_OUTPUT_THRESHOLD_BYTES, LOOP_MAX_RECORDS, LOOP_THRESHOLD_FOR_WASTE, type LoopWindowEvaluation, PRIVILEGE_ESCALATION_RE, type PiiPattern, type PipeChainAnalysis, type PolicyConfig, type PolicyContext, type PolicyHostHooks, type PolicyVerdict, type ProvenanceLookup, type ProvenanceTrust, REALTIME_PII_PATTERNS, type RiskMetadata, SCAN_SIGNAL_WEIGHTS, SENSITIVE_PATH_RE, SENSITIVE_PATH_REGEXES, type ScanFinding, type ScanSignals, type ScanSummary, type ScoreTier, type SessionExtractContext, type SessionToolCall, type Severity, type ShellCommandAnalysis, type ShellDestination, type ShieldDefinition, type ShieldOverrides, type ShieldVerdict, type SmartCondition, type SmartRule, type ToolCallEntry, type ToolCallRecord, analyzeFsOperation, analyzePipeChain, analyzeShellCommand, checkDangerousSql, classifyAuditEntry, classifyRuleSeverity, classifyScanSignal, computeAgentDeviceScore, computeArgsHash, computeBlendedSecurityScore, computeScanScore, computeSecurityScore, dedupeCanonicalFindings, detectArgsPii, detectDangerousEval, detectDangerousShellExec, detectInlineExec, detectPii, evaluateEgress, evaluateLoopWindow, evaluatePolicy, evaluateSmartConditions, extractAllSshHosts, extractCanonicalFindings, extractNetworkTargets, extractPositionalArgs, extractSessionLevelFindings, extractShellDestinations, getCompiledRegex, getNestedValue, hostMatches, isBashTool, isIgnoredTool, isPrivateHost, isProtectedHomePath, isShellShapedTool, isShieldVerdict, matchSensitivePath, matchesPattern, narrativeRuleLabel, normalizeCommandForPolicy, parseAllSshHostsFromCommand, parseDestHost, previewArgs, redactText, resolvePinned, scanArgs, scanInjection, scanText, sensitivePathMatch, summarizeBlast, summarizeScan, toScanFinding, toolMatchesRule, truncateBlastPath, validateOverrides, validateRegex, validateShieldDefinition };
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ __export(src_exports, {
39
39
  DEFAULT_EGRESS_ALLOWLIST: () => DEFAULT_EGRESS_ALLOWLIST,
40
40
  DESTRUCTIVE_OP_RE: () => DESTRUCTIVE_OP_RE,
41
41
  DLP_PATTERNS: () => DLP_PATTERNS,
42
+ DLP_SCAN_LIMITS: () => DLP_SCAN_LIMITS,
42
43
  ENGINE_VERSION: () => ENGINE_VERSION,
43
44
  FILE_TOOLS: () => FILE_TOOLS,
44
45
  FLAGS_WITH_VALUES: () => FLAGS_WITH_VALUES,
@@ -715,6 +716,13 @@ function maskSecret(raw, pattern) {
715
716
  var MAX_DEPTH = 5;
716
717
  var MAX_STRING_BYTES = 1e5;
717
718
  var MAX_JSON_PARSE_BYTES = 1e4;
719
+ var DLP_SCAN_LIMITS = {
720
+ /** Max characters examined per individual string field; the remainder of an
721
+ * oversized string is NOT scanned. */
722
+ maxStringBytes: MAX_STRING_BYTES,
723
+ /** Max nesting depth walked; anything deeper is NOT scanned. */
724
+ maxDepth: MAX_DEPTH
725
+ };
718
726
  function scanArgs(args, depth = 0, fieldPath = "args") {
719
727
  if (depth > MAX_DEPTH || args === null || args === void 0) return null;
720
728
  if (Array.isArray(args)) {
@@ -4329,6 +4337,7 @@ var ENGINE_VERSION = "1.4.0";
4329
4337
  DEFAULT_EGRESS_ALLOWLIST,
4330
4338
  DESTRUCTIVE_OP_RE,
4331
4339
  DLP_PATTERNS,
4340
+ DLP_SCAN_LIMITS,
4332
4341
  ENGINE_VERSION,
4333
4342
  FILE_TOOLS,
4334
4343
  FLAGS_WITH_VALUES,
package/dist/index.mjs CHANGED
@@ -602,6 +602,13 @@ function maskSecret(raw, pattern) {
602
602
  var MAX_DEPTH = 5;
603
603
  var MAX_STRING_BYTES = 1e5;
604
604
  var MAX_JSON_PARSE_BYTES = 1e4;
605
+ var DLP_SCAN_LIMITS = {
606
+ /** Max characters examined per individual string field; the remainder of an
607
+ * oversized string is NOT scanned. */
608
+ maxStringBytes: MAX_STRING_BYTES,
609
+ /** Max nesting depth walked; anything deeper is NOT scanned. */
610
+ maxDepth: MAX_DEPTH
611
+ };
605
612
  function scanArgs(args, depth = 0, fieldPath = "args") {
606
613
  if (depth > MAX_DEPTH || args === null || args === void 0) return null;
607
614
  if (Array.isArray(args)) {
@@ -4215,6 +4222,7 @@ export {
4215
4222
  DEFAULT_EGRESS_ALLOWLIST,
4216
4223
  DESTRUCTIVE_OP_RE,
4217
4224
  DLP_PATTERNS,
4225
+ DLP_SCAN_LIMITS,
4218
4226
  ENGINE_VERSION,
4219
4227
  FILE_TOOLS,
4220
4228
  FLAGS_WITH_VALUES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/policy-engine",
3
- "version": "1.67.3",
3
+ "version": "1.67.5",
4
4
  "description": "Shared policy evaluation engine for node9 — DLP, smart rules, AST shell parsing, shields, loop detection. Pure functions, no I/O. Used by both node9-proxy and the node9 SaaS firewall.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://node9.ai",