File tree Expand file tree Collapse file tree 3 files changed +0
-184
lines changed
Expand file tree Collapse file tree 3 files changed +0
-184
lines changed Original file line number Diff line number Diff line change @@ -951,32 +951,6 @@ This is particularly dangerous because:
951951* Only specific targeted files are affected.
952952* Other operations appear to work normally.
953953
954- ### Monitoring VFS mounts
955-
956- To help detect unauthorized VFS usage, ` node:process ` emits events when
957- a VFS is mounted or unmounted:
958-
959- ``` cjs
960- process .on (' vfs-mount' , (info ) => {
961- console .log (` VFS mounted at ${ info .mountPoint } ` );
962- console .log (` overlay: ${ info .overlay } ` );
963- console .log (` readonly: ${ info .readonly } ` );
964- });
965-
966- process .on (' vfs-unmount' , (info ) => {
967- console .log (` VFS unmounted from ${ info .mountPoint } ` );
968- });
969- ```
970-
971- The event object contains:
972-
973- * ` mountPoint ` {string} The path where the VFS is mounted.
974- * ` overlay ` {boolean} Whether overlay mode is enabled.
975- * ` readonly ` {boolean} Whether the VFS is read-only.
976-
977- Applications can use these events to log VFS activity, alert on suspicious
978- mounts (such as mounting over system paths), or enforce security policies.
979-
980954### Recommendations
981955
982956* ** Audit dependencies** : Be cautious of third-party modules that use VFS, as
Original file line number Diff line number Diff line change @@ -235,29 +235,13 @@ class VirtualFileSystem {
235235 this . #hookProcessCwd( ) ;
236236 }
237237
238- // Emit mount event for security monitoring
239- process . emit ( 'vfs-mount' , {
240- mountPoint : this [ kMountPoint ] ,
241- overlay : this [ kOverlay ] ,
242- readonly : this [ kProvider ] . readonly ,
243- } ) ;
244-
245238 return this ;
246239 }
247240
248241 /**
249242 * Unmounts the VFS.
250243 */
251244 unmount ( ) {
252- // Emit unmount event before clearing state (only if currently mounted)
253- if ( this [ kMounted ] ) {
254- process . emit ( 'vfs-unmount' , {
255- mountPoint : this [ kMountPoint ] ,
256- overlay : this [ kOverlay ] ,
257- readonly : this [ kProvider ] . readonly ,
258- } ) ;
259- }
260-
261245 this . #unhookProcessCwd( ) ;
262246 if ( this [ kModuleHooks ] ) {
263247 loadModuleHooks ( ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments