Secure Credential Registration Guide (How to use the credential APIs) #1773
seokho-son
started this conversation in
Show and tell
Replies: 1 comment
-
|
@MZC-CSC POST /credential 를 웹에서 직접 호출하시는 시나리오를 고려하여, 크리덴셜 암호화 방식을 추가해두었습니다. (mc-iam과 별개로 추가적인 보안 체계) 일단 이해가 잘 되시는지, 내용 살펴봐주시면 감사하겠습니다. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Secure Credential Registration Guide (How to use the credential APIs)
개요
이 가이드는 클라이언트가 하이브리드 암호화(AES + RSA)를 사용해 안전하게 CSP API 사용을 위한
credentials를 CB-Tumblebug 서버에 등록하는 방법을 설명한다.클라이언트는 CB-Tumblebug API를 통해 발급받은 RSA 공개 키를 사용해 자체 생성한 AES 키로
credentials데이터를 암호화한 후 API를 통해 서버에 안전하게 전송한다. 이 과정에서 RSA는 4096비트 키를 사용하며, AES는 256비트 키를 사용해 데이터를 암호화한다.보안 설계 철학 (Security Design Philosophy)
CB-Tumblebug의 credential 암호화는 전송 중 도청 방지에 초점을 맞춥니다:
중요: CB-Tumblebug는 credential의 안전한 전달을 담당하며, credential의 유효성 및 권한 검증은 각 CSP(AWS, Azure, GCP 등)에서 수행됨. credential의 유효성 및 권한 검증은 각 CSP(AWS, Azure, GCP 등)에서 처리되므로, CB-Tumblebug 관리 영역이 아님. CB-Tumblebug은 credential 등록 시, 이 실제로 유효한지는 간단한 CSP API 호출을 통해서 기본 검증만 수행함. 따라서, GCM 적용 등의 변조 여부 확인은 적용하지 않고 있음.
Credential 등록 관련 APIs 및 요청 플로우
sequenceDiagram participant Client participant CB-TB Server Note over Client: Start Credential Registration Process Client->>CB-TB Server: Request an RSA public key (GET: /credential/publicKey) CB-TB Server->>CB-TB Server: Generate RSA Key Pair (4096-bit, OAEP padding, SHA-256) CB-TB Server-->>Client: Return RSA Public Key and Token ID Note over Client: Generate AES-256 Key (32 bytes, One-Time Key) Client->>Client: Encrypt Credential Values with AES-256 (CBC Mode, PKCS7 Padding) Note over Client: Encrypt AES Key with RSA Public Key (OAEP padding, SHA-256) Client->>Client: Prepare Payload with Encrypted AES Key and Encrypted Credential Data Client->>CB-TB Server: Send Encrypted Credential Data and Encrypted AES Key (POST: /credential) Note over CB-TB Server: Decrypt AES Key with RSA Private Key CB-TB Server->>CB-TB Server: Use RSA Private Key to Decrypt AES Key (OAEP padding, SHA-256) CB-TB Server->>CB-TB Server: Use AES Key to Decrypt Credential Values (CBC Mode, PKCS7 Padding) CB-TB Server->>CB-TB Server: Register Credential Information Note over CB-TB Server: Expire All Keys (One-Time Use) CB-TB Server->>CB-TB Server: Delete RSA Key Pair, AES Key (One-Time Use) CB-TB Server-->>Client: Return Success Response with Registered Credential Information Client->>Client: Verify Server Response for Successful Registration Note over Client: Expire All Keys (One-Time Use) Client->>Client: Delete RSA Key Pair, AES Key (One-Time Use) Note over Client: Process Complete활용 방식 참고
CB-Tumblebug의 공식 초기화 스크립트인 init.py에서 사용하는 실제 구현
단계별 가이드
1. RSA 공개 키 발급
먼저, 서버에서 RSA 공개 키를 발급받는다. 이 공개 키는 클라이언트에서 생성할 AES 키를 암호화하는 데 사용한다.
발급받은 RSA 공개 키는 1회성 키이며, Credential 등록 작업이 완료되면 RSA 키 페어는 서버 측에서 삭제된다.
GET/credential/publicKeyAPI 응답 예시
{ "publicKeyTokenId": "cr5sidugsanc73arjjbg", "publicKey": "-----BEGIN RSA PUBLIC KEY-----\nMIICCgKCAgEAuBIImwTfVSjhDUW/NEnWf/9LTpSsSWhsnVOSKRp9AmJGg4fgbYnF\nDMdZ/puWn43x1f8PTk3j7CK2b7T/0L0orOF3JdRVtNdTeuuSDuuyiPAJsYn+nXTr\nQXS/7uEZ23KLrqaaz4DY2tInHmSVeemaGGI4iLVGr9jJpt9IUSWWZBLJ1SWCuxJQ\ntmKggM92SloXE0QDX/qC8rdmLlh2I5+mbAGsO84MtDjPulcKa32o8/F32WISmBqq\nRZ7/+eQLC+/vetDGzLitdZReb3wWq4H7PYJe3jJDjFaDOjJdmg83vOnLOVoPqYOG\nVmsoYYEYPqTyioAIt6XlwsWR6CNj/iRfPDgXlEbPI/GOvLEg2wHFjVd315fB6fid\nayV+owkQNH98qGU9ATOEMnwEz3nHsuEnO6AZALu7SVzNNgl5EZQ+rv2zem+6iHLd\nUuinrUkW5Mhg7it+TFo0GJVt5+DiEOe28evdwbNa2s1TAGxfi40xYU5BXoMPq3Bv\n7QXLLqcXqX8uM5WhYPIUZ79inWmZ+GsUvCh87Ry8s8ouiJ8uE7mv+iHQZ6szvMyL\nreQl87oTiRS2SFw6ZTCpEKSWr2YM0JmMotvKWhsjHXzzMTr5SfADvx3FC+aPjveA\nCm3qjVVcf5/O9G5Wwmyp19rIwUA3V92a2NJ5knnMowntLjxkMfOFjt0CAwEAAQ==\n-----END RSA PUBLIC KEY-----\n" }요청 코드 예시 (Python)
2. AES 키 생성 및 민감 데이터 암호화
클라이언트는 AES-256 키를 생성해 민감한
credentials데이터의 값(value) 만 암호화한다.이 AES 키는 RSA 공개 키로 암호화되어 서버로 전송된다. AES 암호화는 CBC 모드를 사용하며, 패딩은 PKCS7로 처리해야 한다.
AES 기반 데이터 암호화 및 RSA 공개 키를 통한 AES 키 암호화 예시 코드 (Python 예시)
3. Credential 등록
암호화된 AES 키와 암호화된
credentials의 값(value) 들을 서버에 전송해credentials를 등록한다.이때, AES 키는 RSA 공개 키로 암호화된 상태로 전송되며, 서버에서 해당 AES 키를 복호화한 후 데이터를 처리한다.
POST/credentialAPI 요청 Body
{ "credentialHolder": "admin", "credentialKeyValueList": [ { "key": "ClientId", "value": "dPw3+CnCsn0RJXeiZxXnHfW03mFx5RaSfbwtPYCq1h6wwv7XsiWzfFmr02..." }, { "key": "ClientSecret", "value": "ZzXL27hbAUDT0ohglf2Gwr60sAqdPw3+CnCsn0RJXeiZxXnHfW03mFx5RaSfbwtPYCq1h6wwv7XsiWzfFmr02..." } ], "encryptedClientAesKeyByPublicKey": "ZzXL27hbAUDT0ohglf2Gwr60sAqdPw3+CnCsn0RJXeiZxXnHfW03mFx5RaSfbwtPYCq1h6wwv7XsiWzfFmr02...", "providerName": "aws", "publicKeyTokenId": "cr5sidugsanc73arjjbg" }예시 요청 (Python)
Go 언어 예시
Node.js 예시
예시 출력
성공적으로 요청이 완료되면 다음과 같은 형식의 JSON 응답이 반환된다:
{ "credentialName": "admin-aws", "credentialHolder": "admin", "providerName": "aws", "keyValueInfoList": [ {"key": "ClientId", "value": "************"}, {"key": "ClientSecret", "value": "************"} ], "allConnections": { "connectionconfig": [ { "configName": "admin-aws-us-west-1", "providerName": "aws", "regionZoneInfoName": "us-west-1", "regionZoneInfo": { "assignedRegion": "us-west-1", "assignedZone": "us-west-1a" }, "regionRepresentative": true, "verified": true } ] } }이 가이드를 따라 클라이언트에서 안전하게
credentials를 등록할 수 있다.보안성 검토 (Security Review by Claude Sonnet 4.5)
전체 평가 (Overall Assessment)
보안 등급: A (95/100) - 실용적이고 안전한 설계
핵심 강점 (Key Strengths)
del aes_key)로 메모리 덤프 공격 방지설계 철학의 타당성 (Design Philosophy Validity)
CB-Tumblebug는 credential 운반자(carrier) 역할에 집중하며, 이는 올바른 아키텍처 선택입니다:
선택적 개선 사항 (Optional Enhancements)
현재 설계도 충분히 안전하며, 다음은 추가적인 방어 계층입니다:
결론 (Conclusion)
현재 구현은 실용적 보안(practical security) 의 모범 사례입니다. 복잡도를 최소화하면서 핵심 위협을 효과적으로 차단하며, API 레벨에서 Rate limiting과 Audit logging이 구현되어 있어 포괄적인 보안 체계를 갖추고 있습니다.
핵심 메시지: 완벽한 이론적 보안보다 실용적이고 유지보수 가능한 보안이 더 중요하며, 이 설계는 그 균형을 완벽하게 맞추고 있습니다.
본 검토는 Claude Sonnet 4.5 (Anthropic)에 의해 2025년 1월 기준으로 수행되었습니다.
Beta Was this translation helpful? Give feedback.
All reactions