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
@@ -4,6 +4,7 @@ function evidenceType(record){return record?.protectedEvidence?.type??'download'
|
||||
function policyAllows(context,type='download'){return ['download','interaction'].includes(type)&&context?.policy?.evidence?.enabled===true&&context.policy.evidence[type==='download'?'captureDownloads':'captureInteractions']===true&&Date.parse(context.policy.expiresAt)>Date.now();}
|
||||
function collectionAllowed(context){return !!context?.ready&&policyAllows(context,context?.type??'download');}
|
||||
function validatedEvidence(payload,type='download'){if(!(type==='download'?validateDownloadEvidence(payload):type==='interaction'&&validateInteractionEvidence(payload)))throw Error('Invalid protected evidence');return structuredClone(payload);}
|
||||
// eslint-disable-next-line no-unused-vars -- Destructure only to strip protected evidence before releasing ordinary event metadata.
|
||||
function stripPendingEvidence(queue,context){return queue.map(record=>{if(!record.protectedEvidence)return record;if(context&&policyAllows(context,evidenceType(record)))return record;const {protectedEvidence,...event}=record;return event;});}
|
||||
async function deliverAuditRecord({record,send,getContext}){
|
||||
const {protectedEvidence,...event}=record;await send('/api/device/events',event);
|
||||
|
||||
Reference in new issue
Block a user