feat: complete REA remediation program
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { access, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { access, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { createTestTempDirectory } from "./fixtures/temporaryDirectory.js";
|
||||
|
||||
import { createGhidraTargetSnapshot } from "../src/ghidra/GhidraTargetSnapshot.js";
|
||||
|
||||
const roots: string[] = [];
|
||||
@@ -17,7 +18,7 @@ afterEach(async () => {
|
||||
|
||||
describe("Ghidra target snapshot", () => {
|
||||
it("copies an exact digest-bound target into the private runtime", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "rea-ghidra-snapshot-"));
|
||||
const root = await createTestTempDirectory("rea-ghidra-snapshot-");
|
||||
roots.push(root);
|
||||
const source = join(root, "source.exe");
|
||||
const bytes = Buffer.from("native PE fixture");
|
||||
@@ -34,7 +35,7 @@ describe("Ghidra target snapshot", () => {
|
||||
});
|
||||
|
||||
it("removes a snapshot whose digest differs from admission", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "rea-ghidra-snapshot-"));
|
||||
const root = await createTestTempDirectory("rea-ghidra-snapshot-");
|
||||
roots.push(root);
|
||||
const source = join(root, "source with unsafe extension.%PATH%");
|
||||
await writeFile(source, "changed target");
|
||||
|
||||
Reference in New Issue
Block a user