Easy ReviewDOP-C02
Security and Compliance65

VPC

Route private network traffic, control access, and investigate connections with VPC Flow Logs.

Este conteúdo de estudo ainda não foi traduzido, então aparece em inglês. Ajude a traduzir

VPC networking combines routes that select paths, security groups and ACLs that control traffic, and endpoints that reach supported services privately. Flow Logs supply connection records for diagnosis and auditing.

Subnets and gateways

Amazon VPC is your own isolated network in AWS. Inside it, subnetsAn address range within a VPC whose traffic follows an associated route table. split the address range by Availability Zone, route tables steer traffic, and gateways connect the VPC to the internet, other networks or AWS services.

How it works

  1. Create a VPC with an IP address range in a Region.
  2. Add subnets, each in one Availability Zone. Use at least two AZs for high availability.
  3. Attach an internet gateway and route public subnets to it.
  4. Keep most resources in private subnets; give them outbound internet access through a NATTranslation of source addresses so private resources can initiate connections through a gateway. gateway.
  5. Reach AWS services privately with VPC endpoints, other VPCs with peeringA direct private routing relationship between two VPCs. or a transit gateway, and on-premises networks with a VPN or Direct Connect.
Component Purpose
Subnet IP range in one AZ, public or private
Route tableA set of destination and target rules that directs network traffic. Where traffic from a subnet goes
Internet gateway Two-way internet access for public subnets
NAT gateway Outbound-only internet access for private subnets
Virtual private gateway VPN connection to an on-premises network
VPC endpoint Private access to AWS services
Peering, transit gateway Connect VPCs to each other

Exam cues

  • If the question says web servers reachable from the internet, think public subnet with an internet gateway, public addresses and permitted security rules, because a gateway alone does not allow traffic.
  • If the question says databases must not be reachable from the internet, think private subnet.
  • If the question says private instances need outbound internet only, think NAT gateway.

Remember

  • A subnet lives in exactly one AZ.
  • AWS recommends private subnets to protect resources.
  • NAT gateway: managed by AWS. NAT instance: you manage it.

Trap: An internet gateway alone doesn’t make an instance reachable. The subnet needs a route to it, the instance needs a public IPv4 or public IPv6 address, and security controls must permit the traffic.

Da documentação da AWS (18)
  • Amazon VPC launches AWS resources in a logically isolated virtual network that you define, closely resembling a traditional data center network.
  • A subnet is a range of IP addresses in a VPC and must reside in a single Availability Zone.
  • Route tables determine where network traffic from a subnet or gateway is directed.
  • A public subnet has a direct route to an internet gateway; a private subnet doesn't, and its resources need a NAT device to reach the internet.
  • A VPN-only subnet has a route to a Site-to-Site VPN connection through a virtual private gateway and no route to an internet gateway.
  • AWS recommends private subnets to protect AWS resources.
  • An internet gateway is a redundant, highly available VPC component for internet communication. Resources need a public IPv4 or public IPv6 address, an appropriate subnet route, and security controls that allow the traffic.
  • A NAT gateway lets instances in a private subnet connect to services outside the VPC while external services can't initiate connections to them; a public NAT gateway sits in a public subnet with an Elastic IP address.
  • A VPC endpoint connects a VPC to AWS services privately, without an internet gateway or NAT device.
  • A VPC peering connection routes traffic between two VPCs, and a transit gateway acts as a central hub routing traffic between VPCs, VPN connections and AWS Direct Connect connections.
  • A NAT gateway is managed by AWS with no maintenance; a NAT instance is an EC2 instance the customer manages, including patching.
  • A VPC belongs to one Region and can have subnets in each of its Availability Zones; each subnet stays in one Availability Zone.
  • AWS initially provides a default VPC in each Region with public default subnets, an internet gateway and DNS resolution enabled.
  • Default quotas allow 5 VPCs per Region and 5 IPv4 CIDR blocks per VPC (adjustable to 50), and only one internet gateway can be attached to a VPC at a time.
  • A subnet is public when its route table sends 0.0.0.0/0 (or ::/0) to the internet gateway, or a narrower range of public addresses.
  • Gateway endpoints provide S3 and DynamoDB connectivity without an internet gateway or NAT, do not use PrivateLink, and have no additional endpoint charge.
  • A gateway endpoint adds a service prefix-list route to associated route tables. Clients reach the service public endpoint through that route, so the endpoint uses route-table associations rather than network interfaces placed in each subnet.
  • Gateway prefix lists are Region-specific, so the endpoint route applies to the service in that Region rather than another Region.

VPC security basics

A VPC has two built-in network filters: security groups around instances and network ACLsA numbered set of allow and deny rules for traffic entering or leaving a subnet. around subnetsAn address range within a VPC whose traffic follows an associated route table..

How it works

  1. Traffic entering a subnet passes its network ACL.
  2. Traffic reaching an instance passes its security group.
  3. Security groups let responses back automatically; network ACLs need rules both ways.

Exam cues

  • If the question says instance-level firewall, think security group.
  • If the question says subnet-level allow and deny rules, think network ACL.

