- Introduced core files including Dockerfile, action.yml, and entry point script (bin/polinrider.js) for the PolinRider malware scanner. - Created configuration files: .env.example, .gitignore, and .npmrc for environment setup and dependency management. - Added CI workflows for testing, building, and releasing the action, along with examples for usage in GitHub Actions. - Implemented a README.md to provide documentation on usage, features, and setup instructions. - Included necessary scripts for building the action and handling security measures during execution. - Established a structured directory for reports and workspace management within Docker. - Ensured all files are set up for a secure and efficient scanning process of GitHub repositories for PolinRider malware.
20 lines
973 B
JavaScript
20 lines
973 B
JavaScript
// Probe run in a child process so the safety guards don't pollute the main test
|
|
// runner. Importing safety.js installs the guards as a side effect. Exits 0 only
|
|
// if every escape hatch is blocked.
|
|
import "../src/safety.js";
|
|
import assert from "node:assert/strict";
|
|
import { createRequire } from "node:module";
|
|
|
|
const require = createRequire(import.meta.url);
|
|
|
|
assert.throws(() => globalThis.eval("1+1"), /disabled|disallow/i, "direct eval not blocked");
|
|
const indirect = eval;
|
|
assert.throws(() => indirect("1+1"), "indirect eval not blocked");
|
|
assert.throws(() => new Function("return 1"), "Function constructor not blocked");
|
|
assert.throws(() => function () {}.constructor("return 1"), "fn.constructor not blocked");
|
|
assert.throws(() => require("node:vm"), "require(node:vm) not blocked");
|
|
assert.throws(() => require("vm"), "require(vm) not blocked");
|
|
assert.throws(() => process.binding("spawn_sync"), "process.binding not blocked");
|
|
|
|
console.log("safety-probe OK");
|