메뉴
HN
Hacker News 5일 전

오픈소스 보안 게이트웨이 'OneCLI'

IMP
8/10
핵심 요약

OneCLI는 AI 에이전트에게 실제 API 키를 노출하지 않고 안전하게 외부 API를 호출할 수 있도록 돕는 오픈소스 자격 증명 게이트웨이입니다. 에이전트에게는 가짜 키(Placeholder)만 전달하고, Rust 기반의 게이트웨이가 HTTP 요청을 가로채 AES-256으로 암호화된 실제 키를 안전하게 주입하는 방식으로 작동합니다. 개발자는 단일 대시보드에서 여러 에이전트의 권한과 보안 키를 통합 관리할 수 있어 보안 사고를 예방하는 데 매우 유용합니다.

번역된 본문

AI 에이전트를 위한 비밀 금고(Secret Vault)입니다. 한 번 저장하고 어디서든 주입하세요. 에이전트는 키를 결코 볼 수 없습니다. 웹사이트 · 문서 · 디스코드

OneCLI란 무엇인가요? OneCLI는 AI 에이전트와 해당 에이전트가 호출하는 서비스 사이에 위치하는 오픈소스 게이트웨이입니다. 모든 에이전트에 API 키를 직접 내장하는 대신, 자격 증명(Credential)을 OneCLI에 한 번만 저장하면 게이트웨이가 이를 투명하게 주입합니다. 에이전트는 비밀 키를 절대 직접 다루지 않습니다.

왜 이것을 만들었나요? AI 에이전트는 수십 개의 API를 호출해야 하지만, 각 에이전트에 원본 자격 증명을 직접 제공하는 것은 보안 위험을 초래합니다. OneCLI는 인증을 처리하는 단일 게이트웨이로 이 문제를 해결합니다. 따라서 접근 권한 관리, 키 교체, 그리고 모든 에이전트의 활동을 확인할 수 있는 단일 제어 지점을 확보할 수 있습니다.

작동 방식: 실제 API 자격 증명은 OneCLI에 저장하고, AI 에이전트에게는 자리 표시자 키(예: FAKE_KEY)를 부여합니다. 에이전트가 게이트웨이를 통해 HTTP 요청을 보내면, OneCLI 게이트웨이가 해당 요청과 알맞은 자격 증명을 매칭합니다. 그런 다음 FAKE_KEY를 REAL_KEY로 교체 및 복호화하여 아웃바운드 요청에 주입합니다. 에이전트는 실제 비밀 키에 절대 접근하지 않습니다. 단지 일반적인 HTTP 호출을 수행할 뿐이며, 나머지 키 교체 작업은 게이트웨이가 모두 처리합니다.

아키텍처

  • Rust 게이트웨이: 아웃바운드 요청을 가로채서 자격 증명을 주입하는 빠른 HTTP 게이트웨이입니다. 에이전트는 Proxy-Authorization 헤더를 통해 액세스 토큰으로 인증합니다.
  • 웹 대시보드: 에이전트, 비밀 키 및 권한을 관리하는 Next.js 애플리케이션입니다. 게이트웨이가 각 요청에 주입할 자격 증명을 식별할 때 사용하는 API를 제공합니다.
  • 비밀 저장소(Secret Store): AES-256-GCM으로 암호화된 자격 증명 저장소입니다. 비밀 키는 요청 시에만 복호화되며, 호스트 및 경로 패턴과 일치하여 헤더나 URL 쿼리 매개변수 형태로 게이트웨이에 의해 주입됩니다.

빠른 시작 로컬에서 OneCLI를 실행하는 가장 빠른 방법은 다음과 같습니다: curl -fsSL https://onecli.sh/install | sh

또는 수동으로 실행하는 것을 선호한다면: git clone https://github.com/onecli/onecli.git cd onecli docker compose -f docker/docker-compose.yml up -d --wait