Remember

  • Security group: instance level, statefulFiltering that remembers allowed connections and permits their response traffic..
  • Network ACL: subnet level, allow and deny.

Trap: Security groups cannot deny a specific address; use a network ACL for an explicit deny.

Da documentação da AWS (14)
  • A security group acts as a virtual firewall for an instance: only traffic its rules allow reaches it, and it is stateful, so responses are allowed back automatically.
  • A network ACL allows or denies inbound and outbound traffic at the subnet level.
  • Flow logs can cover a VPC, subnet, or network interface; VPC and subnet logs monitor their network interfaces.
  • VPC Flow Logs publish to CloudWatch Logs, S3, or Data Firehose.
  • Flow records include source and destination addresses and ports, protocol, packet and byte counts, timestamps, action, and logging status.
  • VPC Flow Logs do not capture packet contents.
  • Flow log collection occurs outside the network traffic path and does not affect its throughput or latency.
  • Security groups control allowed inbound and outbound traffic for associated resources and their network interfaces.
  • Security groups track connections and automatically allow response traffic for allowed requests regardless of opposite-direction rules.
  • Security groups have allow rules only; rules across multiple attached groups combine into one set of permissions.
  • Each VPC subnet has one network ACL, and one ACL can serve multiple subnets. Creating a custom ACL does not attach it to a subnet; associate it explicitly to apply its rules.
  • Network ACLs do not track connections. Traffic between subnets must pass the source outbound and destination inbound rules; replies must pass both subnet ACLs in the reverse direction.
  • ACL rules allow or deny traffic in ascending rule-number order; the first match wins, and numbered rules range from 1 to 32766.
  • A security group rule source or destination is an IPv4 or IPv6 CIDR range, a single address written as a /32 or /128, a prefix list ID, or another security group; an internet gateway ID is not a valid source.

Security groups and network ACLs

Security groups and network access control listsA numbered set of allow and deny rules for traffic entering or leaving a subnet. (ACLs) control traffic at different places in a VPC. A security group protects its associated resources. A network ACL controls traffic crossing a subnetAn address range within a VPC whose traffic follows an associated route table. boundary, where a subnet is a range of addresses inside the VPC.

How it works

  1. A network ACL checks traffic entering or leaving its subnet. It evaluates rule numbers from lowest to highest and stops at the first match.
  2. The resource’s security groups allow matching traffic. Their permissions combine; they have no deny rules.
  3. For an allowed request, security-group connection tracking automatically allows the response. This is what statefulFiltering that remembers allowed connections and permits their response traffic. means.
  4. The ACL checks the response separately because it is statelessFiltering that evaluates requests and responses independently., meaning it remembers no connection. Allow the client’s ephemeral portsA temporary port selected by a client when starting a connection., the temporary ports selected when it opens a connection.
Property Security group Network ACL
Scope Associated resource or network interfaceA virtual network attachment that sends and receives traffic for a resource. Subnet boundary
Rules Allow only, combined across groups Allow and deny, first numbered match
Return traffic Automatically allowed for an allowed request Needs an explicit allow rule
Association A resource can use multiple groups One ACL per subnet; an ACL can serve multiple subnets

ACL rules match protocol, applicable ports and a source CIDRA network address range written with a prefix length indicating its size. inbound or destination CIDR outbound. They do not accept security group IDs. A custom ACL must be associated explicitly before its rules affect a subnet.

A group reference permits matching traffic involving interfaces in the referenced group, including its own group. It does not copy that group’s rules. For example, a database can allow its application tier by referring to the application’s group.

Before retiring an environment, preserve the replacement application’s access and remove references to the retiring environment’s group. Beanstalk can fail to delete an environment-managed security group while another group depends on it; a separately managed group avoids that lifecycle dependency.

Exam cues

  • If the question says block an IP range for an entire subnet, think an early ACL deny rule, because security groups cannot express deny rules.
  • If the question says inbound access works but replies fail, think the ACL return path, because responses need their own allow rule and the correct client ports.

Remember

  • Between subnets, allow source outbound and destination inbound traffic, then both reverse directions for replies.
  • Numbered ACL rules: 1 to 32766. The asterisk rule denies unmatched traffic.
  • A new custom security group starts with no inbound rules and an allow-all outbound rule.

Trap: An inbound allow rule on a stateless ACL does not permit the response automatically. Choose return-path ports for the actual client, whose ephemeral range can vary.

Da documentação da AWS (16)
  • Security groups track connections and automatically allow response traffic for allowed requests regardless of opposite-direction rules.
  • Security groups have allow rules only; rules across multiple attached groups combine into one set of permissions.
  • A newly created custom security group has no inbound rules and an allow-all outbound rule.
  • A security group reference allows the specified protocol and ports involving private addresses of interfaces in the referenced group, including the same group. It does not inherit that group's rules or automatically allow all traffic.
  • Network ACLs do not track connections. Traffic between subnets must pass the source outbound and destination inbound rules; replies must pass both subnet ACLs in the reverse direction.
  • ACL rules allow or deny traffic in ascending rule-number order; the first match wins, and numbered rules range from 1 to 32766.
  • The unremovable asterisk ACL rules deny traffic that matches no numbered rule.
  • ACL return-path rules must allow the client ephemeral ports, the temporary ports the client selects for connections; the range depends on the client.
  • An accepted request followed by a rejected response can indicate that the subnet ACL blocks the response despite stateful security-group permission.
  • Referencing an Elastic Beanstalk environment security group from another group can prevent deletion during environment termination; a separately managed group avoids tying access to that environment lifecycle.
  • Network ACL rules match protocol, applicable ports and a source CIDR for inbound traffic or destination CIDR for outbound traffic. They do not take security group IDs as the address range.
  • Common security group rules open TCP 22 for SSH to Linux instances, 3389 for RDP to Windows instances, 80 for HTTP and 443 for HTTPS.
  • The default network ACL allows all inbound and outbound traffic, while a new custom network ACL denies everything until you add allow rules.
  • A security group can reference a security group in a peered VPC in the same Region, even in another account (account-id/sg-id); for a peer in another Region use its CIDR block.
  • Network ACL rules are evaluated when traffic enters or leaves a subnet, not for traffic routed within the same subnet.
  • Network ACL rules are evaluated when traffic enters or leaves a subnet, not for traffic routed within the subnet.

Route tables and peering

A VPC route tableA set of destination and target rules that directs network traffic. chooses where traffic goes. Each route pairs a destination address range with a target, such as a gateway or a peeringA direct private routing relationship between two VPCs. connection. Peering provides a direct private path between two VPCs when their address ranges do not overlap.

How it works

  1. Find the subnetAn address range within a VPC whose traffic follows an associated route table.’s route table. It uses the main table unless you explicitly associate another one.
  2. Match the destination using the most specific route. A CIDR blockA network address range written with a prefix length indicating its size. is an address range written with a prefix length; a longer matching prefix is more specific.
  3. For peering, request and accept the connection, add routes to the peer ranges on both sides, and permit traffic in the security controls.
  4. For private IPv4 internet egressTraffic leaving a resource or network., route to a zonal public NATTranslation of source addresses so private resources can initiate connections through a gateway. gateway. It replaces instance source addresses with its own private IPv4 address; the internet gateway maps that address to the gateway Elastic IP. Replies reverse the translation. A zonal public NAT gateway needs a public subnet.
  5. When using zonal NAT gateways, create one per AZ and route each AZ locally. An Availability Zone (AZ) is a separate location within a Region. For outbound-only IPv6, route to an egress-only internet gateway.
Path Target or requirement
All IPv4 destinations 0.0.0.0/0 route
All IPv6 destinations ::/0 route; IPv4 routes do not cover IPv6
Direct private peer Accepted peering, non-overlapping ranges, routes on both sides
Private IPv4 internet egress Public NAT gateway, then internet gateway
Private connectivity through address translation Private NAT gateway; no Elastic IP or internet egress
Outbound-only IPv6 internet access Egress-only internet gateway

Exam cues

  • If the question says peering is active but communication fails, think routes and security controls on both sides, because acceptance alone does not configure them.
  • If the question says B and C must communicate through their shared peer A, think non-transitive peering, because a peering connection is a direct relationship only.
  • If the question says zonal NAT internet access must survive another AZ’s outage, think a local NAT gateway per AZ, because sharing one creates an AZ dependency.
  • If the question says IPv6 clients need outbound access without unsolicited inbound access, think ::/0 to an egress-only internet gateway, because it permits initiated connections and their responses.

Remember

  • Each subnet uses one route table; several subnets can share it.
  • IPv6 internet traffic uses public IPv6 addresses directly; IPv4 uses translation at the internet gateway.
  • An egress-only internet gateway is redundant, highly available and horizontally scaled.
  • Zonal NAT bandwidth scales automatically from 5 Gbps to 100 Gbps. NAT gateways have no security groups.
  • Peering does not share a peer’s internet gateway, NAT, VPN, Direct Connect, or S3 gateway endpoint.
  • Inter-Region peering traffic is encrypted and stays on the AWS backbone.
  • A subnet-CIDR route more specific than the local route can send east-west traffic through a middlebox.

Trap: Transit Gateway does not solve overlapping VPC address ranges. It also cannot route between VPCs whose CIDRs overlap.

Peering needs routes on both sides
private traffic12VPC Aroute to B via peeringVPC Broute to A via peering
  1. Add a route for the peer destination range on the requester side.

  2. Add a return route on the accepter side and allow traffic through the network controls.

