Security
Protecting backup data, configurations, and operations through identity management, encryption, access controls, and audit logging — with the same rigour applied to production Kafka data.
Backups contain a complete copy of your Kafka data. A compromised backup is as damaging as a compromised production cluster. The Security pillar ensures that every layer of your backup architecture — from credentials and network paths to storage buckets and audit trails — is hardened, monitored, and regularly reviewed.
Design Principles
- Implement strong identity foundation — Apply the principle of least privilege to every service account, IAM role, and operator that interacts with backup infrastructure.
- Enable traceability — Audit-log every backup, restore, and configuration change so you can answer who did what, when, where, and with what outcome.
- Apply security at all layers — Secure data in transit, at rest, at the access layer, and inside configuration files. No single control should be the only line of defence.
- Automate security best practices — Rotate credentials on a schedule, scan configurations for drift, and enforce policies via code rather than manual checklists.
- Protect data at rest with encryption — Encrypt all backup data using customer-managed keys where compliance demands it, and verify encryption status continuously.
- Prepare for security events — Maintain runbooks for credential revocation, backup quarantine, and forensic investigation so the team can respond quickly to incidents.
Best Practices
SEC-01: Identity & Access Management
Effective IAM starts with dedicated service accounts scoped to the minimum permissions each operation requires.
Least-Privilege Role Separation
| Role | Storage Access | Kafka Access |
|---|---|---|
| Backup | Write-only to storage | Read-only from source Kafka |
| Restore | Read-only from storage | Write to target Kafka |
| Validate | Read-only from storage | None |
Use IAM roles (AWS), managed identities (Azure), or workload identity (GCP) instead of static credentials. These provide automatic credential rotation and eliminate the risk of leaked long-lived keys.
Enterprise: Role-Based Access Control
Enterprise editions support RBAC for multi-team environments, allowing administrators to grant granular permissions per team, topic pattern, or environment.
Configuration: AWS IAM Policy
Backup role — write-only storage with read-only Kafka:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BackupWriteOnly",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-kafka-backups",
"arn:aws:s3:::my-kafka-backups/*"
]
}
]
}
Restore role — read-only storage:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestoreReadOnly",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-kafka-backups",
"arn:aws:s3:::my-kafka-backups/*"
]
}
]
}
Anti-Patterns
- Admin credentials for backup operations — Over-privileged accounts increase blast radius if compromised.
- Same IAM role for backup and restore — Violates least privilege; a compromised backup process could overwrite or delete data.
- Static access keys — Long-lived keys are a top cause of cloud security incidents.
- No environment separation — Production and staging sharing credentials or storage accounts.
SEC-02: Data Protection at Rest
All backup data must be encrypted at rest, with key management appropriate to your compliance requirements.
Server-Side Encryption Options
| Cloud | Default | Customer-Managed Key |
|---|---|---|
| AWS S3 | SSE-S3 (AES-256) | SSE-KMS / SSE-C |
| Azure Blob | Microsoft-managed keys | Customer-managed keys (CMK) |
| GCS | Google-managed keys | Customer-managed encryption keys (CMEK) |
Enterprise: Client-Side Encryption
Enterprise editions support client-side AES-256 encryption, ensuring data is encrypted before it leaves the backup process — providing defence-in-depth even if storage-layer encryption is misconfigured.
For regulated industries (finance, healthcare), use customer-managed keys (CMK/CMEK) with automatic key rotation. Combine with S3 Object Lock or Azure immutable storage to protect against tampering and ransomware.
Configuration: S3 with KMS Encryption
storage:
type: s3
s3:
bucket: my-kafka-backups
region: eu-west-1
encryption:
type: aws:kms
kms_key_id: arn:aws:kms:eu-west-1:123456789012:key/abcd-1234
Configuration: Enterprise Client-Side Encryption
storage:
type: s3
s3:
bucket: my-kafka-backups
region: eu-west-1
encryption:
enabled: true
algorithm: AES-256
key_provider: aws-kms
kms_key_id: arn:aws:kms:eu-west-1:123456789012:key/abcd-1234
Anti-Patterns
- Unencrypted storage buckets — Backup data readable by anyone with network access to the storage layer.
- Default S3 encryption without key management — SSE-S3 encrypts data but Amazon manages the keys; insufficient for regulatory requirements that mandate customer-controlled keys.
- Public buckets — S3 buckets or Azure containers with public access enabled, exposing backup data to the internet.
SEC-03: Data Protection in Transit
Encrypt all data moving between Kafka, the backup process, and cloud storage.