File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,18 @@ impl RuntimeEvent {
6464 . context ( "failed to get event log directory" ) ?;
6565 fs:: create_dir_all ( logfile_dir) . context ( "failed to create event log directory" ) ?;
6666
67- let mut logfile = fs:: OpenOptions :: new ( )
68- . append ( true )
69- . create ( true )
67+ let mut options = fs:: OpenOptions :: new ( ) ;
68+ options. append ( true ) . create ( true ) ;
69+
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
7079 . open ( logfile_path)
7180 . context ( "failed to open event log file" ) ?;
7281
You can’t perform that action at this time.
0 commit comments