mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Merge pull request #144 from AikidoSec/only-write-stdout-when-safe-chain-audited
Add interceptors for MITM
This commit is contained in:
commit
bb0d06cdfc
9 changed files with 459 additions and 202 deletions
|
|
@ -41,6 +41,22 @@ export function getAuditStats() {
|
|||
return auditStats;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string | undefined} name
|
||||
* @param {string | undefined} version
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
export async function isMalwarePackage(name, version) {
|
||||
if (!name || !version) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auditResult = await auditChanges([{ name, version, type: "add" }]);
|
||||
|
||||
return !auditResult.isAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PackageChange[]} changes
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue