Ngân hàng đề — AWS Certified Security Specialty

Tìm thấy 445 câu.

Câu 401
A company needs to prevent Amazon S3 objects from being shared with IAM identities outside of the company’s organization in AWS Organizations. A security engineer is creating and deploying an SCP to accomplish this goal. The company has enabled the S3 Block Public Access feature on all of its S3 buckets.

What should the SCP do to meet these requirements?
  1. A Deny the S3:* action with a Condition element that comprises an operator of StringNotEquals, a key of aws:ResourceOrgID, and a value of S{aws PrincipalOrgID}.
  2. B Deny the S3:PutAccountPublicAccessBlock action with a Condition element that comprises an operator of StringLike, a key of aws:PrincipalArn, and the values of the external IAM principals.
  3. C Allow the S3:* action with a Condition element that comprises an operator of StringNotEquals, a key of aws:PrincipalOrgID, and a value of S{aws:PrincipalOrgID}.
  4. D Deny the S3:* action with a Condition element that comprises an operator of StringLike, a key of aws:PrincipalArn, and the values of the external IAM principals
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 ngăn chặn Amazon S3 objects bị chia sẻ với các IAM identities (như IAM users/roles) bên ngoài AWS Organizations của công ty. 🛡️

  • Bối cảnh: Công ty sử dụng AWS Organizations để quản lý các tài khoản AWS. Họ đã bật S3 Block Public Access trên tất cả S3 buckets (ngăn public access từ internet). Bây giờ, cần SCP (Service Control Policy) để chặn access cross-organization (từ principal ngoài org).
  • Mục tiêu: SCP phải deny các hành động S3 nếu principal thực hiện request không thuộc cùng organization với resource S3 (bucket/object thuộc account trong org). SCP chỉ áp dụng cho member accounts trong org, không ảnh hưởng external.
  • Kiến thức cốt lõi (cập nhật AWS 2026): Sử dụng global condition keys như aws:PrincipalOrgID (ID của organization mà principal thuộc về) và aws:ResourceOrgID (ID của organization sở hữu resource). SCP với Deny explicit và condition StringNotEquals sẽ chặn hiệu quả mà không cần liệt kê external principals. 📘
    Nguồn tham khảo:
  • AWS Organizations SCP docs: docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples_s3.html
  • Global condition keys: docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html (aws:PrincipalOrgID & aws:ResourceOrgID).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Deny the S3:* action with a Condition element that comprises an operator of StringNotEquals, a key of aws:ResourceOrgID, and a value of ${aws:PrincipalOrgID}.

Lý do 🛠️:

  • SCP này deny tất cả hành động S3* (như GetObject, PutObject) khi aws:ResourceOrgID != ${aws:PrincipalOrgID}, nghĩa là chỉ chặn principal từ organization khác truy cập resource S3 trong org của công ty.
  • aws:ResourceOrgID: ID org sở hữu S3 bucket/object (tự động từ account trong org).
  • ${aws:PrincipalOrgID}: ID org của principal request (IAM user/role).
  • Hiệu quả: Explicit Deny luôn thắng Allow. Không ảnh hưởng internal org access. Hoàn hảo cho yêu cầu, và phù hợp best practice AWS (không cần liệt kê principals). ✅

📋 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. Tôi giữ nguyên văn bản gốc bằng tiếng Anh, chỉ giải thích bằng tiếng Việt với emoji nổi bật.

  • ✅ Phương án ĐÚNG:
    Deny the S3: action with a Condition element that comprises an operator of StringNotEquals, a key of aws:ResourceOrgID, and a value of ${aws:PrincipalOrgID}.*
    🛡️ Giải thích đúng: Như trên, sử dụng condition StringNotEquals để deny chính xác khi org của resource khác org của principal. Đơn giản, scalable, không cần biết external ARNs. Best practice cho SCP cross-org S3 control (AWS re:Post & docs xác nhận).

  • ❌ Phương án SAI 1:
    Deny the S3:PutAccountPublicAccessBlock action with a Condition element that comprises an operator of StringLike, a key of aws:PrincipalArn, and the values of the external IAM principals.
    🚫 Giải thích sai: Chỉ deny PutAccountPublicAccessBlock (hành động thay đổi Block Public Access setting), không chặn các S3 actions khác như GetObject/ListBuckets. Không dùng aws:PrincipalOrgID, mà yêu cầu liệt kê "external IAM principals" (không khả thi vì vô tận). Không đạt yêu cầu chặn chia sẻ objects.

  • ❌ Phương án SAI 2:
    Allow the S3: action with a Condition element that comprises an operator of StringNotEquals, a key of aws:PrincipalOrgID, and a value of ${aws:PrincipalOrgID}.*
    🚫 Giải thích sai: Đây là Allow với condition aws:PrincipalOrgID != ${aws:PrincipalOrgID} – luôn FALSE (vì PrincipalOrgID luôn bằng chính nó). Kết quả: Không allow gì cả, chặn toàn bộ S3 access (kể cả internal). Ngược hoàn toàn yêu cầu!

  • ❌ Phương án SAI 3:
    Deny the S3: action with a Condition element that comprises an operator of StringLike, a key of aws:PrincipalArn, and the values of the external IAM principals.*
    🚫 Giải thích sai: Yêu cầu liệt kê "external IAM principals" bằng StringLike trên aws:PrincipalArn – không scalable (external ARNs vô hạn, không biết trước). Không dùng OrgID, dễ bypass nếu external thay đổi ARN. SCP best practice tránh hardcode principals.

Kết luận 🎯: SCP đúng tận dụng condition keys OrgID để tự động hóa, an toàn và dễ quản lý. Nếu deploy, attach SCP vào root OU trong Organizations! 🛡️

Câu 402
A security engineer is implementing authentication for a multi-account environment by using federated access with SAML 2.0. The security engineer has configured AWS IAM Identity Center as an identity provider (IdP). The security engineer also has created IAM roles to grant access to the AWS accounts.

A federated user reports an authentication failure when the user attempts to authenticate with the new system.

What should the security engineer do to troubleshoot this issue in the MOST operationally efficient way?
  1. A Review the SAML IdP logs to identify errors. Check AWS CloudTrail to verify the API calls that the user made.
  2. B Review the SAML IdP logs to identify errors. Use the IAM policy simulator to validate access to the IAM roles.
  3. C Use IAM access advisor to review recent service access. Use the IAM policy simulator to validate access to the IAM roles.
  4. D Recreate the SAML IdP in a separate account to confirm the behavior that the user is experiencing.
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 tình huống một security engineer đang triển khai authentication cho môi trường multi-account AWS sử dụng federated access với SAML 2.0. Họ đã cấu hình AWS IAM Identity Center (trước đây gọi là AWS SSO) làm Identity Provider (IdP), và tạo IAM roles để cấp quyền truy cập vào các AWS accounts khác nhau. 📘