Da documentação da AWS (24)
  • Each VPC route specifies a destination address range or prefix list and a target for matching traffic.
  • A subnet uses one route table; without an explicit association it uses the main route table, and multiple subnets may share a table.
  • VPC routing normally selects the most specific matching destination, called longest prefix match.
  • The default route 0.0.0.0/0 matches all IPv4 addresses; ::/0 matches all IPv6 addresses, and the two protocols have separate routes.
  • Peering requires request acceptance, routes to the peer range on both sides, and security controls that permit the traffic.
  • VPC peering does not support matching or overlapping IPv4 or IPv6 CIDR blocks.
  • Peering is not transitive: two VPCs peered with the same VPC do not gain connectivity to each other through it.
  • A peer cannot use another VPC internet gateway, NAT device, VPN, Direct Connect connection, or S3 gateway endpoint through the peering connection.
  • Transit Gateway also cannot route between attached VPCs with identical or overlapping CIDRs; overlapping attachment routes are not propagated.
  • A zonal public NAT gateway uses a public subnet and an Elastic IP for private-instance internet egress. It changes the instance source IPv4 address to its own private IPv4 address; the internet gateway maps that address to its Elastic IP. NAT reverses the translation for replies.
  • A private NAT gateway supports private connectivity, has no Elastic IP, and cannot provide internet egress through an internet gateway.
  • A zonal NAT gateway is redundant within its AZ; using one per AZ and routing each AZ to its own gateway avoids dependence on another AZ for egress.
  • NAT gateways cannot have security groups; subnet ACLs and instance security groups control their traffic.
  • A zonal NAT gateway starts with 5 Gbps of bandwidth and automatically scales up to 100 Gbps.
  • An egress-only internet gateway is horizontally scaled, redundant and highly available. It permits outbound IPv6 connections and their responses while blocking unsolicited inbound IPv6 connections.
  • To use an egress-only internet gateway, add a route such as ::/0 targeting it.
  • VPC peering also works between VPCs in different Regions; their resources talk over private IP addresses without a gateway or VPN, and inter-Region traffic is encrypted.
  • Every route table has a local route for each VPC CIDR, so subnets in a VPC can reach each other by default; a more specific route than the local one must match a whole subnet CIDR and target a NAT gateway, network interface or Gateway Load Balancer endpoint.
  • For IPv4, an internet gateway translates an instance private address to its public IPv4 address; the instance sees its private address. IPv6 internet traffic uses the instance public IPv6 address directly, without this IPv4 address translation.
  • VPC peering can connect VPCs in different AWS accounts, in the same Region or in different Regions.
  • A security group rule can reference a security group of a peered VPC in the same Region; for a peer in another Region, use the peer VPC CIDR block instead.
  • Peering DNS resolution is off by default; once enabled, a peer instance public IPv4 DNS hostname resolves to its private IPv4 address across the peering connection.
  • Inter-Region VPC peering traffic stays in private IP address space, is encrypted, and stays on the AWS global backbone without crossing the public internet.
  • A route more specific than the local route, matching a whole subnet CIDR, can send traffic between subnets in a VPC through a middlebox such as a Gateway Load Balancer endpoint, Network Firewall endpoint or appliance network interface.

Gateway endpoints and endpoint policies

A gateway endpoint gives a VPC a route to S3 or DynamoDB without NATTranslation of source addresses so private resources can initiate connections through a gateway. or an internet gateway. A prefix listA named collection of address ranges that can be referenced by network rules. is an AWS-managed set of service address ranges used as the route destination. The endpoint policyA resource policy controlling which requests can use a VPC endpoint. controls what requests may pass through that endpoint.

How it works

  1. Create the gateway endpoint for S3 or DynamoDB in the service’s Region.
  2. Associate the subnetsAn address range within a VPC whose traffic follows an associated route table.’ route tables. AWS adds a route whose destination is the service prefix list and whose target is the endpoint. Clients keep using the service endpoint hostname; there is no endpoint network interfaceA virtual network attachment that sends and receives traffic for a resource. to place in each AZ.
  3. Permit the service traffic in client security groups and subnet ACLs. Groups can reference the prefix list; ACL rules need address ranges.
  4. Evaluate the endpoint policy alongside identity and resource policies, such as IAM and S3 bucket policies. The endpoint policy does not replace them, and an applicable explicit deny wins.
  5. For source-address conditions on S3 endpoint requests, use aws:VpcSourceIp with a VPC or endpoint condition.

Exam cues

  • If the question says instances need S3 access without NAT in the same Region, think gateway endpoint plus route-table association, because its prefix-list route reaches S3 without an internet gateway.
  • If the question says clients connect from on premises or a peered VPC, think an S3 interface endpoint, because the gateway endpoint cannot extend across those connections. An interface endpoint provides a private network interface for the service.
  • If the question says a permissive endpoint policy still yields AccessDenied, think IAM and resource policy evaluation, because endpoint permission alone does not replace authorization.

Remember

  • Gateway endpoints support S3 and DynamoDB, have no additional endpoint charge, and do not use PrivateLink.
  • Interface endpoint clients need connectivity to the endpoint private addresses as well as DNSName resolution that maps names to network addresses. resolution.
  • Traffic to S3 or DynamoDB through an internet gateway can stay on the AWS network.
  • Prefix lists are Region-specific. A gateway endpoint route does not cover a service in another Region.
  • The default endpoint policy permits full endpoint access subject to other applicable policies.
  • Use aws:VpcSourceIp with aws:SourceVpc, aws:SourceVpce, or aws:SourceVpcArn.

Trap: An allowed private IP range is not a unique VPC identity. Unrelated VPCs can use the same addresses, so pair source-address conditions with a VPC or endpoint identifier.

S3 traffic follows the gateway endpoint route
prefix route1to S32EC2 instanceVPCS3
  1. The client subnet uses a route table associated with the S3 gateway endpoint.

  2. The AWS-managed S3 prefix-list route sends matching traffic through the endpoint.

