feat: add TeamPCP behavior detection rules + domain corpus fix#69
Merged
feat: add TeamPCP behavior detection rules + domain corpus fix#69
Conversation
Three new command-shape rules inspired by TeamPCP supply chain attack: 1. ProcMemAccess (High/Block): detects /proc/*/mem scraping via reader commands (cat, dd, strings, cp, grep). Wrapper-aware (sudo, env). Normalized args to handle quoted paths. MITRE T1003.007. 2. DockerRemotePrivEsc (Critical/Block): compound rule requiring Docker remote daemon (-H tcp://, --host=tcp://, DOCKER_HOST=tcp://) AND privilege escalation (--privileged or host root mount -v /:/...). Handles --mount type=bind,src=/ and env wrapper forms. MITRE T1611. 3. CredentialFileSweep (Medium/Warn): exec-only, per-segment, verb-gated. Fires when a read/archive command accesses 2+ credential paths (ssh keys, aws, docker, kube, gcloud, npm, pypi, gnupg, etc). MITRE T1552.001. Also: - Expand known_domains.csv with security vendor + AI provider domains - Wire policy.additional_known_domains into hostname confusable check - 16 golden fixtures (positive + negative for each rule) - resolve_base_through_wrappers() helper for wrapper-aware detection Verified: cargo fmt + clippy + test (902 passed, 0 failed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three new command-shape rules inspired by the TeamPCP supply chain attack (March 2026), plus domain corpus expansion and hostname wiring fix.
New Rules
1. ProcMemAccess (High / Block)
Detects
/proc/*/memscraping via reader commands (cat, dd, strings, cp, grep). Wrapper-aware (sudo, env, env -S). Normalized args handle quoted paths. Excludes echo/printf (not file readers).2. DockerRemotePrivEsc (Critical / Block)
Compound rule: requires Docker remote daemon (
-H tcp://,--host=tcp://,DOCKER_HOST=tcp://) AND privilege escalation (--privilegedor host root mount-v /:/...,--mount type=bind,src=/). Case-sensitive-H(uppercase only, lowercase-his container hostname). Handlesenv -Sand--split-stringwrappers. Skips-e/--envcontainer env args.3. CredentialFileSweep (Medium / Warn)
Exec-only, per-segment, verb-gated. Fires when a read/archive command accesses 2+ credential paths (ssh keys, aws, docker, kube, gcloud, npm, pypi, gnupg, etc). 13 credential paths, full tier-1 coverage.
Infrastructure
resolve_base_through_wrappers()— generic wrapper resolver for sudo/env/command/exec/nohupunwrap_env_split_string_segment()— unwrapsenv -S "cmd"andenv --split-string="cmd"for all 3 rulesadditional_known_domainswired into hostname confusable detectionFixtures
21 golden fixtures covering positive, negative, and edge cases:
Verification