Một federated user báo lỗi authentication failure khi cố gắng authenticate với hệ thống mới. Câu hỏi yêu cầu security engineer làm gì để troubleshoot vấn đề này theo cách MOST operationally efficient (hiệu quả vận hành nhất). 🛠️

Bối cảnh chính:

  • SAML 2.0 federation: User authenticate qua IdP bên ngoài (ở đây là IAM Identity Center), nhận SAML assertion, rồi assume IAM role trong AWS accounts.
  • Vấn đề: Lỗi authentication có thể xảy ra ở giai đoạn IdP (SAML trace) hoặc sau đó (API calls như AssumeRole).
  • Mục tiêu: Tìm cách troubleshoot nhanh, tiết kiệm tài nguyên nhất, ưu tiên logs và traces có sẵn thay vì recreate hoặc simulate. 🔍

Kiến thức cập nhật AWS 2024-2026: IAM Identity Center hỗ trợ SAML 2.0 federation mạnh mẽ hơn với multi-account, tích hợp CloudTrail cho auditing. (Nguồn: AWS Docs - IAM Identity Center Troubleshooting, CloudTrail for IAM Federation).


✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Review the SAML IdP logs to identify errors. Check AWS CloudTrail to verify the API calls that the user made.

Lý do chi tiết 🏆:

  • Đây là cách hiệu quả nhất (operationally efficient): Bắt đầu từ SAML IdP logs (trong IAM Identity Center hoặc IdP bên ngoài) để xác định lỗi authentication ngay từ nguồn (ví dụ: invalid assertion, user mapping sai, hoặc SAML metadata mismatch). ✅
  • Tiếp theo, kiểm tra AWS CloudTrail để verify API calls (như AssumeRoleWithSAML), xem có failure sau authentication không (ví dụ: role trust policy sai, condition keys thiếu). CloudTrail ghi đầy đủ sự kiện IAM federation realtime. 📊
  • Không cần tool simulate hay recreate, chỉ dùng logs có sẵn → Tiết kiệm thời gian, chi phí. Phù hợp best practice AWS troubleshooting SAML (steps 1: IdP logs, steps 2: CloudTrail). 🚀

📋 Giải thí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 tiếng Anh của phương án, chỉ giải thích bằng tiếng Việt với emoji nổi bật. ❌ cho sai, ✅ cho đúng.

  • Review the SAML IdP logs to identify errors. Check AWS CloudTrail to verify the API calls that the user made.
    ✅ Đúng 🥇: Như đã giải thích ở trên, đây là quy trình troubleshoot chuẩn, nhanh chóng và chính xác nhất. SAML logs catch lỗi IdP-side, CloudTrail catch AWS-side API failures (e.g., AssumeRole errors). Hoàn hảo cho multi-account SAML federation.

  • Review the SAML IdP logs to identify errors. Use the IAM policy simulator to validate access to the IAM roles.
    ❌ Sai ⚠️: Phần đầu (SAML IdP logs) tốt, nhưng IAM Policy Simulator chỉ simulate policy evaluation tĩnh (không replay real API calls), không detect lỗi runtime như SAML assertion invalid hoặc CloudTrail events. Không efficient bằng CloudTrail cho verify actual user actions.

  • Use IAM access advisor to review recent service access. Use the IAM policy simulator to validate access to the IAM roles.
    ❌ Sai 🚫: IAM Access Advisor chỉ review service usage history dài hạn (last 400 days), không realtime cho authentication failure cụ thể của user. Policy Simulator cũng chỉ test policy, bỏ qua SAML flow. Không address gốc rễ vấn đề SAML → Không efficient, chậm chạp.

  • Recreate the SAML IdP in a separate account to confirm the behavior that the user is experiencing.
    ❌ Sai 🔄: Recreate IdP là cách không efficient (tốn thời gian, tài nguyên, risk config mới sai). Chỉ dùng cho isolation testing cuối cùng, không phải bước đầu troubleshoot. AWS khuyến nghị logs trước recreate (theo IAM Identity Center docs).


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

Hy vọng phân tích này giúp bạn nắm vững! Nếu cần deep dive thêm, hỏi nhé. 💪

Câu 403
A company stores sensitive data in an Amazon S3 bucket. The company encrypts the data at rest by using server-side encryption with Amazon S3 managed keys (SSE-S3).

A security engineer must prevent any modifications to the data in the S3 bucket.

Which solution will meet this requirement?
  1. A Configure S3 bucket policies to deny DELETE and PUT object permissions.
  2. B Configure S3 Object Lock in compliance mode with S3 bucket versioning enabled.
  3. C Change the encryption on the S3 bucket to use AWS Key Management Service (AWS KMS) customer managed keys.
  4. D Configure the S3 bucket with multi-factor authentication (MFA) delete protection.
Xem giải thích

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

Nội dung câu hỏi:
Câu hỏi xoay quanh việc bảo vệ dữ liệu nhạy cảm trong Amazon S3 bucket đã được mã hóa tại chỗ bằng server-side encryption với SSE-S3 (S3 managed keys). Yêu cầu chính là ngăn chặn mọi sửa đổi (modifications) đối với dữ liệu trong bucket, nghĩa là không cho phép xóa, ghi đè, hoặc thay đổi object dưới bất kỳ hình thức nào.
🛠️ Mục tiêu cốt lõi: Đảm bảo tính bất biến (immutability) của dữ liệu, đặc biệt trong môi trường tuân thủ quy định nghiêm ngặt như WORM (Write Once, Read Many). Đây là tình huống phổ biến trong DevOps và Security trên AWS, nơi cần áp dụng các tính năng S3 nâng cao để chống tampering.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Configure S3 Object Lock in compliance mode with S3 bucket versioning enabled.

Lý do:

  • S3 Object Lock là tính năng chuyên dụng để khóa object vĩnh viễn, ngăn chặn xóa hoặc ghi đè trong một khoảng thời gian xác định (retention period).
  • Compliance mode là chế độ nghiêm ngặt nhất: Không ai (kể cả root user) có thể xóa hoặc sửa đổi object trước khi hết retention period, trừ khi có quyền đặc biệt từ AWS (như Legal Hold).
  • S3 Bucket Versioning phải được kích hoạt vì Object Lock chỉ áp dụng cho versioned objects (theo tài liệu AWS cập nhật 2024-2026).
    ✅ Hoàn hảo cho yêu cầu "prevent any modifications", vì nó đảm bảo dữ liệu bất biến 100%, phù hợp với các quy định như SEC Rule 17a-4(f), FINRA.

