.env는 안전하지만 –/.claude는 안전하지 않습니다.
hackernews
|
|
📦 오픈소스
#ai 딜
#ai 코딩 에이전트
#claude
#보안
#쉘 명령어
#코드 제너레이션
#클로드
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
AI 코딩 에이전트가 파일 접근 및 셸 명령을 자율적으로 수행하는 과정에서 발생할 수 있는 프롬프트 인젝션, 권한 상승, 자격 증명 유출 등의 보안 위협으로부터 시스템을 보호하는 'Prismor Warden'의 등장 배경과 작동 방식을 설명하는 기사입니다. 기존 OS 수준의 보안 도구는 에이전트가 명령을 실행한 후에야 이를 감지해 대응이 늦지만, Prismor는 OS 하부 계층이 아닌 에이전트 계층에 직접 훅을 걸어 위험한 동작을 사전에 차단합니다. 사용자는 YAML 형식의 정책 엔진을 프로젝트별로 유연하게 설정할 수 있으며, 파괴적 명령어 실행, 외부로의 비밀 전송, 역방향 셸(RCE) 시도 등 다양한 위협을 단계별 심각도에 따라 탐지하고 차단합니다. 현재 Claude Code, Cursor, Windsurf 등 주요 AI 코딩 도구에 적용이 가능하며, 설치 마법사를 통해 감시 또는 차단 모드를 선택하고 규칙을 손쉽게 커스텀하여 팀과 공유할 수 있습니다.
본문
Security for AI coding agents. A signed threat feed, agent-native security skills, and a local runtime monitor - in one package. AI coding agents execute shell commands, read and write files, access credentials, and call external APIs. They do this autonomously, often across many steps, with limited checkpoints. This creates risks that traditional security tooling isn't designed for: - Prompt injection - malicious content in a file, issue, or web page can redirect the agent mid-task - Unintended destructive actions - an agent misinterprets an instruction and runs something irreversible - Secret exfiltration - an agent reads .env or credential files as part of a debugging task and sends the content outbound - Privilege escalation - an agent modifies sudoers, CI pipelines, or file permissions to resolve a permission error - Dependency manipulation - an agent installs or rewrites a package at the direction of injected input Standard OS-level and endpoint security tools monitor the kernel and filesystem. By the time they see an action, the agent has already decided to take it. The gap is at the agent layer, not the OS layer. Prismor works at two layers: what the agent knows (skills loaded at session start) and what the agent does (runtime hook on every tool call). flowchart TD IDE["Your IDE / Agent\n(Claude Code · Cursor · Windsurf · OpenClaw)"] IDE -->|"hooks (PreToolUse / PostToolUse)"| Warden subgraph Warden["Prismor Warden"] Policy["Policy Engine\n(YAML rules)"] Session["Session Store\n(SQLite / JSONL)"] Feed["Threat Feed\n(Ed25519 signed)"] Policy --> Session end Warden --> Allow["ALLOW action\n+ log finding"] Warden --> Block["BLOCK action\n+ log finding"] Kernel-level and endpoint security tools intercept syscalls and monitor process activity at the OS layer. For traditional malware, this is the right place to look. For AI agents, that layer is downstream of where the decision happens. By the time an OS-level tool sees a destructive command, the agent has already constructed and dispatched it. The tool has to race to kill the process before damage occurs - and it has no context about why the agent issued the command or what the user actually asked for. Warden hooks into the agent's tool-use pipeline before the action reaches the OS. The command is evaluated against your policy before it is executed. If the policy says block, the shell never sees it. A fixed list of bad strings has a short shelf life. Prismor's policy engine is YAML-driven and configurable per-project: - Every rule has an id , severity, category, event type, and pattern list - all editable - Your project's .prismor-warden/policy.yaml overrides defaults byid at runtime - Allowlists suppress false positives without disabling entire rule categories warden policy edit lets you toggle rules interactively without touching YAML rules: # Disable a default rule for this project - id: risky-write enabled: false # Add a project-specific rule - id: block-prod-db severity: CRITICAL category: db_access title: Block production database access event_types: [shell] fields: [command] patterns: ["psql.*prod", "mysql.*production"] action: block allowlists: - id: allow-test-env rule_ids: ["secret-access"] patterns: ["\\.env\\.test$"] reason: "Test env file has no real secrets" Commit the policy file to share rules across your team. CI picks it up automatically. Default detection rules: | Category | Severity | What It Does | |---|---|---| | Destructive commands | CRITICAL | Blocks rm -rf / , mkfs , dd to disk, shutdown , reboot | | Secret exfiltration | CRITICAL | Blocks cat .env | curl , piping secrets to external hosts | | DoS / resource exhaustion | CRITICAL | Blocks fork bombs, while-true loops, /dev/urandom abuse | | RCE / reverse shells | CRITICAL | Blocks bash -i /dev/tcp , crontab injection, ncat listeners | | Privilege escalation | CRITICAL | Blocks chmod +s , sudoers edits, useradd , setcap | | Prompt injection | HIGH | Detects "ignore instructions", "reveal system prompt" in agent I/O | | Remote execution | HIGH | Blocks curl | bash , wget | sh fetch-and-execute chains | | Sensitive file access | HIGH | Flags reads/writes to .env , .ssh/id_rsa , .aws/credentials | | Suspicious network | HIGH | Flags calls to webhook.site, ngrok, pastebin, Discord webhooks | | Database modification | HIGH | Flags DROP TABLE , DELETE FROM , TRUNCATE in shell commands | | Path traversal | HIGH | Flags ../../ traversal, reads of /etc/passwd , /proc/self/environ | | Risky file writes | MEDIUM | Flags writes to Dockerfile, CI workflows, package.json , go.mod | git clone https://github.com/PrismorSec/immunity-agent.git ~/.prismor bash ~/.prismor/scripts/init.sh . The setup wizard lets you: - Choose enforcement mode ( observe orenforce ) - Toggle detection rules on/off - each rule shows exactly what it catches - Select which agents to hook (Claude Code, Cursor, Windsurf, OpenClaw) - Review and confirm before installing After setup, restart your shell and the warden command
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유