securenow 8.10.0 → 8.11.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/mcp/catalog.js CHANGED
@@ -1936,6 +1936,26 @@ const PROMPTS = [
1936
1936
  { name: 'confirmWrites', description: 'Set true only when the user explicitly wants the MCP agent to execute decisions.', required: false },
1937
1937
  ],
1938
1938
  },
1939
+ {
1940
+ name: 'work_alert_review',
1941
+ title: 'Work Alert Review',
1942
+ description: 'Use MCP tools to clear the Alert Review queue from root-cause buckets: tune noisy rules with validated guards, batch-resolve covered rows, and keep real detections alive.',
1943
+ arguments: [
1944
+ { name: 'limit', description: 'Maximum root-cause groups to work this run. Defaults to 10.', required: false },
1945
+ { name: 'search', description: 'Optional search filter over rule, route, IP, or evidence.', required: false },
1946
+ { name: 'confirmWrites', description: 'Set true only when the user explicitly wants the MCP agent to execute decisions.', required: false },
1947
+ ],
1948
+ },
1949
+ {
1950
+ name: 'soc_patrol',
1951
+ title: 'SOC Patrol (Scheduled)',
1952
+ description: 'The recurring SOC pass SecureNow\'s built-in agent used to run on a 5-minute cron. Run it from your own harness (Claude, Hermes, OpenClaw, ...) on a schedule: Alert Review root-cause fixes first, then the Requires Human queue.',
1953
+ arguments: [
1954
+ { name: 'maxAlertReviewGroups', description: 'Maximum alert-review root-cause groups to work this pass. Defaults to 10.', required: false },
1955
+ { name: 'maxHumanRows', description: 'Maximum Requires Human rows to work this pass. Defaults to 10.', required: false },
1956
+ { name: 'confirmWrites', description: 'Set true only when this scheduled run is allowed to execute decisions autonomously.', required: false },
1957
+ ],
1958
+ },
1939
1959
  {
1940
1960
  name: 'cleanup_legacy_pending_blocks',
1941
1961
  title: 'Clean Legacy Pending Blocks',
@@ -2079,6 +2099,71 @@ function promptMessages(name, args = {}) {
2079
2099
  ];
2080
2100
  }
2081
2101
 
2102
+ if (name === 'work_alert_review') {
2103
+ const limit = args.limit || 10;
2104
+ const confirmWrites = args.confirmWrites === true || args.confirmWrites === 'true';
2105
+ return [
2106
+ {
2107
+ role: 'user',
2108
+ content: {
2109
+ type: 'text',
2110
+ text: [
2111
+ 'Work my SecureNow Alert Review queue like a senior detection engineer using the MCP tools.',
2112
+ `Work up to ${limit} root-cause group(s), biggest and most urgent first.${args.search ? ` Search filter: ${args.search}.` : ''}`,
2113
+ 'Start with securenow_alert_review_runs_count, then securenow_alert_review_runs_list to get the root-cause groups. Work buckets before singletons: one upstream rule fix closes many downstream rows.',
2114
+ 'For each group, inspect a prototype row with securenow_alert_review_run_get and preview the sibling rows with securenow_alert_review_group_similar. Pull trace evidence with securenow_traces_show / securenow_logs_for_trace when trace IDs are available.',
2115
+ 'Classify the root cause: (a) benign false-positive pattern -> tune the rule, (b) real detection that fired correctly -> keep the rule alive and close the review rows, (c) mixed or unclear -> leave open with the exact missing proof.',
2116
+ 'For rule tuning, propose a narrow attack-preserving guard: combine at least TWO of path, method, status_code, user_agent. Never guard on attacker-controllable fields alone (request body/header payloads), never use path starts_with "/" or catch-all regex. Validate with securenow_alert_rule_condition_candidate_test and securenow_alert_rule_condition_diff (or a dry run) BEFORE applying; the guard must suppress the benign samples while attack examples still match.',
2117
+ 'Apply validated tuning with securenow_alert_rule_condition_update or securenow_alert_rule_exclusion_add. If the rule is a system/global rule and the tool returns access denied, do not force a customer-specific workaround — record the exact prepared guard in the decision report with outcome=rule_tuning and the missing permission.',
2118
+ 'After a rule fix, close the covered rows with securenow_alert_review_run_apply_group_decision (use previewOnly:true first; set allowMixed only after reviewing every row). For correct detections use securenow_alert_review_run_keep_alive. For one-off rows use securenow_alert_review_run_resolve or securenow_alert_review_run_dismiss with a full decision report.',
2119
+ confirmWrites
2120
+ ? 'The user requested execution. Call write tools with confirm:true, a precise reason, and a decisionReport containing summary, evidence, reviewedHistory, traceIds, and missingProof when relevant.'
2121
+ : 'Do not execute write tools yet. Produce a group-by-group plan with the exact validated guards and MCP write calls for user approval.',
2122
+ 'Never resolve a group as false positive without concrete benign samples AND proof the guard preserves attack detection. When uncertain, keep the rule alive and leave the row open with the missing proof named.',
2123
+ 'End with counts: groups worked, rules tuned (with the exact guards), rows resolved/dismissed/kept alive, rows left open with missing proof, and any permission blockers.',
2124
+ ].join('\n'),
2125
+ },
2126
+ },
2127
+ ];
2128
+ }
2129
+
2130
+ if (name === 'soc_patrol') {
2131
+ const maxAlertReviewGroups = args.maxAlertReviewGroups || 10;
2132
+ const maxHumanRows = args.maxHumanRows || 10;
2133
+ const confirmWrites = args.confirmWrites === true || args.confirmWrites === 'true';
2134
+ return [
2135
+ {
2136
+ role: 'user',
2137
+ content: {
2138
+ type: 'text',
2139
+ text: [
2140
+ 'Run one scheduled SecureNow SOC patrol pass using the MCP tools. This is the recurring pass the built-in SecureNow agent used to run every 5 minutes; you are its external replacement, so be conservative, auditable, and finish in one bounded pass.',
2141
+ '',
2142
+ 'Phase 0 — check for work:',
2143
+ '- Call securenow_alert_review_runs_count and securenow_human_actions_list (page=1, limit=1).',
2144
+ '- If both queues are empty, stop and report "no open SOC work".',
2145
+ '',
2146
+ 'Phase 1 — Alert Review first (root-cause rule fixes are the upstream fix; they auto-resolve downstream human work):',
2147
+ `- Follow the work_alert_review runbook for up to ${maxAlertReviewGroups} root-cause group(s): list groups, inspect prototypes and siblings, validate narrow attack-preserving guards (two or more of path/method/status_code/user_agent) with condition tests/diffs before applying, tune rules, batch-resolve covered rows, keep real detections alive, and leave unclear rows open with the exact missing proof.`,
2148
+ '',
2149
+ 'Phase 2 — Requires Human queue:',
2150
+ `- Follow the work_human_actions runbook for up to ${maxHumanRows} row(s): list the queue most urgent first, read each AI report and trace evidence, then choose exactly one outcome per row (block, rate limit, scoped false positive, rule tuning, case action approve/reject, or an auditable no-write decision report with the missing proof).`,
2151
+ '- Re-check rows against any rule changes from Phase 1 before deciding — a Phase 1 fix often already covers them.',
2152
+ '',
2153
+ 'Safety (this run may be unattended):',
2154
+ confirmWrites
2155
+ ? '- Writes are allowed this pass: call write tools with confirm:true, a precise reason, and a full decisionReport. Never block without high-confidence malicious evidence (riskScore >= 90 or equivalent proof). Never create broad false positives or single-condition exclusions. Prefer an auditable no-write decision report whenever evidence is mixed.'
2156
+ : '- Read-only pass: do NOT call write tools. Produce the exact prepared write calls (with guards and reasons) as a reviewable plan.',
2157
+ '- Never trust an IP globally, never create IP allowlist entries, never suppress on attacker-controllable fields alone.',
2158
+ '- Stay within the row/group budgets; leave the rest for the next scheduled pass.',
2159
+ '',
2160
+ 'End with a compact patrol report: queues checked, groups/rows worked, rules tuned (exact guards), blocks/rate limits/false positives executed or prepared, rows left open with missing proof, and anything that needs a human decision.',
2161
+ ].join('\n'),
2162
+ },
2163
+ },
2164
+ ];
2165
+ }
2166
+
2082
2167
  if (name === 'cleanup_legacy_pending_blocks') {
2083
2168
  const limit = args.limit || 50;
2084
2169
  const environment = args.environment || 'production';