📋 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. Tôi giữ nguyên văn bản gốc bằng tiếng Anh, chỉ giải thích bằng tiếng Việt với lý do rõ ràng dựa trên kiến thức AWS mới nhất (tính đến 2026, S3 Object Lock hỗ trợ Legal Hold và tích hợp IAM sâu hơn).

  • ❌ Phương án A: Configure S3 bucket policies to deny DELETE and PUT object permissions.
    Sai vì: Bucket policies chỉ hạn chế quyền truy cập dựa trên IAM, nhưng không ngăn chặn hoàn toàn modifications. Nếu có quyền cao hơn (như root hoặc policy override), vẫn có thể bypass. Không đảm bảo immutability thực sự, chỉ là kiểm soát access tạm thời. Không giải quyết được yêu cầu "prevent any modifications" tuyệt đối.

  • ✅ Phương án B: Configure S3 Object Lock in compliance mode with S3 bucket versioning enabled.
    Đúng vì: Như đã giải thích ở trên. Đây là giải pháp chuẩn AWS cho WORM storage. Object Lock + Versioning tạo ra các version bất biến; Compliance mode khóa chặt, không thể PUT/DELETE/Overwrite. Đã được kiểm chứng trong các kỳ thi DOP-C02 (DevOps Professional 2024+).

  • ❌ Phương án C: Change the encryption on the S3 bucket to use AWS Key Management Service (AWS KMS) customer managed keys.
    Sai vì: Thay đổi encryption sang KMS customer managed keys chỉ cải thiện quản lý khóa mã hóa (key rotation, access control), nhưng không ảnh hưởng đến modifications. Dữ liệu vẫn có thể bị PUT/DELETE/Overwrite bình thường. Encryption chỉ bảo vệ confidentiality, không phải integrity/immutability.

  • ❌ Phương án D: Configure the S3 bucket with multi-factor authentication (MFA) delete protection.
    Sai vì: MFA Delete chỉ yêu cầu MFA khi xóa versions trong bucket versioning, không ngăn PUT mới hoặc overwrite. Nó bảo vệ chống xóa ngẫu nhiên, nhưng không "prevent any modifications" (vẫn cho phép ghi mới). Không đủ mạnh cho yêu cầu toàn diện.

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

🛠️ Lời khuyên DevOps: Luôn kích hoạt Object Lock tại bucket creation (không thể bật sau nếu không versioned). Test với AWS CLI: aws s3api put-object-lock-configuration. Nếu cần scale, kết hợp S3 Access Points!

Câu 404 Chọn nhiều đáp án
A company is developing a new serverless application that uses AWS Lambda functions. The company uses AWS CloudFormation to deploy the Lambda functions.

The company’s developers are trying to debug a Lambda function that is deployed. The developers cannot debug the Lambda function because the Lambda function is not logging its output to Amazon CloudWatch Logs.

Which combination of steps should a security engineer take to resolve this issue? (Choose two.)
  1. A Check the role that is defined in the CloudFormation template and is passed to the Lambda function. Ensure that the role has a trust policy that allows the sts:AssumeRole action by the service principal lambda amazonaws.com.
  2. B Check the execution role that is configured in the CloudFormation template for the Lambda function. Ensure that the execution role has the necessary permissions to write to CloudWatch Logs.
  3. C Check the Lambda function configuration in the CloudFormation template. Ensure that the Lambda function has an AWS X-Ray tracing configuration that is set to Active mode or PassThrough mode.
  4. D Check the resource policy that is configured in the CloudFormation template for the Lambda function. Ensure that the resource policy has the necessary permissions to write to CloudWatch Logs.
  5. E Check the role that the developers use to debug the Lambda function. Ensure that the role has a trust policy that allows the sts:AssumeRole action by the service principal lambda.amazonaws.com.
Xem giải thích

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

Câu hỏi xoay quanh một công ty đang phát triển ứng dụng serverless sử dụng AWS Lambda và triển khai qua AWS CloudFormation. Các developer gặp vấn đề khi debug Lambda function: function không ghi log output vào Amazon CloudWatch Logs.
📌 Vấn đề cốt lõi: Lambda cần quyền thực thi (execution role) đúng để ghi log tự động vào CloudWatch Logs. Mỗi Lambda invocation sẽ tạo log group/stream tự động nếu có quyền. Nếu thiếu, log sẽ không xuất hiện.
🛠️ Yêu cầu: Chọn TWO steps mà security engineer cần thực hiện để khắc phục, tập trung vào cấu hình CloudFormation template (vì deploy qua CFN).
💡 Kiến thức cập nhật 2026: Theo AWS Lambda docs mới nhất (re:Post 2024-2026), logging mặc định qua execution role với policy AWSLambdaBasicExecutionRole. Trust policy phải cho phép Lambda service assume role. Không liên quan X-Ray hay resource policy cho logging cơ bản.

✅ Đáp án đúng (Chọn TWO)

Hai bước đúng là:

  1. Check the role that is defined in the CloudFormation template and is passed to the Lambda function. Ensure that the role has a trust policy that allows the sts:AssumeRole action by the service principal lambda amazonaws.com.
    🧠 Lý do: Đây là trust policy của execution role. Lambda service (lambda.amazonaws.com) phải assume role này để function chạy. Nếu trust policy sai (ví dụ thiếu hoặc sai principal), Lambda không assume được role → không có quyền logging. Kiểm tra trong CFN template để đảm bảo AssumeRolePolicyDocument đúng.

  2. Check the execution role that is configured in the CloudFormation template for the Lambda function. Ensure that the execution role has the necessary permissions to write to CloudWatch Logs.
    🧠 Lý do: Execution role cần permissions policy cho logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents (thường attach managed policy arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole). Nếu thiếu, Lambda chạy nhưng không ghi log được. Kiểm tra IAM role trong CFN.

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

