mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Implement a proxy blocking tarball requests for packages containing malware.
This commit is contained in:
parent
04cb001006
commit
e2afcb16e3
16 changed files with 633 additions and 33 deletions
|
|
@ -22,12 +22,22 @@ export async function safeSpawn(command, args, options = {}) {
|
|||
const fullCommand = buildCommand(command, args);
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = spawn(fullCommand, { ...options, shell: true });
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
child.stdout?.on("data", (data) => {
|
||||
stdout += data.toString();
|
||||
});
|
||||
|
||||
child.stderr?.on("data", (data) => {
|
||||
stderr += data.toString();
|
||||
});
|
||||
|
||||
child.on("close", (code) => {
|
||||
resolve({
|
||||
status: code,
|
||||
stdout: Buffer.from(""),
|
||||
stderr: Buffer.from(""),
|
||||
stdout: stdout,
|
||||
stderr: stderr,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue