Ngân hàng đề — AWS Certified Solutions Architect Associate

Tìm thấy 2194 câu.

Câu 2191
A company runs an application in a private subnet behind an Application Load Balancer (ALB) in a VPC. The VPC has a NAT gateway and an internet gateway. The application calls the Amazon S3 API to store objects.

According to the company's security policy, traffic from the application must not travel across the internet.

Which solution will meet these requirements MOST cost-effectively?
  1. A Configure an S3 interface endpoint. Create a security group that allows outbound traffic to Amazon S3.
  2. B Configure an S3 gateway endpoint. Update the VPC route table to use the endpoint.
  3. C Configure an S3 bucket policy to allow traffic from the Elastic IP address that is assigned to the NAT gateway.
  4. D Create a second NAT gateway in the same subnet where the legacy application is deployed. Update the VPC route table to use the second NAT gateway.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi xoay quanh một ứng dụng chạy trong private subnet (subnet riêng tư) đằng sau Application Load Balancer (ALB) trong một VPC. VPC này đã có NAT gateway và internet gateway (IGW). Ứng dụng cần gọi Amazon S3 API để lưu trữ các object (đối tượng dữ liệu).

📌 Yêu cầu chính từ security policy: Traffic từ ứng dụng KHÔNG được phép đi qua internet (must not travel across the internet).

🛠️ Mục tiêu: Tìm giải pháp MOST cost-effectively (tiết kiệm chi phí nhất) để ứng dụng truy cập S3 mà không vi phạm chính sách bảo mật.

Vấn đề cốt lõi: Private subnet không có route trực tiếp ra internet (chỉ qua NAT gateway), nhưng NAT vẫn route traffic qua internet (dù private IP). Do đó, cần một cách private routing đến S3 mà không qua public internet, và ưu tiên chi phí thấp nhất.

✅ Đáp án đúng: Configure an S3 gateway endpoint. Update the VPC route table to use the endpoint.

Lý do lựa chọn (chi tiết):

  • S3 Gateway Endpoint là giải pháp miễn phí hoàn toàn (no hourly charges, no data processing fees), chỉ route traffic từ VPC endpoint trực tiếp đến S3 qua AWS private network (không qua internet).
  • Chỉ cần thêm prefix list route (pl-... cho S3) vào VPC route table của private subnet (route 0.0.0.0/0 -> igw; nhưng thêm route cụ thể cho S3 prefix -> endpoint).
  • Hoạt động với ALB/private subnet mà không cần thay đổi lớn, tuân thủ security policy 100%, và cost-effective nhất so với các option khác (không tốn NAT data fees hay endpoint fees).
  • Cập nhật AWS 2026: Gateway endpoints vẫn là best practice cho S3 (high throughput, no MTU issues như interface endpoints).

📋 Phân tích tất cả các phương án (đúng/sai)

Dưới đây là phân tích từng lựa chọn một cách chi tiết. Tôi giữ nguyên văn bản gốc bằng tiếng Anh, và giải thích hoàn toàn bằng tiếng Việt với lý do đúng/sai:

  • ❌ [SAI] Configure an S3 interface endpoint. Create a security group that allows outbound traffic to Amazon S3.

    • Giải thích sai: Interface Endpoint (VPCE) cho S3 sử dụng Elastic Network Interface (ENI) trong subnet, route private qua AWS network (không internet). Tuy nhiên, nó có phí (hourly charge ~$0.01/giờ/ENI + data processing fees), đắt hơn Gateway Endpoint rất nhiều. Security group không cần thiết vì endpoint dùng VPC endpoint policy. Không phải "MOST cost-effectively".
  • ✅ [ĐÚNG] Configure an S3 gateway endpoint. Update the VPC route table to use the endpoint.

    • Giải thích đúng: Như đã nêu ở trên. Gateway Endpoint là virtual interface miễn phí, chỉ cần update route table với prefix list của S3 (com.amazonaws.region.s3). Traffic từ private subnet/EC2/ALB target đi thẳng S3 private, bypass NAT/IGW/internet hoàn toàn. Tiết kiệm nhất, scalable, và AWS khuyến nghị cho S3 (không hỗ trợ KMS/DynamoDB).
  • ❌ [SAI] Configure an S3 bucket policy to allow traffic from the Elastic IP address that is assigned to the NAT gateway.

    • Giải thích sai: Bucket policy chỉ kiểm soát access permission dựa trên EIP của NAT (public IP), nhưng traffic vẫn đi qua NAT gateway -> internet (vi phạm security policy). Không giải quyết vấn đề "no internet travel", chỉ là workaround permission, vẫn tốn NAT data transfer fees và không private.
  • ❌ [SAI] Create a second NAT gateway in the same subnet where the legacy application is deployed. Update the VPC route table to use the second NAT gateway.

    • Giải thích sai: Thêm NAT thứ 2 trong cùng subnet private không thay đổi gì (vẫn route qua NAT -> internet cho S3). Tốn kém gấp đôi (NAT hourly + data fees), không private hóa traffic S3, và private subnet không nên có NAT (NAT thường ở public subnet). Hoàn toàn không hiệu quả.

