For the complete documentation index, see llms.txt. This page is also available as Markdown.

Secrets Manager

Secrets Manager는 AWS에서 제공하는 비밀 관리형 서비스로 데이터베이스 연결 정보 등과 같은 크리덴셜을 백엔드 소스코드에 하드코딩하지 않고도 연결할 수 있도록 지원합니다.

이 서비스를 통해 관리되는 모든 정보는 기본적으로 AWS KMS를 통해 암호화가 되며, 저장 외에도 자동으로 주기적 패스워드 변경 서비스도 지원합니다.

Abuse

환경 구성 : Secrets Manager

# 현재 연결된 IAM 사용자 ARN 확인
aws sts get-caller-identity

# Secrets Manager와 관련된 IAM 권한 확인
aws iam simulate-principal-policy --policy-source-arn '<arn>' --action-names secretsmanager:GetSecretValue secretsmanager:ListSecrets

# AWS Secrets Manager 열거
aws secretsmanager list-secrets --query 'SecretList[*].[Name, Description, ARN]' --output json

# 열거된 보안 암호에 저장된 값 출력
aws secretsmanager get-secret-value --secret-id '<보안 암호 이름>' --query SecretString --output text | jq

해당 시나리오는 다음과 같은 권한이 요구됩니다.

  1. GetCallerIdentity

  2. iam:SimulatePrincipalPolicy

  3. secretsmanager:ListSecrets

  4. secretsmanager:GetSecretValue

Secrets Manager을 사용하여 자격증명을 안전하게 보관하면 파일 다운로드 공격과 같이 웹 서버의 소스코드를 탈취하는 공격으로부터는 비교적 안전할 수 있지만 웹 서버가 장악당한다면 소스코드를 수정하여 자격증명을 탈취할 수 있습니다.

Demo

References

Last updated