mirror of
https://github.com/telemt/telemt.git
synced 2026-11-02 05:42:00 +03:00
Conntrack: Firewall reconciliation process-owned&transactional
This commit is contained in:
@@ -2,10 +2,12 @@ use std::os::unix::fs::{MetadataExt, PermissionsExt};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
const TRUSTED_HELPER_DIRS: [&str; 4] = ["/usr/sbin", "/usr/bin", "/sbin", "/bin"];
|
||||
const TRUSTED_HELPERS: [&str; 10] = [
|
||||
const TRUSTED_HELPERS: [&str; 12] = [
|
||||
"nft",
|
||||
"iptables",
|
||||
"iptables-restore",
|
||||
"ip6tables",
|
||||
"ip6tables-restore",
|
||||
"conntrack",
|
||||
"pfctl",
|
||||
"systemctl",
|
||||
@@ -69,6 +71,13 @@ mod tests {
|
||||
assert!(resolve_trusted_helper("../bin/nft").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn privileged_helper_allowlist_accepts_exact_restore_names() {
|
||||
assert!(TRUSTED_HELPERS.contains(&"iptables-restore"));
|
||||
assert!(TRUSTED_HELPERS.contains(&"ip6tables-restore"));
|
||||
assert!(!TRUSTED_HELPERS.contains(&"iptables-restore-wrapper"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn writable_executable_is_not_trusted() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user