📘 Tài liệu tham khảo (AWS cập nhật mới nhất 2026)

  • AWS VPC Endpoints Documentation: Gateway endpoints for Amazon S3 – Xác nhận free tier và route table config.
  • AWS Best Practices: Amazon S3 VPC Endpoints – So sánh Gateway vs Interface (Gateway rẻ hơn).
  • AWS Pricing: VPC Endpoints Pricing – Gateway: $0; Interface: $0.01/hr + $0.01/GB.
  • Exam Topic DOP-C02: VPC Connectivity & Endpoints (AWS Certified DevOps Engineer Professional 2026 syllabus).

🛠️ Lời khuyên DevOps: Luôn ưu tiên Gateway Endpoint cho S3/DynamoDB trong private VPC để tối ưu chi phí/bảo mật. Test bằng AWS CLI: aws s3 ls s3://your-bucket từ EC2 private để verify!

Câu 2192
A company has an application that runs on an Amazon Elastic Kubernetes Service (Amazon EKS) cluster on Amazon EC2 instances. The application has a UI that uses Amazon DynamoDB and data services that use Amazon S3 as part of the application deployment.

The company must ensure that the EKS Pods for the UI can access only Amazon DynamoDB and that the EKS Pods for the data services can access only Amazon S3. The company uses AWS Identity and Access Management (IAM).

Which solution meals these requirements?
  1. A Create separate IAM policies for Amazon S3 and DynamoDB access with the required permissions. Attach both IAM policies to the EC2 instance profile. Use role-based access control (RBAC) to control access to Amazon S3 or DynamoDB for the respective EKS Pods.
  2. B Create separate IAM policies for Amazon S3 and DynamoDB access with the required permissions. Attach the Amazon S3 IAM policy directly to the EKS Pods for the data services and the DynamoDB policy to the EKS Pods for the UI.
  3. C Create separate Kubernetes service accounts for the UI and data services to assume an IAM role. Attach the AmazonS3FullAccess policy to the data services account and the AmazonDynamoDBFullAccess policy to the UI service account.
  4. D Create separate Kubernetes service accounts for the UI and data services to assume an IAM role. Use IAM Role for Service Accounts (IRSA) to provide access to the EKS Pods for the UI to Amazon S3 and the EKS Pods for the data services to DynamoDB.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi tập trung vào việc kiểm soát quyền truy cập chi tiết (least privilege access) cho các Pods trong Amazon EKS cluster chạy trên EC2 instances. Ứng dụng gồm hai phần chính:

  • UI Pods: Chỉ được phép truy cập Amazon DynamoDB (không được access S3).
  • Data services Pods: Chỉ được phép truy cập Amazon S3 (không được access DynamoDB).

Yêu cầu sử dụng AWS IAM để thực thi nguyên tắc này một cách an toàn, không cấp quyền thừa. EKS hỗ trợ IAM Roles for Service Accounts (IRSA) – tính năng cho phép Kubernetes Service Accounts (SA) assume IAM Roles, từ đó Pods có thể gọi AWS APIs với quyền hạn cụ thể mà không cần lưu credentials trên Pods. Đây là best practice theo AWS Well-Architected Framework (Security Pillar) cập nhật đến 2026, tránh chia sẻ IAM role ở mức node (EC2 instance profile).

Mục tiêu chính: Phân tách quyền truy cập ở mức Pod/Service Account, không phải ở mức cluster/node, để đảm bảo isolation.

📘 Tài liệu tham khảo:

✅ Đáp án đúng

Create separate Kubernetes service accounts for the UI and data services to assume an IAM role. Attach the AmazonS3FullAccess policy to the data services account and the AmazonDynamoDBFullAccess policy to the UI service account.