Da documentação da AWS (10)
  • A gateway endpoint adds a service prefix-list route to associated route tables. Clients reach the service public endpoint through that route, so the endpoint uses route-table associations rather than network interfaces placed in each subnet.
  • An S3 gateway endpoint cannot be extended through VPN, peering, Transit Gateway, or Direct Connect; use an interface endpoint for those access paths.
  • Client security groups and subnet ACLs must allow service traffic; security groups can reference service prefix lists but ACLs cannot.
  • An endpoint policy controls use of the endpoint and does not replace or override identity or resource policies.
  • The default endpoint policy permits full access through the endpoint, subject to other applicable authorization policies.
  • An explicit deny in an applicable IAM policy overrides an allow.
  • For S3 requests through a VPC endpoint, use aws:VpcSourceIp rather than aws:SourceIp for source-address conditions.
  • Pair aws:VpcSourceIp with aws:SourceVpc, aws:SourceVpce, or aws:SourceVpcArn because unrelated VPCs can use overlapping private addresses.
  • An interface endpoint provides private-addressed network interfaces for a PrivateLink service. Clients need network connectivity to those addresses; DNS resolves the service name to endpoint interface addresses.
  • Traffic from a VPC public subnet to the public S3 or DynamoDB endpoint can leave through the internet gateway while remaining on the AWS network.

Flow Logs

VPC Flow Logs record information about IP traffic at network interfaces. They help investigate allowed and rejected connections without collecting packet contentsThe application data carried inside a network packet.. A network interfaceA virtual network attachment that sends and receives traffic for a resource. is the virtual network attachment through which a resource sends and receives traffic.

How it works

  1. Choose VPC, subnetAn address range within a VPC whose traffic follows an associated route table., or network-interface scope. Choose accepted traffic, rejected traffic, or all traffic.
  2. Select CloudWatch Logs, S3, or Data Firehose as the destination. Collection happens outside the traffic path.
  3. Aggregate traffic into flow records containing addresses, ports, protocol, counts, times, an action, and a logging status. Metadata describes a connection; it does not contain the application data inside packets.
  4. Compare request and response records. An accepted request followed by a rejected reply can point to a subnet ACL missing its return-path rule.
Field value Meaning
ACCEPT Traffic was accepted
REJECT Traffic was rejected, including by a group or ACL, or after connection closure

Exam cues

  • If the question says diagnose accepted versus rejected network connections, think Flow Logs, because they record flow metadata and actions.
  • If the question says read an HTTP body, think packet contents are unavailable in Flow Logs, because records contain metadata only.
  • If the question says GuardDuty already runs but audit logs need retention, think configure your own flow logs, because GuardDuty’s separate stream is not exposed for retention.

Remember

  • Default maximum aggregation intervalThe period over which traffic is combined into a flow log record.: ten minutes. One minute is selectable. This is a capture window; publication adds delay.
  • Nitro instance interfaces aggregate in one minute or less. Nitro is the EC2 platform used by those instances.
  • Collection and publication can take several minutes; this is not a real-time stream.
  • Out-of-path collection does not affect traffic throughput or latency.

Trap: REJECT alone does not name a particular security rule or prove that an ACL caused the rejection. Examine both directions and the applicable controls.

Da documentação da AWS (11)
  • Flow logs can capture accepted traffic, rejected traffic, or all traffic.
  • ACCEPT means accepted traffic; REJECT can indicate security group or ACL rejection or packets arriving after connection closure.
  • The aggregation interval is the capture window for combining a flow into a record, not a publication schedule. Its maximum defaults to ten minutes, can be set to one minute, and is one minute or less for Nitro instance interfaces. Processing and delivery take additional time.
  • Flow logs are not real-time streams and can take several minutes to begin collecting and publishing.
  • VPC Flow Logs do not capture packet contents.
  • GuardDuty analyzes its own independent stream of EC2 flow data without requiring customer-created flow logs; it does not make those logs available for customer retention.
  • An accepted request and rejected response can reveal a stateless subnet ACL that permits only one direction.
  • CloudWatch Contributor Insights analyzes log data, such as flow logs in CloudWatch Logs, to show the top-N contributors, for example the hosts sending the most traffic.
  • VPC Traffic Mirroring copies packets from an elastic network interface to a target (another network interface, a Network Load Balancer or a Gateway Load Balancer endpoint) for content inspection; flow logs record only metadata.
  • Flow logs published to S3 can be queried with SQL in Amazon Athena to investigate traffic patterns and threats.
  • Flow logs do not record traffic to the Amazon DNS server, instance metadata at 169.254.169.254, Amazon Time Sync at 169.254.169.123, DHCP or Windows license activation.

VPC operational checks

VPC operations require interpreting flow log status, restricting where EC2 role credentials are used, and knowing which platform traffic bypasses network filters. These checks help distinguish missing records from idle traffic and identify the right control for DNSName resolution that maps names to network addresses. requests.

How it works

  1. Read the flow log status: OK means normal logging, NODATA means no traffic during the interval, and SKIPDATA means some records were skipped because of internal capacity constraints or errors.
  2. To restrict EC2 role credentials to their original VPC, compare aws:Ec2InstanceSourceVpc with aws:SourceVpc. The latter applies to requests through a VPC endpoint. Scope the policy to EC2 role credentials and account for AWS services calling on the role’s behalf. See the IAM condition key guidance.
  3. Check the exceptions for both security groups and network ACLsA numbered set of allow and deny rules for traffic entering or leaving a subnet.. Neither filters Amazon DNS, DHCPA protocol that supplies network configuration to clients., EC2 instance metadata, ECS task metadata, Windows activation, Time Sync, or reserved VPC router addresses. Use Route 53 Resolver DNS Firewall to filter DNS requests through the VPC Resolver.

Exam cues

  • If the question says a flow log reports SKIPDATA, think skipped records, because capacity constraints or errors can prevent some records from being captured.
  • If the question says EC2 role credentials must be used through an endpoint in their original VPC, think aws:Ec2InstanceSourceVpc and aws:SourceVpc, because the policy can compare the credential’s VPC with the endpoint request’s VPC.
  • If the question says filter DNS requests through the VPC Resolver, think Route 53 Resolver DNS Firewall, because security groups and network ACLs do not filter Amazon DNS traffic.

Remember

  • OK means normal logging; NODATA means no traffic during the interval; SKIPDATA means some records were skipped.
  • aws:SourceVpc applies to requests through a VPC endpoint. Account for AWS service calls on the role’s behalf when restricting EC2 role credentials.
  • Security groups and network ACLs do not filter the listed AWS platform traffic.

Trap: SKIPDATA does not mean the interval had no traffic. It means some flow log records were skipped.

Da documentação da AWS (5)
  • OK means normal logging, NODATA means no traffic during the interval, and SKIPDATA means some records were skipped because of internal capacity constraints or errors.
  • Compare aws:Ec2InstanceSourceVpc with endpoint-only aws:SourceVpc to restrict EC2 role credentials to requests from their original VPC; account for AWS service calls on the role behalf.
  • Security groups do not filter Amazon DNS, DHCP, EC2 instance metadata, ECS task metadata, Windows activation, Time Sync, or reserved VPC router addresses.
  • Network ACLs do not filter Amazon DNS, DHCP, EC2 instance metadata, ECS task metadata, Windows activation, Time Sync, or reserved VPC router addresses.
  • Use Route 53 Resolver DNS Firewall to filter DNS requests through the VPC Resolver.

Flashcards

toque para virar
Resposta

·

Todos os 65 flashcards em lista

What is an Amazon VPC subnet, and how many Availability Zones can one subnet span?

A range of IP addresses in the VPC. It lives in exactly one Availability Zone.

What makes a VPC subnet public rather than private?

A public subnet has a route to an internet gateway; a private subnet doesn't.

Instances in a private subnet must download patches from the internet but must not accept incoming connections. What should the company add?

A NAT gateway in a public subnet, with a route from the private subnet to it.

Which VPC component allows two-way communication between a VPC and the internet?

An internet gateway.

How can instances in a private subnet reach Amazon S3 without going through the internet?

Through a VPC endpoint, which connects to AWS services privately without an internet gateway or NAT.

Does a NAT gateway let people on the internet connect to instances in a private subnet?

No. It allows outbound connections only; external services can't initiate connections through it.

Which VPC component directs traffic from a subnet to a gateway or another network?

A route table.

A company wants private subnets to reach the internet through NAT with no instances to patch. Should it use a NAT gateway or a NAT instance?

A NAT gateway, which AWS manages. A NAT instance is an EC2 instance the customer must patch and maintain.

Can one Amazon VPC span several AWS Regions or several Availability Zones?

Only several Availability Zones. A VPC is in one Region and can have subnets in each of its AZs; each subnet is in one AZ.

What is the purpose of an internet gateway in Amazon VPC?

An internet gateway connects a VPC to the internet. Resources also need a public IPv4 or public IPv6 address, a route to the gateway and security controls that permit traffic.

What makes a subnet public?

Its route table sends 0.0.0.0/0 (or ::/0) to an internet gateway.

How does a VPC gateway endpoint provide private S3 or DynamoDB access?

It adds an AWS-managed service prefix-list route to associated route tables. No internet gateway or NAT is required, and there is no additional endpoint charge. The service prefix list is Region-specific.

What does a security group do in an Amazon VPC?

A security group acts as a virtual firewall for an instance and controls which traffic can reach it.

Which Amazon VPC security control allows or denies traffic at the subnet level?

A network ACL controls inbound and outbound traffic at the subnet level.

What do VPC Flow Logs record, and where can the records be published?

IP traffic metadata such as addresses, ports, protocol, bytes, and ACCEPT or REJECT, at VPC, subnet, or network-interface scope. Publish to CloudWatch Logs, S3, or Data Firehose. Packet contents are not captured, and collection is outside the traffic path.

How do VPC security groups and network ACLs differ?

Security groups protect associated resources, track connections, and have allow rules only. Network ACLs protect subnets, do not track connections, and process allow or deny rules from lowest number to first match. A subnet has one ACL.