http://localhost:10254 를 열고, 에이전트를 생성한 뒤 비밀 키를 추가하세요. 그런 다음 에이전트의 HTTP 게이트웨이를 localhost:10255 로 설정하면 됩니다. 빠른 시작 기능은 OneCLI를 로컬 모드(단일 사용자, 로그인 없음)로 실행하므로 .env 나 NEXTAUTH_SECRET 이 필요하지 않습니다. 여러 사용자를 위해 Google OAuth를 활성화하려면 NEXTAUTH_SECRET 과 Google 자격 증명을 설정하세요(설정 참조).

주요 기능

  • 투명한 자격 증명 주입: 에이전트는 일반적인 HTTP 호출을 수행하고, 게이트웨이가 인증을 처리합니다.
  • 암호화된 비밀 저장소: 저장 시 AES-256-GCM 암호화를 사용하며, 요청 시에만 복호화됩니다.
  • 호스트 및 경로 매칭: 패턴 일치를 통해 비밀 키를 올바른 API 엔드포인트로 라우팅합니다.
  • 다중 에이전트 지원: 각 에이전트는 범위가 지정된 권한을 가진 자체 액세스 토큰을 받습니다.
  • 간편한 설정: curl -fsSL https://onecli.sh/install | sh 명령 한 줄로 모든 것(앱 + PostgreSQL)을 시작합니다.
  • 두 가지 인증 모드: 로컬 사용을 위한 단일 사용자(로그인 없음) 모드 또는 팀을 위한 Google OAuth 모드를 지원합니다.
  • Rust 게이트웨이: HTTPS를 위한 MITM(중간자 공격 기법) 가로채기 기능을 갖춘 빠르고 메모리 안전성이 보장되는 HTTP 게이트웨이입니다.
  • 금고(Vault) 통합: 서버에 비밀 키를 저장하지 않고 필요에 따라 자격 증명을 주입하기 위해 Bitwarden(또는 다른 비밀번호 관리자)을 연결할 수 있습니다.

프로젝트 구조 apps/ web/ # Next.js 앱 (대시보드 + API, 포트 10254) gateway/ # Rust 게이트웨이 (자격 증명 주입, 포트 10255) packages/ db/ # Prisma ORM + 마이그레이션 ui/ # 공유 UI 컴포넌트 (shadcn/ui) docker/ Dockerfile # 앱 이미지 (게이트웨이 + 웹) docker-compose.yml

로컬 개발 전제 조건: mise (Node.js, pnpm 및 기타 도구 설치) Rust (게이트웨이용) Docker (PostgreSQL용)

설정 과정: mise install pnpm install cp .env.example .env pnpm db:generate pnpm db:up # PostgreSQL 시작 pnpm db:migrate # 데이터베이스 마이그레이션 적용 pnpm dev 대시보드는 http://localhost:10254, 게이트웨이는 http://localhost:10255 에서 접속할 수 있습니다.

명령어 명령어 | 설명 pnpm dev | 개발 모드에서 웹 및 게이트웨이 시작 pnpm build | 프로덕션 빌드 pnpm check | 린트(Lint) + 타입 검사 + 포맷팅 pnpm db:up | PostgreSQL 시작 (Docker) pnpm db:down | PostgreSQL 중지 pnpm db:generate | Prisma 클라이언트 생성 pnpm db:migrate | 데이터베이스 마이그레이션 실행 pnpm db:studio | Prisma Studio 열기

설정 (Configuration) 로컬 개발을 위한 모든 환경 변수는 선택 사항입니다: 변수 | 설명 | 기본값