Dưới đây là phân tích từng lựa chọn (giữ nguyên văn bản gốc tiếng Anh). Tôi đánh dấu ✅ đúng hoặc ❌ sai, kèm giải thích bằng tiếng Việt:

  • Check the role that is defined in the CloudFormation template and is passed to the Lambda function. Ensure that the role has a trust policy that allows the sts:AssumeRole action by the service principal lambda amazonaws.com.
    ✅ Đúng. Trust policy bắt buộc cho Lambda service assume role. Service principal chính xác là lambda.amazonaws.com (không phải lambda.amazon.com như một số lỗi cũ). Nếu sai, Lambda báo lỗi permissions denied ngay từ đầu.

  • Check the execution role that is configured in the CloudFormation template for the Lambda function. Ensure that the execution role has the necessary permissions to write to CloudWatch Logs.
    ✅ Đúng. Execution role là IAM role Lambda dùng để gọi AWS services. Phải có quyền Logs cụ thể; policy mặc định AWSLambdaBasicExecutionRole bao quát logging. Đây là nguyên nhân phổ biến nhất cho missing logs.

  • Check the Lambda function configuration in the CloudFormation template. Ensure that the Lambda function has an AWS X-Ray tracing configuration that is set to Active mode or PassThrough mode.
    ❌ Sai. AWS X-Ray dùng cho tracing và monitoring performance, không liên quan logging cơ bản vào CloudWatch Logs. Tracing có thể ghi thêm traces vào Logs, nhưng logging mặc định độc lập. Cấu hình X-Ray là optional, không fix missing logs.

  • Check the resource policy that is configured in the CloudFormation template for the Lambda function. Ensure that the resource policy has the necessary permissions to write to CloudWatch Logs.
    ❌ Sai. Resource policy của Lambda chỉ kiểm soát ai invoke Lambda (cross-account invoke), không cấp quyền cho Lambda gọi services khác như CloudWatch Logs. Quyền logging nằm ở execution role, không phải resource policy.

  • Check the role that the developers use to debug the Lambda function. Ensure that the role has a trust policy that allows the sts:AssumeRole action by the service principal lambda.amazonaws.com.
    ❌ Sai. Role của developers (console/CLI role) dùng để quản lý Lambda, không phải execution role của function. Trust policy lambda.amazonaws.com chỉ dành cho service Lambda, không liên quan debug user. Developer role cần quyền lambda:InvokeFunction hoặc logs:Describe* để xem logs, nhưng không fix logging của function.

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

Hy vọng phân tích này giúp bạn ôn thi DOP-C02 hiệu quả! 🚀 Nếu cần ví dụ CFN YAML, hỏi thêm nhé!

Câu 405
A company uses a collaboration application. A security engineer needs to configure automated alerts from AWS Security Hub in the us-west-2 Region for the application. The security engineer wants to receive an alert in a channel in the application every time Security Hub receives a new finding.

The security engineer creates an AWS Lambda function to convert the message to the format that the application requires. The Lambda function also sends the message to the application’s API. The security engineer configures a corresponding Amazon EventBridge rule that specifies the Lambda function as the target.

After the EventBridge rule is implemented, the channel begins to constantly receive alerts from Security Hub. Many of the alerts are Amazon Inspector alerts that do not require any action. The security engineer wants to stop the Amazon Inspector alerts.

Which solution will meet this requirement with the LEAST operational effort?
  1. A Update the Lambda function code to find pattern matches of events from Amazon Inspector and to suppress the findings.
  2. B Create a Security Hub custom action that automatically sends findings from all services except Amazon Inspector to the EventBridge event bus.
  3. C Modify the value of the ProductArn attribute in the event pattern of the EventBridge rule to “anything-but”: [“arn:aws:securityhub:us-west-2::product/aws/inspector”].
  4. D Create an Amazon Simple Notification Service (Amazon SNS) topic to send messages to the application. Set a filter policy on the topic subscriptions to reject any messages that contain the product/aws/inspector string.
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 việc tối ưu hóa quy trình gửi thông báo (alerts) từ AWS Security Hub trong region us-west-2. Một công ty đang sử dụng ứng dụng collaboration (như Slack hoặc tương tự), và security engineer cần thiết lập alert tự động mỗi khi Security Hub nhận được finding mới, gửi trực tiếp vào một channel của ứng dụng.

  • Cấu hình hiện tại:

    • Tạo AWS Lambda function để chuyển đổi định dạng message phù hợp với API của ứng dụng và gửi đi.
    • Sử dụng Amazon EventBridge rule với Lambda làm target để bắt sự kiện từ Security Hub.
  • Vấn đề phát sinh: Sau khi triển khai, channel nhận quá nhiều alerts liên tục, chủ yếu từ Amazon Inspector (dịch vụ quét lỗ hổng), nhưng những alerts này không cần hành động ngay (không yêu cầu xử lý). Security engineer muốn dừng hoàn toàn alerts từ Amazon Inspector mà với LEAST operational effort (ít nỗ lực vận hành nhất, ưu tiên giải pháp đơn giản, không thay đổi code lớn).

Mục tiêu: Filter events từ Security Hub để loại bỏ findings từ Inspector, giữ nguyên các findings từ dịch vụ khác, sử dụng tính năng có sẵn của AWS (dựa trên cập nhật AWS đến 2026, EventBridge hỗ trợ advanced filtering cho Security Hub findings).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Modify the value of the ProductArn attribute in the event pattern of the EventBridge rule to “anything-but”: [“arn:aws:securityhub:us-west-2::product/aws/inspector”].

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

  • Đây là giải pháp đơn giản nhất (least effort): Chỉ cần sửa event pattern trong EventBridge rule hiện tại, không cần code mới, không tạo resource thêm.
  • EventBridge hỗ trợ "anything-but" operator (tính năng advanced filtering từ 2021, cập nhật ổn định đến 2026) để loại trừ chính xác findings từ Amazon Inspector dựa trên ProductArn (ARN định danh sản phẩm Security Hub: arn:aws:securityhub:us-west-2::product/aws/inspector).
  • Event pattern sẽ match tất cả findings trừ Inspector, gửi đến Lambda → channel. Hoàn hảo cho Security Hub events (detail.type là "Security Hub Findings - Imported").
  • Không ảnh hưởng quy trình hiện tại, chỉ filter ở lớp event routing, giảm noise ngay lập tức.

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

