mirror of
https://github.com/clawdbot/clawdbot.git
synced 2026-01-31 19:37:45 +01:00
test: stub windows ACL for include perms audit
This commit is contained in:
@@ -862,12 +862,33 @@ describe("security audit", () => {
|
|||||||
await fs.chmod(configPath, 0o600);
|
await fs.chmod(configPath, 0o600);
|
||||||
|
|
||||||
const cfg: ClawdbotConfig = { logging: { redactSensitive: "off" } };
|
const cfg: ClawdbotConfig = { logging: { redactSensitive: "off" } };
|
||||||
|
const user = "DESKTOP-TEST\\Tester";
|
||||||
|
const execIcacls = isWindows
|
||||||
|
? async (_cmd: string, args: string[]) => {
|
||||||
|
const target = args[0];
|
||||||
|
if (target === includePath) {
|
||||||
|
return {
|
||||||
|
stdout: `${target} NT AUTHORITY\\SYSTEM:(F)\n BUILTIN\\Users:(W)\n ${user}:(F)\n`,
|
||||||
|
stderr: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
stdout: `${target} NT AUTHORITY\\SYSTEM:(F)\n ${user}:(F)\n`,
|
||||||
|
stderr: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
const res = await runSecurityAudit({
|
const res = await runSecurityAudit({
|
||||||
config: cfg,
|
config: cfg,
|
||||||
includeFilesystem: true,
|
includeFilesystem: true,
|
||||||
includeChannelSecurity: false,
|
includeChannelSecurity: false,
|
||||||
stateDir,
|
stateDir,
|
||||||
configPath,
|
configPath,
|
||||||
|
platform: isWindows ? "win32" : undefined,
|
||||||
|
env: isWindows
|
||||||
|
? { ...process.env, USERNAME: "Tester", USERDOMAIN: "DESKTOP-TEST" }
|
||||||
|
: undefined,
|
||||||
|
execIcacls,
|
||||||
});
|
});
|
||||||
|
|
||||||
const expectedCheckId = isWindows
|
const expectedCheckId = isWindows
|
||||||
|
|||||||
Reference in New Issue
Block a user