Observability Security¶
This document covers security best practices for observability stacks.
Threat Model¶
Attack Vectors¶
- Data Exfiltration: Unauthorized access to telemetry data
- Data Injection: Malicious data injected into observability pipeline
- Denial of Service: Overwhelming observability infrastructure
- Privilege Escalation: Gaining unauthorized access
Network Security¶
Network Segmentation¶
Kubernetes Network Policies:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: observability-isolation
spec:
podSelector:
matchLabels:
component: observability
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: default
ports:
- protocol: TCP
port: 4317
egress:
- to:
- namespaceSelector:
matchLabels:
name: observability
Firewall Rules¶
- Restrict access to observability endpoints
- Allow only necessary ports
- Block external access to internal services
Transport Security¶
TLS/SSL¶
Collector TLS Configuration:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
tls:
cert_file: /etc/certs/server.crt
key_file: /etc/certs/server.key
client_ca_file: /etc/certs/ca.crt # mTLS
Exporter TLS Configuration:
exporters:
otlp/jaeger:
endpoint: jaeger:4317
tls:
cert_file: /etc/certs/client.crt
key_file: /etc/certs/client.key
insecure_skip_verify: false
Certificate Management¶
- Use Certificates: Never use self-signed in production
- Rotate Certificates: Regular rotation schedule
- Certificate Authority: Use trusted CA
- mTLS: Enable mutual TLS where possible
Authentication and Authorization¶
API Keys¶
Seq API Key:
Best Practices: - Store in secrets management - Rotate regularly - Use least privilege - Audit key usage
OAuth2 / JWT¶
Implementation: - Use service mesh for mTLS - Implement OAuth2 for API access - Validate JWT tokens - Use short-lived tokens
RBAC¶
Kubernetes RBAC:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: observability-reader
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["otel-collector-config"]
verbs: ["get"]
Data Protection¶
PII Redaction¶
Processor Configuration:
processors:
attributes:
actions:
- key: user.email
action: delete
- key: user.credit_card
action: delete
Best Practices: - Identify PII in telemetry - Redact before export - Document redaction policies - Regular audits
Data Masking¶
Example:
Encryption at Rest¶
Storage Encryption: - Enable encryption for Elasticsearch - Encrypt Prometheus storage - Use encrypted volumes - Key management
Encryption in Transit¶
- Always use TLS
- Enable mTLS where possible
- Use strong cipher suites
- Regular cipher suite updates
Access Control¶
Principle of Least Privilege¶
- Minimal Permissions: Grant only necessary permissions
- Role-Based Access: Use roles, not individual permissions
- Regular Reviews: Audit and review permissions
- Remove Unused: Remove unused accounts/permissions
Audit Logging¶
Enable Audit Logs: - Log all access to observability data - Log configuration changes - Log authentication attempts - Regular audit log reviews
Secrets Management¶
Kubernetes Secrets¶
apiVersion: v1
kind: Secret
metadata:
name: observability-secrets
type: Opaque
stringData:
seq-api-key: <api-key>
azure-connection-string: <connection-string>
Best Practices: - Use sealed secrets or external secrets operator - Rotate secrets regularly - Encrypt secrets at rest - Limit secret access
External Secrets¶
Azure Key Vault: - Store secrets in Key Vault - Use managed identities - Rotate secrets automatically
AWS Secrets Manager: - Store secrets in Secrets Manager - Use IAM roles - Enable automatic rotation
Vulnerability Management¶
Container Security¶
- Base Images: Use minimal base images
- Image Scanning: Scan for vulnerabilities
- Regular Updates: Keep images updated
- Non-Root: Run as non-root user
Dependency Management¶
- Dependency Scanning: Regular scans
- Update Dependencies: Keep updated
- Vulnerability Database: Monitor CVEs
- Patch Management: Rapid patching
Incident Response¶
Detection¶
- Monitoring: Monitor for anomalies
- Alerts: Set up security alerts
- Log Analysis: Regular log reviews
- Threat Intelligence: Use threat feeds
Response¶
- Isolation: Isolate affected systems
- Investigation: Investigate incidents
- Remediation: Fix vulnerabilities
- Documentation: Document incidents
Compliance¶
GDPR¶
- Data Minimization: Collect only necessary data
- Right to Erasure: Ability to delete data
- Data Portability: Export data capability
- Privacy by Design: Build privacy in
SOC 2¶
- Access Controls: Implement access controls
- Audit Logs: Maintain audit logs
- Encryption: Encrypt data
- Monitoring: Monitor security events
HIPAA¶
- PHI Protection: Protect health information
- Access Controls: Strict access controls
- Audit Trails: Comprehensive audit trails
- Encryption: Encrypt PHI
Security Checklist¶
Deployment¶
- TLS enabled for all connections
- Network policies configured
- Secrets stored securely
- RBAC configured
- Non-root containers
- Resource limits set
- Health checks configured
Configuration¶
- PII redaction configured
- Authentication enabled
- Audit logging enabled
- Retention policies set
- Backup configured
- Monitoring enabled
Operations¶
- Regular security updates
- Vulnerability scanning
- Access reviews
- Incident response plan
- Security training
- Compliance audits
Further Reading¶
- Observability Production Patterns
- OpenTelemetry Collector
- Observability Stacks: Observability stack comparison and selection