[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6K21NBNBDKEMYY6VZB5V6SY":3,"skill-same:01M6K21NBNBDKEMYY6VZB5V6SY":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6K21NBNBDKEMYY6VZB5V6SY","threat-rules-ingestion",null,"Ingest fresh security research from URLs\u002Ffiles, generate signed scanner rule packs, and validate with policy and behavior scan styles across ecosystems. Use when the user asks to operationalize new threat intel into skeptic detections.","TGPSKI\u002Fskeptic","TGPSKI","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12532803?v=4","01M6K20PYXDJ1HVD04MF5W8W09","Tyler Pate","01M6K20Q2S3W3JSXJZRF0C91S3",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fthreat-rules-ingestion\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"threat rules ingestion","Rules","threat","ingestion","files","with","styles","security research","fresh","ecosystems","across","scan","scanner","security","skeptic","ingest","use","generate","research","policy","2026-11-10 10:12:30",false,"---\nname: threat-rules-ingestion\ndescription: Ingest fresh security research from URLs\u002Ffiles, generate signed scanner rule packs, and validate with policy and behavior scan styles across ecosystems. Use when the user asks to operationalize new threat intel into skeptic detections.\n---\n\n# Threat Rules Ingestion\n\n## Workflow\n\n1. Gather sources and ecosystems.\n2. Generate a dated rule pack with strict quality checks.\n3. **Curate the pack** — prune web-scrape noise and over-broad patterns.\n4. **De-duplicate** — remove rules that overlap with the built-in library.\n5. **Classify** — map each surviving rule to an existing group or flag as standalone.\n6. Sign the pack (detached `.sig`).\n7. Validate signed pack loading.\n8. Run a hybrid scan with policy checks enabled.\n\n## Commands\n\n```bash\n# Generate\ngo run .\u002Fcmd\u002Fskeptic ingest \\\n  --source \"\u003Csource-1>\" \\\n  --source \"\u003Csource-2>\" \\\n  --ecosystems \"\u003Cecosystems>\" \\\n  --rule-quality strict \\\n  --out \"\u003Coutput-json>\"\n\n# Sign (after curation + dedup)\ngo run .\u002Fcmd\u002Fskeptic sign-rulepack \\\n  --rules-file \"\u003Coutput-json>\" \\\n  --private-key \"\u003Cprivate-key>\"\n\n# Validate signed loading in isolation\ngo run .\u002Fcmd\u002Fskeptic \\\n  --rules-file \"\u003Coutput-json>\" \\\n  --rules-pubkey \"\u003Cpublic-key>\" \\\n  --require-signed-rules \\\n  --no-default-rules \\\n  --mode developer \\\n  --profile repo \\\n  --path .. \\\n  --fail-on medium\n\n# Run combined scan (always set --profile repo to avoid dev-profile home-dir sweep)\ngo run .\u002Fcmd\u002Fskeptic \\\n  --rules-file \"\u003Coutput-json>\" \\\n  --rules-pubkey \"\u003Cpublic-key>\" \\\n  --require-signed-rules \\\n  --scan-style hybrid \\\n  --policy-checks \\\n  --mode developer \\\n  --profile repo \\\n  --path .. \\\n  --fail-on high\n```\n\n---\n\n## Post-Generation Curation\n\nWhen sources are URLs (web pages), the HTML scrape includes page chrome\nthat the ingest pipeline may extract as false IOC patterns. **Always\nreview and prune the generated pack before signing.**\n\n### Step 1: Identify noise\n\nRead the generated JSON and flag rules whose `pattern` field matches any\nof these categories:\n\n| Category | Examples | Why it's noise |\n|----------|----------|----------------|\n| Analytics \u002F tracking | `posthog`, `reb2b`, `segment`, `mixpanel`, `hotjar`, `gtag`, `ga4`, `hubspot`, `intercom`, `amplitude` | Site telemetry JS embedded in page HTML |\n| Font \u002F asset loaders | `webfont.load`, `typekit`, `fonts.googleapis`, `use.fontawesome` | Web font bootstrap code |\n| DOM manipulation stubs | `document.createElement`, `getElementsByTagName`, `parentNode.insertBefore`, `classList`, `className` | Generic JS DOM API calls |\n| JS runtime primitives | `Array.prototype`, `Object.keys`, `toString`, `push`, `split`, `length`, `async`, `src` | Ubiquitous JS tokens |\n| CDN \u002F infra domains | `cdn.jsdelivr.net`, `unpkg.com`, `cdnjs.cloudflare.com`, `ajax.googleapis.com` | Legitimate CDN origins |\n| Marketing \u002F consent | `cookieconsent`, `onetrust`, `gdpr`, `privacy-policy` | Cookie banner JS |\n\n### Step 2: Prune noise\n\nRemove matching rules from the `rules` array in the JSON file. Use a\nscript or manual edit — do not re-run ingest (that would re-generate the\nnoise).\n\n```python\n# Example pruning script (adjust noise_patterns as needed)\nimport json, re, sys\n\nnoise_patterns = [\n    r\"posthog\", r\"reb2b\", r\"segment\\.(com|io)\", r\"mixpanel\",\n    r\"hotjar\", r\"gtag\", r\"hubspot\", r\"intercom\", r\"amplitude\",\n    r\"webfont\\.load\", r\"typekit\", r\"fonts\\.googleapis\",\n    r\"document\\.createElement\", r\"getelementsbytagname\",\n    r\"parentnode\\.insertbefore\", r\"classlist\", r\"classname\",\n    r\"array\\.prototype\", r\"\\.tostring\", r\"\\.push\\b\", r\"\\.split\\b\",\n    r\"\\.length\\b\", r\"\\.async\\b\", r\"\\.src\\b\",\n    r\"cdn\\.jsdelivr\", r\"unpkg\\.com\", r\"cdnjs\\.cloudflare\",\n    r\"cookieconsent\", r\"onetrust\",\n]\n\nwith open(sys.argv[1]) as f:\n    pack = json.load(f)\n\nbefore = len(pack[\"rules\"])\ncompiled = [re.compile(p, re.IGNORECASE) for p in noise_patterns]\npack[\"rules\"] = [\n    r for r in pack[\"rules\"]\n    if not any(c.search(r[\"pattern\"]) for c in compiled)\n]\nafter = len(pack[\"rules\"])\n\nwith open(sys.argv[1], \"w\") as f:\n    json.dump(pack, f, indent=2)\n\nprint(f\"pruned {before - after} noise rules ({before} -> {after})\")\n```\n\nRun: `python3 prune_noise.py \u003Coutput-json>`\n\n### Step 3: Over-Broad Pattern Heuristic\n\nAlso remove rules whose pattern is a single common token that would\nmatch most codebases and produce excessive false positives:\n\n- Patterns shorter than 8 characters (e.g., `e\\.init`, `t\\.push`)\n- Patterns matching generic filenames without a distinguishing qualifier\n  (e.g., bare `index\\.js`, `package\\.json`, `extension\\.js`)\n- Patterns matching language-standard API calls\n  (e.g., `process\\.platform`, `child_process`, `require`)\n\nThese tokens may appear in the advisory as context for the attack chain,\nbut as standalone regex patterns they are not actionable detections.\n\n---\n\n## De-Duplication Against Built-In Rules\n\nAfter noise pruning and before signing, de-duplicate the ingested rules\nagainst the 200+ built-in rules in `internal\u002Frules\u002F`. **Do not ingest a\nrule that the built-in library already covers.**\n\n**Note:** Some finding families are emitted by `internal\u002Fchecks\u002F` (e.g.,\n`DOM-TYPO-*`, `DEP-TYPO-*`, `GRAPH-*`, `MID-*`, `POL-*`, `BHV-*`) and\nby `internal\u002Fcorrelation\u002F` (e.g., `COR-*`, `DRIFT-*`). These are not\nin the rule files and do not appear in the prefix registry below. Ingested\nrules should not try to duplicate these check-emitted finding families.\n\n### Overlap dimensions\n\nCheck each ingested rule against the built-in library on three axes,\nfrom strongest to weakest signal:\n\n| Axis | How to check | Action |\n|------|-------------|--------|\n| **Exact ID** | Ingested rule ID matches a built-in rule ID | **Drop** — direct duplicate |\n| **Pattern equivalence** | Ingested `pattern` is identical (or functionally identical after whitespace normalization) to a built-in `pattern` | **Drop** — same detection |\n| **Semantic subsumption** | A built-in rule's pattern already matches a strict superset of the ingested rule's pattern (e.g., built-in `curl.*\\|.*sh` subsumes ingested `curl.*\\|.*bash`) | **Drop** — already covered |\n\nWhen uncertain about subsumption, keep the ingested rule — false\nnegatives from missing a novel IOC are worse than mild overlap.\n\n### Built-in ID prefix registry\n\nUse this to quickly identify ID collisions:\n\n| Prefix | Group file | Domain |\n|--------|-----------|--------|\n| `TPCP-ACT-*` | `rules_supply_chain_campaigns.go` | GitHub Actions campaign indicators |\n| `TPCP-TRV-*` | `rules_supply_chain_campaigns.go` | Trivy\u002Fbinary-image indicators |\n| `TPCP-NPM-*` | `rules_supply_chain_campaigns.go` | npm supply chain |\n| `TPCP-PY-*` | `rules_supply_chain_campaigns.go` | PyPI supply chain |\n| `TPCP-VSX-*` | `rules_supply_chain_campaigns.go` | VSCode extension supply chain |\n| `TPCP-PERSIST-*` | `rules_supply_chain_campaigns.go` | Persistence artifacts |\n| `TPCP-TEL-*` | `rules_supply_chain_campaigns.go` | Telemetry\u002Fstaging domains |\n| `TPCP-IOC-*` | `rules_supply_chain_campaigns.go` | Network IOCs |\n| `TPCP-CRED-*` | `rules_supply_chain_campaigns.go` | Credential harvesting |\n| `SCM-TRUST-*` | `rules_supply_chain_campaigns.go` | SCM workflow trust |\n| `CI-SECRET-*` | `rules_supply_chain_campaigns.go` | CI secret hygiene |\n| `ENC-EXFIL-*` | `rules_behavioral_signals.go` | Encoded exfiltration |\n| `OBF-CMD-*` | `rules_behavioral_signals.go` | Obfuscated commands |\n| `OBF-ENT-*` | `rules_behavioral_signals.go` | Entropy\u002Fobfuscation |\n| `AGT-EXP-*` | `rules_behavioral_signals.go` | Agentic exploit patterns |\n| `CTR-ESC-*` | `rules_behavioral_signals.go` | Container escape |\n| `CI-ABUSE-*` | `rules_behavioral_signals.go` | CI pipeline abuse |\n| `RUGPULL-*` | `rules_behavioral_signals.go` | Rug-pull indicators |\n| `AGT-ART-001..003` | `rules_agentic_surfaces.go` | Agent artifact poisoning |\n| `AGT-SKL-*` | `rules_agentic_surfaces.go` | Skills poisoning |\n| `AGT-MCP-*` | `rules_agentic_surfaces.go` | MCP poisoning |\n| `AGT-MEM-*` | `rules_agentic_surfaces.go` | Memory poisoning |\n| `AGT-OUT-*` | `rules_agentic_surfaces.go` | Tool-output injection |\n| `AGT-TRUST-*` | `rules_agentic_surfaces.go` | Trust laundering |\n| `SCM-GIT-*` | `rules_non_code_surfaces.go` | Git metadata surfaces |\n| `SCM-PKG-*` | `rules_non_code_surfaces.go` | Package manager config |\n| `AGT-ART-004..006` | `rules_non_code_surfaces.go` | IDE\u002Fdevcontainer surfaces |\n| `IAC-TF-*` | `rules_identity_exposure.go` | Terraform credential exposure |\n| `IAC-ANS-*` | `rules_identity_exposure.go` | Ansible credential exposure |\n| `IAC-HELM-*` | `rules_identity_exposure.go` | Helm credential exposure |\n| `CLOUD-ID-*` | `rules_identity_exposure.go` | Machine identity policy |\n| `ATK-EXE-*` | `rules_attack_tactics.go` | ATT&CK execution |\n| `ATK-PER-*` | `rules_attack_tactics.go` | ATT&CK persistence |\n| `ATK-DEF-*` | `rules_attack_tactics.go` | ATT&CK defense evasion |\n| `ATK-LAT-*` | `rules_attack_tactics.go` | ATT&CK lateral movement |\n| `ATK-COL-*` | `rules_attack_tactics.go` | ATT&CK collection |\n| `ATK-CC-*` | `rules_attack_tactics.go` | ATT&CK command & control |\n\n### De-duplication procedure\n\n1. **Load the built-in rule list** by scanning every `ID:` and `Pattern:` field\n   in `internal\u002Frules\u002Frules_*.go` (exclude `_test.go`, `_core.go`).\n2. **For each ingested rule**, check:\n   - Does the ID exist in the built-in list? → Drop.\n   - Does the normalized pattern (`strings.ToLower`, collapse `\\s+` to ` `)\n     match a built-in pattern? → Drop.\n   - Does a built-in pattern regex-match the ingested pattern's literal\n     IOC content (e.g., a domain, hash, filename)? → Drop (already detected).\n3. **Log every drop** with the reason and the built-in rule ID that covers it.\n4. **Report the dedup summary**: `N ingested → M unique (dropped D: X ID-dupes,\n   Y pattern-dupes, Z subsumed)`.\n\n### Quick extraction commands\n\n```bash\n# Extract all built-in rule IDs\nrg 'ID:\\s+\"([^\"]+)\"' internal\u002Frules\u002Frules_*.go -o --no-filename -r '$1' | sort > \u002Ftmp\u002Fbuiltin-ids.txt\n\n# Extract all built-in patterns\nrg 'Pattern:\\s+\"([^\"]+)\"' internal\u002Frules\u002Frules_*.go -o --no-filename -r '$1' | sort > \u002Ftmp\u002Fbuiltin-patterns.txt\n\n# Check for ID collisions against an ingested pack\npython3 -c \"\nimport json, sys\nwith open(sys.argv[1]) as f: pack = json.load(f)\nids = {r['id'] for r in pack['rules']}\nbuiltins = set(open('\u002Ftmp\u002Fbuiltin-ids.txt').read().splitlines())\ndupes = ids & builtins\nprint(f'{len(dupes)} ID collisions: {sorted(dupes)}')\n\" \u003Coutput-json>\n\n# Check for pattern collisions\npython3 -c \"\nimport json, sys, re\nwith open(sys.argv[1]) as f: pack = json.load(f)\nnorm = lambda s: re.sub(r'\\s+', ' ', s.lower().strip())\nbp = set(open('\u002Ftmp\u002Fbuiltin-patterns.txt').read().splitlines())\nbp_norm = {norm(p) for p in bp}\ndupes = [(r['id'], r['pattern']) for r in pack['rules'] if norm(r['pattern']) in bp_norm]\nprint(f'{len(dupes)} pattern collisions:')\nfor rid, pat in dupes: print(f'  {rid}: {pat[:80]}')\n\" \u003Coutput-json>\n```\n\n---\n\n## Rule Group Classification\n\nAfter de-duplication, classify each surviving ingested rule into an\nexisting built-in group — or mark it for a standalone campaign pack.\n\n### Category → group mapping\n\nMap each ingested rule's `category` field to the best-fit group file:\n\n| Ingested category | Target group file | Rationale |\n|-------------------|-------------------|-----------|\n| `github-actions`, `npm`, `pypi`, `ide-extension`, `binary-image` | `rules_supply_chain_campaigns.go` | Ecosystem-specific supply chain |\n| `persistence`, `exfiltration`, `network-ioc`, `command-control`, `credential-access` (campaign-tied IOCs) | `rules_supply_chain_campaigns.go` | Campaign indicators with specific IOCs |\n| `scm-trust`, `ci-secret-hygiene` | `rules_supply_chain_campaigns.go` | SCM\u002FCI trust signals |\n| `encoded-exfiltration`, `obfuscated-command`, `obfuscation` | `rules_behavioral_signals.go` | Encoding\u002Fobfuscation behavior |\n| `persistence` (generic behavioral, no specific IOC) | `rules_behavioral_signals.go` | Behavioral persistence patterns |\n| `rug-pull`, `container-escape`, `ci-abuse` | `rules_behavioral_signals.go` | Behavioral attack signals |\n| `mcp-agentic` | `rules_behavioral_signals.go` | Agentic behavioral patterns |\n| `skills-poisoning`, `mcp-poisoning`, `memory-poisoning` | `rules_agentic_surfaces.go` | Agent\u002FLLM attack surfaces |\n| `tool-output-injection`, `trust-laundering`, `artifact` | `rules_agentic_surfaces.go` | Agentic trust manipulation |\n| `non-code-surface` | `rules_non_code_surfaces.go` | Git\u002Fpackage\u002FIDE metadata |\n| `credential-access` (IaC\u002Fcloud, no campaign IOC) | `rules_identity_exposure.go` | Infrastructure credentials |\n| `machine-identity` | `rules_identity_exposure.go` | Cloud identity policy |\n| `execution`, `defense-evasion`, `lateral-movement`, `collection` | `rules_attack_tactics.go` | ATT&CK tactic heuristics |\n\n### Disambiguation: campaign IOC vs. behavioral pattern\n\nMany categories (e.g., `persistence`, `credential-access`, `command-control`)\nappear in both `supply_chain_campaigns` and `behavioral_signals`. Use this\nheuristic:\n\n- **Campaign-specific**: the rule's pattern contains a literal IOC\n  (domain, hash, filename, extension ID, IP address, known tool name).\n  → `rules_supply_chain_campaigns.go`\n- **Behavioral\u002Fgeneric**: the rule's pattern matches a technique\n  (encoding method, API call pattern, configuration key) without a\n  campaign-specific literal.\n  → `rules_behavioral_signals.go` or `rules_attack_tactics.go`\n\n### When to create a standalone group\n\nCreate a standalone rule pack (kept as an external `.json` file in\n`rulepacks\u002Fcampaigns\u002F`) instead of merging into built-in groups when:\n\n- The advisory is for a **specific, time-bounded campaign** with IOCs\n  that will age out (C2 domains, payload hashes, extension publisher IDs).\n- The rules are **not general-purpose detections** — they would not help\n  scan any repository unrelated to the campaign.\n- The pack should be **loadable and removable independently** without\n  modifying the core rule library.\n\nWhen a rule pack contains a mix of campaign IOCs and general behavioral\npatterns, split them:\n\n1. Keep campaign-specific IOCs (domains, hashes, filenames) in the\n   standalone external pack.\n2. Promote general behavioral patterns (technique detections that apply\n   broadly) into the appropriate built-in group file via PR.\n\n### Classification output\n\nFor each surviving rule, record its classification:\n\n```\nRULE-ID  | category         | target                              | reason\n---------|------------------|-------------------------------------|--------\nIOL-C2-001 | command-control | standalone: iolitelabs campaign pack | campaign-specific C2 domain\nIOL-RCE-001 | execution      | rules_attack_tactics.go             | generic curl|sh pattern (promote)\nIOL-GK-001 | defense-evasion | rules_behavioral_signals.go         | generic Gatekeeper bypass (promote)\n```\n\nRules marked \"promote\" are candidates for merging into the built-in\nlibrary. Rules marked \"standalone\" stay in the external pack.\n\n---\n\n## Checklist\n\n- Rule pack is non-empty and includes mixed severities.\n- **Web-scrape noise has been pruned** (analytics, fonts, DOM stubs, JS primitives).\n- **Over-broad patterns removed** (single common tokens, generic filenames).\n- **De-duplication completed** against built-in library (ID, pattern, subsumption).\n- **Dedup summary logged** (counts of ID-dupes, pattern-dupes, subsumed).\n- **Each rule classified** into an existing group or standalone pack.\n- **Campaign\u002Fbehavioral split applied** if pack mixes IOCs and techniques.\n- Top critical\u002Fhigh rules are manually spot-checked.\n- Advisory-specific IOCs confirmed present after pruning and dedup.\n- Detached signature exists and verifies.\n- Pack filename is date-versioned.\n- Validation scan passes argument\u002Fruntime checks.\n- Validation and combined scans use `--profile repo` to avoid dev-profile home-dir sweep.\n","# Threat Rules Ingestion\n\n## Workflow\n\n1. Gather sources and ecosystems.\n2. Generate a dated rule pack with strict quality checks.\n3. **Curate the pack** — prune web-scrape noise and over-broad patterns.\n4. **De-duplicate** — remove rules that overlap with the built-in library.\n5. **Classify** — map each surviving rule to an existing group or flag as standalone.\n6. Sign the pack (detached `.sig`).\n7. Validate signed pack loading.\n8. Run a hybrid scan with policy checks enabled.\n\n## Commands\n\n```bash\n# Generate\ngo run .\u002Fcmd\u002Fskeptic ingest \\\n  --source \"\u003Csource-1>\" \\\n  --source \"\u003Csource-2>\" \\\n  --ecosystems \"\u003Cecosystems>\" \\\n  --rule-quality strict \\\n  --out \"\u003Coutput-json>\"\n\n# Sign (after curation + dedup)\ngo run .\u002Fcmd\u002Fskeptic sign-rulepack \\\n  --rules-file \"\u003Coutput-json>\" \\\n  --private-key \"\u003Cprivate-key>\"\n\n# Validate signed loading in isolation\ngo run .\u002Fcmd\u002Fskeptic \\\n  --rules-file \"\u003Coutput-json>\" \\\n  --rules-pubkey \"\u003Cpublic-key>\" \\\n  --require-signed-rules \\\n  --no-default-rules \\\n  --mode developer \\\n  --profile repo \\\n  --path .. \\\n  --fail-on medium\n\n# Run combined scan (always set --profile repo to avoid dev-profile home-dir sweep)\ngo run .\u002Fcmd\u002Fskeptic \\\n  --rules-file \"\u003Coutput-json>\" \\\n  --rules-pubkey \"\u003Cpublic-key>\" \\\n  --require-signed-rules \\\n  --scan-style hybrid \\\n  --policy-checks \\\n  --mode developer \\\n  --profile repo \\\n  --path .. \\\n  --fail-on high\n```\n\n---\n\n## Post-Generation Curation\n\nWhen sources are URLs (web pages), the HTML scrape includes page chrome\nthat the ingest pipeline may extract as false IOC patterns. **Always\nreview and prune the generated pack before signing.**\n\n### Step 1: Identify noise\n\nRead the generated JSON and flag rules whose `pattern` field matches any\nof these categories:\n\n| Category | Examples | Why it's noise |\n|----------|----------|----------------|\n| Analytics \u002F tracking | `posthog`, `reb2b`, `segment`, `mixpanel`, `hotjar`, `gtag`, `ga4`, `hubspot`, `intercom`, `amplitude` | Site telemetry JS embedded in page HTML |\n| Font \u002F asset loaders | `webfont.load`, `typekit`, `fonts.googleapis`, `use.fontawesome` | Web font bootstrap code |\n| DOM manipulation stubs | `document.createElement`, `getElementsByTagName`, `parentNode.insertBefore`, `classList`, `className` | Generic JS DOM API calls |\n| JS runtime primitives | `Array.prototype`, `Object.keys`, `toString`, `push`, `split`, `length`, `async`, `src` | Ubiquitous JS tokens |\n| CDN \u002F infra domains | `cdn.jsdelivr.net`, `unpkg.com`, `cdnjs.cloudflare.com`, `ajax.googleapis.com` | Legitimate CDN origins |\n| Marketing \u002F consent | `cookieconsent`, `onetrust`, `gdpr`, `privacy-policy` | Cookie banner JS |\n\n### Step 2: Prune noise\n\nRemove matching rules from the `rules` array in the JSON file. Use a\nscript or manual edit — do not re-run ingest (that would re-generate the\nnoise).\n\n```python\n# Example pruning script (adjust noise_patterns as needed)\nimport json, re, sys\n\nnoise_patterns = [\n    r\"posthog\", r\"reb2b\", r\"segment\\.(com|io)\", r\"mixpanel\",\n    r\"hotjar\", r\"gtag\", r\"hubspot\", r\"intercom\", r\"amplitude\",\n    r\"webfont\\.load\", r\"typekit\", r\"fonts\\.googleapis\",\n    r\"document\\.createElement\", r\"getelementsbytagname\",\n    r\"parentnode\\.insertbefore\", r\"classlist\", r\"classname\",\n    r\"array\\.prototype\", r\"\\.tostring\", r\"\\.push\\b\", r\"\\.split\\b\",\n    r\"\\.length\\b\", r\"\\.async\\b\", r\"\\.src\\b\",\n    r\"cdn\\.jsdelivr\", r\"unpkg\\.com\", r\"cdnjs\\.cloudflare\",\n    r\"cookieconsent\", r\"onetrust\",\n]\n\nwith open(sys.argv[1]) as f:\n    pack = json.load(f)\n\nbefore = len(pack[\"rules\"])\ncompiled = [re.compile(p, re.IGNORECASE) for p in noise_patterns]\npack[\"rules\"] = [\n    r for r in pack[\"rules\"]\n    if not any(c.search(r[\"pattern\"]) for c in compiled)\n]\nafter = len(pack[\"rules\"])\n\nwith open(sys.argv[1], \"w\") as f:\n    json.dump(pack, f, indent=2)\n\nprint(f\"pruned {before - after} noise rules ({before} -> {after})\")\n```\n\nRun: `python3 prune_noise.py \u003Coutput-json>`\n\n### Step 3: Over-Broad Pattern Heuristic\n\nAlso remove rules whose pattern is a single common token that would\nmatch most codebases and produce excessive false positives:\n\n- Patterns shorter than 8 characters (e.g., `e\\.init`, `t\\.push`)\n- Patterns matching generic filenames without a distinguishing qualifier\n  (e.g., bare `index\\.js`, `package\\.json`, `extension\\.js`)\n- Patterns matching language-standard API calls\n  (e.g., `process\\.platform`, `child_process`, `require`)\n\nThese tokens may appear in the advisory as context for the attack chain,\nbut as standalone regex patterns they are not actionable detections.\n\n---\n\n## De-Duplication Against Built-In Rules\n\nAfter noise pruning and before signing, de-duplicate the ingested rules\nagainst the 200+ built-in rules in `internal\u002Frules\u002F`. **Do not ingest a\nrule that the built-in library already covers.**\n\n**Note:** Some finding families are emitted by `internal\u002Fchecks\u002F` (e.g.,\n`DOM-TYPO-*`, `DEP-TYPO-*`, `GRAPH-*`, `MID-*`, `POL-*`, `BHV-*`) and\nby `internal\u002Fcorrelation\u002F` (e.g., `COR-*`, `DRIFT-*`). These are not\nin the rule files and do not appear in the prefix registry below. Ingested\nrules should not try to duplicate these check-emitted finding families.\n\n### Overlap dimensions\n\nCheck each ingested rule against the built-in library on three axes,\nfrom strongest to weakest signal:\n\n| Axis | How to check | Action |\n|------|-------------|--------|\n| **Exact ID** | Ingested rule ID matches a built-in rule ID | **Drop** — direct duplicate |\n| **Pattern equivalence** | Ingested `pattern` is identical (or functionally identical after whitespace normalization) to a built-in `pattern` | **Drop** — same detection |\n| **Semantic subsumption** | A built-in rule's pattern already matches a strict superset of the ingested rule's pattern (e.g., built-in `curl.*\\|.*sh` subsumes ingested `curl.*\\|.*bash`) | **Drop** — already covered |\n\nWhen uncertain about subsumption, keep the ingested rule — false\nnegatives from missing a novel IOC are worse than mild overlap.\n\n### Built-in ID prefix registry\n\nUse this to quickly identify ID collisions:\n\n| Prefix | Group file | Domain |\n|--------|-----------|--------|\n| `TPCP-ACT-*` | `rules_supply_chain_campaigns.go` | GitHub Actions campaign indicators |\n| `TPCP-TRV-*` | `rules_supply_chain_campaigns.go` | Trivy\u002Fbinary-image indicators |\n| `TPCP-NPM-*` | `rules_supply_chain_campaigns.go` | npm supply chain |\n| `TPCP-PY-*` | `rules_supply_chain_campaigns.go` | PyPI supply chain |\n| `TPCP-VSX-*` | `rules_supply_chain_campaigns.go` | VSCode extension supply chain |\n| `TPCP-PERSIST-*` | `rules_supply_chain_campaigns.go` | Persistence artifacts |\n| `TPCP-TEL-*` | `rules_supply_chain_campaigns.go` | Telemetry\u002Fstaging domains |\n| `TPCP-IOC-*` | `rules_supply_chain_campaigns.go` | Network IOCs |\n| `TPCP-CRED-*` | `rules_supply_chain_campaigns.go` | Credential harvesting |\n| `SCM-TRUST-*` | `rules_supply_chain_campaigns.go` | SCM workflow trust |\n| `CI-SECRET-*` | `rules_supply_chain_campaigns.go` | CI secret hygiene |\n| `ENC-EXFIL-*` | `rules_behavioral_signals.go` | Encoded exfiltration |\n| `OBF-CMD-*` | `rules_behavioral_signals.go` | Obfuscated commands |\n| `OBF-ENT-*` | `rules_behavioral_signals.go` | Entropy\u002Fobfuscation |\n| `AGT-EXP-*` | `rules_behavioral_signals.go` | Agentic exploit patterns |\n| `CTR-ESC-*` | `rules_behavioral_signals.go` | Container escape |\n| `CI-ABUSE-*` | `rules_behavioral_signals.go` | CI pipeline abuse |\n| `RUGPULL-*` | `rules_behavioral_signals.go` | Rug-pull indicators |\n| `AGT-ART-001..003` | `rules_agentic_surfaces.go` | Agent artifact poisoning |\n| `AGT-SKL-*` | `rules_agentic_surfaces.go` | Skills poisoning |\n| `AGT-MCP-*` | `rules_agentic_surfaces.go` | MCP poisoning |\n| `AGT-MEM-*` | `rules_agentic_surfaces.go` | Memory poisoning |\n| `AGT-OUT-*` | `rules_agentic_surfaces.go` | Tool-output injection |\n| `AGT-TRUST-*` | `rules_agentic_surfaces.go` | Trust laundering |\n| `SCM-GIT-*` | `rules_non_code_surfaces.go` | Git metadata surfaces |\n| `SCM-PKG-*` | `rules_non_code_surfaces.go` | Package manager config |\n| `AGT-ART-004..006` | `rules_non_code_surfaces.go` | IDE\u002Fdevcontainer surfaces |\n| `IAC-TF-*` | `rules_identity_exposure.go` | Terraform credential exposure |\n| `IAC-ANS-*` | `rules_identity_exposure.go` | Ansible credential exposure |\n| `IAC-HELM-*` | `rules_identity_exposure.go` | Helm credential exposure |\n| `CLOUD-ID-*` | `rules_identity_exposure.go` | Machine identity policy |\n| `ATK-EXE-*` | `rules_attack_tactics.go` | ATT&CK execution |\n| `ATK-PER-*` | `rules_attack_tactics.go` | ATT&CK persistence |\n| `ATK-DEF-*` | `rules_attack_tactics.go` | ATT&CK defense evasion |\n| `ATK-LAT-*` | `rules_attack_tactics.go` | ATT&CK lateral movement |\n| `ATK-COL-*` | `rules_attack_tactics.go` | ATT&CK collection |\n| `ATK-CC-*` | `rules_attack_tactics.go` | ATT&CK command & control |\n\n### De-duplication procedure\n\n1. **Load the built-in rule list** by scanning every `ID:` and `Pattern:` field\n   in `internal\u002Frules\u002Frules_*.go` (exclude `_test.go`, `_core.go`).\n2. **For each ingested rule**, check:\n   - Does the ID exist in the built-in list? → Drop.\n   - Does the normalized pattern (`strings.ToLower`, collapse `\\s+` to ` `)\n     match a built-in pattern? → Drop.\n   - Does a built-in pattern regex-match the ingested pattern's literal\n     IOC content (e.g., a domain, hash, filename)? → Drop (already detected).\n3. **Log every drop** with the reason and the built-in rule ID that covers it.\n4. **Report the dedup summary**: `N ingested → M unique (dropped D: X ID-dupes,\n   Y pattern-dupes, Z subsumed)`.\n\n### Quick extraction commands\n\n```bash\n# Extract all built-in rule IDs\nrg 'ID:\\s+\"([^\"]+)\"' internal\u002Frules\u002Frules_*.go -o --no-filename -r '$1' | sort > \u002Ftmp\u002Fbuiltin-ids.txt\n\n# Extract all built-in patterns\nrg 'Pattern:\\s+\"([^\"]+)\"' internal\u002Frules\u002Frules_*.go -o --no-filename -r '$1' | sort > \u002Ftmp\u002Fbuiltin-patterns.txt\n\n# Check for ID collisions against an ingested pack\npython3 -c \"\nimport json, sys\nwith open(sys.argv[1]) as f: pack = json.load(f)\nids = {r['id'] for r in pack['rules']}\nbuiltins = set(open('\u002Ftmp\u002Fbuiltin-ids.txt').read().splitlines())\ndupes = ids & builtins\nprint(f'{len(dupes)} ID collisions: {sorted(dupes)}')\n\" \u003Coutput-json>\n\n# Check for pattern collisions\npython3 -c \"\nimport json, sys, re\nwith open(sys.argv[1]) as f: pack = json.load(f)\nnorm = lambda s: re.sub(r'\\s+', ' ', s.lower().strip())\nbp = set(open('\u002Ftmp\u002Fbuiltin-patterns.txt').read().splitlines())\nbp_norm = {norm(p) for p in bp}\ndupes = [(r['id'], r['pattern']) for r in pack['rules'] if norm(r['pattern']) in bp_norm]\nprint(f'{len(dupes)} pattern collisions:')\nfor rid, pat in dupes: print(f'  {rid}: {pat[:80]}')\n\" \u003Coutput-json>\n```\n\n---\n\n## Rule Group Classification\n\nAfter de-duplication, classify each surviving ingested rule into an\nexisting built-in group — or mark it for a standalone campaign pack.\n\n### Category → group mapping\n\nMap each ingested rule's `category` field to the best-fit group file:\n\n| Ingested category | Target group file | Rationale |\n|-------------------|-------------------|-----------|\n| `github-actions`, `npm`, `pypi`, `ide-extension`, `binary-image` | `rules_supply_chain_campaigns.go` | Ecosystem-specific supply chain |\n| `persistence`, `exfiltration`, `network-ioc`, `command-control`, `credential-access` (campaign-tied IOCs) | `rules_supply_chain_campaigns.go` | Campaign indicators with specific IOCs |\n| `scm-trust`, `ci-secret-hygiene` | `rules_supply_chain_campaigns.go` | SCM\u002FCI trust signals |\n| `encoded-exfiltration`, `obfuscated-command`, `obfuscation` | `rules_behavioral_signals.go` | Encoding\u002Fobfuscation behavior |\n| `persistence` (generic behavioral, no specific IOC) | `rules_behavioral_signals.go` | Behavioral persistence patterns |\n| `rug-pull`, `container-escape`, `ci-abuse` | `rules_behavioral_signals.go` | Behavioral attack signals |\n| `mcp-agentic` | `rules_behavioral_signals.go` | Agentic behavioral patterns |\n| `skills-poisoning`, `mcp-poisoning`, `memory-poisoning` | `rules_agentic_surfaces.go` | Agent\u002FLLM attack surfaces |\n| `tool-output-injection`, `trust-laundering`, `artifact` | `rules_agentic_surfaces.go` | Agentic trust manipulation |\n| `non-code-surface` | `rules_non_code_surfaces.go` | Git\u002Fpackage\u002FIDE metadata |\n| `credential-access` (IaC\u002Fcloud, no campaign IOC) | `rules_identity_exposure.go` | Infrastructure credentials |\n| `machine-identity` | `rules_identity_exposure.go` | Cloud identity policy |\n| `execution`, `defense-evasion`, `lateral-movement`, `collection` | `rules_attack_tactics.go` | ATT&CK tactic heuristics |\n\n### Disambiguation: campaign IOC vs. behavioral pattern\n\nMany categories (e.g., `persistence`, `credential-access`, `command-control`)\nappear in both `supply_chain_campaigns` and `behavioral_signals`. Use this\nheuristic:\n\n- **Campaign-specific**: the rule's pattern contains a literal IOC\n  (domain, hash, filename, extension ID, IP address, known tool name).\n  → `rules_supply_chain_campaigns.go`\n- **Behavioral\u002Fgeneric**: the rule's pattern matches a technique\n  (encoding method, API call pattern, configuration key) without a\n  campaign-specific literal.\n  → `rules_behavioral_signals.go` or `rules_attack_tactics.go`\n\n### When to create a standalone group\n\nCreate a standalone rule pack (kept as an external `.json` file in\n`rulepacks\u002Fcampaigns\u002F`) instead of merging into built-in groups when:\n\n- The advisory is for a **specific, time-bounded campaign** with IOCs\n  that will age out (C2 domains, payload hashes, extension publisher IDs).\n- The rules are **not general-purpose detections** — they would not help\n  scan any repository unrelated to the campaign.\n- The pack should be **loadable and removable independently** without\n  modifying the core rule library.\n\nWhen a rule pack contains a mix of campaign IOCs and general behavioral\npatterns, split them:\n\n1. Keep campaign-specific IOCs (domains, hashes, filenames) in the\n   standalone external pack.\n2. Promote general behavioral patterns (technique detections that apply\n   broadly) into the appropriate built-in group file via PR.\n\n### Classification output\n\nFor each surviving rule, record its classification:\n\n```\nRULE-ID  | category         | target                              | reason\n---------|------------------|-------------------------------------|--------\nIOL-C2-001 | command-control | standalone: iolitelabs campaign pack | campaign-specific C2 domain\nIOL-RCE-001 | execution      | rules_attack_tactics.go             | generic curl|sh pattern (promote)\nIOL-GK-001 | defense-evasion | rules_behavioral_signals.go         | generic Gatekeeper bypass (promote)\n```\n\nRules marked \"promote\" are candidates for merging into the built-in\nlibrary. Rules marked \"standalone\" stay in the external pack.\n\n---\n\n## Checklist\n\n- Rule pack is non-empty and includes mixed severities.\n- **Web-scrape noise has been pruned** (analytics, fonts, DOM stubs, JS primitives).\n- **Over-broad patterns removed** (single common tokens, generic filenames).\n- **De-duplication completed** against built-in library (ID, pattern, subsumption).\n- **Dedup summary logged** (counts of ID-dupes, pattern-dupes, subsumed).\n- **Each rule classified** into an existing group or standalone pack.\n- **Campaign\u002Fbehavioral split applied** if pack mixes IOCs and techniques.\n- Top critical\u002Fhigh rules are manually spot-checked.\n- Advisory-specific IOCs confirmed present after pruning and dedup.\n- Detached signature exists and verifies.\n- Pack filename is date-versioned.\n- Validation scan passes argument\u002Fruntime checks.\n- Validation and combined scans use `--profile repo` to avoid dev-profile home-dir sweep.\n",{"name":5,"description":7},"main","c712742a4c0e0d44b1ab5ed65e93e93288c2fb3d",".agents\u002Fskills\u002Fthreat-rules-ingestion",0,"https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic","https:\u002F\u002Fskeptic.sh","https:\u002F\u002Fgithub.com\u002FTGPSKI","pate.sh","Principal Software Engineer, App SRE @ Red Hat","2026-08-27 15:30:12",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add TGPSKI\u002Fskeptic --skill threat-rules-ingestion",{"tool":60,"command":61},"bunx","bunx skills add TGPSKI\u002Fskeptic --skill threat-rules-ingestion",{"tool":63,"command":64},"pnpm","pnpm dlx skills add TGPSKI\u002Fskeptic --skill threat-rules-ingestion","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fthreat-rules-ingestion\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"scripts\u002Fcurate_pack.py","SCRIPT","脚本",3717,"https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fthreat-rules-ingestion\u002Fscripts\u002Fcurate_pack.py",[75,84,93,118,135,156],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":39},"01M6K228SZDWW2VHNSZ7C2SY9B","correlation-multi","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002Ftestdata\u002Fproof\u002Fcorrelation-multi\u002Fskill.md",[],[81,82,83],"correlation","multi","correlation multi",{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":39},"01M6K223W4DGD1TH0CHNY5QAVS","agentic-mcp-creds","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002Ftestdata\u002Fproof\u002Fagentic-mcp-creds\u002FSKILL.md",[],[90,91,92],"MCP","agentic","agentic mcp creds",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":39},"01M6K21Y9Q62SEJFV60JPCB274","workflow-action-updates","Audit and update GitHub Actions workflow files to use the latest action releases pinned to full commit SHAs. Scans all .github\u002Fworkflows\u002F*.yml files, resolves current vs latest versions, and applies upgrades. Use when the user asks to update actions, check for outdated workflow dependencies, pin actions to SHAs, or audit CI workflow hygiene.","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkflow-action-updates\u002FSKILL.md",[],[100,101,102,103,104,105,106,107,108,109,110,111,112,113,35,114,23,115,116,117],"action","workflow","updates","workflow action updates","upgrades","workflows","commit","update","audit","actions","ci","github actions","pin","check","releases","full","github actions workflow","for",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":39},"01M6K21GBVZP22D2R0FPGG8P1J","ruleset-lifecycle-operations","Add or update rule definitions, create and manage rule groups, and migrate rules across groups in skeptic using the property-based layout. Use when the user asks to add\u002Fupdate rules, add\u002Fmanage groups, or reorganize `internal\u002Frules`.","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fruleset-lifecycle-operations\u002FSKILL.md",[],[125,126,127,29,128,129,130,131,132,107,133,20,134,35,33],"lifecycle","operations","ruleset lifecycle operations","layout","add","rule","manage","create","migrate","user",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":39},"01M6K21CP4GEXZ0GN7C5M1DBXF","go-release","Manage the full Go module release lifecycle: determine next semver version, update CHANGELOG.md, create and push a git tag, and verify pkg.go.dev picks up the new version. Use when the user asks to tag a release, bump the version, update the changelog, or publish a new module version.","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgo-release\u002FSKILL.md",[],[142,143,144,145,132,107,146,147,148,149,150,151,125,152,35,153,131,154,115,155],"go","release","go release","bump","git","semver","dev","changelog","push","publish","update changelog","up","next","module",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":39},"01M6K216FX4EJWB2KV9W3RX1NS","documentation-lifecycle","Generate, update, and maintain per-module documentation under docs\u002Fmodules\u002F, keep ARCHITECTURE.md and README.md current, and produce Mermaid diagrams for data-flow, block, and dependency views. Use when the user asks to document a package, update architecture docs, generate diagrams, or audit documentation freshness.","https:\u002F\u002Fgithub.com\u002FTGPSKI\u002Fskeptic\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdocumentation-lifecycle\u002FSKILL.md",[],[163,164,125,165,166,167,108,168,169,107,36,170,171,117,172,173,155,174,175,35],"documentation lifecycle","documentation","README","data","flow","package","produce","mermaid","architecture","maintain","diagrams","modules","dependency"]