원문 보기
원문 보기 (영어)
The secret vault for AI agents. Store once. Inject anywhere. Agents never see the keys. Website · Docs · Discord What is OneCLI? OneCLI is an open-source gateway that sits between your AI agents and the services they call. Instead of baking API keys into every agent, you store credentials once in OneCLI and the gateway injects them transparently. Agents never see the secrets. Why we built it: AI agents need to call dozens of APIs, but giving each agent raw credentials is a security risk. OneCLI solves this with a single gateway that handles auth, so you get one place to manage access, rotate keys, and see what every agent is doing. How it works: You store your real API credentials in OneCLI and give your agents placeholder keys (e.g. FAKE_KEY ). When an agent makes an HTTP call through the gateway, the OneCLI gateway matches the request to the right credentials, swaps the FAKE_KEY for the REAL_KEY , decrypts them, and injects them into the outbound request. The agent never touches the real secrets. It just makes normal HTTP calls and the gateway handles the swap. Architecture Rust Gateway : fast HTTP gateway that intercepts outbound requests and injects credentials. Agents authenticate with access tokens via Proxy-Authorization headers. Web Dashboard : Next.js app for managing agents, secrets, and permissions. Provides the API the gateway uses to resolve which credentials to inject for each request. Secret Store : AES-256-GCM encrypted credential storage. Secrets are decrypted only at request time, matched by host and path patterns, and injected by the gateway as headers or URL query parameters. Quick Start The fastest way to run OneCLI locally: curl -fsSL https://onecli.sh/install | sh Or, if you prefer to run it manually: git clone https://github.com/onecli/onecli.git cd onecli docker compose -f docker/docker-compose.yml up -d --wait Open http://localhost:10254 , create an agent, add your secrets, and point your agent's HTTP gateway to localhost:10255 . The Quick Start runs OneCLI in local mode (single-user, no login), so no .env or NEXTAUTH_SECRET is required. To enable Google OAuth for multiple users, set NEXTAUTH_SECRET and the Google credentials (see Configuration ). Features Transparent credential injection : agents make normal HTTP calls, the gateway handles auth Encrypted secret storage : AES-256-GCM encryption at rest, decrypted only at request time Host & path matching : route secrets to the right API endpoints with pattern matching Multi-agent support : each agent gets its own access token with scoped permissions Easy setup : curl -fsSL https://onecli.sh/install | sh starts everything (app + PostgreSQL) Two auth modes : single-user (no login) for local use, or Google OAuth for teams Rust gateway : fast, memory-safe HTTP gateway with MITM interception for HTTPS Vault integration : connect Bitwarden (or other password managers) for on-demand credential injection without storing secrets on the server Project Structure apps/ web/ # Next.js app (dashboard + API, port 10254) gateway/ # Rust gateway (credential injection, port 10255) packages/ db/ # Prisma ORM + migrations ui/ # Shared UI components (shadcn/ui) docker/ Dockerfile # App image (gateway + web) docker-compose.yml Local Development Prerequisites mise (installs Node.js, pnpm, and other tools) Rust (for the gateway) Docker (for PostgreSQL) Setup mise install pnpm install cp .env.example .env pnpm db:generate pnpm db:up # Start PostgreSQL pnpm db:migrate # Apply migrations pnpm dev Dashboard at http://localhost:10254 , gateway at http://localhost:10255 . Commands Command Description pnpm dev Start web + gateway in dev mode pnpm build Production build pnpm check Lint + types + format pnpm db:up Start PostgreSQL (Docker) pnpm db:down Stop PostgreSQL pnpm db:generate Generate Prisma client pnpm db:migrate Run database migrations pnpm db:studio Open Prisma Studio Configuration All environment variables are optional for local development: Variable Description Default DATABASE_URL PostgreSQL connection string See .env.example NEXTAUTH_SECRET Enables Google OAuth (multi-user) Single-user mode GOOGLE_CLIENT_ID Google OAuth client ID — GOOGLE_CLIENT_SECRET Google OAuth client secret — SECRET_ENCRYPTION_KEY AES-256-GCM encryption key Auto-generated Contributing We welcome contributions! Please read our Contributing Guide and Code of Conduct before getting started. License Apache-2.0