[Vault-2] 기능 별 내용 (Polices)
Checkbox |
|
---|---|
Date |
요약
- Vault의 기능들은 경로를 통해 통제 되고 사용자에게 제공된다.
- 경로에 대해 접근제어를 Policy를 통해 제어를 한다.
- Vault는 다른 Auth 데이터와 연동하여 사본을 스스로 가지진 않지만 맵핑을 통한 연동기능을 제공한다.
- 유저를 생성할 때 Policy를 할당해주고, 한 유저의 다수의 ID(ldap,token etc)를 엔티티로 묶을 수 있고 그 엔티티를 Group 단위로 묶어서 관리를 할 수 있다.
내용
- 워크플로우 (LDAP 연동 기준)
null - Vault에서 LDAP 인증 방식을 사용하기 위해 LDAP 서버의 주소와 TLS 사용 여부를 선택하여 연동
- Vault에서는 모든 정보를 경로를 통한 엔드포인트로 관리하며, 해당 경로에 대한 액세스 권한을 부여하는 정책(Policy)을 작성한다.
- 정책은 Vault에 업로드 되어서 스토리지에 저장되고, 이름으로 참조된다.
- LDAP의 데이터가 Vault 정책에 맵핑된다.
- OU 그룹 “dev” 구성원은 “readonly-dev”라는 Vault 정책에 맵핑된다.
- 이후 사용자가 LDAP 인증 방식을 통해 접근을 하면, Vault는 LDAP에 Auth 정보를 확인하고, Vault 정책을 확인하여 해당 권한이 있는 토큰을 User에게 반환하여 사용한다.
- ACL 정책
- Vault는 중앙에서 액세스를 제어하기 때문에, 권한 설정을 해줘야하는 것이 필요함
- HCL, Json 형식을 사용해서 정책을 추가하고 제어할 수 있다.
- Vault는 경로를 통해 접근하는 엑세스 포인트를 생성한다 ( Path 라는 명칭을 사용 )
- 기본적으로 Deny 상태이다
- 정책 내 사용 가능 메소드
사용 메소드 HTTP API 연동 create POST/PUT read GET update (일부 기능해서 create와 차이가 있음) POST/PUT delete DELETE list LIST patch PATCH sudo - deny -
- Entity와 Group
null - Entity - 1명의 사람이 LDAP, Token, Github 등 여러 개의 인증 방식으로 연동이 되어 있을 때, 해당 방식 중 하나를 시도했을 때 접근할 수 있도록 묶는 단위 Entity 단위를 통해 공통 속성을 설정할 수 있다.
- 그림에서 bob_smith 씨는 bob이라는 token 접속과, bsmith라는 github id가 2개 있음
- Group - Entitiy의 묶음
- 외부 그룹은 실제 외부 연동되는 Auth 서버의 그룹명이랑 일치해야한다. (참고자료 튜토리얼 참고)
- Entity - 1명의 사람이 LDAP, Token, Github 등 여러 개의 인증 방식으로 연동이 되어 있을 때, 해당 방식 중 하나를 시도했을 때 접근할 수 있도록 묶는 단위 Entity 단위를 통해 공통 속성을 설정할 수 있다.
- 예제
- 관리 사용자가 수행할 액트 정의
- 시스템 상태 확인 읽기
- Vault에서 광범위하게 ACL 정책을 만들고 관리
- Vault에서 인증 방법 사용 및 관리
- 커스텀으로 생성된 collie-ssh Secret Engine 제어
- HCL 코드 (Admin 용)
# Read system health check path "sys/health" { capabilities = ["read", "sudo"] } # List existing policies path "sys/policies/acl" { capabilities = ["list"] } # Create and manage ACL policies path "sys/policies/acl/*" { capabilities = ["create", "read", "update", "delete", "list", "sudo"] } # Enable and manage authentication methods broadly across Vault # Manage auth methods broadly across Vault path "auth/*" { capabilities = ["create", "read", "update", "delete", "list", "sudo"] } # Create, update, and delete auth methods path "sys/auth/*" { capabilities = ["create", "update", "delete", "sudo"] } # List auth methods path "sys/auth" { capabilities = ["read"] } # Enable and manage the key/value secrets engine at `secret/` path # collie-ssh secret 엔진 접근 관리 path "collie-ssh/*" { capabilities = ["create", "read", "update", "delete", "list", "sudo"] } # Manage secrets engines path "sys/mounts/*" { capabilities = ["create", "read", "update", "delete", "list", "sudo"] } # List existing secrets engines. path "sys/mounts" { capabilities = ["read"] }
- HCL 코드 - ( ssh secret 엔진을 사용할 유저 )
# Read system health check path "sys/health" { capabilities = ["read", "sudo"] } # Manage auth methods broadly across Vault path "auth/*" { capabilities = ["read", "list" ] } # List auth methods path "sys/auth" { capabilities = ["read"] } # Enable and manage the key/value secrets engine at `secret/` path # List, create, update, and delete key/value secrets path "collie-ssh/*" { capabilities = [ "read", "list", "update" ] }
- 관리 사용자가 수행할 액트 정의
고려할 사항
- LDAP 연동 시 LDAP 사본을 Vault에 저장하기 않기 때문에, LDAP이 문제가 생기면 Vault도 전파가 될 수 있음
- Vault OSS 사용자에게는 문제가 되지 않을 수 있습니다. 그러나 이로 인해 Vault Enterprise 또는 HCP Vault 청구 비용에 영향을 미치는 클라이언트 수가 예기치 않게 증가할 수 있습니다 .
추후 해야할 것
- Secret Engine에 대해서 이해하기
- System(logging, audit, health) 에 대해서 이해하기
- HA 구조 확인
- 체크리스트 작성 및 테스트
참고자료
Vault Policies | Vault | HashiCorp Developer
Vault uses policies to govern the behavior of clients and instrument Role-Based Access Control (RBAC) by specifying access privileges ( authorization). Vault creates a policy during initialization. The root policy is capable of performing every operation for all paths. This policy is assigned to the root token that displays when initialization completes.

System Backend - HTTP API | Vault | HashiCorp Developer
The system backend is a default backend in Vault that is mounted at the /sys endpoint. This endpoint cannot be disabled or moved, and is used to configure Vault and interact with many of Vault's internal features. For more information about a particular path, please click on it in the sidebar.

Policies | Vault | HashiCorp Developer
Everything in Vault is path-based, and policies are no exception. Policies provide a declarative way to grant or forbid access to certain paths and operations in Vault. This section discusses policy workflows and syntaxes. Policies are deny by default, so an empty policy grants no permission in the system.

Identity: Entities and Groups | Vault | HashiCorp Developer
Vault supports multiple authentication methods and also allows enabling the same type of authentication method on different mount paths. Each Vault client may have multiple accounts with various identity providers that are enabled on the Vault server. Vault clients can be mapped as and their corresponding accounts with authentication providers can be mapped as .

728x90
반응형
'Devops 솔루션 > Vault' 카테고리의 다른 글
[Vault] 기능 별 내용 -2 (Secret Engine) (0) | 2023.01.26 |
---|---|
[Vault] 기초 개념 & 테스트 환경 구축 (0) | 2023.01.19 |