Security and Compliance

Trusted Advisor flags unrestricted SSH access on an EC2 instance with two security groups: one allows all inbound traffic from the internet, and another allows SSH from a corporate CIDR. HTTPS must remain public, SSH must remain available only from the corporate CIDR, and other instances sharing these groups must remain unchanged. What should a CloudOps engineer do?

Show the answer

Correct answerD. Replace both associations with a dedicated group allowing public HTTPS and corporate-only SSH.

AWhy not this: The unrestricted group still allows public SSH; a narrower rule in another group does not override that permission.

BWhy not this: Changing a shared group changes traffic permissions for other associated instances, violating the stated constraint.

CWhy not this: Instance-role policies control AWS API permissions, not inbound SSH connections.

DWhy this is right: Replacing both associations removes the unrestricted access while preserving required traffic and leaving shared groups unchanged.

A dedicated security group meets the access requirements without changing shared groups. Security group permissions are additive, so adding a restricted SSH rule cannot override an existing unrestricted allow.