Contents
A running EC2 instance does not mean AWS is securing its operating system and applications for you. Separate the underlying infrastructure AWS manages from the identities, network rules and server configuration you manage. For a small web server, exposed management ports and instance permissions are useful starting points.
Security groups combine allow rules
Security groups support allow rules, not deny rules. If several groups are attached, narrowing one may leave the same traffic allowed by another. Review every attached group.
Public web access and administration serve different purposes. Publishing HTTPS does not require exposing SSH or RDP to the entire internet. Restrict direct management access to trusted sources and remove unnecessary rules. Check IPv6 ::/0 as well as IPv4 0.0.0.0/0.
Separate administrator access from application permissions
Session Manager can establish sessions without inbound management ports. It still requires an appropriate SSM Agent, instance permissions, a network path to the service and IAM authorization for the person connecting. Enabling an option alone does not make every instance reachable.
For applications accessing services such as S3, configure role-based temporary credentials rather than embedding long-lived access keys in code or configuration. Limit policies to the necessary actions and resources. Permission for a person to administer an instance and permission for its application to call other AWS services are different.
Check compatibility before requiring IMDSv2
The metadata service can be configured to accept only IMDSv2 requests. First check the SDKs and metadata access code used by applications and agents. A security change should not unexpectedly prevent a workload from retrieving the credentials it needs.
Patching and recovery need separate plans
Restricted access does not remove vulnerabilities in the OS, web server, runtime or application. Record the components being updated and services requiring restarts, then check real requests before and after the change. Update the AMI and deployment process used for replacement instances too.
Volume encryption, log retention and backups address different problems. Encryption does not undo accidental deletion, and the existence of a backup does not prove recovery works. Test restoration with the key permissions and configuration it requires.
Manage network entry points, human and application permissions, updates and recovery paths separately. That is more useful during ongoing changes than treating EC2 security as a one-time setup.