The Simplest Way to Make Ec2 Systems Manager and TimescaleDB Work Like They Should
Teams pair ec2 systems manager and timescaledb to reach private time-series hosts without public ports. The cloud agent routes traffic to the database while cloud roles verify the user. This setup removes the need for open firewall rules on your database servers. Engineers reach the database through an outbound tunnel from the host agent. You keep the database on a private subnet away from the public web. How ec2 systems manager and timescaledb handle identity and data The workflow starts wh
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.
Teams pair ec2 systems manager and timescaledb to reach private time-series hosts without public ports. The cloud agent routes traffic to the database while cloud roles verify the user.
This setup removes the need for open firewall rules on your database servers. Engineers reach the database through an outbound tunnel from the host agent. You keep the database on a private subnet away from the public web.
How ec2 systems manager and timescaledb handle identity and data
The workflow starts when an engineer logs in to the cloud provider. Cloud identity rules check if that person can reach the target host. Once approved, the host agent starts a local port forwarding session.
The engineer then opens a local database client on their laptop. Traffic flows through the cloud tunnel straight to the database port. At this point, the cloud tool hands the job over to the database.
Now the time-series database must check the user credentials on its own. The database checks the username, password, or certificate before it runs any query. You must manage both cloud roles and database roles to keep data safe.
Data flows back to the user through the same encrypted tunnel. The host agent moves bytes back and forth without reading the SQL queries. This separation means your cloud logs and database logs stay in two places.
Common failure modes and how to scope access
A common mistake is giving every engineer the same database login. Cloud logs will show who opened the tunnel to the host. Still, database logs will only show one shared user running every command.
When a bad query drops a table, you cannot trace who ran it. Another risk comes from broad cloud roles that grant shell access everywhere. If a user can open a host shell, they can read local files.
They might find database keys stored on the disk and bypass database rules. You can fix this by limiting cloud roles to port forwarding only. Do not let normal users open a full shell on database hosts.
GCP Access Context Manager + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Next, create separate database roles for read and write tasks. Most daily checks only need read access to recent time-series chunks. Give write roles only to the apps that ingest new sensor or metric data.
You should also mask personal fields like emails, phone numbers, and card numbers. Masking rewrites matched fields in query results before the user reads them. Keep network paths tight by placing the database in an isolated subnet.
Allow the host agent to talk only to the cloud service endpoint. Block all other outbound traffic from the database server to stop data leaks.
Auditing queries across your time-series hosts
Good security requires clear logs at both the network and database layers. Cloud session logs tell you when a tunnel started and when it ended. They do not record the actual SQL statements sent inside that tunnel.
To see the queries, you must turn on statement logging in the database. Send those database logs to a central store right away. If logs stay on the local disk, a user with host access could delete them.
Match the timestamps from your cloud logs with your database query logs. This step helps your security team link a query to a real person. Regular reviews of both log streams keep your time-series data safe during audits.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Does EC2 Systems Manager log the SQL queries sent to TimescaleDB?
No, the cloud agent only logs the start and end of the tunnel. It moves raw network traffic and does not read the database protocol. You must enable database audit logs to see the actual SQL queries.
Can we use EC2 Systems Manager to reach TimescaleDB without opening inbound ports?
Yes, the host agent makes an outbound call to the cloud service. Engineers forward a local port through that outbound link to reach the database. You can close all inbound firewall ports on the database server.
How do we stop engineers from sharing one Postgres role in TimescaleDB?
Remove shared passwords and create distinct database roles for each team duty. Link your identity provider so users log in with their own credentials. Review database logs each week to spot any shared account use.
Related guides
In this post