Lý do chọn đáp án này 🛠️:

  • Tạo Kubernetes Service Accounts riêng biệt cho UI và data services: UI SA assume IAM Role với AmazonDynamoDBFullAccess (chỉ DynamoDB), data services SA assume IAM Role với AmazonS3FullAccess (chỉ S3).
  • Sử dụng IRSA (IAM Roles for Service Accounts) để Pods annotate với SA tương ứng, tự động assume role phù hợp khi gọi AWS SDK/API.
  • Đảm bảo least privilege: UI Pods chỉ access DynamoDB, data services chỉ S3. Không quyền thừa, tuân thủ Zero Trust.
  • Đây là giải pháp native EKS + IAM, scalable và secure nhất theo docs AWS 2026.

📋 Giải thích chi tiết từng phương án

Dưới đây là phân tích tất cả 4 lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá ✅ (đúng) hoặc ❌ (sai) kèm lý do cụ thể bằng tiếng Việt.

  • Create separate IAM policies for Amazon S3 and DynamoDB access with the required permissions. Attach both IAM policies to the EC2 instance profile. Use role-based access control (RBAC) to control access to Amazon S3 or DynamoDB for the respective EKS Pods.
    ❌ Sai: IAM policies attach vào EC2 instance profile sẽ cấp quyền cho toàn bộ node/cluster (tất cả Pods chia sẻ). RBAC chỉ kiểm soát Kubernetes resources nội bộ, không kiểm soát AWS services như S3/DynamoDB. Vi phạm least privilege, Pods có thể cross-access.

  • Create separate IAM policies for Amazon S3 and DynamoDB access with the required permissions. Attach the Amazon S3 IAM policy directly to the EKS Pods for the data services and the DynamoDB policy to the EKS Pods for the UI.
    ❌ Sai: Không thể attach IAM policies trực tiếp vào Pods. IAM roles chỉ attach qua Service Accounts + IRSA hoặc instance profile. Cách này không tồn tại trong EKS/IAM, dẫn đến Pods không có credentials để access AWS services.

  • Create separate Kubernetes service accounts for the UI and data services to assume an IAM role. Attach the AmazonS3FullAccess policy to the data services account and the AmazonDynamoDBFullAccess policy to the UI service account.
    ✅ Đúng: Như phân tích ở phần đáp án. Sử dụng separate K8s SAs assume IAM Roles riêng với managed policies phù hợp (S3 cho data services, DynamoDB cho UI). Pods bind SA sẽ inherit quyền chính xác qua IRSA – giải pháp chuẩn AWS.

  • Create separate Kubernetes service accounts for the UI and data services to assume an IAM role. Use IAM Role for Service Accounts (IRSA) to provide access to the EKS Pods for the UI to Amazon S3 and the EKS Pods for the data services to DynamoDB.
    ❌ Sai: Mặc dù dùng IRSA đúng cách với separate SAs, nhưng đảo ngược quyền hạn: UI Pods được S3 (thừa), data services được DynamoDB (thừa). Không đáp ứng yêu cầu "UI chỉ DynamoDB, data services chỉ S3".

Câu 2193
A company needs to give a globally distributed development team secure access to the company's AWS resources in a way that complies with security policies.

The company currently uses an on-premises Active Directory for internal authentication. The company uses AWS Organizations to manage multiple AWS accounts that support multiple projects.

The company needs a solution to integrate with the existing infrastructure to provide centralized identity management and access control.

Which solution will meet these requirements with the LEAST operational overhead?
  1. A Set up AWS Directory Service to create an AWS managed Microsoft Active Directory on AWS. Establish a trust relationship with the on-premises Active Directory. Use IAM rotes that are assigned to Active Directory groups to access AWS resources within the company's AWS accounts.
  2. B Create an IAM user for each developer. Manually manage permissions for each IAM user based on each user's involvement with each project. Enforce multi-factor authentication (MFA) as an additional layer of security.
  3. C Use AD Connector in AWS Directory Service to connect to the on-premises Active Directory. Integrate AD Connector with AWS IAM Identity Center. Configure permissions sets to give each AD group access to specific AWS accounts and resources.
  4. D Use Amazon Cognito to deploy an identity federation solution. Integrate the identity federation solution with the on-premises Active Directory. Use Amazon Cognito to provide access tokens for developers to access AWS accounts and resources.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi tập trung vào việc cung cấp quyền truy cập an toàn cho đội ngũ phát triển phân bố toàn cầu vào tài nguyên AWS, đồng thời tuân thủ chính sách bảo mật và tích hợp với hạ tầng hiện tại (Active Directory on-premises). Công ty sử dụng AWS Organizations để quản lý nhiều tài khoản AWS cho các dự án khác nhau. Yêu cầu chính là giải pháp tập trung quản lý identity và access control với ít overhead vận hành nhất (LEAST operational overhead).

