We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9a5b3e4 + d30027e commit f8a8321Copy full SHA for f8a8321
1 file changed
cc-eventlog/src/runtime_events.rs
@@ -64,9 +64,18 @@ impl RuntimeEvent {
64
.context("failed to get event log directory")?;
65
fs::create_dir_all(logfile_dir).context("failed to create event log directory")?;
66
67
- let mut logfile = fs::OpenOptions::new()
68
- .append(true)
69
- .create(true)
+ let mut options = fs::OpenOptions::new();
+ options.append(true).create(true);
+
70
+ // Restrict runtime event log visibility and writability to the owner (root).
71
+ // This avoids other processes in the CVM tampering with or reading the log.
72
+ #[cfg(unix)]
73
+ {
74
+ use fs_err::os::unix::fs::OpenOptionsExt;
75
+ options.mode(0o600);
76
+ }
77
78
+ let mut logfile = options
79
.open(logfile_path)
80
.context("failed to open event log file")?;
81
0 commit comments