Dưới đây là phân tích từng phương án một cách chi tiết, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá dựa trên tính feasible, effort, và phù hợp với yêu cầu "LEAST operational effort".

  • ❌ Update the Lambda function code to find pattern matches of events from Amazon Inspector and to suppress the findings.
    Tại sao SAI 🚫: Yêu cầu viết code mới trong Lambda để parse và filter events (tìm pattern Inspector), dẫn đến effort cao (test, deploy, maintain code). Không tận dụng native filtering của EventBridge, dễ lỗi nếu format finding thay đổi (Security Hub findings có schema phức tạp). Không phải "least effort".

  • ❌ Create a Security Hub custom action that automatically sends findings from all services except Amazon Inspector to the EventBridge event bus.
    Tại sao SAI 🚫: Custom action của Security Hub (tính năng automation) chỉ hỗ trợ gửi đến EventBridge bus cụ thể, nhưng không dễ exclude Inspector (custom action target tất cả hoặc filter cơ bản, không "except" native). Phải tạo resource mới (action + rule), effort cao hơn so với sửa event pattern. Không linh hoạt cho rule hiện tại.

  • ✅ Modify the value of the ProductArn attribute in the event pattern of the EventBridge rule to “anything-but”: [“arn:aws:securityhub:us-west-2::product/aws/inspector”].
    Tại sao ĐÚNG 🟢: Như đã giải thích ở trên. Event pattern mẫu đầy đủ (cập nhật 2026):

    {
      "source": ["aws.securityhub"],
      "detail-type": ["Security Hub Findings - Imported"],
      "detail": {
        "findings": {
          "ProductArn": [{"anything-but": "arn:aws:securityhub:us-west-2::product/aws/inspector"}]
        }
      }
    }
    

    Chỉ update rule qua console/CLI, zero code change, filter chính xác tại source.

  • ❌ Create an Amazon Simple Notification Service (Amazon SNS) topic to send messages to the application. Set a filter policy on the topic subscriptions to reject any messages that contain the product/aws/inspector string.
    Tại sao SAI 🚫: Phải tạo SNS topic + subscription mới, refactor EventBridge target từ Lambda sang SNS, rồi filter subscription (dùng string match "product/aws/inspector"). Effort lớn (thêm layer, migrate flow), SNS filter không mạnh bằng EventBridge cho structured events (dễ miss nested fields). Không tận dụng Lambda hiện tại.

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

  • AWS EventBridge Event Patterns cho Security Hub: Documenting EventBridge patterns for Security Hub – Chi tiết "anything-but" operator và ProductArn filtering.
  • Security Hub Findings Schema: Security Hub event structure – ARN format cho Inspector.
  • EventBridge Filters: Advanced event patterns – Xác nhận hỗ trợ "anything-but" từ 2021, ổn định 2026.
  • Best Practices: AWS Well-Architected Framework – Reliability Pillar: Sử dụng native filtering để giảm operational overhead.

Giải pháp này đảm bảo scaleable, cost-effective và tuân thủ least privilege cho alerts! 🚀

Câu 406
A company has an organization in AWS Organizations. The organization consists of multiple OUs. The company must prevent IAM principals from outside the organization from accessing the organization’s Amazon S3 buckets. The solution must not affect the existing access that the OUs have to the S3 buckets.

Which solution will meet these requirements?
  1. A Configure S3 Block Public Access for all S3 buckets.
  2. B Configure S3 Block Public Access for all AWS accounts.
  3. C Deploy an SCP that includes the “aws:ResourceOrgPaths”: “${aws:PrincipalOrgPaths}” condition.
  4. D Deploy an SCP that includes the “aws:ResourceOrgID”: “${aws:PrincipalOrgID}" condition.
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 AWS Organizations với nhiều Organizational Units (OUs). Yêu cầu chính là ngăn chặn IAM principals từ bên ngoài organization (như tài khoản AWS ngoài tổ chức) truy cập vào Amazon S3 buckets thuộc organization, mà không làm ảnh hưởng đến quyền truy cập hiện tại giữa các OUs bên trong organization.

✅ Mục tiêu chính: Sử dụng cơ chế kiểm soát quyền ở cấp organization (như SCP - Service Control Policy) để đảm bảo chỉ principals nội bộ mới truy cập được S3 buckets. Giải pháp phải tuân thủ nguyên tắc least privilege và không phá vỡ access intra-organization. Kiến thức dựa trên tài liệu AWS mới nhất (2024-2026), SCP hỗ trợ các condition keys như aws:PrincipalOrgID và aws:PrincipalOrgPaths cho Attribute-Based Access Control (ABAC).
📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Deploy an SCP that includes the “aws:ResourceOrgID”: “${aws:PrincipalOrgID}" condition.

🛠️ Lý do chi tiết: SCP này áp dụng ở cấp organization (root hoặc OU), yêu cầu Organization ID của S3 bucket (ResourceOrgID) phải bằng Organization ID của principal thực hiện action (PrincipalOrgID). Điều này chặn hoàn toàn IAM principals từ organization khác (OrgID khác) truy cập S3 buckets, vì condition sẽ fail. Đồng thời, không ảnh hưởng access nội bộ giữa các OUs (cùng OrgID). SCP chỉ deny nếu condition không khớp, không override IAM policies hiện tại nội bộ. Đây là best practice cho cross-organization isolation theo AWS Well-Architected Framework (Security Pillar, cập nhật 2024).

📋 Giải thích tất cả các phương án

  • ❌ Configure S3 Block Public Access for all S3 buckets.
    Phương án này chỉ chặn public access (như anonymous hoặc public ACLs/IP-based) vào S3 buckets bằng cách kích hoạt Block Public Access settings. ❌ Sai vì: Không ngăn IAM principals từ account ngoài organization (cross-account IAM roles/users) truy cập qua IAM policies authenticated. Block Public Access chỉ ảnh hưởng public endpoints, không liên quan Organizations/SCP.

  • ❌ Configure S3 Block Public Access for all AWS accounts.
    Tương tự phương án trên, nhưng áp dụng ở cấp account (Bucket/Object level). ❌ Sai vì: Vẫn không chặn cross-account IAM access từ principals ngoài organization. Block Public Access là tính năng S3-specific, không tích hợp Organizations để kiểm soát principals theo OrgID. Ngoài ra, không scalable cho multi-account org.

  • ❌ Deploy an SCP that includes the “aws:ResourceOrgPaths”: “${aws:PrincipalOrgPaths}” condition.
    SCP này so sánh đường dẫn OU đầy đủ (OrgPaths như /root/ou1/ou2) giữa resource và principal. ❌ Sai vì: Sẽ chặn access intra-organization nếu principal ở OU khác với OU chứa S3 bucket (paths khác nhau), vi phạm yêu cầu "không ảnh hưởng existing access của OUs". OrgPaths chi tiết hơn OrgID, gây overly restrictive. (Lưu ý: Condition đúng phải là ${aws:PrincipalOrgPaths}, không phải ResourceOrgPaths như ghi - vẫn sai logic).

  • ✅ Deploy an SCP that includes the “aws:ResourceOrgID”: “${aws:PrincipalOrgID}" condition.
    Như đã giải thích ở phần đáp án đúng: Hoàn hảo khớp yêu cầu, chỉ kiểm tra OrgID chung, cho phép full intra-org access mà deny external. Ví dụ policy JSON:

    {
      "Statement": [{
        "Effect": "Deny",
        "Action": "s3:*",
        "Resource": "*",
        "Condition": {
          "StringNotEquals": {
            "aws:ResourceOrgID": "${aws:PrincipalOrgID}"
          }
        }
      }]
    }
    

    🛠️ Best practice: Áp dụng SCP tại root OU để cover toàn organization.

Câu 407
A company needs to implement data lifecycle management for Amazon RDS snapshots. The company will use AWS Backup to manage the snapshots.

The company must retain RDS automated snapshots for 5 years and will use Amazon S3 for long-term archival storage.

Which solution will meet these requirements?
  1. A Use AWS Backup to apply a 5-year retention tag to the RDS snapshots.
  2. B Enable versioning on the S3 bucket that AWS Backup uses for the RDS snapshots. Configure a 5-year retention period.
  3. C Create an S3 Lifecycle policy. Include a 5-year retention period for the S3 bucket that AWS Backup uses for the RDS snapshots.
  4. D Create a backup plan in AWS Backup. Configure a 5-year retention period.
Xem giải thích

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

Câu hỏi tập trung vào việc triển khai quản lý vòng đời dữ liệu (data lifecycle management) cho các snapshot tự động của Amazon RDS bằng dịch vụ AWS Backup. 🛡️️ Công ty yêu cầu lưu giữ (retain) các snapshot này trong 5 năm và sử dụng Amazon S3 làm lưu trữ dài hạn (long-term archival storage).

  • Bối cảnh chính: Amazon RDS tự động tạo snapshot backup, nhưng để quản lý retention dài hạn (5 năm), cần tích hợp AWS Backup – dịch vụ trung tâm hóa backup đa tài nguyên AWS. AWS Backup hỗ trợ RDS snapshots và có thể tự động chuyển chúng sang S3 Glacier hoặc S3 cho lưu trữ rẻ tiền hơn theo chính sách retention.
  • Yêu cầu cốt lõi: Giải pháp phải đảm bảo retention chính xác 5 năm, tận dụng S3 cho archival, và tuân thủ best practices AWS (cập nhật đến 2026: AWS Backup hỗ trợ backup vaults với retention policies linh hoạt, tích hợp S3 Intelligent-Tiering/Glacier cho lifecycle).
  • Thách thức: Không thể dùng tính năng RDS thuần túy vì retention mặc định RDS chỉ 0-35 ngày; cần AWS Backup để mở rộng dài hạn mà không mất quyền kiểm soát.

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

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create a backup plan in AWS Backup. Configure a 5-year retention period.

Lý do chi tiết 🎯:

  • AWS Backup sử dụng Backup Plan để định nghĩa lịch backup và retention period cụ thể cho tài nguyên như RDS snapshots. Khi assign plan cho RDS instance, nó sẽ quản lý automated snapshots với retention 5 năm, tự động transition sang S3 (vault hoặc cold storage) cho archival dài hạn.
  • Điều này đáp ứng đầy đủ: Retention chính xác 5 năm, tích hợp S3 native (qua backup vault), không cần cấu hình thêm S3 thủ công. Theo AWS best practices 2026, đây là cách chuẩn để lifecycle management RDS snapshots dài hạn, tránh xóa sớm hoặc chi phí cao.
  • Ưu điểm: Audit trail đầy đủ, cross-region copy, compliance tags tự động.

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

  • Phương án 1: Use AWS Backup to apply a 5-year retention tag to the RDS snapshots.
    ❌ Sai vì: Tags trong AWS Backup chỉ dùng để phân loại và filter (như cost allocation), không áp dụng retention trực tiếp. Retention phải định nghĩa qua Backup Plan hoặc Vault Policy. Áp tag 5-year không ngăn RDS xóa snapshot sau 35 ngày mặc định, vi phạm yêu cầu.

  • Phương án 2: Enable versioning on the S3 bucket that AWS Backup uses for the RDS snapshots. Configure a 5-year retention period.
    ❌ Sai vì: S3 Versioning chỉ bảo vệ objects khỏi ghi đè/xóa ngẫu nhiên, nhưng không hỗ trợ retention period 5 năm (versioning không có cơ chế expire tự động theo thời gian dài như vậy). RDS snapshots trong AWS Backup lưu managed trong vault (không phải S3 bucket thông thường), nên versioning trên bucket AWS Backup dùng không ảnh hưởng đến lifecycle RDS.

  • Phương án 3: Create an S3 Lifecycle policy. Include a 5-year retention period for the S3 bucket that AWS Backup uses for the RDS snapshots.
    ❌ Sai vì: S3 Lifecycle policy chỉ áp dụng cho objects thông thường trong bucket S3, không quản lý RDS snapshots (chúng là metadata-managed bởi RDS/AWS Backup). Bucket của AWS Backup vault không expose trực tiếp objects RDS snapshots để lifecycle thủ công; dùng cách này có thể gây conflict, xóa sớm hoặc không enforce 5 năm chính xác.

  • Phương án 4 (Đúng): Create a backup plan in AWS Backup. Configure a 5-year retention period.
    ✅ Đúng vì: Như giải thích trên, Backup Plan là cơ chế cốt lõi của AWS Backup để set retention cho RDS, tự động handle S3 archival (transition to Glacier Deep Archive nếu cần). Hoàn hảo cho yêu cầu 5 năm mà không phức tạp hóa.

🛠️ Lời khuyên thực tế: Sau khi tạo plan, assign role IAM phù hợp (AWSBackupServiceRoleForBackup) và enable continuous backups RDS để tối ưu. Test với small instance trước production! 🚀

Câu 408
A company’s security policy requires all Amazon EC2 instances to use the Amazon Time Sync Service. AWS CloudTrail trails are enabled in all of the company’s AWS accounts. VPC flow logs are enabled for all VPCs.

A security engineer must identify any EC2 instances that attempt to use Network Time Protocol (NTP) servers on the internet.

Which solution will meet these requirements?
  1. A Monitor CloudTrail logs for API calls to non-standard time servers.
  2. B Monitor CloudTrail logs for API calls to the Amazon Time Sync Service.
  3. C Monitor VPC flow logs for traffic to non-standard time servers.
  4. D Monitor VPC flow logs for traffic to the Amazon Time Sync Service.
Xem giải thích