Which of these cannot be the source of a security group inbound rule: a CIDR block, a single IP, another security group, or an internet gateway ID?

An internet gateway ID. Sources are CIDR ranges (including single addresses), prefix lists and security groups.

A team creates a custom Amazon VPC network ACL but does not associate a subnet. Do its rules affect an existing subnet?

No. Associate the custom ACL with the subnet to apply its rules; creation alone changes no subnet association.

A VPC subnet ACL allows inbound HTTPS, but a client gets no response. What return-path rule may be missing?

An outbound allow rule for the client ephemeral port range. ACLs are stateless, so allowing the inbound request does not automatically allow its response.

A team must block one abusive IP range from reaching a VPC subnet. Which network control fits?

An ACL deny rule placed before any matching allow rule. Security groups have no deny rules.

VPC Flow Logs show an accepted inbound request followed by a rejected response. Which control should the team inspect first?

The subnet network ACL. It needs an explicit return-path allow rule, while the stateful security group automatically permits responses to allowed requests.

A new custom VPC security group has not been edited. What traffic do its initial rules allow?

No inbound connections and all outbound traffic. Responses to allowed outbound requests are permitted by connection tracking.

A database security group references the application security group. Does it inherit the application group rules?

No. The reference permits matching traffic involving the application group network interfaces; it does not copy that group rules.

An old Elastic Beanstalk environment cannot terminate because a database security group references its security group. How should the team remove the dependency without cutting replacement access?

Permit the replacement application through a suitable independent security group, then remove the retiring environment group reference. References to an environment-managed group can block its deletion.

How do Amazon VPC network ACL rules specify the remote network for inbound and outbound traffic?

An inbound rule uses a source CIDR; an outbound rule uses a destination CIDR. Rules also match protocol and applicable ports, and cannot use security group IDs.

Which inbound ports does a security group open for SSH to a Linux instance, RDP to a Windows instance, and HTTPS?

TCP 22 for SSH, 3389 for RDP and 443 for HTTPS (80 for plain HTTP).

A new custom network ACL is associated with a subnet and all traffic stops. Why?

A custom network ACL denies all inbound and outbound traffic until allow rules are added; only the default ACL allows everything.

Can an inbound rule reference a security group in a peered VPC in another Region?

No. Cross-account references work within the same Region; for an inter-Region peer, use the peer VPC CIDR block.

Two instances in the same subnet cannot talk. Can the subnet network ACL be the cause?

No. Network ACLs only filter traffic entering or leaving the subnet; check the security groups and the hosts.

A network ACL denies TCP 5432, yet two instances in the same subnet still connect on that port. Why?

Network ACLs filter traffic entering or leaving the subnet, not traffic within it. Use security groups to control instance-to-instance traffic in one subnet.

Amazon EC2 cluster members share one VPC security group. How can the group permit the required member-to-member port?

Add an inbound rule for that protocol and port with the same security group as its source. Sharing a group alone does not grant all traffic.

Amazon EC2 instances in two VPC subnets exchange requests and responses. Which network ACL directions must allow the traffic?

Source outbound and destination inbound for the request; destination outbound and source inbound for the response.

A VPC subnet has no explicit route-table association. Which table directs its traffic?

The main route table. Every subnet uses exactly one route table.

A VPC route table has a default internet route and a more specific route to a peer network. Which route handles the peer addresses?

The more specific peer route. VPC routing uses longest prefix match.

VPC A peers with B and C. Can B reach C through A without another connection?

No. VPC peering is not transitive; B and C need their own direct connection or another suitable routing design.

Two VPCs use overlapping address ranges. Does replacing peering with Transit Gateway fix their routing?

No. Neither peering nor Transit Gateway supports routing between overlapping VPC CIDRs.

Instances in several AZs share one zonal NAT gateway. How should the team remove the shared AZ dependency for internet egress?

Create a zonal NAT gateway per AZ and route each private subnet to its local AZ gateway.

IPv6 instances need internet connections initiated only from inside the VPC. Which gateway and route fit?

An egress-only internet gateway with an IPv6 default route ::/0 targeting it. It permits responses but prevents unsolicited inbound connections.

Which controls protect a zonal NAT gateway, and how does its bandwidth scale?

Use subnet ACLs and instance security groups; the gateway itself cannot have a security group. Its bandwidth automatically scales from 5 Gbps to 100 Gbps.

EC2 instances in VPCs in Ohio and N. Virginia must exchange data privately. What is the simplest setup?

An inter-Region VPC peering connection, plus routes to the peer CIDR in each route table.

Traffic between two subnets of a VPC must pass through a firewall appliance. How can the route tables force that?

Add a route more specific than the local route, matching the destination subnet CIDR and targeting the appliance network interface or a Gateway Load Balancer endpoint.

Does an EC2 instance with a public IPv4 address see that public address on its own network interface?

No. The OS sees only the private address; the internet gateway translates to the public IPv4 address.

VPC A in us-east-1 is peered with VPC B in eu-west-1. Can a security group in VPC A allow traffic by referencing a security group in VPC B?

No. Security group references work only for peers in the same Region. For an inter-Region peer, allow the peer VPC CIDR block.

