@clear-capabilities/agentic-security-scanner 0.144.0 → 0.147.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/CHANGELOG.md +390 -0
- package/bin/agentic-security.js +3813 -83
- package/dist/1122.index.js +702 -0
- package/dist/{301.index.js → 1301.index.js} +2 -2
- package/dist/1379.index.js +591 -0
- package/dist/{444.index.js → 1444.index.js} +13 -4
- package/dist/{660.index.js → 1660.index.js} +2 -2
- package/dist/{700.index.js → 1700.index.js} +2 -2
- package/dist/{905.index.js → 1905.index.js} +3 -3
- package/dist/{920.index.js → 1920.index.js} +3 -3
- package/dist/{238.index.js → 2238.index.js} +3 -3
- package/dist/2271.index.js +165 -0
- package/dist/{985.index.js → 2376.index.js} +1260 -340
- package/dist/2432.index.js +793 -0
- package/dist/2659.index.js +93 -0
- package/dist/{826.index.js → 2826.index.js} +2 -2
- package/dist/{830.index.js → 2830.index.js} +2 -2
- package/dist/2923.index.js +298 -0
- package/dist/{1.index.js → 3001.index.js} +5 -5
- package/dist/{117.index.js → 3117.index.js} +3 -3
- package/dist/3180.index.js +307 -0
- package/dist/3276.index.js +117 -0
- package/dist/{415.index.js → 3415.index.js} +2 -2
- package/dist/{499.index.js → 3499.index.js} +2 -2
- package/dist/3518.index.js +450 -0
- package/dist/{526.index.js → 3526.index.js} +14 -6
- package/dist/{736.index.js → 3736.index.js} +4 -4
- package/dist/{839.index.js → 3839.index.js} +4 -4
- package/dist/{113.index.js → 4113.index.js} +14 -6
- package/dist/{265.index.js → 4265.index.js} +2 -2
- package/dist/{384.index.js → 4384.index.js} +3 -3
- package/dist/4547.index.js +268 -0
- package/dist/4863.index.js +422 -0
- package/dist/{970.index.js → 4970.index.js} +67 -3
- package/dist/5051.index.js +770 -0
- package/dist/{144.index.js → 5144.index.js} +5 -5
- package/dist/{333.index.js → 5333.index.js} +3 -3
- package/dist/5343.index.js +185 -0
- package/dist/5350.index.js +866 -0
- package/dist/5561.index.js +436 -0
- package/dist/{637.index.js → 5637.index.js} +29 -7
- package/dist/{449.index.js → 5830.index.js} +78 -14
- package/dist/6626.index.js +532 -0
- package/dist/6662.index.js +297 -0
- package/dist/{675.index.js → 6675.index.js} +5 -5
- package/dist/{730.index.js → 6730.index.js} +6 -6
- package/dist/6829.index.js +225 -0
- package/dist/6944.index.js +130 -0
- package/dist/{178.index.js → 7178.index.js} +26 -8
- package/dist/{227.index.js → 7227.index.js} +2 -2
- package/dist/7310.index.js +520 -0
- package/dist/{552.index.js → 7552.index.js} +4 -4
- package/dist/7709.index.js +78 -0
- package/dist/8218.index.js +160 -0
- package/dist/{476.index.js → 8476.index.js} +4 -4
- package/dist/{513.index.js → 8513.index.js} +5 -5
- package/dist/{520.index.js → 8520.index.js} +2 -2
- package/dist/{718.index.js → 8718.index.js} +2 -2
- package/dist/{752.index.js → 8752.index.js} +2 -2
- package/dist/8846.index.js +100 -0
- package/dist/{435.index.js → 9091.index.js} +580 -187
- package/dist/{207.index.js → 9207.index.js} +2 -2
- package/dist/{220.index.js → 9220.index.js} +2 -2
- package/dist/9390.index.js +163 -0
- package/dist/{503.index.js → 9503.index.js} +2 -2
- package/dist/{801.index.js → 9801.index.js} +2 -2
- package/dist/{824.index.js → 9824.index.js} +2 -2
- package/dist/agentic-security.mjs +16 -16
- package/dist/agentic-security.mjs.sha256 +1 -1
- package/dist/compliance-frameworks/hipaa-security-rule.json +3 -2
- package/package.json +23 -10
- package/src/compare.js +6 -1
- package/src/dataflow/CLAUDE.md +2 -2
- package/src/dataflow/catalog.js +42 -0
- package/src/dataflow/orm-write-catalog.js +175 -0
- package/src/engine.js +580 -30
- package/src/fix/apply-fix-service.js +1 -0
- package/src/history-scan.js +22 -5
- package/src/ir/CLAUDE.md +2 -1
- package/src/ir/chrome-probe.mjs +150 -0
- package/src/ir/parser-js.js +94 -7
- package/src/lineage/CLAUDE.md +1203 -0
- package/src/lineage/DESIGN_DESTINATION_RESOLVER.md +156 -0
- package/src/lineage/DESIGN_GRAPH_BUILDER.md +938 -0
- package/src/lineage/DESIGN_HANDLING_ANALYZER.md +355 -0
- package/src/lineage/DESIGN_INTRAPROCEDURAL.md +628 -0
- package/src/lineage/DESIGN_PATH_PROVENANCE.md +3451 -0
- package/src/lineage/DESIGN_QUEUE_DETAIL.md +120 -0
- package/src/lineage/DESIGN_REGISTRIES.md +880 -0
- package/src/lineage/DESIGN_STORE_DETAIL.md +143 -0
- package/src/lineage/DESIGN_TRANSIT_PROTECTION.md +245 -0
- package/src/lineage/classification.js +56 -0
- package/src/lineage/coverage.js +658 -0
- package/src/lineage/cross-repo-link.js +107 -0
- package/src/lineage/dataflow-graph.schema.json +184 -0
- package/src/lineage/decision-story.js +206 -0
- package/src/lineage/drift-policy.js +279 -0
- package/src/lineage/driver.js +135 -0
- package/src/lineage/engine.js +992 -0
- package/src/lineage/export-briefing.js +628 -0
- package/src/lineage/export-csv.js +62 -0
- package/src/lineage/export-json.js +238 -0
- package/src/lineage/export-privacy.js +258 -0
- package/src/lineage/federation-loader.js +111 -0
- package/src/lineage/field-identity.js +78 -0
- package/src/lineage/fixtures/build-flagship-fixture.mjs +272 -0
- package/src/lineage/fixtures/flagship-graph.json +1453 -0
- package/src/lineage/flow-grade.js +221 -0
- package/src/lineage/governance-edit.js +169 -0
- package/src/lineage/graph-builder.js +1114 -0
- package/src/lineage/graph-diff.js +431 -0
- package/src/lineage/graph-snapshot.js +180 -0
- package/src/lineage/handling-analyzer.js +168 -0
- package/src/lineage/ids.js +349 -0
- package/src/lineage/impact-assessment.js +76 -0
- package/src/lineage/impact-engine.js +268 -0
- package/src/lineage/index.js +281 -0
- package/src/lineage/language-coverage-tiers.js +58 -0
- package/src/lineage/obligation-mapping.js +126 -0
- package/src/lineage/obligation-predicates.js +235 -0
- package/src/lineage/observation-adapters.js +282 -0
- package/src/lineage/observation-correlation.js +622 -0
- package/src/lineage/observation-store.js +497 -0
- package/src/lineage/path-query.js +410 -0
- package/src/lineage/path-store.js +400 -0
- package/src/lineage/protection.js +53 -0
- package/src/lineage/recipient-profile.js +192 -0
- package/src/lineage/recipient-registry.js +394 -0
- package/src/lineage/redact-graph.js +224 -0
- package/src/lineage/remediation.js +417 -0
- package/src/lineage/resolve-destination.js +91 -0
- package/src/lineage/runtime-observation.js +464 -0
- package/src/lineage/scenario-diff.js +84 -0
- package/src/lineage/scenario-engine.js +251 -0
- package/src/lineage/scenario.js +101 -0
- package/src/lineage/schema.js +167 -0
- package/src/lineage/sink-registry.js +427 -0
- package/src/lineage/source-registry.js +357 -0
- package/src/lineage/source-seeding.js +212 -0
- package/src/lineage/summaries.js +590 -0
- package/src/lineage/transform-catalog.js +397 -0
- package/src/lineage/transit-protection.js +150 -0
- package/src/lineage/validate.js +285 -0
- package/src/lsp/server.js +49 -2
- package/src/mcp/CLAUDE.md +7 -1
- package/src/mcp/dataflow-tools.js +160 -0
- package/src/mcp/server.js +1 -1
- package/src/mcp/tools.js +22 -1
- package/src/pipeline/assurance-mode.js +64 -1
- package/src/pipeline/finding-schema.js +8 -1
- package/src/pipeline/scan-health.js +19 -1
- package/src/posture/CLAUDE.md +140 -0
- package/src/posture/accuracy-scorecard.js +60 -0
- package/src/posture/artifact-registry.js +76 -0
- package/src/posture/auditor-walkthrough.js +192 -13
- package/src/posture/compliance-frameworks/hipaa-security-rule.json +3 -2
- package/src/posture/compliance-policy.js +12 -2
- package/src/posture/cross-repo-memory.js +7 -2
- package/src/posture/fix-history.js +25 -2
- package/src/posture/fix-verify.js +9 -1
- package/src/posture/fleet.js +0 -0
- package/src/posture/git-history.js +13 -5
- package/src/posture/material-change.js +21 -2
- package/src/posture/mttr.js +75 -12
- package/src/posture/obligation-evidence-pack.js +202 -0
- package/src/posture/pre-incident-archaeology.js +39 -7
- package/src/posture/privacy-framework.js +14 -0
- package/src/posture/provenance/ai-authorship.js +68 -0
- package/src/posture/provenance/branch-entry.js +80 -0
- package/src/posture/provenance/cache.js +143 -0
- package/src/posture/provenance/confidence.js +36 -0
- package/src/posture/provenance/coordinator.js +786 -0
- package/src/posture/provenance/dag-walk.js +249 -0
- package/src/posture/provenance/evidence-attribution.js +59 -0
- package/src/posture/provenance/git-evidence.js +310 -0
- package/src/posture/provenance/lifecycle.js +208 -0
- package/src/posture/provenance/missing-control-resolver.js +137 -0
- package/src/posture/provenance/origin-resolver.js +342 -0
- package/src/posture/provenance/predicate-replay.js +133 -0
- package/src/posture/provenance/providers/config.js +39 -0
- package/src/posture/provenance/providers/github.js +62 -0
- package/src/posture/provenance/providers/gitlab.js +58 -0
- package/src/posture/provenance/repo-lineage.js +74 -0
- package/src/posture/provenance/sca-origin.js +139 -0
- package/src/posture/provenance/schema.js +255 -0
- package/src/posture/provenance/transitive-sca.js +147 -0
- package/src/posture/provenance/validate.js +30 -0
- package/src/posture/provenance-evidence-bundle.js +144 -0
- package/src/posture/remediation-ledger.js +337 -0
- package/src/posture/sbom-diff.js +15 -2
- package/src/posture/secret-history.js +10 -2
- package/src/posture/state-dir.js +38 -14
- package/src/posture/vuln-archaeology.js +8 -2
- package/src/pr-delta.js +25 -4
- package/src/report/index.js +197 -3
- package/src/runScan.js +34 -5
- package/src/sast/rate-limit.js +33 -3
- package/src/server/CLAUDE.md +47 -0
- package/src/server/graph-loader.js +141 -0
- package/src/server/http-server.js +325 -0
- package/src/server/routes.js +129 -0
- package/src/server/security.js +111 -0
- package/src/server/static-assets.js +139 -0
- package/src/util/git-hardening.js +128 -0
- package/dist/11.index.js +0 -353
- package/dist/259.index.js +0 -975
- package/dist/317.index.js +0 -300
- package/dist/609.index.js +0 -741
- package/dist/838.index.js +0 -152
package/dist/838.index.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
export const id = 838;
|
|
2
|
-
export const ids = [838];
|
|
3
|
-
export const modules = {
|
|
4
|
-
|
|
5
|
-
/***/ 7838:
|
|
6
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
7
|
-
|
|
8
|
-
__webpack_require__.r(__webpack_exports__);
|
|
9
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
|
-
/* harmony export */ runProjectLinter: () => (/* binding */ runProjectLinter),
|
|
11
|
-
/* harmony export */ verifyFix: () => (/* binding */ verifyFix),
|
|
12
|
-
/* harmony export */ verifyPatch: () => (/* binding */ verifyPatch)
|
|
13
|
-
/* harmony export */ });
|
|
14
|
-
/* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1421);
|
|
15
|
-
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3024);
|
|
16
|
-
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6760);
|
|
17
|
-
/* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3793);
|
|
18
|
-
// Closed-loop /fix verification (Sentinel-parity FR-L4-4, FR-L4-5).
|
|
19
|
-
//
|
|
20
|
-
// Given a candidate patch (the new file content + the finding stableId being
|
|
21
|
-
// fixed), verify it:
|
|
22
|
-
//
|
|
23
|
-
// 1. The original finding's stableId no longer fires on the patched file.
|
|
24
|
-
// 2. No new findings at severity ≥ medium were introduced by the patch.
|
|
25
|
-
// 3. The project's existing linter (when present) passes on the patched file.
|
|
26
|
-
//
|
|
27
|
-
// If any of those fail, the caller is expected to NOT apply the patch and
|
|
28
|
-
// instead surface a "fix plan" — a numbered list of steps the engineer can
|
|
29
|
-
// follow — rather than dump a broken patch on the user.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const SEVERITY_RANK = { critical: 0, high: 1, medium: 2, low: 3, info: 4 };
|
|
37
|
-
|
|
38
|
-
// Run a focused re-scan over just the patched file(s) using the in-memory
|
|
39
|
-
// engine. No filesystem write needed — we hand the new content in via the
|
|
40
|
-
// fileContents map.
|
|
41
|
-
async function verifyPatch({
|
|
42
|
-
scanRoot,
|
|
43
|
-
originalFindingStableId,
|
|
44
|
-
files, // { [relPath]: newContent }
|
|
45
|
-
depFileContents = {},
|
|
46
|
-
} = {}) {
|
|
47
|
-
if (!files || typeof files !== 'object') return { ok: false, reason: 'no-files-provided' };
|
|
48
|
-
const fileContents = { ...files };
|
|
49
|
-
let scan;
|
|
50
|
-
try {
|
|
51
|
-
scan = await (0,_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .runFullScan */ .wW)({ fileContents, depFileContents, scanRoot }, () => {});
|
|
52
|
-
} catch (e) {
|
|
53
|
-
return { ok: false, reason: 'rescan-failed', error: e.message };
|
|
54
|
-
}
|
|
55
|
-
const findings = (scan && scan.findings) || [];
|
|
56
|
-
const stillHasOriginal = !!originalFindingStableId &&
|
|
57
|
-
findings.some(f => f.stableId === originalFindingStableId);
|
|
58
|
-
if (stillHasOriginal) {
|
|
59
|
-
return { ok: false, reason: 'original-finding-still-present', stableId: originalFindingStableId };
|
|
60
|
-
}
|
|
61
|
-
const introducedHighOrAbove = findings.filter(f =>
|
|
62
|
-
(SEVERITY_RANK[f.severity] ?? 9) <= SEVERITY_RANK.medium);
|
|
63
|
-
// Don't count findings on lines outside the patched files — but our
|
|
64
|
-
// fileContents map IS the patched files, so every finding is in-scope.
|
|
65
|
-
return {
|
|
66
|
-
ok: introducedHighOrAbove.length === 0,
|
|
67
|
-
reason: introducedHighOrAbove.length === 0 ? 'verified' : 'introduced-new-findings',
|
|
68
|
-
introduced: introducedHighOrAbove.map(f => ({
|
|
69
|
-
vuln: f.vuln, file: f.file, line: f.line, severity: f.severity,
|
|
70
|
-
stableId: f.stableId,
|
|
71
|
-
})),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Detect which linter the project uses and run it on the patched files.
|
|
76
|
-
// Returns { ok, runner, output } or { ok: true, runner: 'none' } when no
|
|
77
|
-
// linter is configured (silent pass).
|
|
78
|
-
function runProjectLinter(scanRoot, filePaths) {
|
|
79
|
-
if (!scanRoot || !Array.isArray(filePaths) || filePaths.length === 0) {
|
|
80
|
-
return { ok: true, runner: 'none' };
|
|
81
|
-
}
|
|
82
|
-
const has = (p) => { try { return node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(node_path__WEBPACK_IMPORTED_MODULE_2__.join(scanRoot, p)); } catch { return false; } };
|
|
83
|
-
// Pick the linter by config file present in the repo root.
|
|
84
|
-
const jsFiles = filePaths.filter(f => /\.(?:js|jsx|ts|tsx|mjs|cjs)$/i.test(f));
|
|
85
|
-
const pyFiles = filePaths.filter(f => /\.py$/i.test(f));
|
|
86
|
-
const goFiles = filePaths.filter(f => /\.go$/i.test(f));
|
|
87
|
-
const javaFiles = filePaths.filter(f => /\.java$/i.test(f));
|
|
88
|
-
|
|
89
|
-
if (jsFiles.length && (has('.eslintrc') || has('.eslintrc.json') || has('.eslintrc.js') || has('eslint.config.js') || has('eslint.config.mjs'))) {
|
|
90
|
-
return runLinter(scanRoot, 'eslint', ['--no-error-on-unmatched-pattern', ...jsFiles]);
|
|
91
|
-
}
|
|
92
|
-
if (pyFiles.length && (has('pyproject.toml') || has('ruff.toml') || has('.ruff.toml'))) {
|
|
93
|
-
return runLinter(scanRoot, 'ruff', ['check', ...pyFiles]);
|
|
94
|
-
}
|
|
95
|
-
if (pyFiles.length && has('.flake8')) {
|
|
96
|
-
return runLinter(scanRoot, 'flake8', pyFiles);
|
|
97
|
-
}
|
|
98
|
-
if (goFiles.length && (has('.golangci.yml') || has('.golangci.yaml'))) {
|
|
99
|
-
return runLinter(scanRoot, 'golangci-lint', ['run', ...goFiles]);
|
|
100
|
-
}
|
|
101
|
-
if (javaFiles.length && has('checkstyle.xml')) {
|
|
102
|
-
return runLinter(scanRoot, 'checkstyle', ['-c', 'checkstyle.xml', ...javaFiles]);
|
|
103
|
-
}
|
|
104
|
-
return { ok: true, runner: 'none' };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function runLinter(cwd, cmd, args) {
|
|
108
|
-
let r;
|
|
109
|
-
try {
|
|
110
|
-
r = (0,node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, args, { cwd, encoding: 'utf8', timeout: 60_000 });
|
|
111
|
-
} catch (e) {
|
|
112
|
-
return { ok: true, runner: cmd, skipped: true, reason: 'binary-missing', error: e.message };
|
|
113
|
-
}
|
|
114
|
-
if (r.error && r.error.code === 'ENOENT') {
|
|
115
|
-
return { ok: true, runner: cmd, skipped: true, reason: 'binary-missing' };
|
|
116
|
-
}
|
|
117
|
-
if (r.status === null) {
|
|
118
|
-
return { ok: false, runner: cmd, reason: 'timed-out', output: (r.stderr || r.stdout || '').slice(-2000) };
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
ok: r.status === 0,
|
|
122
|
-
runner: cmd,
|
|
123
|
-
exitCode: r.status,
|
|
124
|
-
output: ((r.stderr || '') + (r.stdout || '')).slice(-2000),
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Top-level verify: re-scan + lint. Returns the combined verdict + a
|
|
129
|
-
// human-readable summary string suitable for surfacing to the user.
|
|
130
|
-
async function verifyFix({
|
|
131
|
-
scanRoot,
|
|
132
|
-
originalFindingStableId,
|
|
133
|
-
files,
|
|
134
|
-
depFileContents,
|
|
135
|
-
} = {}) {
|
|
136
|
-
const rescan = await verifyPatch({ scanRoot, originalFindingStableId, files, depFileContents });
|
|
137
|
-
const lint = runProjectLinter(scanRoot, Object.keys(files || {}));
|
|
138
|
-
const ok = rescan.ok && (lint.ok || lint.skipped);
|
|
139
|
-
const summary = [
|
|
140
|
-
`re-scan: ${rescan.ok ? 'PASS' : 'FAIL — ' + rescan.reason}`,
|
|
141
|
-
`linter: ${lint.runner === 'none' ? 'skipped (no linter config)'
|
|
142
|
-
: lint.skipped ? `${lint.runner} not installed`
|
|
143
|
-
: lint.ok ? `${lint.runner} PASS`
|
|
144
|
-
: `${lint.runner} FAIL (exit ${lint.exitCode})`}`,
|
|
145
|
-
].join('\n');
|
|
146
|
-
return { ok, rescan, lint, summary };
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/***/ })
|
|
151
|
-
|
|
152
|
-
};
|