Skip to content

Commit 4fea19c

Browse files
tianzhouclaude
andauthored
feat: warn on startup when auth is enabled but no IAM rules exist (#22)
IAM is now opt-in — with no [[iam]] rules, every authenticated principal has full access. Emit a startup warning so an empty IAM section isn't a silent misconfiguration. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 41a1ed4 commit 4fea19c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

server/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import cookieParser from 'cookie-parser'
44
import { authRouter } from './auth-routes'
55
import { connectRouter } from './connect'
66
import { mcpRouter, MCP_PATH } from './mcp'
7-
import { loadConfig, loadConfigFromString, loadDemoConfig, isDemoMode, getBanner, getBranding, getExternalUrl, getAgents } from './lib/config'
7+
import { loadConfig, loadConfigFromString, loadDemoConfig, isDemoMode, getBanner, getBranding, getExternalUrl, getAgents, isAuthEnabled, getIAMRules } from './lib/config'
88
import { startDemoDatabase, stopDemoDatabase } from './lib/demo'
99
import { testAllConnections } from './lib/test-connections'
1010

@@ -92,6 +92,14 @@ async function start() {
9292
console.log(`✓ Demo database started on port ${demoPort}`)
9393
}
9494

95+
// IAM is opt-in: with no [[iam]] rules, every authenticated principal gets full
96+
// access. Warn so an empty IAM section with auth enabled isn't a silent misconfig.
97+
if (isAuthEnabled() && getIAMRules().length === 0) {
98+
console.warn(
99+
'⚠ Auth is enabled but no [[iam]] rules are configured — every authenticated user and agent has full access to all connections. Add [[iam]] rules to restrict access.',
100+
)
101+
}
102+
95103
// Test all connections to populate cache
96104
try {
97105
await testAllConnections()

0 commit comments

Comments
 (0)