🧩 Phân tích nội dung câu hỏi
Câu hỏi xoay quanh một chính sách bảo mật của công ty yêu cầu tất cả Amazon EC2 instances phải sử dụng Amazon Time Sync Service (dịch vụ đồng bộ thời gian chính thức của AWS, sử dụng địa chỉ link-local 169.254.169.123 qua giao thức chrony hoặc systemd-timesyncd trên port UDP 123). AWS CloudTrail đã được kích hoạt trên tất cả accounts để ghi log các API calls, và VPC Flow Logs đã được bật cho mọi VPC để capture lưu lượng mạng vào/ra.
Nhiệm vụ của security engineer là phát hiện bất kỳ EC2 instance nào cố gắng kết nối đến các NTP servers trên internet (các máy chủ thời gian không chuẩn, như pool.ntp.org hoặc các IP public khác trên port UDP 123). Giải pháp phải tận dụng các dịch vụ đã sẵn có (CloudTrail và VPC Flow Logs) mà không cần cấu hình thêm, đảm bảo tuân thủ chính sách bảo mật.
📘 Tài liệu tham khảo:

✅ Đáp án đúng: Monitor VPC flow logs for traffic to non-standard time servers.
Lý do lựa chọn: VPC Flow Logs ghi lại toàn bộ lưu lượng mạng (bao gồm source IP của ENI thuộc EC2, destination IP/port của NTP servers public như 162.159.200.1 hoặc pool.ntp.org trên UDP 123). "Non-standard time servers" ám chỉ các NTP servers internet không phải Amazon Time Sync Service (link-local IP không xuất hiện trong flow logs outbound công khai). Có thể dùng Amazon Athena hoặc CloudWatch Logs Insights để query flow logs lọc traffic UDP 123 đến IP không thuộc AWS Time Sync, từ đó identify ENI/EC2 vi phạm. Giải pháp này hiệu quả, chi phí thấp và phù hợp phiên bản AWS mới nhất (2026).

🛠️ Giải thích chi tiết từng phương án (giữ nguyên văn bản gốc):

  • Monitor CloudTrail logs for API calls to non-standard time servers.
    ❌ Sai: CloudTrail chỉ ghi log các API calls AWS (như DescribeInstances), không capture network traffic outbound đến NTP servers. Không có API call nào liên quan đến "non-standard time servers" trên EC2, vì NTP là giao thức mạng cấp thấp, không qua API AWS.

  • Monitor CloudTrail logs for API calls to the Amazon Time Sync Service.
    ❌ Sai: CloudTrail không log traffic đến Amazon Time Sync Service (vì đây là traffic nội bộ link-local, không phải API call). Hơn nữa, giải pháp này chỉ detect traffic chuẩn (tuân thủ policy), trong khi yêu cầu là phát hiện traffic không chuẩn đến internet NTP.

  • Monitor VPC flow logs for traffic to non-standard time servers.
    ✅ Đúng: VPC Flow Logs capture chính xác traffic UDP 123 từ ENI của EC2 đến IP public NTP (non-standard). Có thể filter log bằng Athena với query như SELECT srcAddr, dstAddr, dstPort WHERE dstPort = 123 AND dstAddr NOT LIKE '169.254.%', identify instance ngay lập tức. Hoàn hảo cho yêu cầu!

  • Monitor VPC flow logs for traffic to the Amazon Time Sync Service.
    ❌ Sai: Traffic đến Amazon Time Sync (169.254.169.123) là link-local nội bộ VPC, thường không xuất hiện rõ trong flow logs outbound (vì không rời VPC). Giải pháp này detect traffic tuân thủ, ngược với yêu cầu phát hiện vi phạm (NTP internet).

Câu 409
A company has a multi-account strategy that uses an organization in AWS Organizations with all features enabled. The company has enabled trusted access for AWS Account Management. New accounts are provisioned through AWS Control Tower Account Factory.

The company must ensure that all new accounts in the organization become AWS Security Hub member accounts.

Which solution will meet these requirements with the LEAST development effort?
  1. A Enable Security Hub in the organization’s management account. Create an AWS Step Functions workflow. Create an Amazon EventBridge rule to invoke the workflow when a CreateAccount event occurs.
  2. B Enable Security Hub in the organization’s management account. Wait for all new accounts to complete automatic onboarding.
  3. C Enable Security Hub in the organization’s management account. Create an AWS Lambda function to enable Security Hub for new accounts. Invoke the Lambda function by using an AWS Control Tower lifecycle event that occurs when a new account is provisioned.
  4. D Use the organization’s management account to designate a Security Hub delegated administrator account. In the delegated administrator account, create a configuration policy to enable Security Hub. Associate the configuration policy with the organization root.
Xem giải thích

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

Câu hỏi xoay quanh một công ty sử dụng chiến lược multi-account với AWS Organizations (đã kích hoạt all features enabled), đã bật trusted access cho AWS Account Management, và các tài khoản mới được tạo qua AWS Control Tower Account Factory.
Yêu cầu chính: Đảm bảo tất cả tài khoản mới trong organization tự động trở thành member accounts của AWS Security Hub (tức là Security Hub được kích hoạt và liên kết tự động).
Mục tiêu: Giải pháp với LEAST development effort (ít nỗ lực phát triển nhất, ưu tiên giải pháp native, tự động, không cần code custom).
🛠️ Bối cảnh quan trọng: AWS Security Hub hỗ trợ delegated administrator để quản lý org-wide, tích hợp với Organizations và Control Tower. Kiến thức cập nhật đến 2026: Security Hub (phiên bản mới nhất) hỗ trợ tự động onboard new accounts qua delegated admin và policies tại organization root (theo AWS docs 2024-2026).

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

✅ Đáp án đúng

Use the organization’s management account to designate a Security Hub delegated administrator account. In the delegated administrator account, create a configuration policy to enable Security Hub. Associate the configuration policy with the organization root.

Lý do chọn:
Giải pháp này sử dụng tính năng native của AWS Organizations và Security Hub delegated administrator để tự động kích hoạt Security Hub cho tất cả tài khoản hiện tại và mới (bao gồm từ Control Tower Account Factory) mà không cần code custom, Lambda, Step Functions hay EventBridge.

  • Từ management account, designate delegated admin (trusted access đã bật).
  • Trong delegated admin account, tạo configuration policy (tính năng Organizations policy để enforce service enablement org-wide, áp dụng recursive xuống root → OUs → accounts mới).
  • Kết quả: Zero development effort, tự động onboard new accounts làm members. Đây là cách least effort theo best practices AWS 2026.
    🛡️ Ưu điểm: Tích hợp sâu với Organizations/Control Tower, scalable, compliant.

