Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 269 additions & 75 deletions crates/killswitch-adjudication/src/adjudicator.rs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions crates/killswitch-adjudication/src/immunity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ fn is_blanket_immunity_denied(name: &str) -> bool {
/// Inspect target PID and traverse its parent ancestry up to depth 5.
pub fn inspect_process_lineage(target_pid: u32, proc_name: Option<&str>) -> LineageImmunityVerdict {
let p_name = proc_name.unwrap_or("");
let registry = killswitch_core::TrackedAgentTreeRegistry::global();
if !is_immutable_os_kernel_pid(target_pid, p_name) && registry.is_tracked_pid(target_pid) {
let res = registry.resolve_offending_process_subtree(target_pid, proc_name, &[]);
return LineageImmunityVerdict::AgentRuntimeChild {
ancestor_pid: res.root_pid,
ancestor_name: res.root_name.unwrap_or_else(|| p_name.to_string()),
depth: res.ancestor_chain.len().saturating_sub(1),
};
}

let denied = is_blanket_immunity_denied(p_name);

// 1. Direct Target Immunity Check
Expand Down
56 changes: 47 additions & 9 deletions crates/killswitch-adjudication/src/rea/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ pub fn has_active_lotl_or_exploit_indicators(text: &str) -> bool {
"lsass",
"-enc ",
"-encodedcommand",
" -ec ",
"frombase64string",
"downloadstring",
"invoke-expression",
"invoke-webrequest",
"invoke-restmethod",
"net.webclient",
"-executionpolicy bypass",
"-ep bypass",
"-windowstyle hidden",
"-w hidden",
"iex(",
"canarytraptripped",
"canaryalert",
Expand All @@ -48,6 +56,42 @@ pub fn has_active_lotl_or_exploit_indicators(text: &str) -> bool {
"cobalt",
"meterpreter",
"reverse_tcp",
"reverse shell",
"/dev/tcp/",
"/dev/udp/",
"mkfifo",
"nc -e",
"ncat -e",
"socat exec:",
"python -c",
"python3 -c",
"perl -e",
"ruby -e",
"os.system(",
"subprocess.popen",
"curl ",
"wget ",
"certutil -urlcache",
"bitsadmin /transfer",
"mshta http",
"regsvr32 ",
"ld_preload=",
"/proc/self/mem",
"ptrace",
"nsenter",
"/var/run/docker.sock",
"release_agent",
".aws/credentials",
".ssh/id_rsa",
".ssh/id_ed25519",
".kube/config",
".docker/config.json",
"/etc/shadow",
"169.254.169.254",
"metadata.google.internal",
"crownjewel",
"[token escalation detected]",
"[privileged binary metadata probed]",
];
ACTIVE_ATTACK_MARKERS.iter().any(|m| lower.contains(m))
}
Expand Down Expand Up @@ -411,7 +455,9 @@ pub fn is_rea_benign_system_or_dev_process(proc_or_path: &str, reason: Option<&s
return false;
}

// Benign Developer Tools & System Whitelist
// Benign Developer Compilers, IDEs & Immutable System Daemons
// NOTE: Interactive shells and scripting interpreters (powershell, pwsh, cmd, python, node)
// are intentionally excluded so LOTL or agent-spawned children cannot hijack REA benign vetoes.
matches!(
base_lower.as_str(),
"cargo.exe"
Expand All @@ -426,17 +472,9 @@ pub fn is_rea_benign_system_or_dev_process(proc_or_path: &str, reason: Option<&s
| "antigravity.exe"
| "git.exe"
| "git"
| "node.exe"
| "node"
| "python.exe"
| "python"
| "python3"
| "cl.exe"
| "link.exe"
| "lld-link.exe"
| "cmd.exe"
| "powershell.exe"
| "pwsh.exe"
| "svchost.exe"
| "explorer.exe"
| "systemd"
Expand Down
Loading
Loading