Skip to content

Commit df53f9e

Browse files
committed
settings: Register only runc as traced container runtime process
Starting from now, registering containers is handled by the runc wrapper and the role of the BPF runtime map becomes rather to find the unwrapped runc processes and deny them. Signed-off-by: Michal Rostecki <[email protected]>
1 parent ad5d137 commit df53f9e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/settings.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
const TASK_COMM_LEN: usize = 16;
2+
13
#[derive(Debug, serde::Deserialize)]
24
pub struct Settings {
35
pub runtimes: Vec<String>,
46
}
57

8+
fn trim_task_comm_len(mut s: std::string::String) -> std::string::String {
9+
s.truncate(TASK_COMM_LEN - 1);
10+
s
11+
}
12+
613
impl Settings {
714
pub fn new() -> Result<Self, config::ConfigError> {
8-
let mut s = config::Config::default();
15+
let mut s = config::Config::default();
916

10-
s.set("runtimes", vec![
11-
"conmon".to_string(),
12-
"containerd-shim".into()
13-
])?;
17+
s.set("runtimes", vec![trim_task_comm_len("runc".to_string())])?;
1418

15-
s.merge(config::File::with_name("/etc/enclave/enclave.toml").
16-
required(false))?;
17-
s.try_into()
19+
s.merge(config::File::with_name("/etc/enclave/enclave.toml").required(false))?;
20+
s.try_into()
1821
}
1922
}

0 commit comments

Comments
 (0)