Q55. AWS VPC 아키텍처에서 프라이빗 서브넷의 EC2 인스턴스만 RDS에 접근하도록 설정하기
AWS 자격증을 준비하는 여러분, 안녕하세요. 오늘은 VPC 내에서 특정 서브넷의 EC2 인스턴스만 RDS 데이터베이스에 접근할 수 있도록 설정하는 방법에 대해 알아보겠습니다. 이는 보안을 강화하고 데이터베이스 접근을 제어하는 데 중요한 기술입니다.
문제 상황
Q55:
솔루션 설계자는 여러 서브넷을 포함하는 VPC 아키텍처를 개발 중입니다. 아키텍처는 Amazon EC2 인스턴스 및 Amazon RDS DB 인스턴스를 사용하는 애플리케이션을 호스팅합니다. 아키텍처는 2개의 가용 영역에 있는 6개의 서브넷으로 구성됩니다. 각 가용 영역에는 퍼블릭 서브넷, 프라이빗 서브넷 및 데이터베이스용 전용 서브넷이 포함됩니다. 프라이빗 서브넷에서 실행되는 EC2 인스턴스만 RDS 데이터베이스에 액세스할 수 있습니다.
어떤 솔루션이 이러한 요구 사항을 충족합니까?
<small>A solutions architect is developing a VPC architecture that includes multiple subnets. The architecture hosts an application that uses Amazon EC2 instances and Amazon RDS DB instances. The architecture consists of six subnets across two Availability Zones. Each Availability Zone includes a public subnet, a private subnet, and a dedicated subnet for databases. Only EC2 instances that run in the private subnets should be able to access the RDS databases.
Which solution will meet these requirements?</small>
선택지
A. 퍼블릭 서브넷의 CIDR 블록에 대한 경로를 제외하는 새 라우팅 테이블을 생성합니다. 라우팅 테이블을 데이터베이스 서브넷과 연결합니다.
<small>Create a new route table that excludes routes for the CIDR blocks of the public subnets. Associate the route table with the database subnets.</small>
B. 퍼블릭 서브넷의 인스턴스에 할당된 보안 그룹의 인바운드 트래픽을 거부하는 보안 그룹을 생성합니다. 보안 그룹을 DB 인스턴스에 연결합니다.
<small>Create a security group that denies inbound traffic from the security groups that are assigned to instances in the public subnets. Attach the security group to the DB instances.</small>
C. 프라이빗 서브넷의 인스턴스에 할당된 보안 그룹의 인바운드 트래픽을 허용하는 보안 그룹을 생성합니다. 보안 그룹을 DB 인스턴스에 연결합니다.
<small>Create a security group that allows inbound traffic from the security groups that are assigned to instances in the private subnets. Attach the security group to the DB instances.</small>
D. 퍼블릭 서브넷과 프라이빗 서브넷 사이에 새로운 피어링 연결을 생성합니다. 프라이빗 서브넷과 데이터베이스 서브넷 간에 다른 피어링 연결을 만듭니다.
<small>Create a new peering connection between the public subnets and the private subnets. Create another peering connection between the private subnets and the database subnets.</small>
정답 및 해설
정답은 C입니다.
프라이빗 서브넷의 인스턴스에 할당된 보안 그룹의 인바운드 트래픽을 허용하는 보안 그룹을 생성하고, 이를 DB 인스턴스에 연결하는 것이 가장 적절한 솔루션입니다. 이 방법을 통해 프라이빗 서브넷에 있는 EC2 인스턴스만 RDS 데이터베이스에 접근할 수 있도록 제한할 수 있습니다.
<small>The correct answer is C. Creating a security group that allows inbound traffic from the security groups assigned to instances in the private subnets and attaching it to the DB instances is the most appropriate solution. This method restricts access to the RDS databases to only EC2 instances in the private subnets.</small>
AWS 보안 그룹은 인스턴스 수준에서 작동하는 가상 방화벽 역할을 합니다. 인바운드 및 아웃바운드 트래픽을 제어하여 EC2 인스턴스나 RDS 데이터베이스와 같은 AWS 리소스에 대한 접근을 관리할 수 있습니다.
이 솔루션에서는:
- 프라이빗 서브넷의 EC2 인스턴스에 할당된 보안 그룹을 소스로 하는 인바운드 규칙을 가진 새로운 보안 그룹을 생성합니다.
- 이 새로운 보안 그룹을 RDS 데이터베이스 인스턴스에 연결합니다.
이렇게 하면 프라이빗 서브넷의 EC2 인스턴스만 RDS 데이터베이스에 접근할 수 있으며, 퍼블릭 서브넷의 인스턴스는 접근할 수 없게 됩니다.
<small>AWS Security Groups act as a virtual firewall for your instances to control inbound and outbound traffic. Security groups work at the instance level, allowing you to specify which traffic is allowed to reach and leave the resources associated with that security group.
In this solution:
- Create a new security group with an inbound rule that uses the security group assigned to EC2 instances in the private subnet as the source.
- Attach this new security group to the RDS database instances.
This ensures that only EC2 instances in the private subnets can access the RDS databases, while instances in the public subnets cannot.</small>
오답 설명
A. 라우팅 테이블 수정만으로는 특정 서브넷의 인스턴스만 데이터베이스에 접근하도록 제한할 수 없습니다.
<small>A. Modifying route tables alone cannot restrict database access to instances from specific subnets.</small>
B. 보안 그룹은 '허용' 규칙만 지정할 수 있으며, '거부' 규칙은 지정할 수 없습니다.
<small>B. Security groups can only specify 'allow' rules, not 'deny' rules.</small>
D. VPC 피어링은 이 상황에서 불필요하며, 같은 VPC 내의 서브넷 간 통신에는 필요하지 않습니다.
<small>D. VPC peering is unnecessary in this scenario and not needed for communication between subnets within the same VPC.</small>
결론
이 문제는 AWS VPC 내에서 네트워크 보안을 구성하는 방법, 특히 보안 그룹을 사용하여 특정 리소스에 대한 접근을 제어하는 방법을 이해하고 있는지 평가합니다. 보안 그룹의 적절한 사용은 AWS 환경에서 네트워크 보안을 유지하는 데 핵심적인 역할을 합니다.
<small>This question assesses understanding of how to configure network security within an AWS VPC, particularly using security groups to control access to specific resources. Proper use of security groups is crucial for maintaining network security in AWS environments.</small>
댓글
댓글 쓰기