🔍 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. Tôi giữ nguyên văn bản gốc bằng tiếng Anh, chỉ giải thích bằng tiếng Việt với lý do đúng/sai dựa trên tính năng AWS mới nhất.

  • Enable Security Hub in the organization’s management account. Create an AWS Step Functions workflow. Create an Amazon EventBridge rule to invoke the workflow when a CreateAccount event occurs.
    ❌ Sai: Yêu cầu phát triển custom workflow Step Functions + EventBridge để detect CreateAccount event (từ Organizations). Effort cao (code, test, maintain), không native. Không tận dụng delegated admin hoặc Control Tower lifecycle → vi phạm least effort. EventBridge có thể miss events nếu không config đúng.

  • Enable Security Hub in the organization’s management account. Wait for all new accounts to complete automatic onboarding.
    ❌ Sai: Không có automatic onboarding mặc định cho Security Hub ở new accounts từ Control Tower. Chỉ enable ở management account không propagate tự động đến members (phải manual hoặc policy). "Wait" là passive, không đảm bảo 100% new accounts thành members → không meet requirements.

  • Enable Security Hub in the organization’s management account. Create an AWS Lambda function to enable Security Hub for new accounts. Invoke the Lambda function by using an AWS Control Tower lifecycle event that occurs when a new account is provisioned.
    ❌ Sai: Dùng Control Tower lifecycle event (CreateAccountSuccess) để trigger Lambda enable Security Hub – khả thi nhưng yêu cầu dev Lambda custom (IAM roles, API calls). Effort trung bình-cao (code, error handling), không scalable bằng native policy. Delegated admin tốt hơn, ít effort hơn.

  • Use the organization’s management account to designate a Security Hub delegated administrator account. In the delegated administrator account, create a configuration policy to enable Security Hub. Associate the configuration policy with the organization root.
    ✅ Đúng: Như giải thích ở trên. Native, zero-code, tự động apply đến root → tất cả OUs/accounts mới. Hỗ trợ đầy đủ với trusted access và Control Tower (2026 updates confirm delegated admin auto-enables via org policies). Least effort nhất!

Câu 410
A company uses Amazon Elastic Kubernetes Service (Amazon EKS) clusters to run its Kubernetes-based applications. The company uses Amazon GuardDuty to protect the applications.

EKS Protection is enabled in GuardDuty. However, the corresponding GuardDuty feature is not monitoring the Kubernetes-based applications.

Which solution will cause GuardDuty to monitor the Kubernetes-based applications?
  1. A Enable VPC flow logs for the VPC that hosts the EKS clusters.
  2. B Assign the CloudWatchEventsFullAccess AWS managed policy to the EKS clusters.
  3. C Ensure that the AmazonGuardDutyFullAccess AWS managed policy is attached to the GuardDuty service role.
  4. D Enable the control plane logs in Amazon EKS. Ensure that the logs are ingested into Amazon CloudWatch.
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 vấn đề bảo mật ứng dụng Kubernetes trên Amazon EKS sử dụng Amazon GuardDuty. Cụ thể:

  • Công ty đang chạy ứng dụng dựa trên Kubernetes trên các EKS clusters.
  • Họ đã kích hoạt GuardDuty với EKS Protection (tính năng bảo vệ EKS, bao gồm Control Plane Protection và Runtime Monitoring).
  • Tuy nhiên, GuardDuty không đang monitor (giám sát) các ứng dụng Kubernetes-based.
  • Mục tiêu: Tìm giải pháp để GuardDuty bắt đầu monitor các ứng dụng này một cách hiệu quả.

🛠️ Nguyên lý cốt lõi: GuardDuty EKS Protection dựa vào audit logs từ EKS control plane (như API server, audit, authenticator, controller manager, scheduler) và pod logs để phát hiện threat. Để GuardDuty pull và phân tích logs, phải enable control plane logs trong EKS và gửi chúng vào CloudWatch Logs. Nếu không, dù EKS Protection enabled, GuardDuty cũng không có dữ liệu để monitor ứng dụng. (Kiến thức cập nhật AWS 2024-2026: GuardDuty EKS Protection v2.0+ yêu cầu này bắt buộc).

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

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Enable the control plane logs in Amazon EKS. Ensure that the logs are ingested into Amazon CloudWatch.

Lý do:

  • Đây là yêu cầu bắt buộc để GuardDuty EKS Protection hoạt động. Khi enable control plane logs (qua EKS console/CLI: aws eks update-cluster-config --logging), logs sẽ được gửi vào CloudWatch Logs Groups (ví dụ: /aws/eks/my-cluster/cluster). GuardDuty tự động pull logs từ đây để monitor Kubernetes API calls và runtime activities của ứng dụng.
  • Không có bước này, dù EKS Protection enabled, GuardDuty thiếu dữ liệu → không monitor được. Sau khi enable, GuardDuty sẽ generate findings cho threats như privilege escalation, pod injection.
  • ✅ Hiệu quả ngay lập tức, chi phí chỉ tính theo logs ingested.

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

Dưới đây là phân tích chi tiết từng 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á dựa trên docs AWS mới nhất:

  • [SAI] Enable VPC flow logs for the VPC that hosts the EKS clusters.
    ❌ Sai vì: VPC Flow Logs chỉ capture network traffic (IP, port, bytes) giữa VPC resources, không liên quan đến Kubernetes audit/pod logs. GuardDuty dùng Flow Logs cho network threats chung (như Crypto Mining), nhưng không phải cho EKS Protection. Enabling nó không giúp monitor ứng dụng Kubernetes. (Tham khảo: GuardDuty Malware Protection docs).

  • [SAI] Assign the CloudWatchEventsFullAccess AWS managed policy to the EKS clusters.
    ❌ Sai vì: EKS clusters không cần policy này để GuardDuty monitor. CloudWatch Events (nay là EventBridge) dùng cho event routing, nhưng EKS Protection dựa vào CloudWatch Logs, không phải Events. Attach policy vào EKS node/role là thừa và không giải quyết vấn đề thiếu logs. GuardDuty có role riêng để read logs.

  • [SAI] Ensure that the AmazonGuardDutyFullAccess AWS managed policy is attached to the GuardDuty service role.
    ❌ Sai vì: GuardDuty service role (tạo tự động khi enable detector) đã có permissions cần thiết (Read CloudWatch Logs, S3). Policy AmazonGuardDutyFullAccess là cho users/IAM roles quản lý GuardDuty, không phải service role. Vấn đề ở đây là thiếu EKS control plane logs, không phải permission role. Enabling EKS Protection đã imply role setup đúng.

  • [ĐÚNG] Enable the control plane logs in Amazon EKS. Ensure that the logs are ingested into Amazon CloudWatch.
    ✅ Đúng như đã giải thích ở trên: Bước trực tiếp khắc phục, enable qua AWS Console/CLI/Terraform, logs auto-ingest vào CloudWatch → GuardDuty monitor ngay.

🛡️ Lời khuyên DevOps: Sau khi apply, kiểm tra findings qua GuardDuty console và set up CloudWatch alarms cho EKS log groups để tối ưu. Test bằng workload mẫu để verify!