praxis-sec 1.1.0 → 1.2.1
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/cli/agents/abom-generator.js +1 -1
- package/cli/agents/agent-attestation-agent.js +16 -2
- package/cli/agents/agent-config-scanner.js +1 -1
- package/cli/agents/agent-telemetry-agent.js +8 -1
- package/cli/agents/ai-infra-inventory-agent.js +482 -453
- package/cli/agents/base-agent.js +61 -1
- package/cli/agents/endpoint-agent-abuse-agent.js +2 -2
- package/cli/agents/git-history-scanner.js +1 -1
- package/cli/agents/html-reporter.js +3 -3
- package/cli/agents/index.js +2 -2
- package/cli/agents/injection-tester.js +8 -1
- package/cli/agents/mcp-security-agent.js +7 -1
- package/cli/agents/memory-poisoning-agent.js +1 -1
- package/cli/agents/model-file-scanner.js +1 -1
- package/cli/agents/orchestrator.js +11 -6
- package/cli/agents/prompt-injection-prober.js +228 -224
- package/cli/bin/praxis.js +7 -3
- package/cli/commands/agent-fix.js +1091 -1245
- package/cli/commands/audit.js +1228 -1216
- package/cli/commands/baseline.js +1 -1
- package/cli/commands/benchmark.js +1 -1
- package/cli/commands/ci.js +45 -21
- package/cli/commands/deps.js +11 -5
- package/cli/commands/env-audit.js +1 -1
- package/cli/commands/fix.js +1 -1
- package/cli/commands/mcp.js +2 -2
- package/cli/commands/openclaw.js +1 -1
- package/cli/commands/red-team.js +350 -350
- package/cli/commands/remediate.js +1 -1
- package/cli/commands/rotate.js +1 -1
- package/cli/commands/rules.js +1 -1
- package/cli/commands/scan.js +554 -554
- package/cli/commands/score.js +1 -1
- package/cli/commands/undo.js +22 -77
- package/cli/commands/vibe-check.js +1 -1
- package/cli/core/fix-plan.js +274 -0
- package/cli/core/fs.js +27 -0
- package/cli/core/git-clone.js +8 -6
- package/cli/core/glob.js +56 -0
- package/cli/core/output/html-theme.js +158 -158
- package/cli/core/output/sarif.js +2 -2
- package/cli/core/web/jobs.js +2 -2
- package/cli/core/web/server.js +19 -8
- package/cli/data/threatpacks/latest.json +41 -41
- package/cli/integrations/github-action.js +136 -0
- package/cli/utils/plugin-loader.js +15 -95
- package/cli/utils/rule-import.js +227 -227
- package/cli/utils/rule-registry.js +425 -425
- package/cli/utils/scan-fingerprint.js +1 -1
- package/cli/utils/score-history.js +118 -118
- package/docs/USAGE.md +16 -9
- package/docs/design/WEB-UI.md +4 -5
- package/package.json +13 -4
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import fs from 'fs';
|
|
23
23
|
import path from 'path';
|
|
24
24
|
import { createHash } from 'crypto';
|
|
25
|
-
import { BaseAgent, createFinding } from './base-agent.js';
|
|
25
|
+
import { BaseAgent, createFinding, ruleTableLineMask } from './base-agent.js';
|
|
26
26
|
|
|
27
27
|
// =============================================================================
|
|
28
28
|
// PATTERNS — detected in source files
|
|
@@ -284,9 +284,23 @@ export class AgentAttestationAgent extends BaseAgent {
|
|
|
284
284
|
|
|
285
285
|
// Pattern-based checks
|
|
286
286
|
const lines = content.split('\n');
|
|
287
|
+
// This lane bypasses scanFileWithPatterns, so honour the documented
|
|
288
|
+
// suppression comment here too — it was silently ignored before.
|
|
289
|
+
const ruleTable = ruleTableLineMask(lines);
|
|
290
|
+
// In a package manifest every `"url"` is npm metadata — bugs, repository,
|
|
291
|
+
// homepage, funding — pointing at a human, never fetched at runtime, and
|
|
292
|
+
// npm has no `integrity` field that would pin one. Applying ASI-10 there
|
|
293
|
+
// reported a high on essentially every published package that declares
|
|
294
|
+
// `bugs.url`. The rule still applies to agent/manifest configs, which is
|
|
295
|
+
// where a remote resource is actually loaded.
|
|
296
|
+
const patterns = isPackageJson
|
|
297
|
+
? PATTERNS.filter(p => p.rule !== 'AGENT_NO_INTEGRITY_HASH')
|
|
298
|
+
: PATTERNS;
|
|
287
299
|
for (let i = 0; i < lines.length; i++) {
|
|
288
300
|
const line = lines[i];
|
|
289
|
-
|
|
301
|
+
if (ruleTable && ruleTable.has(i)) continue;
|
|
302
|
+
if (this.isSuppressed(line)) continue;
|
|
303
|
+
for (const pattern of patterns) {
|
|
290
304
|
pattern.regex.lastIndex = 0;
|
|
291
305
|
if (pattern.regex.test(line)) {
|
|
292
306
|
findings.push(createFinding({
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import fs from 'fs';
|
|
23
23
|
import path from 'path';
|
|
24
24
|
import os from 'os';
|
|
25
|
-
import fg from '
|
|
25
|
+
import fg from '../core/glob.js';
|
|
26
26
|
import { BaseAgent, createFinding } from './base-agent.js';
|
|
27
27
|
|
|
28
28
|
// =============================================================================
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import fs from 'fs';
|
|
26
|
-
import { BaseAgent, createFinding } from './base-agent.js';
|
|
26
|
+
import { BaseAgent, createFinding, ruleTableLineMask } from './base-agent.js';
|
|
27
27
|
|
|
28
28
|
// =============================================================================
|
|
29
29
|
// PATTERNS & REGEXES
|
|
@@ -291,9 +291,16 @@ export class AgentTelemetryAgent extends BaseAgent {
|
|
|
291
291
|
};
|
|
292
292
|
|
|
293
293
|
// ── Pass 1: line-scoped regex patterns ───────────────────────────────
|
|
294
|
+
// A rule table's own prose/patterns would otherwise match the very rules
|
|
295
|
+
// looking for them; `ruleTable` is null for anything that is not a table.
|
|
296
|
+
const ruleTable = ruleTableLineMask(lines);
|
|
294
297
|
for (const group of [SECRET_PATTERNS, HAZARDOUS_CMD_PATTERNS, PROMPT_INJECTION_PATTERNS, EXFIL_PATTERNS]) {
|
|
295
298
|
for (const pattern of group) {
|
|
296
299
|
for (let i = 0; i < lines.length; i++) {
|
|
300
|
+
if (ruleTable && ruleTable.has(i)) continue;
|
|
301
|
+
// This lane bypassed scanFileWithPatterns, so honour the documented
|
|
302
|
+
// suppression comment here too — it was silently ignored before.
|
|
303
|
+
if (this.isSuppressed(lines[i])) continue;
|
|
297
304
|
pattern.regex.lastIndex = 0;
|
|
298
305
|
let match;
|
|
299
306
|
while ((match = pattern.regex.exec(lines[i])) !== null) {
|