The Simplest Way to Make Ec2 Systems Manager and Github Work Like They Should
Integrating ec2 systems manager and github lets teams deploy code to cloud servers without open ports. A workflow pushes tested scripts from source control straight to target instances over secure channels. Modern teams keep server scripts and app code inside version control repos. They need a safe way to run those scripts on cloud machines. Using these two tools together removes the need for public SSH ports. It also stops engineers from copying scripts by hand to live hosts. How ec2 systems
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Integrating ec2 systems manager and github lets teams deploy code to cloud servers without open ports. A workflow pushes tested scripts from source control straight to target instances over secure channels.
Modern teams keep server scripts and app code inside version control repos. They need a safe way to run those scripts on cloud machines. Using these two tools together removes the need for public SSH ports. It also stops engineers from copying scripts by hand to live hosts.
How ec2 systems manager and github share roles and data
The workflow starts when a developer merges code into a branch. The source control platform starts an automated job runner for that repo. That runner must prove its identity to the cloud account before taking action. Teams set up an OpenID Connect trust between the two platforms for this step.
The runner requests a short-lived token from the cloud identity service. The cloud checks the repo name and branch against a strict trust policy. If the check passes, the runner gets temporary permissions for that single job. No human has to store long-lived keys inside the repo settings.
Next, the runner calls the management service API to run a task. It can pull scripts directly from the repo to the target server. The cloud agent on the server reads the task and runs the commands. Output logs flow back to the cloud console and the job runner.
Common failure modes and how to scope permissions
Many teams make mistakes when they first link these two platforms. The worst mistake is storing static cloud admin keys in repo secrets. If an attacker reads those secrets, they gain control of every server. Static keys also fail to rotate on time and break audit trails.
Broad role permissions create another major risk for production fleets. If a runner can reach all instances, a bad script can wipe production. Teams often share one single service account across dozens of different code repos. When a script changes a server, logs only show the shared role name.
GCP Access Context Manager + GitHub Actions Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix these risks by scoping roles to specific resource tags. Give each repo its own cloud role with tight tag rules. A test branch should only reach servers tagged for test workloads. Production jobs should require human review before the runner gets its cloud role.
Network paths between the server agent and the source repo also need care. Servers should live in private subnets with outbound access restricted to needed endpoints. You should also mask sensitive data in job logs before storing them. Masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in results.
Keeping server tasks safe and auditable
Good ops teams treat every server command like a production code change. They store management documents inside git repos so peers can review every edit. When a script runs, the cloud log records the exact git commit hash. This links every server change back to a human author and reviewer.
Teams also limit which commands the server agent is allowed to run. Instead of allowing raw shell scripts, they restrict jobs to pre-approved task documents. This stops a rogue pipeline from running unsafe commands on a host. Clear logs and tight roles keep both platforms clean and safe.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
How does GitHub run scripts on EC2 without SSH keys?
The workflow runner assumes an IAM role using OpenID Connect tokens. It then asks the cloud management API to run commands through the host agent.
How can we limit which servers a repo can touch?
You can attach resource tags to your servers and check them in IAM policies. The role for that repo can only target instances with matching tags.
Where do command logs go when a job finishes?
The host agent sends command output back to the cloud management service. You can route those logs to cloud storage buckets or central log tools.
Related guides
In this post