🛠️ Các yếu tố then chốt:

  • Tích hợp với on-premises Active Directory (không muốn migrate hoặc replicate toàn bộ).
  • Hỗ trợ nhiều tài khoản AWS qua Organizations.
  • Bảo mật cao: Centralized identity, group-based access, phù hợp global team.
  • Least overhead: Tránh setup phức tạp như managed directory hoặc IAM users thủ công.

📘 Kiến thức AWS cập nhật (2026): Giải pháp lý tưởng sử dụng AWS IAM Identity Center (trước đây là AWS SSO, nay là tiêu chuẩn cho multi-account access) kết hợp AWS Directory Service (cụ thể AD Connector) để proxy kết nối on-prem AD mà không cần replicate data, giảm chi phí và overhead.

✅ Đáp án đúng: Use AD Connector in AWS Directory Service to connect to the on-premises Active Directory. Integrate AD Connector with AWS IAM Identity Center. Configure permissions sets to give each AD group access to specific AWS accounts and resources.

Lý do lựa chọn:

  • Least operational overhead: AD Connector chỉ proxy kết nối đến on-prem AD (không replicate users/objects), dễ setup trong VPC, tích hợp trực tiếp với IAM Identity Center.
  • Centralized management: IAM Identity Center hỗ trợ permission sets map AD groups → roles/accounts cụ thể trong Organizations, phù hợp multi-account/multi-project.
  • Secure & compliant: Sử dụng existing AD authentication, SSO cho console/CLI, hỗ trợ MFA từ AD.
  • Hoàn hảo cho global team: Single sign-on, no IAM users sprawl.

🛠️ Phân tích chi tiết từng phương án

  • Phương án 1: Set up AWS Directory Service to create an AWS managed Microsoft Active Directory on AWS. Establish a trust relationship with the on-premises Active Directory. Use IAM roles that are assigned to Active Directory groups to access AWS resources within the company's AWS accounts.
    ❌ Sai vì: Tạo AWS Managed Microsoft AD (Directory Service) yêu cầu replicate toàn bộ directory và setup trust relationship phức tạp (forest trust), dẫn đến high operational overhead (quản lý AD riêng trên AWS, backup, patching). Không least overhead so với AD Connector (chỉ proxy). Dù hỗ trợ IAM roles qua groups, nhưng overhead lớn hơn.

  • Phương án 2: Create an IAM user for each developer. Manually manage permissions for each IAM user based on each user's involvement with each project. Enforce multi-factor authentication (MFA) as an additional layer of security.
    ❌ Sai vì: Tạo IAM users riêng lẻ cho từng developer là manual scaling nightmare với global team/multi-project, vi phạm centralized identity (không tích hợp on-prem AD). Quản lý permissions thủ công per user/project gây high overhead, dễ lỗi, không scale với Organizations. MFA tốt nhưng không giải quyết gốc rễ.

  • Phương án 3: Use AD Connector in AWS Directory Service to connect to the on-premises Active Directory. Integrate AD Connector with AWS IAM Identity Center. Configure permissions sets to give each AD group access to specific AWS accounts and resources.
    ✅ Đúng vì: Như đã giải thích ở trên. AD Connector là lightweight proxy (read-only từ on-prem AD), tích hợp seamless với IAM Identity Center cho permission sets (assign roles/accounts theo AD groups). Hỗ trợ Organizations, SSO global, zero replication overhead. Lý tưởng cho least effort.

  • Phương án 4: Use Amazon Cognito to deploy an identity federation solution. Integrate the identity federation solution with the on-premises Active Directory. Integrate với on-premises Active Directory. Use Amazon Cognito to provide access tokens for developers to access AWS accounts and resources.
    ❌ Sai vì: Cognito dành cho app/mobile/web auth (user pools/federation), không phải admin console/CLI access cho AWS resources. Tích hợp AD qua SAML/OIDC phức tạp, không centralized cho multi-account Organizations. High overhead custom federation, không hỗ trợ permission sets native như IAM Identity Center. Không phù hợp secure AWS resource access.

📘 Tài liệu tham khảo (AWS cập nhật 2026)

Giải pháp này đảm bảo secure, scalable, low-overhead! 🚀

Câu 2194
A company is developing an application in the AWS Cloud. The application's HTTP API contains critical information that is published in Amazon API Gateway. The critical information must be accessible from only a limited set of trusted IP addresses that belong to the company's internal network.

