Courseiva
Continuous Improvement for Existing SolutionshardMultiple ChoiceObjective-mapped

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

Network Topology
$ aws ec2 describe-network-interfacesfilters Name=group-idRefer to the exhibit."NetworkInterfaces": ["NetworkInterfaceId": "eni-0a1b2c3d4e5f67890","Description": "Lambda function VPC attachment","Groups": ["GroupId": "sg-12345678","GroupName": "lambda-security-group"],"InterfaceType": "lambda"

A security engineer runs the command above and finds an ENI attached to a Lambda function. The security group sg-12345678 allows inbound traffic on port 443 from 0.0.0.0/0. The Lambda function is used to process API requests. The engineer is concerned about security. What should the engineer do?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Restrict the security group source to the API Gateway's VPC endpoint or the ALB security group.

The Lambda function should not be directly accessible from the internet. The security group sg-12345678 currently allows inbound traffic on port 443 from 0.0.0.0/0, which exposes the function to unnecessary risk. The function is intended to process API requests, typically invoked via API Gateway or an ALB. Therefore, the security group should restrict inbound traffic to only the source from the API Gateway's VPC endpoint or the ALB's security group. Option A is incorrect because the Lambda function might need to be in a VPC to access internal resources, and removing VPC attachment is not the best security measure. Option B is incorrect because Lambda functions do not have their own static IP; the ENI's IP is dynamic and cannot be used as a source restriction. More importantly, the source should be the API Gateway, not the Lambda function itself. Option C is incorrect because while using a VPC endpoint is beneficial, simply removing the VPC attachment does not solve the security group issue; the function may still need VPC access. The most direct fix is to modify the security group rule.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Modify the Lambda function to not use a VPC.

    Why it's wrong here

    This may break functionality if the function needs VPC resources.

  • Add a deny rule for inbound 0.0.0.0/0 and allow only from the Lambda function's own IP.

    Why it's wrong here

    Lambda functions don't have static IPs without a NAT.

  • Remove the VPC attachment from the Lambda function and use a VPC endpoint.

    Why it's wrong here

    VPC attachment might be needed for accessing other VPC resources.

  • Restrict the security group source to the API Gateway's VPC endpoint or the ALB security group.

    Why this is correct

    Limits inbound traffic to only the expected source.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every SAP-C02 question from scratch — 1,660 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.