MongoDB 자동 사용자 프로비저닝
MongoDB의 자동 사용자 프로비저닝을 구성합니다.
Teleport can automatically create users in your database, removing the need for creating individual user accounts in advance or using the same set of shared database accounts for all users. 전제 조건 # Teleport 클러스터. Teleport 클러스터에 등록된 셀프 호스팅 MongoDB 데이터베이스. 데이터베이스를 등록하는 방법은 Teleport 문서 를 참조하세요. MongoDB 데이터베이스는 구성 파일에서 security.authorization 을 enabled 로 설정하여 역할 기반 접근 제어(RBAC)가 활성화되어 있어야 합니다. 대상 데이터베이스에 연결하고 사용자 계정을 생성할 수 있는 권한. 지원되는 서비스 자동 사용자 프로비저닝은 MongoDB Atlas와 호환되지 않습니다. 1/3단계. 데이터베이스 관리자 구성 # Teleport는 관리자 사용자로 연결할 때 일반 사용자 연결과 동일한 인증 메커니즘(X.509)을 사용합니다. 관리자 사용자는 데이터베이스 내에서 사용자를 생성하고 권한을 부여할 수 있는 권한이 있어야 합니다. 또한 사용자 연결을 모니터링할 수 있는 권한도 있어야 합니다. 먼저 다음 권한으로 admin 데이터베이스에 역할을 생성합니다: db.getSiblingDB("admin").runCommand({ createRole: "teleport-admin-role", privileges: [ { resource: { cluster: true }, actions: [ "inprog" ] }, { resource: { db: "", collection: "" }, actions: [ "grantRole", "revokeRole" ] }, { resource: { db: "$external", "collection": "" }, actions: [ "createUser", "updateUser", "dropUser", "viewUser", "setAuthenticationRestriction", "changeCustomData"] }, ], roles: [], }) grantRole 액션을 특정 데이터베이스로 제한 위 예시에서 `grantRole` 권한은 `admin` 데이터베이스를 포함한 모든 데이터베이스에서 관리자 사용자에게 부여되어 자동 프로비저닝된 사용자에게 모든 데이터베이스의 역할을 할당할 수 있습니다. 최소 권한 원칙을 적용하기 위해 자동 프로비저닝된 사용자에게 할당할 역할을 소유한 데이터베이스로만 grantRole 을 제한할 수 있습니다: db.getSiblingDB("admin").runCommand({ createRole: "teleport-admin-role", privileges: [ { resource: { cluster: true }, actions: [ "inprog" ] }, { resource: { db: "", collection: ""
