Secure EC2 Deployments from GitHub Actions Using AWS SSM, No Open Ports Needed
Developers deploying to EC2 via GitHub Actions have traditionally relied on long-lived SSH keys, open port 22, or bastion hosts — all of which carry significant security risks. AWS Systems Manager Session Manager eliminates these risks by having the SSM Agent on the instance initiate an outbound HTTPS connection to AWS, removing the need for any inbound security group rules. Combined with EC2 Instance Connect, temporary SSH keys can be pushed to an instance for just 60 seconds, leaving nothing persistent to rotate or leak. IAM policies replace key-file-based authentication, and every session is logged in CloudTrail for full auditability. An open-source GitHub Action, ankurk91/setup-ssh-over-ssm-action, packages this entire setup and teardown process, enabling clean deployments with no stored secrets or open ports.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in