Which solution will meet these requirements?
  1. A Set up an API Gateway private integration to restrict access to a predefined set of IP addresses.
  2. B Create a resource policy for the API that denies access to any IP address that is not specifically allowed.
  3. C Directly deploy the API in a private subnet. Create a network ACL. Set up rules to allow the traffic from specific IP addresses.
  4. D Modify the security group that is attached to API Gateway to allow inbound traffic from only the trusted IP addresses.
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi xoay quanh việc bảo mật truy cập vào HTTP API trên Amazon API Gateway trong AWS Cloud. Ứng dụng chứa thông tin critical (quan trọng), và yêu cầu chỉ cho phép truy cập từ một tập hợp IP addresses đáng tin cậy hạn chế, thuộc mạng nội bộ của công ty.

📌 Yêu cầu chính: Cần một giải pháp hạn chế truy cập dựa trên IP cụ thể, không cho phép từ các IP khác. API Gateway là dịch vụ managed, hỗ trợ nhiều cách bảo mật như IAM, resource policies, private APIs, nhưng phải chọn phương án phù hợp nhất với IP restriction từ mạng nội bộ (có thể là on-premises hoặc VPC cụ thể). Giải pháp phải an toàn, scalable và tuân thủ best practices AWS (cập nhật đến 2026, với HTTP APIs hỗ trợ resource policies đầy đủ).

✅ Đáp án đúng

Create a resource policy for the API that denies access to any IP address that is not specifically allowed.

Lý do lựa chọn:

  • Resource policy trên API Gateway cho phép chính xác kiểm soát truy cập dựa trên IP addresses bằng cách deny tất cả trừ các IP được allow explicitly (sử dụng điều kiện aws:SourceIp).
  • Đây là cách chuẩn và được AWS khuyến nghị cho public APIs cần IP whitelisting/blacklisting. Policy này áp dụng ở edge level, chặn request trước khi đến backend.
  • ✅ Hiệu quả cao: Hỗ trợ CIDR blocks, IPv4/IPv6, và kết hợp với VPC endpoints nếu cần. Không yêu cầu thay đổi infrastructure, dễ quản lý qua Console/CLI/Terraform.
  • 📘 Tài liệu tham khảo: AWS API Gateway Resource Policies (cập nhật 2025-2026, hỗ trợ HTTP APIs đầy đủ).

🛠️ Phân tích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên nội dung gốc bằng tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể dựa trên kiến thức AWS mới nhất:

  • Set up an API Gateway private integration to restrict access to a predefined set of IP addresses.
    ❌ Sai: Private integration chỉ dùng để kết nối API Gateway với backend private resources trong VPC (như NLB/EC2), không kiểm soát truy cập vào API endpoint chính. Nó không hỗ trợ restrict IP của client gọi API. Nếu dùng private integration, client vẫn cần truy cập public API Gateway trước.

  • Create a resource policy for the API that denies access to any IP address that is not specifically allowed.
    ✅ Đúng: Như đã giải thích ở trên. Resource policy là IAM-like policy gắn trực tiếp vào API, với syntax như "Condition": {"IpAddress": {"aws:SourceIp": ["203.0.113.0/24"]}} và Deny default. Hoàn hảo cho trusted IPs từ internal network.

  • Directly deploy the API in a private subnet. Create a network ACL. Set up rules to allow the traffic from specific IP addresses.
    ❌ Sai: API Gateway không thể deploy trực tiếp vào private subnet (là dịch vụ edge-managed, không có ENI/SG/NACL). Chỉ Private REST/HTTP APIs mới restrict qua VPC endpoints, nhưng không hỗ trợ specific external IPs một cách linh hoạt. NACL chỉ áp dụng cho VPC resources, không phải API Gateway.

  • Modify the security group that is attached to API Gateway to allow inbound traffic from only the trusted IP addresses.
    ❌ Sai: API Gateway không có security groups (không phải EC2/VPC resource). SG chỉ dùng cho VPC-integrated services như NLB/ALB. Không thể attach SG vào API Gateway; truy cập được kiểm soát qua resource policies hoặc WAF thay thế.

📚 Tài liệu tham khảo bổ sung

  • API Gateway Security Best Practices (2026 updates: Tăng cường IP conditions trong policies).
  • HTTP APIs vs REST APIs: HTTP APIs hỗ trợ resource policies từ 2021, đầy đủ tính năng đến nay.
  • Exam tip (DevOps Pro DOP-C02): Chủ đề này thường kiểm tra least privilege access qua policies, không phải network controls sai vị trí.

Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần ví dụ code policy, hãy hỏi thêm.