test(security): cover background-chain validation path
This commit is contained in:
parent
0f56211892
commit
e8088f624e
1 changed files with 8 additions and 0 deletions
|
|
@ -725,6 +725,14 @@ mod tests {
|
||||||
assert!(result.unwrap_err().contains("high-risk"));
|
assert!(result.unwrap_err().contains("high-risk"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn validate_command_rejects_background_chain_bypass() {
|
||||||
|
let p = default_policy();
|
||||||
|
let result = p.validate_command_execution("ls & python3 -c 'print(1)'", false);
|
||||||
|
assert!(result.is_err());
|
||||||
|
assert!(result.unwrap_err().contains("not allowed"));
|
||||||
|
}
|
||||||
|
|
||||||
// ── is_path_allowed ─────────────────────────────────────
|
// ── is_path_allowed ─────────────────────────────────────
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue