exam questions

Exam AWS Certified Security - Specialty All Questions

View all questions & answers for the AWS Certified Security - Specialty exam

Exam AWS Certified Security - Specialty topic 1 question 232 discussion

Exam question from Amazon's AWS Certified Security - Specialty
Question #: 232
Topic #: 1
[All AWS Certified Security - Specialty Questions]

A company is implementing a new application in a new AWS account. A VPC and subnets have been created for the application. The application has been peered to an existing VPC in another account in the same AWS Region for database access. Amazon EC2 instances will regularly be created and terminated in the application VPC, but only some of them will need access to the databases in the peered VPC over TCP port 1521. A security engineer must ensure that only the
EC2 instances than need access to the databases can access them through the network.
How can the security engineer implement this solution?

  • A. Create a new security group in the database VPC and create an inbound rule that allows all traffic from the IP address range of the application VPC. Add a new network ACL rule on the database subnets. Configure the rule to TCP port 1521 from the IP address range of the application VPC. Attach the new security group to the database instances that the application instances need to access.
  • B. Create a new security group in the application VPC with an inbound rule that allows the IP address range of the database VPC over TCP port 1521. Create a new security group in the database VPC with an inbound rule that allows the IP address range of the application VPC over port 1521. Attach the new security group to the database instances and the application instances that need database access.
  • C. Create a new security group in the application VPC with no inbound rules. Create a new security group in the database VPC with an inbound rule that allows TCP port 1521 from the new application security group in the application VPC. Attach the application security group to the application instances that need database access, and attach the database security group to the database instances.
  • D. Create a new security group in the application VPC with an inbound rule that allows the IP address range of the database VPC over TCP port 1521. Add a new network ACL rule on the database subnets. Configure the rule to allow all traffic from the IP address range of the application VPC. Attach the new security group to the application instances that need database access.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
Highly Voted 3 years, 7 months ago
I think C , why add inbound rule for Database on application instance. Create SG on Application instance so we can add SG to the database SH rules i.e allow traffic to database port from SG of application instance.
upvoted 33 times
DahMac
3 years, 6 months ago
The VPC security group must also allow outbound traffic to the security groups of the data destinations, specifically on the port or ports that the database is listening on. https://docs.aws.amazon.com/quicksight/latest/user/vpc-security-groups.html "By default, a security group includes an outbound rule that allows all outbound traffic. We recommend that you remove this default rule and add outbound rules that allow specific outbound traffic only." "When you create a security group, it has no inbound rules. No inbound traffic originating from another host to your instance is allowed until you add inbound rules to the security group." Can't be -C- no path the DB SG from App instance. Must be -B-
upvoted 2 times
...
...
dlenehan
Highly Voted 3 years, 7 months ago
C is the right answer. The question says that EC2s will be created in the VPC, but not all need access to the database. By creating an empty SG and attaching it only to the EC2s that need access to the database, you can set that SG name as the source address for an inbound rule on the database SG. The others are all too permissive, as they will allow all EC2s to access the database.
upvoted 23 times
ramozo
3 years, 6 months ago
Am I missing something? if there aren't rules on the application SG, then, how the traffic goes out?
upvoted 2 times
pmjcr
3 years, 6 months ago
Security Groups only block/filter inbound traffic, not outbound so has nothing to do with the SG created. The creation of a SG with no rules is just to dynamically group the instances because they are constantly changing in the environment
upvoted 1 times
...
...
...
Raphaello
Most Recent 1 year, 2 months ago
Selected Answer: C
Long question with annoying long options, and the only purpose of it to test you on: 1. reference SG in another SG rule(s) 2. SG reference can work through VPC peering 3. you noticed "EC2 instances will regularly be created and terminated in the application VPC" in the question, therefore IP list is not practical and better use SG reference. Option C.
upvoted 1 times
...
Green53
1 year, 10 months ago
Selected Answer: C
The VPCs are peered, so you *can* reference security groups in other VPCs: https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html and it would likely be deemed best practise, rather than opening up an SG to an entire IP range. I'd eliminate both B and D, since the application doesn't require inbound 1521 (it's making outbound requests, and SGs are stateful). It would be between C and A. I'd then eliminate A, since it shoudn't require a Network ACL rule (they allow all access by default), and using security groups for access is just better.
upvoted 1 times
...
samCarson
1 year, 10 months ago
Selected Answer: C
C. Create a new security group in the application VPC with no inbound rules. Create a new security group in the database VPC with an inbound rule that allows TCP port 1521 from the new application security group in the application VPC. Attach the application security group to the application instances that need database access, and attach the database security group to the database instances. To restrict access to the databases in the peered VPC, the security engineer should create a new security group in the application VPC with no inbound rules. In the database VPC, a new security group should be created allowing TCP port 1521 from the application security group in the application VPC. The application instances that require database access should be associated with the application security group, while the database instances should be associated with the database security group. This ensures that only the designated application instances can access the databases on TCP port 1521, while blocking access from other instances in the application VPC.
upvoted 1 times
...
pal40sg
1 year, 11 months ago
Selected Answer: C
In this approach, a new security group is created in the application VPC without any inbound rules. This security group will be attached to the EC2 instances that require access to the databases. Another new security group is created in the database VPC, specifically for the database instances. This security group will have an inbound rule that allows TCP port 1521, which is the database access port, from the newly created application security group in the application VPC. By attaching the application security group to the application instances and the database security group to the database instances, the necessary access control is achieved. Only the EC2 instances associated with the application security group will be able to access the database instances on TCP port 1521. This solution ensures that the access is restricted to the required instances and follows the principle of least privilege, reducing the attack surface and enhancing security.
upvoted 2 times
...
ITGURU51
2 years ago
As per AWS documentation: You can update the inbound or outbound rules for your VPC security groups to reference security groups in the peered VPC. Doing so allows traffic to flow to and from instances that are associated with the referenced security group in the peered VPC. Therefore we can safely eliminate D and A from the equation. By default, a security group includes an outbound rule that allows all outbound traffic. Creating a new security group for the application tier essentially allows outbound communication to the database servers. Now we must configure an inbound access to the database tier in the other VPC. C
upvoted 1 times
...
peddyua
2 years, 1 month ago
Selected Answer: A
A is right, you can configure ip range to allow let's say ping from prod vpc or to dev or/and vice versa C is wrong you can't add SG id from VPC from another account, just tried.
upvoted 2 times
...
ycl1008
2 years, 2 months ago
C. Since we can use SG across peered VPC, I think it would be easier to do C rather than A. You can update the inbound or outbound rules for your VPC security groups to reference security groups in the peered VPC. Reference: https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html
upvoted 1 times
...
hubekpeter
2 years, 5 months ago
Selected Answer: C
C ti is not complete but it's the only meningfull answer.
upvoted 3 times
...
Isaias
2 years, 5 months ago
Selected Answer: A
A is the Best Answer, You cannot attach SG from another VPC, someone says you need epheramal ports but you don´t, you just modify the acl inbound for dst port 1521 the acl out has permit all by default
upvoted 1 times
...
Bosch123
2 years, 6 months ago
Selected Answer: A
A is the only correct answer I can see many people voted for C - Now note this part in Option C "Create a new security group in the database VPC with an inbound rule that allows TCP port 1521 from the new application security group in the application VPC". Question is - Is it possible to select a SG which is in a different VPC, as a source, in a SG rule which is in an another VPC?
upvoted 2 times
...
cloud_collector
2 years, 7 months ago
C The following inbound rules are examples of rules you might add for database access, depending on what type of database you're running on your instance. TCP 6 1521 (Oracle) The default port to access an Oracle database, for example, on an Amazon RDS instance https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html#sg-rules-db-server
upvoted 1 times
...
sapien45
2 years, 8 months ago
Selected Answer: C
C not only works, it is the more elegant option
upvoted 4 times
...
watoz1851
2 years, 8 months ago
Selected Answer: C
A cannot work because it needs additional allow ACL for ephemeral ports.
upvoted 2 times
...
Rja148393
2 years, 9 months ago
Selected Answer: C
Least permissive option
upvoted 3 times
...
dcasabona
2 years, 9 months ago
Selected Answer: C
I agree with dlenehan...
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago