The Simplest Way to Make Cloud Storage and Datadog Work Like They Should
Teams pair cloud storage and Datadog to store old logs and watch bucket usage. This setup lets you save raw event files in cheap storage while Datadog reads metrics and forwards new logs for alerts. In a standard production flow, apps write logs and backups into object buckets. Datadog then checks bucket size and request counts, or pulls fresh log files for search. You can also send old logs from Datadog back into your buckets for long-term archives. How permissions and data flow between clou
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 cloud storage and Datadog to store old logs and watch bucket usage. This setup lets you save raw event files in cheap storage while Datadog reads metrics and forwards new logs for alerts.
In a standard production flow, apps write logs and backups into object buckets. Datadog then checks bucket size and request counts, or pulls fresh log files for search. You can also send old logs from Datadog back into your buckets for long-term archives.
How permissions and data flow between cloud storage and Datadog
Setting up cloud storage and Datadog starts with an identity role in your cloud account. You do not want to share static access keys across these two systems. Instead, you set up a cross-account role that trusts the Datadog account ID.
This role needs read rights to pull bucket metrics and read log objects. If you archive logs from Datadog back to your buckets, the role also needs write rights on that specific archive bucket.
For log ingestion, a cloud event trigger notices when a new file lands in a bucket. That event wakes up a small worker function in your cloud account. The worker reads the file and sends the log lines to the Datadog intake endpoint over HTTPS. Metadata like bucket names and object prefixes travel along as tags.
Common failure modes and how to scope roles
Many teams make the mistake of giving the integration role full read rights across every bucket. If that role gets misused, an attacker or a bad rule could read private app backups or user files. Another common failure is using one shared service account for both log shipping and engineer bucket checks.
Shared accounts make audit logs hard to read. When someone downloads a sensitive file, you cannot tell who ran the query. Broad tokens also break the rule of least privilege when they stay active for months.
End-to-End Encryption + Datadog Security Monitoring: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, split your roles by task. Give the log shipper read rights on the log bucket only. Give the archive writer write rights on the archive bucket only. Block public network routes by using private cloud endpoints for your storage buckets. You should also add a scrubbing rule before logs leave your cloud account. Data masking rewrites matched fields like emails, phone numbers, card numbers, or national IDs in results before they reach the log index.
Keeping bucket access safe during live incidents
When a Datadog alert fires, engineers often need to inspect raw files in the storage bucket. They might check failed payload dumps or read old archive logs that are not indexed. Giving every engineer permanent read rights to production buckets creates a big security risk.
Teams should separate automated metric collection from human debugging tasks. Let the cloud role handle automated log forwarding in the background. When a person needs to check a bucket or run a command, require a quick approval step and log every action they take.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Should Datadog read all buckets in our cloud account?
No, you should limit file read rights to specific log buckets only. You can allow metric collection across the account, since metrics only show file counts and bucket sizes, not raw file contents.
How do we stop private user data from entering log archives?
Set up your log forwarder or pipeline to scrub sensitive patterns before indexing or archiving. Masking rewrites matched fields such as emails, phone numbers, card numbers, and national IDs in the log results.
Why did our cloud bill jump after linking our buckets to Datadog?
Frequent list and read calls on buckets with millions of small files can raise cloud request costs. Batch your logs into larger files before writing them to the bucket, and turn off deep file scanning on buckets that only hold cold backups.
Related guides
In this post