Harden Windows DLP enforcement and Electron runtime packaging
This commit is contained in:
1 parent
e7d778aeac
commit
8a253eda89
120 files changed
+3569
-135
No files matched your search
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
// Frame-only defense against unsupported native RTC paths. This exports no bridge
|
||||
// and is additional to the browser-process connection policy, not message DLP.
|
||||
function denyUninspectedRTC(){
|
||||
const SecurityException=DOMException;
|
||||
function blockedPeerConnection(){throw new SecurityException('Managed WebRTC inspection is unavailable','NotAllowedError');}
|
||||
Object.freeze(blockedPeerConnection.prototype);Object.freeze(blockedPeerConnection);
|
||||
for(const name of ['RTCPeerConnection','webkitRTCPeerConnection','mozRTCPeerConnection']){
|
||||
if(name in globalThis)Object.defineProperty(globalThis,name,{value:blockedPeerConnection,writable:false,configurable:false,enumerable:true});
|
||||
}
|
||||
}
|
||||
if(process.sandboxed!==true||process.contextIsolated!==true){require('electron').ipcRenderer.send('managed:transport-guard-failure');window.stop();throw Error('Managed transport isolation is required');}
|
||||
try{require('electron').contextBridge.executeInMainWorld({func:denyUninspectedRTC});}
|
||||
catch{require('electron').ipcRenderer.send('managed:transport-guard-failure');window.stop();throw Error('Managed transport guard could not be installed');}
|
||||
Reference in new issue
Block a user