mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:41:22 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { listChannelPlugins } from "../channels/plugins/index.js";
|
||||
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
||||
import type { ChannelId } from "../channels/plugins/types.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import { resolveBrowserConfig, resolveProfile } from "../browser/config.js";
|
||||
import { resolveConfigPath, resolveStateDir } from "../config/paths.js";
|
||||
import { resolveGatewayAuth } from "../gateway/auth.js";
|
||||
@@ -62,7 +62,7 @@ export type SecurityAuditReport = {
|
||||
};
|
||||
|
||||
export type SecurityAuditOptions = {
|
||||
config: ClawdbotConfig;
|
||||
config: MoltbotConfig;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
platform?: NodeJS.Platform;
|
||||
deep?: boolean;
|
||||
@@ -145,7 +145,7 @@ async function collectFilesystemFindings(params: {
|
||||
checkId: "fs.state_dir.perms_world_writable",
|
||||
severity: "critical",
|
||||
title: "State dir is world-writable",
|
||||
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; other users can write into your Clawdbot state.`,
|
||||
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; other users can write into your Moltbot state.`,
|
||||
remediation: formatPermissionRemediation({
|
||||
targetPath: params.stateDir,
|
||||
perms: stateDirPerms,
|
||||
@@ -159,7 +159,7 @@ async function collectFilesystemFindings(params: {
|
||||
checkId: "fs.state_dir.perms_group_writable",
|
||||
severity: "warn",
|
||||
title: "State dir is group-writable",
|
||||
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; group users can write into your Clawdbot state.`,
|
||||
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; group users can write into your Moltbot state.`,
|
||||
remediation: formatPermissionRemediation({
|
||||
targetPath: params.stateDir,
|
||||
perms: stateDirPerms,
|
||||
@@ -248,7 +248,7 @@ async function collectFilesystemFindings(params: {
|
||||
}
|
||||
|
||||
function collectGatewayConfigFindings(
|
||||
cfg: ClawdbotConfig,
|
||||
cfg: MoltbotConfig,
|
||||
env: NodeJS.ProcessEnv,
|
||||
): SecurityAuditFinding[] {
|
||||
const findings: SecurityAuditFinding[] = [];
|
||||
@@ -356,7 +356,7 @@ function collectGatewayConfigFindings(
|
||||
return findings;
|
||||
}
|
||||
|
||||
function collectBrowserControlFindings(cfg: ClawdbotConfig): SecurityAuditFinding[] {
|
||||
function collectBrowserControlFindings(cfg: MoltbotConfig): SecurityAuditFinding[] {
|
||||
const findings: SecurityAuditFinding[] = [];
|
||||
|
||||
let resolved: ReturnType<typeof resolveBrowserConfig>;
|
||||
@@ -368,7 +368,7 @@ function collectBrowserControlFindings(cfg: ClawdbotConfig): SecurityAuditFindin
|
||||
severity: "warn",
|
||||
title: "Browser control config looks invalid",
|
||||
detail: String(err),
|
||||
remediation: `Fix browser.cdpUrl in ${resolveConfigPath()} and re-run "${formatCliCommand("clawdbot security audit --deep")}".`,
|
||||
remediation: `Fix browser.cdpUrl in ${resolveConfigPath()} and re-run "${formatCliCommand("moltbot security audit --deep")}".`,
|
||||
});
|
||||
return findings;
|
||||
}
|
||||
@@ -398,7 +398,7 @@ function collectBrowserControlFindings(cfg: ClawdbotConfig): SecurityAuditFindin
|
||||
return findings;
|
||||
}
|
||||
|
||||
function collectLoggingFindings(cfg: ClawdbotConfig): SecurityAuditFinding[] {
|
||||
function collectLoggingFindings(cfg: MoltbotConfig): SecurityAuditFinding[] {
|
||||
const redact = cfg.logging?.redactSensitive;
|
||||
if (redact !== "off") return [];
|
||||
return [
|
||||
@@ -412,7 +412,7 @@ function collectLoggingFindings(cfg: ClawdbotConfig): SecurityAuditFinding[] {
|
||||
];
|
||||
}
|
||||
|
||||
function collectElevatedFindings(cfg: ClawdbotConfig): SecurityAuditFinding[] {
|
||||
function collectElevatedFindings(cfg: MoltbotConfig): SecurityAuditFinding[] {
|
||||
const findings: SecurityAuditFinding[] = [];
|
||||
const enabled = cfg.tools?.elevated?.enabled;
|
||||
const allowFrom = cfg.tools?.elevated?.allowFrom ?? {};
|
||||
@@ -444,7 +444,7 @@ function collectElevatedFindings(cfg: ClawdbotConfig): SecurityAuditFinding[] {
|
||||
}
|
||||
|
||||
async function collectChannelSecurityFindings(params: {
|
||||
cfg: ClawdbotConfig;
|
||||
cfg: MoltbotConfig;
|
||||
plugins: ReturnType<typeof listChannelPlugins>;
|
||||
}): Promise<SecurityAuditFinding[]> {
|
||||
const findings: SecurityAuditFinding[] = [];
|
||||
@@ -797,7 +797,7 @@ async function collectChannelSecurityFindings(params: {
|
||||
}
|
||||
|
||||
async function maybeProbeGateway(params: {
|
||||
cfg: ClawdbotConfig;
|
||||
cfg: MoltbotConfig;
|
||||
timeoutMs: number;
|
||||
probe: typeof probeGateway;
|
||||
}): Promise<SecurityAuditReport["deep"]> {
|
||||
@@ -923,7 +923,7 @@ export async function runSecurityAudit(opts: SecurityAuditOptions): Promise<Secu
|
||||
severity: "warn",
|
||||
title: "Gateway probe failed (deep)",
|
||||
detail: deep.gateway.error ?? "gateway unreachable",
|
||||
remediation: `Run "${formatCliCommand("clawdbot status --all")}" to debug connectivity/auth, then re-run "${formatCliCommand("clawdbot security audit --deep")}".`,
|
||||
remediation: `Run "${formatCliCommand("moltbot status --all")}" to debug connectivity/auth, then re-run "${formatCliCommand("moltbot security audit --deep")}".`,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user