Instances in peered VPCs call each other by public DNS hostname, and the traffic resolves to public IP addresses. How can the hostnames resolve to private IPs?

Turn on DNS resolution for the peering connection (off by default). Public IPv4 DNS hostnames then resolve to private IPv4 addresses.

Does an Amazon VPC internet gateway translate a public IPv6 address the same way it translates an instance private IPv4 address?

No. IPv6 uses the assigned public IPv6 address directly; IPv4 uses address translation at the internet gateway.

An Amazon VPC needs highly available outbound IPv6 internet access without unsolicited inbound connections. Which gateway fits?

An egress-only internet gateway. It is horizontally scaled, redundant and highly available.

Does traffic over an inter-Region Amazon VPC peering connection cross the public internet?

No. It stays in private IP space, is encrypted and stays on the AWS global backbone.

Traffic between two subnets in the same Amazon VPC must pass through a firewall appliance. How can routing achieve that?

Add a route more specific than the local route, matching the other subnet's CIDR, with the appliance (for example a Gateway Load Balancer endpoint) as target.

An S3 gateway endpoint policy allows a bucket, but the request is denied. Why can that happen?

The endpoint policy does not replace IAM or bucket policies. Other applicable policies must authorize the request, and an explicit deny overrides an allow.

On-premises clients need private access to S3 through the VPC. Can they use its S3 gateway endpoint over VPN?

No. Use an S3 interface endpoint with suitable connectivity. Gateway endpoint access cannot extend through VPN, peering, Transit Gateway, or Direct Connect.

An S3 policy must restrict requests through a VPC endpoint to a private source address. Which condition keys should it use?

aws:VpcSourceIp together with aws:SourceVpc, aws:SourceVpce, or aws:SourceVpcArn. aws:SourceIp does not serve endpoint requests, and a private address alone is not globally unique.

Must an Amazon VPC S3 gateway endpoint have an endpoint network interface in each Availability Zone?

No. Associate the client subnet route tables with the gateway endpoint; matching service traffic follows the endpoint route.

Must an application change its standard Amazon S3 service hostname to use a VPC gateway endpoint?

No. Requests to the service public endpoint follow the matching gateway endpoint route in the associated route table.

An on-premises client resolves an AWS PrivateLink interface endpoint hostname to private IP addresses. Is DNS resolution alone enough to reach it?

No. The client also needs network connectivity to the endpoint network interface private addresses.

Amazon EC2 in a public VPC subnet reaches the public Amazon S3 endpoint through an internet gateway. Does this traffic leave the AWS network?

No. This service traffic stays on the AWS network even though it uses the internet gateway.

A team wants to inspect HTTP request bodies from historical VPC Flow Logs. Can it do that?

No. Flow Logs contain traffic metadata and do not capture packet contents.

A GuardDuty-enabled account needs retained EC2 network records for an audit. Must it configure its own VPC Flow Logs?

Yes. GuardDuty uses an independent flow-data stream and does not expose it as customer-retained flow logs.

What aggregation intervals are available for VPC Flow Logs, and what happens on Nitro instance interfaces?

Ten minutes by default, or one minute when selected. Nitro instance interfaces aggregate in one minute or less. This capture window does not guarantee delivery at that interval.

Which IP addresses generate the most rejected traffic in a VPC? What gives a quick top-N view from flow logs?

Send the flow logs to CloudWatch Logs and use Contributor Insights rules on them.

A security appliance must inspect full packet contents from production instances. Flow logs or Traffic Mirroring?

Traffic Mirroring, sending copies to the appliance through an NLB or Gateway Load Balancer endpoint for availability. Flow logs hold no packet payloads.

A security team wants to run ad hoc SQL queries over months of VPC Flow Logs without loading a database. Which design fits?

Publish the flow logs to S3 and query them with Amazon Athena.

An engineer searches VPC Flow Logs for instance calls to 169.254.169.254 and to the Amazon-provided DNS server and finds none. Why?

Flow logs do not record traffic to instance metadata, the Amazon DNS server, Amazon Time Sync, DHCP or Windows license activation.

A VPC Flow Log shows NODATA for one interval and SKIPDATA for another. Do both mean there was no traffic?

No. NODATA means no traffic in the interval. SKIPDATA means records were skipped because of internal capacity constraints or errors.

A team wants EC2 role credentials usable only through an endpoint in the VPC where they were issued. Which condition values should it compare?

aws:Ec2InstanceSourceVpc and aws:SourceVpc. Scope the policy to EC2 role credentials and account for AWS services making calls on their behalf.

Which AWS platform traffic bypasses VPC security-group and network-ACL filtering?

Amazon DNS, DHCP, EC2 instance metadata, ECS task metadata, Windows activation, Time Sync, and reserved VPC router addresses. Use Resolver DNS Firewall for DNS filtering.

Você concluiu todos os tópicos da DOP-C02!

Seu badge ficou dourado. Próximo passo: agendar a prova na AWS. Depois de passar, adicione-se ao Quem passou.

Compartilhar

Conte que você concluiu esta certificação

Concluí todos os tópicos da AWS Certified DevOps Engineer - Professional (DOP-C02) no Easy Review. Venha estudar também!