On June 20, 2024, the Indonesian government faced its worst digital nightmare in history.
Brain Cipher ransomware β a new variant of LockBit 3.0 β successfully encrypted the entire infrastructure of the Temporary National Data Center (PDNS), operated by the Ministry of Communication and Information Technology.
The result?
β 230+ government services PARALYZED
β Airports forced to rely on MANUAL processes
β Ransom demand: USD 8,000,000
β Data that had a backup: < 2%
β Recovery time: WEEKS
And the root cause wasn't sophisticated malware β it was having no backup at all.
"The most sophisticated ransomware in the world is powerless against a well-tested backup."
This article rebuilds that scenario as a resilient reference architecture on AWS β complete with code, runbooks, and cost calculations.
STEP 2 β Create S3 Bucket with Object Lock (WORM)
β οΈ IMPORTANT: S3 Object Lock can only be enabled when a bucket is first created. It cannot be added after the bucket exists.
2A. Create Bucket in Jakarta
Confirm active region: ap-southeast-3 (Jakarta).
Search for S3 in the top search bar β click S3.
Click the Create bucket button.
Fill in the bucket configuration:
Parameter
Value
Security Rationale
Bucket name
pdns-immutable-backup-[your-account-number]
Must be globally unique across AWS
AWS Region
Asia Pacific (Jakarta) ap-southeast-3
Primary production region
Object Ownership
ACLs disabled (recommended)
Access controlled exclusively via IAM policies
Block Public Access
Block all public access (All checkboxes checked)
Completely prevents unauthorized public exposure
Bucket Versioning
Enable
Mandatory technical prerequisite for Object Lock
Default Encryption
SSE-KMS
Server-side encryption with Customer Managed Key (CMK)
KMS Key
Select pdns-backup-key
Uses Jakarta CMK created in Step 1
Bucket Key
Enable
Reduces KMS API call costs by up to 99%
Object Lock
Enable β
Enables WORM (Write Once, Read Many) capability
Under Advanced settings β Object Lock, check Enable and acknowledge the confirmation dialog.
Click Create bucket.
2B. Configure Default Retention (Compliance Mode)
Click the name of the newly created bucket (pdns-immutable-backup-...).
Go to the Properties tab.
Scroll down to Object Lock β click Edit.
Fill in the default retention settings:
Parameter
Value
Security Impact
Default retention
Enable
Automatically applied to all newly stored objects
Default retention mode
Compliance β οΈ
Absolute protection β objects cannot be deleted by anyone, including Root and AWS Support
Retention period
30 Days
Minimum 30-day immutability window for ransomware defense
Click Save changes.
π΄ Critical Note: In Compliance Mode, no user (not even the root account or AWS Support) can delete objects or overwrite them until the 30-day retention period has expired.
2C. Add Lifecycle Rule (Auto-transition to Glacier)
In the same bucket, click the Management tab.
Click the Create lifecycle rule button.
Fill in the lifecycle configuration:
Parameter
Value
Optimization Purpose
Lifecycle rule name
move-to-glacier-after-90-days
Policy identifier
Filter scope
Apply to all objects in the bucket
Covers all historical backup archives
Lifecycle rule actions
Check: Transition current versions of objects between storage classes
Moves older objects to colder tiers
Storage class transition
Glacier Flexible Retrieval
Low-cost cold archival storage
Days after object creation
90
Automatic migration after 90 days
Acknowledge the cost transition dialog if prompted β click Create rule.
STEP 3 β AWS Backup Vault + Vault Lock
3A. Create Backup Vault in Jakarta
Confirm active region: ap-southeast-3 (Jakarta).
Search for AWS Backup in the search bar β click AWS Backup.
In the left navigation menu, click Backup vaults.
Click Create backup vault.
Fill in the configuration:
Parameter
Value
Description
Backup vault name
pdns-immutable-vault
Primary backup vault in Jakarta
Encryption key
Select pdns-backup-key
Uses Jakarta KMS key from Step 1
Tags
Key: Environment, Value: Production
Environment metadata classification
Click Create backup vault.
3B. Enable Vault Lock
β οΈ There is a 72-hour grace period. During the first 3 days, Vault Lock can still be modified or deleted. After that period, it becomes PERMANENT and cannot be deleted or bypassed by anyone, including AWS.
On the pdns-immutable-vault page, click the Vault Lock tab.
Click Configure Vault Lock.
Fill in the parameters:
Parameter
Value
Security Boundary
Vault Lock mode
Compliance
Permanent compliance mode (WORM Vault)
Min retention period
7 Days
Snapshots cannot be deleted before 7 days
Max retention period
365 Days
Upper bound for snapshot retention in the vault
Grace period
72 Hours (Default)
Evaluation period before the lock becomes irreversible
In Security Hub, click Integrations in the left menu.
Type GuardDuty in the search box.
Click Accept findings on the Amazon GuardDuty integration card.
Confirm acceptance.
6C. Setup Ransomware Insight
In the left menu, click Insights β click Create insight.
Configure the custom insight:
Parameter
Value
Description
Insight name
Ransomware-Risk-Indicators
Custom security analytical filter
Filter 1
Product name = GuardDuty
Focuses on GuardDuty intelligence
Filter 2
Severity label = HIGH, CRITICAL
Filters for severe and fatal threats
Filter 3
Workflow status = NEW
Displays active unaddressed incidents
Group by
Resource ID
Aggregates findings per impacted asset
Click Create insight.
STEP 7 β AWS CloudTrail (Audit Log)
7A. Create CloudTrail Trail
Search for CloudTrail in the search bar β open CloudTrail.
In the left menu, click Trails β click Create trail.
Fill in the trail parameters:
Parameter
Value
Forensic & Security Rationale
Trail name
pdns-full-audit-trail
Master audit trail name
Storage location
Create new S3 bucket
Dedicated S3 bucket for audit records
Trail log bucket name
pdns-cloudtrail-logs-[account-number]
Unique audit bucket name
Log file SSE-KMS encryption
Enabled
Encrypts all stored log archives
AWS KMS alias
Select pdns-backup-key
Uses Jakarta CMK
Log file validation
Enabled β
Generates cryptographic hashes to detect log tampering
CloudWatch Logs
Enabled
Streams events to CloudWatch for near real-time alerting
Log group name
/aws/cloudtrail/pdns-audit
Dedicated CloudWatch log group
Multi-region trail
Yes β
Captures API actions across all AWS regions
Click Next.
7B. Select Events to Log
Under Events:
Check: β Management events (Read + Write)
Check: β Data events
Under Data events, click Add data event type:
Data event type: S3 β All current and future S3 buckets β Read + Write
Click Add data event type again:
Data event type: Lambda β All current and future functions
Click Next β review settings β click Create trail.
STEP 8 β AWS Elastic Disaster Recovery (DRS)
8A. Initialize DRS in Recovery Region
Switch region to ap-southeast-1 (Singapore).
Search for Elastic Disaster Recovery in the search bar β click AWS Elastic Disaster Recovery.
Click Set up Elastic Disaster Recovery / Get started.
Configure Default replication settings:
Parameter
Value
Technical Rationale
Staging area subnet
Public Subnet in ap-southeast-1b
Subnet where lightweight replication servers run
Security groups
pdns-drs-replication-sg
Security group governing replication traffic
Instance type
t3.small
Cost-effective instance for replication servers
EBS encryption
Custom β select pdns-recovery-key
Ensures encrypted staging storage in DR region
Create public IP
Yes
Required for cross-region replication traffic over the internet
π‘ Architectural Recommendation: Before initializing DRS, create a dedicated VPC in Singapore named pdns-recovery-vpc (10.10.0.0/16) with 1 Public Subnet in AZ ap-southeast-1b and an active Internet Gateway.
Create Security Group pdns-drs-replication-sg in Singapore with:
Inbound: Port TCP 1500 from 0.0.0.0/0(incoming block-level data replication from Jakarta)
Outbound: All traffic (Default)
Click Next.
8B. Configure Point-in-Time (PIT) Recovery
Under Point-in-time recovery:
Click Add rule
Snapshot retention (in days): 7 days
Click Next β click Create.
8C. Install DRS Agent on Production Server
DRS Agent installation is conducted via AWS Systems Manager Session Manager (no SSH port 22 required).
DRS Replication Topology
[Jakarta - ap-southeast-3] [Singapore - ap-southeast-1]
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β PRODUCTION EC2 β β DRS Replication Server β
β β Install DRS Agent ββreplicateββΊβ (created AUTOMATICALLY β
β on this server β (Port 1500)β by AWS DRS, not manually) β
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
SOURCE (Origin) TARGET (Recovery)
Step 1 β Create Production EC2 in Jakarta (if not yet exists)
Confirm region: ap-southeast-3 (Jakarta).
Go to EC2 β Instances β Launch instances.
Fill in the instance configuration:
Parameter
Value
Critical Note
Name
pdns-prod-server-01
Production instance identifier
AMI
Amazon Linux 2023
SSM Agent pre-installed
Instance type
t3.medium
β οΈ Minimum t3.medium β t3.micro (1 GiB RAM) is insufficient for DRS Agent
Storage (EBS)
20 GiB
β οΈ Minimum 20 GiB β 8 GiB is too small for OS + Agent download
Key pair
Proceed without key pair
Access via Session Manager (no SSH required)
Auto-assign public IP
Enable
Required for internet connectivity
IAM instance profile
EC2-SSM-SessionManager-Role
Attach role created in Step 2 below
Tags
Key: Environment, Value: Production
Required for automated backup by the Backup Plan
Click Launch instance.
Step 2 β Create IAM Role for EC2 (SSM + DRS)
Go to IAM β Roles β Create role.
Select AWS service β Use case: EC2 β click Next.
Add the following statement inside the Statement array before the closing ]:
{"Sid":"Allow DRS Service to use this key","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::[YOUR-ACCOUNT-ID]:role/aws-service-role/drs.amazonaws.com/AWSServiceRoleForElasticDisasterRecovery"},"Action":["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey","kms:GenerateDataKeyWithoutPlaintext","kms:DescribeKey","kms:CreateGrant","kms:ReEncrypt*"],"Resource":"*"}
(Replace [YOUR-ACCOUNT-ID] with your 12-digit AWS account ID). Click Save changes.
Step 6 β Verify Instance Readiness in Fleet Manager
Open Systems Manager β Fleet Manager in region ap-southeast-3 (Jakarta).
Wait 3β5 minutes after attaching the IAM role.
Refresh the page until pdns-prod-server-01 appears with status: Online β .
Possible Cause
Recommended Solution
IAM Role not yet attached
Verify and attach EC2-SSM-SessionManager-Role in EC2 Security tab
Wait until execution completes (~10β20 minutes). Installation stages:
Stage
Terminal Output
Estimated Duration
Volume detection
All volumes were successfully identified.
~30 seconds
Agent download
Downloading the AWS Replication Agent... Finished.
~3β5 minutes
Agent install
Installing the AWS Replication Agent onto the source server...
~5β10 minutes
Complete
The AWS Replication Agent was successfully installed.
Complete
Command 5 β Enable agent auto-start on reboot:
sudo systemctl enable aws-replication-agent
8D. Verify Replication Status
Switch region to ap-southeast-1 (Singapore).
Open Elastic Disaster Recovery β Source servers.
Inspect the Data replication status column:
Status
Indicator
Meaning
Required Action
Initiating
π‘ Yellow
Agent recently connected
Wait for handshake
Initial sync
π΅ Blue
First synchronization in progress
Wait until 100%
Continuous
π’ Green
β Active replication, RPO < 1 minute
β Done & protected!
Disconnected
π΄ Red
Network or agent connectivity lost
Check outbound port 1500 and agent service
8E. Configure Launch Template for Recovery
In DRS left menu, click Launch settings.
Select the source server β click Edit.
Configure the launch template:
Parameter
Value
Rationale
Launch disposition
Stopped
Cost optimization; recovered instance started manually during DR
Target subnet
Subnet in pdns-recovery-vpc
Places recovery VM in isolated network
Security groups
Recovery Security Group
Governs recovery firewall rules
Instance type
Match production (t3.medium)
Ensures equivalent compute capacity
Click Save template.
note : If you've achieved 100% replication or the status is green, you can proceed to 8E. In my case, it didn't reach the green status because my internet connection is slow.
π° Estimated Monthly Architecture Cost
AWS Service
Assumed Capacity & Workload
Estimated Cost / Month
Business Value & Protection
AWS Backup
1 TB Backup storage in Jakarta + cross-region copy to Singapore
~$80
Protects database snapshots & EBS volumes
S3 Object Lock (WORM)
5 TB Immutable data storage (Standard + Glacier)
~$115
Data archives cannot be deleted or modified by attackers
AWS Elastic DRS
5 Production servers continuously replicated to Singapore
2 Customer Managed Keys (Jakarta & Singapore) + API calls
~$20
Independent cryptographic key isolation per region
TOTAL ESTIMATED COST
Complete Ransomware-Resilient DR Architecture
~$545 / Month
Insurance against tens of millions of dollars in losses
π‘ Cost vs. Impact: In the June 2024 PDNS ransomware incident, attackers demanded an $8,000,000 ransom while disrupting 230+ public agencies for weeks. The prevention and resilience architecture documented here costs only ~$545/month.
Top comments (0)