mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
25 lines
980 B
TypeScript
25 lines
980 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { OpenClawConfig } from "../config/config.js";
|
|
import { collectAttackSurfaceSummaryFindings } from "./audit-extra.sync.js";
|
|
|
|
describe("security audit attack surface summary", () => {
|
|
it("includes an attack surface summary (info)", () => {
|
|
const cfg: OpenClawConfig = {
|
|
channels: { whatsapp: { groupPolicy: "open" }, telegram: { groupPolicy: "allowlist" } },
|
|
tools: { elevated: { enabled: true, allowFrom: { whatsapp: ["+1"] } } },
|
|
hooks: { enabled: true },
|
|
browser: { enabled: true },
|
|
};
|
|
|
|
const findings = collectAttackSurfaceSummaryFindings(cfg);
|
|
const summary = findings.find((f) => f.checkId === "summary.attack_surface");
|
|
|
|
expect(findings).toEqual(
|
|
expect.arrayContaining([
|
|
expect.objectContaining({ checkId: "summary.attack_surface", severity: "info" }),
|
|
]),
|
|
);
|
|
expect(summary?.detail).toContain("trust model: personal assistant");
|
|
});
|
|
});
|