AochenShen99
658c39ccf7
feat(skills): Add native SkillScan phase 1 for skills ( #3033 )
...
* Add phase 1 skill static scanning
* Rework SkillScan phase 1 as native scanner
* refactor(skillscan): align phase 1 with trimmed RFC contract
- SecurityFinding: 7 fields (rule_id, severity, file, line, message,
remediation, evidence); category/analyzer derive from the rule_id
prefix, confidence/column/fingerprint/metadata removed
- scan_archive_preflight()/scan_skill_dir() are pure functions: no
ScanContext, no policy schema; CRITICAL-blocks is a code constant and
skill_scan.enabled is applied by enforce_static_scan()/callers
- secret-* evidence is redacted before findings leave the scanner
- de-dup keys on (rule_id, file, line) so repeated occurrences keep
distinct locations for agent self-correction
- cloud-metadata detection consolidated into network-cloud-metadata
- nested zip members get a one-level stdlib magic-byte peek; an
executable member escalates package-nested-archive to CRITICAL
- install metadata sidecar removed (Phase 7 decides if it is needed)
- rule specs moved next to their analyzers; skillscan/rules/ removed
- tests updated + new anchors: redaction, dedup lines, nested-zip
escalation, single cloud-metadata rule, bundled-skill zero-CRITICAL
* fix(skillscan): tighten reverse-shell/secret/archive scan rules from review
Address PR #3033 review feedback on the native SkillScan analyzers:
- Reverse-shell false positives: split shell detection by signal strength
(/dev/tcp/, nc -e stay CRITICAL; bash -i, mkfifo -> new HIGH
shell-reverse-shell-heuristic, warn->LLM). The Python check is now
AST-anchored on real socket.socket/os.dup2/subprocess call sites instead
of raw-text substring matching, so prose/docstrings no longer hard-block.
- Secret evidence: _redact_secret_evidence returns [redacted] with no secret
bytes (was value[:6], which leaked 2 real token bytes past the prefix).
- Archive DoS: cap outer archive member count (_MAX_ARCHIVE_MEMBERS=4096);
scan_archive_preflight early-aborts with a package-too-many-members CRITICAL
finding (routes through the existing blocked->400 fail-closed path).
- shell-destructive-command: broaden the rm -rf matcher to sensitive system
roots (/home, /usr, /*, --no-preserve-root /) while leaving safe subpaths
unflagged.
- Dead code: collapse _decode_text_for_analysis to a single decode path and
drop the unused _TEXT_SUFFIXES set and _has_text_shebang helper.
- local_skill_storage: document why the host_path branch keeps app_config
possibly-None (lazy kill-switch resolution; avoids eager get_app_config in
config-free environments such as CI).
Tests: new negative/positive coverage in test_skillscan_native.py. Full
backend suite 6616 passed, 26 skipped.
2026-07-07 21:44:28 +08:00
..
2026-07-07 21:44:28 +08:00
2026-07-01 22:49:17 +08:00
2026-07-04 21:31:01 +08:00
2026-05-12 23:18:54 +08:00
2026-06-30 18:58:02 +08:00
2026-04-26 15:09:25 +08:00
2026-06-01 15:50:39 +08:00
2026-07-05 08:45:27 +08:00
2026-06-21 20:56:42 +08:00
2026-06-08 12:35:03 +08:00
2026-03-27 20:03:30 +08:00
2026-06-18 10:15:31 +08:00
2026-06-11 17:53:37 +08:00
2026-07-06 07:21:12 +08:00
2026-05-21 14:44:34 +08:00
2026-07-03 21:52:31 +08:00
2026-06-23 10:39:40 +08:00
2026-06-21 22:16:00 +08:00
2026-05-15 22:15:58 +08:00
2026-05-29 23:05:59 +08:00
2026-05-16 09:24:40 +08:00
2026-04-26 11:08:11 +08:00
2026-06-16 23:20:20 +08:00
2026-07-02 08:28:29 +08:00
2026-06-21 15:47:53 +08:00
2026-06-24 13:57:12 +08:00
2026-07-06 07:21:12 +08:00
2026-07-02 11:00:49 +08:00
2026-07-05 09:54:55 +08:00
2026-05-20 16:37:36 +08:00
2026-06-16 23:04:39 +08:00
2026-06-18 10:15:31 +08:00
2026-06-18 10:09:46 +08:00
2026-05-02 15:19:28 +08:00
2026-07-04 21:18:11 +08:00
2026-06-18 10:45:33 +08:00
2026-07-04 22:56:24 +08:00
2026-04-14 10:29:44 +08:00
2026-04-26 11:09:55 +08:00
2026-07-04 23:09:29 +08:00
2026-07-06 22:34:41 +08:00
2026-03-30 07:41:18 +08:00
2026-04-25 19:40:06 +08:00
2026-04-07 18:21:22 +08:00
2026-07-04 13:54:04 +08:00
2026-07-03 08:01:46 +08:00
2026-03-29 21:03:58 +08:00
2026-05-04 09:56:16 +08:00
2026-07-06 15:09:56 +08:00
2026-05-02 15:04:11 +08:00
2026-06-10 21:36:25 +08:00
2026-03-14 22:55:52 +08:00
2026-07-05 09:40:16 +08:00
2026-07-07 19:55:33 +08:00
2026-04-26 11:05:47 +08:00
2026-07-05 09:54:55 +08:00
2026-03-29 15:31:18 +08:00
2026-07-04 11:27:19 +08:00
2026-05-07 16:15:15 +08:00
2026-06-12 15:24:58 +08:00
2026-07-04 22:56:24 +08:00
2026-05-29 17:46:24 +08:00
2026-06-08 07:59:50 +08:00
2026-06-05 15:21:41 +08:00
2026-06-02 22:43:22 +08:00
2026-06-05 15:21:41 +08:00
2026-06-05 15:21:41 +08:00
2026-07-04 23:09:29 +08:00
2026-06-02 22:43:22 +08:00
2026-07-01 22:49:17 +08:00
2026-07-06 07:55:32 +08:00
2026-07-04 09:21:19 +08:00
2026-05-26 23:30:24 +08:00
2026-07-04 21:31:01 +08:00
2026-07-04 09:21:19 +08:00
2026-06-12 17:16:01 +08:00
2026-06-09 15:29:40 +08:00
2026-06-18 10:15:31 +08:00
2026-06-12 15:24:58 +08:00
2026-06-13 23:27:17 +08:00
2026-03-31 22:19:27 +08:00
2026-07-02 11:00:49 +08:00
2026-07-04 11:27:19 +08:00
2026-07-01 22:49:17 +08:00
2026-07-04 22:56:24 +08:00
2026-04-26 11:09:56 +08:00
2026-04-08 17:13:39 +08:00
2026-07-05 09:54:55 +08:00
2026-07-02 11:33:32 +08:00
2026-04-26 11:09:55 +08:00
2026-07-04 23:06:28 +08:00
2026-07-02 08:24:15 +08:00
2026-07-04 21:31:01 +08:00
2026-04-10 17:43:39 +08:00
2026-05-21 21:18:10 +08:00
2026-05-11 17:38:37 +08:00
2026-07-04 11:27:19 +08:00
2026-07-03 08:49:33 +08:00
2026-06-07 11:24:30 +08:00
2026-07-04 16:07:42 +08:00
2026-07-06 08:00:49 +08:00
2026-07-07 08:05:26 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-04 22:56:24 +08:00
2026-07-03 08:49:33 +08:00
2026-07-03 08:49:33 +08:00
2026-06-21 15:55:10 +08:00
2026-07-03 16:08:41 +08:00
2026-03-14 22:55:52 +08:00
2026-07-06 07:21:12 +08:00
2026-07-06 22:34:41 +08:00
2026-03-26 14:20:18 +08:00
2026-06-28 16:10:44 +08:00
2026-07-06 22:34:41 +08:00
2026-07-04 13:54:04 +08:00
2026-06-17 15:29:22 +08:00
2026-05-19 22:11:46 +08:00
2026-06-08 23:25:29 +08:00
2026-05-29 09:27:53 +08:00
2026-06-10 16:11:00 +08:00
2026-07-07 19:55:33 +08:00
2026-07-04 23:09:29 +08:00
2026-07-04 23:09:29 +08:00
2026-07-04 22:56:24 +08:00
2026-04-11 16:52:10 +08:00
2026-07-03 07:51:22 +08:00
2026-07-03 07:51:22 +08:00
2026-06-19 21:50:03 +08:00
2026-07-04 13:54:04 +08:00
2026-06-23 23:13:12 +08:00
2026-07-04 13:54:04 +08:00
2026-07-03 08:01:46 +08:00
2026-04-30 22:27:14 +08:00
2026-05-07 16:15:15 +08:00
2026-05-21 14:36:07 +08:00
2026-07-03 15:39:12 +08:00
2026-06-18 10:45:33 +08:00
2026-04-25 09:18:13 +08:00
2026-07-04 13:54:04 +08:00
2026-03-14 22:55:52 +08:00
2026-07-04 09:40:05 +08:00
2026-06-25 22:57:00 +08:00
2026-06-23 08:10:12 +08:00
2026-05-15 10:26:35 +08:00
2026-07-03 08:01:46 +08:00
2026-06-18 11:45:35 +08:00
2026-07-06 15:09:56 +08:00
2026-04-26 15:09:25 +08:00
2026-04-17 12:00:31 +08:00
2026-04-26 11:09:55 +08:00
2026-04-26 15:09:25 +08:00
2026-07-03 08:01:46 +08:00
2026-07-06 22:34:41 +08:00
2026-07-04 13:54:04 +08:00
2026-05-15 22:30:05 +08:00
2026-03-22 20:39:26 +08:00
2026-07-05 10:17:25 +08:00
2026-07-06 15:20:27 +08:00
2026-06-22 18:55:20 +08:00
2026-06-21 15:47:53 +08:00
2026-05-28 08:20:52 +08:00
2026-04-26 11:09:55 +08:00
2026-07-04 21:44:22 +08:00
2026-05-28 18:24:32 +08:00
2026-06-08 22:04:38 +08:00
2026-03-26 15:07:05 +08:00
2026-06-09 18:01:43 +08:00
2026-06-12 15:24:58 +08:00
2026-06-24 13:57:12 +08:00
2026-07-04 21:51:57 +08:00
2026-06-24 13:57:12 +08:00
2026-07-04 21:51:57 +08:00
2026-06-24 13:57:12 +08:00
2026-06-24 13:57:12 +08:00
2026-07-04 21:51:57 +08:00
2026-06-24 13:57:12 +08:00
2026-06-24 10:57:45 +08:00
2026-05-21 16:22:09 +08:00
2026-04-26 11:13:01 +08:00
2026-04-10 20:40:30 +08:00
2026-05-17 15:23:42 +08:00
2026-07-05 08:45:27 +08:00
2026-07-06 20:57:41 +08:00
2026-06-17 21:11:44 +08:00
2026-03-14 22:55:52 +08:00
2026-03-14 22:55:52 +08:00
2026-07-03 08:01:46 +08:00
2026-06-23 23:13:12 +08:00
2026-06-08 17:32:41 +08:00
2026-06-09 21:58:31 +08:00
2026-06-24 17:47:04 +08:00
2026-07-02 07:43:09 +08:00
2026-04-26 15:09:25 +08:00
2026-06-12 22:58:30 +08:00
2026-07-02 07:43:09 +08:00
2026-07-07 14:39:04 +08:00
2026-06-12 16:48:47 +08:00
2026-05-21 14:48:28 +08:00
2026-06-19 21:42:42 +08:00
2026-07-04 22:56:24 +08:00
2026-06-01 15:50:39 +08:00
2026-06-24 10:24:36 +08:00
2026-07-03 07:46:04 +08:00
2026-05-03 23:40:59 +08:00
2026-05-22 21:20:28 +08:00
2026-05-22 21:20:28 +08:00
2026-05-22 21:20:28 +08:00
2026-06-25 22:43:28 +08:00
2026-06-03 22:02:27 +08:00
2026-07-03 07:51:22 +08:00
2026-04-09 17:21:23 +08:00
2026-06-23 23:13:12 +08:00
2026-06-25 08:06:17 +08:00
2026-07-04 13:54:04 +08:00
2026-07-04 13:54:04 +08:00
2026-07-04 13:54:04 +08:00
2026-06-12 10:20:38 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-07-04 21:51:57 +08:00
2026-06-12 09:45:26 +08:00
2026-05-17 08:59:42 +08:00
2026-06-19 11:23:07 +08:00
2026-03-26 14:20:18 +08:00
2026-06-18 07:36:35 +08:00
2026-06-27 23:30:54 +08:00
2026-06-21 16:08:25 +08:00
2026-05-12 23:18:54 +08:00
2026-06-14 10:40:16 +08:00
2026-07-05 19:55:39 +08:00
2026-06-19 21:57:03 +08:00
2026-07-04 23:09:29 +08:00
2026-07-04 11:27:19 +08:00
2026-07-04 11:27:19 +08:00
2026-07-04 23:09:29 +08:00
2026-07-07 21:44:28 +08:00
2026-05-28 15:48:32 +08:00
2026-07-04 23:34:32 +08:00
2026-07-04 13:54:04 +08:00
2026-03-25 16:28:33 +08:00
2026-04-23 14:06:14 +08:00
2026-07-07 21:44:28 +08:00
2026-07-07 21:44:28 +08:00
2026-05-03 23:40:59 +08:00
2026-07-04 23:09:29 +08:00
2026-07-04 13:54:04 +08:00
2026-05-07 08:34:43 +08:00
2026-07-07 21:44:28 +08:00
2026-06-18 10:09:46 +08:00
2026-07-04 23:09:29 +08:00
2026-03-30 16:02:23 +08:00
2026-06-12 15:24:58 +08:00
2026-07-04 16:07:42 +08:00
2026-06-14 10:30:45 +08:00
2026-06-08 23:17:22 +08:00
2026-07-06 07:55:32 +08:00
2026-05-08 10:08:53 +08:00
2026-04-23 23:59:47 +08:00
2026-05-02 06:37:49 +08:00
2026-07-06 07:55:32 +08:00
2026-07-02 07:43:09 +08:00
2026-06-16 19:55:04 +08:00
2026-06-19 21:42:42 +08:00
2026-07-03 08:01:46 +08:00
2026-07-01 22:49:17 +08:00
2026-07-07 19:55:33 +08:00
2026-07-01 22:30:55 +08:00
2026-06-24 07:28:17 +08:00
2026-07-06 07:55:32 +08:00
2026-05-21 21:18:10 +08:00
2026-06-18 10:15:31 +08:00
2026-03-26 17:39:16 +08:00
2026-06-21 21:43:43 +08:00
2026-06-12 15:24:58 +08:00
2026-06-20 18:59:42 +08:00
2026-07-04 09:21:19 +08:00
2026-06-02 22:43:22 +08:00
2026-07-03 08:49:33 +08:00
2026-05-22 21:42:14 +08:00
2026-07-06 07:40:41 +08:00
2026-06-10 23:26:15 +08:00
2026-03-14 22:55:52 +08:00
2026-07-02 00:13:01 +08:00
2026-06-12 22:48:47 +08:00
2026-06-21 22:25:15 +08:00
2026-07-04 23:14:46 +08:00
2026-05-10 22:00:57 +08:00
2026-06-23 23:37:41 +08:00
2026-03-26 14:20:18 +08:00
2026-05-10 23:09:03 +08:00
2026-05-19 22:11:46 +08:00
2026-07-06 20:57:41 +08:00
2026-07-04 11:27:19 +08:00
2026-07-03 07:51:22 +08:00
2026-04-06 15:09:57 +08:00
2026-07-06 20:57:41 +08:00
2026-07-06 20:57:41 +08:00
2026-06-08 23:17:22 +08:00
2026-07-03 08:01:46 +08:00
2026-07-03 08:01:46 +08:00
2026-05-21 16:49:31 +08:00
2026-05-21 16:49:31 +08:00
2026-07-03 08:01:46 +08:00
2026-07-03 08:49:33 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-07-03 08:49:33 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-06-25 20:10:49 +08:00
2026-05-12 23:18:54 +08:00
2026-07-04 22:56:24 +08:00
2026-07-01 16:43:56 +08:00
2026-07-04 08:58:12 +08:00
2026-07-04 21:31:01 +08:00
2026-04-26 15:09:25 +08:00
2026-07-04 13:54:04 +08:00
2026-06-24 09:28:43 +08:00
2026-05-02 15:16:16 +08:00
2026-06-09 15:29:40 +08:00
2026-06-08 22:04:38 +08:00
2026-04-28 11:13:17 +08:00
2026-04-06 15:18:34 +08:00
2026-07-04 09:21:19 +08:00
2026-07-06 07:21:12 +08:00
2026-07-04 21:35:05 +08:00
2026-07-05 00:07:27 +08:00
2026-07-02 07:43:09 +08:00
2026-07-06 22:24:14 +08:00
2026-06-07 17:47:11 +08:00