Datadog Hardening Guide
Observability platform security for API keys, log pipelines, and sensitive data
Overview
Datadog serves 28,000+ customers with 800+ integrations collecting application metrics, security signals, and log data enterprise-wide. API keys and OAuth tokens (security_monitoring scopes) provide broad access to operational telemetry. Datadog proactively monitors GitHub for leaked keys, but organizations must implement their own controls for API key lifecycle management.
Intended Audience
- Security engineers managing observability platforms
- SRE/DevOps teams configuring Datadog
- GRC professionals assessing monitoring compliance
- Third-party risk managers evaluating telemetry integrations
How to Use This Guide
- L1 (Baseline): Essential controls for all organizations
- L2 (Hardened): Enhanced controls for security-sensitive environments
- L3 (Maximum Security): Strictest controls for regulated industries
Scope
This guide covers Datadog security configurations including authentication, API key management, agent security, and log/APM data protection.
Table of Contents
- Authentication & Access Controls
- API Key Management
- Agent Security
- Data Security
- Monitoring & Detection
- Compliance Quick Reference
1. Authentication & Access Controls
1.1 Enforce SAML SSO with MFA
Profile Level: L1 (Baseline) NIST 800-53: IA-2(1)
Description
Require SAML SSO with MFA for all Datadog access.
ClickOps Implementation
Step 1: Configure SAML SSO
- Navigate to: Organization Settings → SAML Login
- Configure:
- Identity Provider: Your IdP (Okta, Azure AD, etc.)
- Entity ID: Datadog entity ID
- SSO URL: IdP login endpoint
- Certificate: Upload IdP certificate
Step 2: Enforce SAML
- Enable: Require SAML
- Configure: Default role for new users
- Disable: Allow password login
Step 3: Configure Just-In-Time Provisioning
- Enable: JIT provisioning
- Map SAML attributes to Datadog roles
- Configure team assignments
1.2 Implement Role-Based Access Control
Profile Level: L1 (Baseline) NIST 800-53: AC-3, AC-6
Description
Configure Datadog roles with granular permissions.
ClickOps Implementation
Step 1: Design Role Structure
| Role | Permissions |
|---|---|
| Admin | Full organization access (2-3 users) |
| Standard | View all data, create dashboards |
| Read-Only | View only, no modifications |
| Security Analyst | Security Monitoring, logs |
| APM Developer | APM data, traces |
Step 2: Create Custom Roles
- Navigate to: Organization Settings → Roles
- Create roles with specific permissions:
- Dashboards: Read/Write
- Monitors: Read/Write
- Logs: Read (specific indexes)
- APM: Read
Step 3: Configure Teams
- Navigate to: Organization Settings → Teams
- Create teams by function
- Assign appropriate roles to teams
2. API Key Management
2.1 Implement API Key Best Practices
Profile Level: L1 (Baseline) NIST 800-53: IA-5
Description
Secure Datadog API keys with proper lifecycle management.
Rationale
Why This Matters:
- API keys provide write access to metrics/logs
- Application keys enable full API access
- Leaked keys enable data exfiltration or manipulation
Hardening Priority: One-Time Read (OTR) mode for application keys; IP-based access controls.
ClickOps Implementation
Step 1: Audit Existing Keys
- Navigate to: Organization Settings → API Keys
- Document all keys:
- Creation date
- Purpose/integration
- Owner
- Navigate to: Organization Settings → Application Keys
- Repeat audit for app keys
Step 2: Implement Key Separation
Key Strategy:
├── API Keys (one per agent deployment)
│ ├── prod-us-east-agents
│ ├── prod-us-west-agents
│ └── staging-agents
└── Application Keys (one per integration)
├── terraform-readonly
├── ci-cd-pipeline
└── security-automation
Step 3: Enable One-Time Read (OTR)
- For new application keys, key value is shown only once
- Store in secrets manager immediately
- Document key purpose before creation
Step 4: Configure Key Scopes (Application Keys)
- Navigate to: Organization Settings → Application Keys
- For each key, configure scopes:
dashboards_read(for BI tools)monitors_read(for alerting)- Avoid broad scopes unless required
2.2 API Key Rotation
Profile Level: L1 (Baseline) NIST 800-53: IA-5(1)
Description
Implement regular API key rotation.
Implementation
| Key Type | Rotation Frequency |
|---|---|
| API Keys (agents) | Semi-annually |
| Application Keys | Quarterly |
| Compromised keys | Immediately |
#!/bin/bash
# Key rotation script
# Create new API key
NEW_KEY=$(curl -X POST "https://api.datadoghq.com/api/v1/api_key" \
-H "DD-API-KEY: ${CURRENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${APP_KEY}" \
-H "Content-Type: application/json" \
-d '{"name": "prod-agents-'$(date +%Y%m%d)'"}' \
| jq -r '.api_key.key')
# Update agents with new key
# Deploy configuration with new key
# Verify metrics flowing with new key
# Revoke old key
curl -X DELETE "https://api.datadoghq.com/api/v1/api_key/${OLD_KEY_ID}" \
-H "DD-API-KEY: ${NEW_KEY}" \
-H "DD-APPLICATION-KEY: ${APP_KEY}"
2.3 Configure IP Allowlisting for API
Profile Level: L2 (Hardened) NIST 800-53: AC-3(7)
Description
Restrict API access to known IP ranges.
ClickOps Implementation
- Navigate to: Organization Settings → Access → Login Methods
- Configure: IP Allowlist for UI access
- For API: Use network policies/firewalls to restrict source IPs
3. Agent Security
3.1 Secure Agent Configuration
Profile Level: L1 (Baseline) NIST 800-53: CM-7
Description
Harden Datadog Agent deployment.
Implementation
# datadog.yaml - Security hardened configuration
# API key from environment variable (not hardcoded)
api_key: ${DD_API_KEY}
# Restrict local listening
bind_host: localhost
cmd_port: 5001
# Disable unnecessary features
apm_config:
enabled: false # Enable only if using APM
# Log collection (if enabled)
logs_enabled: true
logs_config:
# Mask sensitive data
processing_rules:
- type: mask_sequences
name: mask_credit_cards
pattern: '\b(?:\d{4}[-\s]?){3}\d{4}\b'
replace_placeholder: "[MASKED_CC]"
- type: mask_sequences
name: mask_ssn
pattern: '\b\d{3}-\d{2}-\d{4}\b'
replace_placeholder: "[MASKED_SSN]"
# Security settings
security_config:
runtime_security_config:
enabled: false # Enable for CWS
Step 2: Secure Agent Credentials
- Use secrets management for API keys
- Never commit keys to version control
- Use environment variables or secret stores
3.2 Network Policy for Agents
Profile Level: L2 (Hardened) NIST 800-53: SC-7
Description
Restrict agent network communications.
Kubernetes NetworkPolicy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: datadog-agent-egress
spec:
podSelector:
matchLabels:
app: datadog-agent
policyTypes:
- Egress
egress:
# Allow Datadog intake endpoints
- to:
- ipBlock:
cidr: 0.0.0.0/0
ports:
- protocol: TCP
port: 443
4. Data Security
4.1 Configure Log Data Masking
Profile Level: L1 (Baseline) NIST 800-53: SC-28
Description
Mask sensitive data in logs before ingestion.
ClickOps Implementation
Step 1: Configure Pipeline Processors
- Navigate to: Logs → Configuration → Pipelines
- Create processor for sensitive data:
- Type: Grok Parser + Remapper
- Pattern: Match sensitive fields
- Action: Mask or remove
Step 2: Configure Sensitive Data Scanner
- Navigate to: Compliance → Sensitive Data Scanner
- Enable rules for:
- Credit card numbers
- Social Security Numbers
- API keys/passwords
- Action: Mask or redact
4.2 Log Retention and Access
Profile Level: L1 (Baseline) NIST 800-53: SI-12
Description
Configure appropriate log retention and access controls.
ClickOps Implementation
Step 1: Configure Log Indexes
- Navigate to: Logs → Configuration → Indexes
- Create separate indexes:
security-logs(longer retention)application-logs(standard retention)debug-logs(short retention)
Step 2: Configure Index Permissions
- Navigate to: Organization Settings → Roles
- Configure role permissions for log indexes
- Restrict sensitive indexes to security team
5. Monitoring & Detection
5.1 Security Monitoring
Profile Level: L1 (Baseline) NIST 800-53: SI-4
Description
Configure Datadog Security Monitoring for threat detection.
ClickOps Implementation
Step 1: Enable Cloud SIEM
- Navigate to: Security → Security Monitoring
- Enable: Cloud SIEM
- Configure log sources
Step 2: Enable Detection Rules
- Navigate to: Security → Detection Rules
- Enable relevant rules:
- AWS CloudTrail
- GCP Audit Logs
- Azure Activity Logs
Step 3: Configure Security Signals
- Create monitors for high-severity signals
- Configure notification channels
- Set up automated response (if using Workflow Automation)
5.2 Audit Trail
Profile Level: L1 (Baseline) NIST 800-53: AU-2, AU-3
Description
Enable and monitor Datadog audit trail.
ClickOps Implementation
Step 1: Access Audit Trail
- Navigate to: Organization Settings → Audit Trail
- Review events:
- Authentication
- Configuration changes
- API key operations
Step 2: Export to SIEM
- Enable: Audit Trail Logs
- Forward to log index for retention
- Create monitors for critical events
6. Compliance Quick Reference
SOC 2 Mapping
| Control ID | Datadog Control | Guide Section |
|---|---|---|
| CC6.1 | SSO enforcement | 1.1 |
| CC6.2 | RBAC | 1.2 |
| CC7.2 | Audit trail | 5.2 |
Appendix A: References
Official Datadog Documentation:
Changelog
| Date | Version | Maturity | Changes | Author |
|---|---|---|---|---|
| 2025-12-14 | 0.1.0 | draft | Initial Datadog hardening guide | Claude Code (Opus 4.5) |