惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
D
Docker
J
Java Code Geeks
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
腾讯CDC
罗磊的独立博客
U
Unit 42
爱范儿
爱范儿
Vercel News
Vercel News
MyScale Blog
MyScale Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: Hook ingress token unlocks password-mode gateway aut...
clawsweeper · 2026-05-25 · via Recent Commits to openclaw:main
11

import type { Command } from "commander";

22

import { getRuntimeConfig } from "../config/config.js";

3+

import type { GatewayAuthMode } from "../config/types.gateway.js";

34

import { defaultRuntime } from "../runtime.js";

45

import { runSecurityAudit } from "../security/audit.js";

56

import { fixSecurityFootguns } from "../security/fix.js";

6-

import { normalizeOptionalString } from "../shared/string-coerce.js";

7+

import {

8+

normalizeOptionalLowercaseString,

9+

normalizeOptionalString,

10+

} from "../shared/string-coerce.js";

711

import { formatDocsLink } from "../terminal/links.js";

812

import { isRich, theme } from "../terminal/theme.js";

913

import { shortenHomeInString, shortenHomePath } from "../utils.js";

@@ -16,10 +20,45 @@ type SecurityAuditOptions = {

1620

json?: boolean;

1721

deep?: boolean;

1822

fix?: boolean;

23+

auth?: string;

1924

token?: string;

2025

password?: string;

2126

};

222728+

function parseGatewayAuthMode(value: string | undefined): GatewayAuthMode | undefined {

29+

const mode = normalizeOptionalLowercaseString(value);

30+

if (!mode) {

31+

return undefined;

32+

}

33+

if (mode === "none" || mode === "token" || mode === "password" || mode === "trusted-proxy") {

34+

return mode;

35+

}

36+

throw new Error(

37+

'Invalid --auth value. Expected "none", "token", "password", or "trusted-proxy".',

38+

);

39+

}

40+41+

function buildAuditGatewayAuthOverride(params: {

42+

mode?: GatewayAuthMode;

43+

token?: string;

44+

password?: string;

45+

}) {

46+

if (!params.mode) {

47+

return undefined;

48+

}

49+

if (params.mode === "token" && !params.token) {

50+

throw new Error("Invalid --auth token: pass --token <token> for audit auth override.");

51+

}

52+

if (params.mode === "password" && !params.password) {

53+

throw new Error("Invalid --auth password: pass --password <password> for audit auth override.");

54+

}

55+

return {

56+

mode: params.mode,

57+

...(params.token ? { token: params.token } : {}),

58+

...(params.password ? { password: params.password } : {}),

59+

};

60+

}

61+2362

function formatSummary(summary: { critical: number; warn: number; info: number }): string {

2463

const rich = isRich();

2564

const c = summary.critical;

@@ -50,6 +89,10 @@ export function registerSecurityCli(program: Command) {

5089

"openclaw security audit --deep --password <password>",

5190

"Use explicit password for deep probe.",

5291

],

92+

[

93+

"openclaw security audit --auth password --password <password>",

94+

"Audit a runtime-only password-mode Gateway secret.",

95+

],

5396

["openclaw security audit --fix", "Apply safe remediations and file-permission fixes."],

5497

["openclaw security audit --json", "Output machine-readable JSON."],

5598

])}\n\n${theme.muted("Docs:")} ${formatDocsLink("/cli/security", "docs.openclaw.ai/cli/security")}\n`,

@@ -59,13 +102,23 @@ export function registerSecurityCli(program: Command) {

59102

.command("audit")

60103

.description("Audit config + local state for common security foot-guns")

61104

.option("--deep", "Attempt live Gateway probes and plugin-owned collector checks", false)

105+

.option(

106+

"--auth <mode>",

107+

'Runtime gateway auth mode ("none"|"token"|"password"|"trusted-proxy")',

108+

)

62109

.option("--token <token>", "Use explicit gateway token for deep probe auth")

63110

.option("--password <password>", "Use explicit gateway password for deep probe auth")

64111

.option("--fix", "Apply safe fixes (tighten defaults + chmod state/config)", false)

65112

.option("--json", "Print JSON", false)

66113

.action(async (opts: SecurityAuditOptions) => {

114+

const authMode = parseGatewayAuthMode(opts.auth);

67115

const token = normalizeOptionalString(opts.token);

68116

const password = normalizeOptionalString(opts.password);

117+

const auditGatewayAuthOverride = buildAuditGatewayAuthOverride({

118+

mode: authMode,

119+

token,

120+

password,

121+

});

69122

const fixResult = opts.fix ? await fixSecurityFootguns().catch((_err) => null) : null;

7012371124

const sourceConfig = getRuntimeConfig();

@@ -84,8 +137,12 @@ export function registerSecurityCli(program: Command) {

84137

includeChannelSecurity: true,

85138

deepProbeAuth:

86139

token || password

87-

? { ...(token ? { token } : {}), ...(password ? { password } : {}) }

140+

? {

141+

...(token ? { token } : {}),

142+

...(password ? { password } : {}),

143+

}

88144

: undefined,

145+

auditGatewayAuthOverride,

89146

});

9014791148

if (opts.json) {