AeroCartwright

Security & Disaster Recovery for Your ODX Cloud

Production security for WebODM on AWS: IAM, VPC isolation, S3 bucket policies, encryption at rest/transit, tested backup and recovery procedures.

Eric

By · M.S. GIS, FAA Part 107

Published · 26 min read

A heavy steel door with a key in its lock stands half open onto rows of server racks with green status lights, and a padlocked metal case waits on a cart beside it. An illustration, not a photograph.
  • Library ODM Cloud
  • Station Process
  • Series Part 10 of 11
  • Published Nov 19, 2026
Security & Disaster Recovery for Your ODX Cloud

ODM Cloud Series — Crawl / Walk / Run  ·  Article 10 of 10

From zero to a self-hosted cloud processing pipeline

This series builds a production WebODM setup from scratch — starting with the ecosystem fundamentals, moving through AWS spot instance setup and cost control, and finishing with auto-scaling, security, and a head-to-head comparison with commercial platforms. Each article stands alone; read in order to build the full stack.

Pricing note: AWS prices change. The NAT gateway, KMS and Secrets Manager figures below were checked against AWS’s pricing pages on November 11, 2026, for US East (Ohio). Verify them before you make infrastructure decisions.

Monday morning: you log in and something’s wrong. CloudTrail shows two EC2 instances you didn’t launch. Your billing alarm fired. Someone is using your infrastructure.

This article is insurance. Security configuration that makes this scenario less likely, and disaster recovery procedures for when — not if — something breaks.

It secures the auto-scaling layout from part 8 of this series. An always-on static node runs ClusterODX, WebODM’s fork of OpenDroneMap’s ClusterODM. WebODM runs there too if you use it. Spot NodeODX workers (WebODM’s fork of NodeODM) launch in the same public subnet. A processing bucket takes uploads and backups, and a dedicated bucket takes results. The VPC section also shows an optional hardening step part 8 doesn’t take, moving workers to a private subnet behind a NAT gateway, along with what it costs. If you run a single public instance, as in the early parts of the series, the IAM, S3, encryption and backup sections still apply; skip the VPC section.

Hardened variant of the part 8 network — public subnet with WebODM UI and ClusterODX reachable only from the office IP; private subnet with NodeODX workers reachable only from ClusterODX; private subnet with RDS PostgreSQL; NAT gateway for worker outbound traffic; S3 bucket with Block All Public Access
The optional hardened variant. Part 8 keeps workers in the public subnet with no NAT gateway; this diagram moves them to a private subnet. Public Subnet A (10.0.1.0/24) holds WebODM UI on :8000 and ClusterODX on :3000, with SSH and the UI restricted to your office IP. Private Subnet A (10.0.2.0/24) holds NodeODX workers: no route from the internet, inbound only from ClusterODX (22, 2376, 3000), outbound through the NAT gateway (logged if you enable VPC Flow Logs). Private Subnet B (10.0.3.0/24) holds an optional RDS PostgreSQL database. The S3 bucket has Block Public Access on and default SSE-S3 encryption.

IAM least privilege: The foundation

Every component that calls AWS needs credentials. Bad: long-lived access keys pasted into config files and environment variables. Good: an IAM role per instance type, attached through an instance profile, so the instance gets short-lived credentials that AWS rotates for you. AWS’s own S3 security best practices recommend exactly this.

There’s one place in this stack where you can’t avoid a long-lived key, and it matters for everything below. ClusterODX’s AWS provider is configured with an accessKey and secretKey for “an IAM account for ClusterODX to use, which has EC2 and S3 permissions” (ClusterODX AWS docs). Its provider source then starts NodeODX on every new worker with that same key (--s3_access_key, --s3_secret_key). So whoever controls a worker can read the ClusterODX key, and the key can launch and terminate instances. Plan for that: scope the key tightly, and rotate it after any incident.

Here’s what each identity needs, and nothing more.

1. Static node role (ClusterODX host, plus WebODM if it runs there):

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListProcessingBucket",
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::your-processing-bucket"
    },
    {
      "Sid": "ReadWriteProcessingBucket",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::your-processing-bucket/*"
    },
    {
      "Sid": "ReadDbSecret",
      "Effect": "Allow",
      "Action": "secretsmanager:GetSecretValue",
      "Resource": "arn:aws:secretsmanager:us-east-2:ACCOUNT:secret:webodm/db-password-??????"
    },
    {
      "Sid": "WriteOwnLogGroup",
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:us-east-2:ACCOUNT:log-group:/webodm/static:*"
    },
    {
      "Sid": "PublishOwnMetrics",
      "Effect": "Allow",
      "Action": "cloudwatch:PutMetricData",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "cloudwatch:namespace": "ODM/Processing"
        }
      }
    }
  ]
}

This is the WebODM side. Part 8 gives the same host a narrower set of grants for its intake pipeline: read incoming/*, write clusterodx-backups/*, consume one SQS queue, and read the autoscaler keys from Parameter Store. If you don’t run WebODM on the host, use part 8’s grants instead of the bucket-wide read/write above.

A few details that are easy to get wrong:

  • s3:ListBucket applies to the bucket ARN; object actions apply to bucket/*. Putting ListBucket on a prefix path grants nothing.
  • Secrets Manager appends six random characters to every secret’s ARN. The -?????? wildcard matches exactly those six and nothing longer (Secrets Manager docs).
  • Log writes authorize on the log stream, so the ARN needs the :* suffix (CloudWatch Logs IAM examples). Create the log group once as an admin, and the role never needs logs:CreateLogGroup.
  • PutMetricData has no resource ARN, so the cloudwatch:namespace condition is what keeps it to one namespace. logs:* and cloudwatch:* on * would let a compromised node delete your log groups and alarms. That’s the evidence you need after an incident.
  • No rds-db:connect. WebODM logs in to PostgreSQL with a password. If you switch RDS to IAM database authentication, the resource is not the DB instance ARN. It’s arn:aws:rds-db:us-east-2:ACCOUNT:dbuser:DbiResourceId/db-user-name, built from the instance’s resource ID (RDS docs).

Store the database password in Secrets Manager, not in code. The role retrieves it at runtime:

aws secretsmanager get-secret-value \
  --region us-east-2 \
  --secret-id webodm/db-password \
  --query SecretString \
  --output text

2. ClusterODX access key (a dedicated IAM user):

This key launches and terminates workers, and NodeODX on each worker uses it to upload results. Part 8 lists its full policy. The EC2 statements there follow the calls in docker-machine’s amazonec2 driver, which ClusterODX uses to provision nodes. Four points matter for security.

S3: write-only, to a dedicated results bucket. The only S3 call in ClusterODX’s libs/S3.js is a putObject of test.txt at startup. NodeODX’s libs/S3.js writes the same test file and then uploads results with the SDK’s multipart Upload. Neither reads or lists anything. So the key gets only this:

{
  "Sid": "WriteResultsOnly",
  "Effect": "Allow",
  "Action": ["s3:PutObject", "s3:AbortMultipartUpload"],
  "Resource": "arn:aws:s3:::your-odx-results/*"
}

Results land at the bucket root (<task-uuid>/all.zip), so the key can’t be confined to a prefix. That’s why it gets a bucket of its own. Keep it away from your-processing-bucket, which holds uploads and the backups/db/ dumps. A leaked worker key can then overwrite results, but it can’t read client imagery or your database backups.

Terminate: the tag condition limits accidents, not attackers. Part 8 allows ec2:TerminateInstances only on instances tagged type=clusterodx, following AWS’s EC2 example policies. It also has to allow ec2:CreateTags. For Spot requests, the docker-machine driver tags the instance with a separate CreateTags call after RunInstances (amazonec2.go). Anyone holding the key can therefore tag any instance in the account type=clusterodx, then terminate it. The condition stops a misconfigured ClusterODX from killing your static node. It doesn’t stop someone who has the key and means harm. Real separation means running the cluster in its own AWS account, so the key can’t see anything else.

Set the tag explicitly. "tags": ["type,clusterodx"] appears in the example config in ClusterODX’s docs. The provider’s built-in default is ["clusterodx"]. docker-machine reads tags as key,value pairs and skips the odd element, so the default creates no type tag at all, and a tag-conditioned terminate rule would then deny every termination. Put "tags": ["type,clusterodx"] in your config.

Two more config settings. Set "acl": "none" in the s3 block. ClusterODX’s docs warn that without it, uploads default to public-read, which Block Public Access rejects. Set "usePrivateAddress": true so ClusterODX reaches workers on their private IPs. On the ClusterODX server itself, set public-address to the static node’s private IP, as part 8 does (http://10.0.1.10:3000 in its example). Workers use that address for the task-complete webhook and for split-merge.

3. Workers: no instance role.

Stock NodeODX writes to S3 with the ClusterODX key, not with an instance role. Follow part 8 and leave the provider’s iamrole option unset. Each node already holds the key, so an instance profile would add a second credential and no protection.

4. Self-terminating processing instance (part 7):

Part 7’s shutdown script publishes an SNS message and then terminates its own instance. Publishing needs one statement on one topic (SNS policy examples):

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "NotifyOneTopic",
      "Effect": "Allow",
      "Action": "sns:Publish",
      "Resource": "arn:aws:sns:us-east-2:ACCOUNT:processing-complete"
    }
  ]
}

Self-termination needs no IAM permission if you do it the other way. Set the instance’s shutdown behavior to terminate at launch, and end the script with sudo shutdown -h now instead of aws ec2 terminate-instances. A shutdown from inside the OS then terminates the instance. If you keep the API call, scope ec2:TerminateInstances with an aws:ResourceTag condition. Never grant it on *.


VPC architecture: Security groups first, private subnets optional

Network isolation is critical. The WebODM UI is reachable from your office. Processing nodes are internal. Never expose processing nodes.

Part 8’s layout (the baseline):

VPC 10.0.0.0/16
  Public subnet 10.0.1.0/24 (us-east-2a, route to an internet gateway)
    - Static node: ClusterODX (+ WebODM UI if you run it here)
    - Autoscaled NodeODX spot workers (public IP for outbound only;
      no inbound from the internet)

Workers sit in the public subnet so they can reach the internet without a NAT gateway. The security groups are what keep them unreachable from outside, so get them exactly right.

Security groups. These match part 8. Create both groups, with every rule, before ClusterODX launches its first node.

sg-clusterodx-host (static node)
  Inbound  22/tcp    from YOUR_OFFICE_IP/32     (SSH)
  Inbound  3000/tcp  from YOUR_OFFICE_CIDR      (ClusterODX, for WebODM and surveyors)
  Inbound  8000/tcp  from YOUR_OFFICE_CIDR      (WebODM UI, if it runs here)
  Inbound  3000/tcp  from odx-workers           (task-complete webhook, split-merge)
  Outbound all

odx-workers (autoscaled nodes; ClusterODX's config refers to it by name)
  Inbound  22/tcp    from sg-clusterodx-host    (docker-machine SSH)
  Inbound  2376/tcp  from sg-clusterodx-host    (docker-machine Docker API)
  Inbound  3000/tcp  from sg-clusterodx-host    (NodeODX API)
  Outbound all

The 22 and 2376 rules are not optional. When docker-machine launches a node, its amazonec2 driver checks the named group for rules on TCP 22 and TCP 2376. For any port without a rule, it adds one open to 0.0.0.0/0 (amazonec2.go, configureSecurityGroupPermissions). The driver only skips this with --amazonec2-security-group-readonly, and ClusterODX’s provider doesn’t pass that flag. So both ports must already have group-limited rules. Otherwise docker-machine opens SSH and the Docker API on every worker to the internet. Check the group after the first launch for rules you didn’t write.

ClusterODX’s docs require TCP 3000 from the ClusterODX host. The provider runs docker run -p 3000:3000 on each node over SSH. Workers call back to ClusterODX on 3000 because the provider passes each NodeODX a --webhook URL pointing at ClusterODX.

Outbound traffic: each worker needs the internet to install Docker, pull the NodeODX image from Docker Hub (webodm/nodeodx is ClusterODX’s default), and upload results to S3.

Optional hardening: private worker subnet + NAT gateway. Part 8 doesn’t do this. It’s the one change in this article that costs real money. Move the workers to a private subnet, 10.0.2.0/24, with no route from the internet. Their outbound traffic then goes through a NAT gateway in the public subnet, and a wrong security group rule can no longer expose a worker to the internet. The diagram above shows this variant. In the ClusterODX config, point subnet at the private subnet and set "assignPrivateAddressOnly": true (with usePrivateAddress) so nodes get no public IP. The security group rules stay the same.

The cost is at least $36.50 a month in us-east-2 ($32.85 in hourly fees plus $3.65 for the gateway’s public IPv4 address), plus $0.045 per GB through the gateway (worked out in the cost section below). Two additions are worth making if you do it:

  • An S3 gateway endpoint on the private route table. S3 uploads then bypass the NAT gateway’s per-GB charge, and gateway endpoints carry no additional charge.
  • VPC Flow Logs on the worker subnet, published to CloudWatch Logs or S3, at CloudWatch’s vended-log rates. A NAT gateway keeps no log of its own, and flow logs work the same in part 8’s public layout.

An optional RDS database, if you move WebODM’s database off the static node, belongs in a private subnet in either layout. It needs no internet route.


S3 bucket security: Public access prevention

S3 buckets are frequently misconfigured. One typo in a policy and your whole backlog is public.

So use layers. One policy mistake shouldn’t be enough to expose everything.

The commands below use your-processing-bucket, the bucket for uploads and backups. Apply the same Block Public Access, TLS policy and encryption settings to your-odx-results too.

Layer 1: Block Public Access (the control that actually blocks public reads)

S3 Block Public Access has four settings (AWS docs):

  • BlockPublicAcls rejects requests that set a public ACL.
  • IgnorePublicAcls makes S3 ignore any public ACL that already exists.
  • BlockPublicPolicy rejects a bucket policy that would grant public access.
  • RestrictPublicBuckets limits a bucket with a public policy to AWS services and your own account.
aws s3api put-public-access-block \
  --bucket your-processing-bucket \
  --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"

AWS recommends turning on all four at the account level as well (aws s3control put-public-access-block --account-id ACCOUNT ...). S3 applies the most restrictive combination of account and bucket settings, so account-level settings will also block the public static-site bucket from part 6 of this series. If you host public maps that way, keep Block Public Access at the bucket level on your processing bucket, and keep public maps in their own bucket.

A Deny statement in a bucket policy is not a substitute for this. A Deny on s3:GetObject for "Principal": "*" with no condition also blocks your own roles and every presigned URL. Add a condition and it no longer stops anonymous reads. Block Public Access is the tool built for this job.

Layer 2: Bucket policy that requires TLS

You don’t need a policy that demands an encryption header on uploads. Since January 5, 2023, S3 has encrypted every new object with SSE-S3 automatically, at no additional cost, and you can’t turn that off (default encryption FAQ). A Deny on PutObject without x-amz-server-side-encryption would only break things. Part 4’s aws s3 cp and aws s3 sync commands and the backup script below don’t send that header, so their uploads would fail with AccessDenied.

What is worth denying is plain HTTP. This is AWS’s TLS-only example policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "RestrictToTLSRequestsOnly",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::your-processing-bucket",
        "arn:aws:s3:::your-processing-bucket/*"
      ],
      "Condition": {
        "Bool": {
          "aws:SecureTransport": "false"
        }
      }
    }
  ]
}

The AWS CLI, the SDKs and presigned URLs all use HTTPS by default, so nothing in the series breaks.

Layer 3: Versioning

Versioning keeps the previous copy when an object is overwritten or deleted, so an accidental aws s3 rm can be undone.

aws s3api put-bucket-versioning \
  --bucket your-processing-bucket \
  --versioning-configuration Status=Enabled

aws s3api get-bucket-versioning --bucket your-processing-bucket

Skip MFA delete on this bucket. Only the root account can enable it, only through the CLI or API, and S3 doesn’t support lifecycle configuration on buckets with MFA delete enabled (MFA delete docs). Part 4’s storage-tiering rules and the backup expiry rule below would both stop working.

Versioning has a cost: noncurrent versions are billed until they expire. Add a NoncurrentVersionExpiration rule (shown in the backup section).

Verification (monthly):

aws s3api get-public-access-block --bucket your-processing-bucket
# Expect: all four settings true

aws s3api get-bucket-policy-status --bucket your-processing-bucket
# Expect: "IsPublic": false

aws s3api get-bucket-encryption --bucket your-processing-bucket
# Expect: SSEAlgorithm AES256 (or aws:kms if you chose SSE-KMS)

aws s3 ls s3://your-processing-bucket/ --no-sign-request
# Expect: an AccessDenied error. A file listing means the bucket is public.

--no-sign-request stops the CLI from loading credentials (CLI reference), so the last command is an anonymous request, the same as a stranger’s browser.


Encryption: At rest and in transit

At rest (S3 and EBS):

S3: SSE-S3 is already on for every new object, free, with no performance impact according to AWS. To use a KMS key instead, set SSE-KMS as the bucket default and turn on an S3 Bucket Key (bucket encryption docs). SSE-KMS is not free, even with the AWS-managed aws/s3 key. AWS doesn’t charge to create or store AWS-managed keys, but it does charge for every API request made to them (KMS pricing, Note 1). A Bucket Key cuts that request traffic, by up to 99 percent according to AWS.

aws s3api put-bucket-encryption \
  --bucket your-processing-bucket \
  --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"YOUR_KEY_ARN"},"BucketKeyEnabled":true}]}'

Changing the default only affects new objects. Uploads still don’t need a header.

EBS: turn on encryption by default once per Region. Every new volume, including the root volumes ClusterODX launches, is then encrypted with the AWS-managed aws/ebs key unless you choose another. Existing volumes aren’t changed.

aws ec2 enable-ebs-encryption-by-default --region us-east-2
aws ec2 get-ebs-encryption-by-default --region us-east-2

This is safer than adding Encrypted=true to each launch command, because the device name in a block device mapping has to match the AMI’s root device. It’s /dev/sda1 on some AMIs and /dev/xvda on others (device naming). Use the wrong one and you attach an extra encrypted volume while the root volume stays unencrypted. If you do set it per launch, read the name from the AMI first:

aws ec2 describe-images --image-ids ami-xxxxx --query 'Images[0].RootDeviceName' --output text

Don’t be thrown when the OS shows something else. On Nitro instances (T3, M5 and R5 are all Nitro types), Linux sees EBS volumes as NVMe devices: /dev/nvme0n1, /dev/nvme1n1 and so on, whatever name the mapping used (EBS and NVMe). The mapping name is for the EC2 API. The NVMe name is what lsblk shows.

In transit (TLS/HTTPS):

  • S3: the CLI and SDKs use HTTPS by default, and the bucket policy above rejects anything else.
  • Database: connect with sslmode=require (shown in the backup script).
  • Docker pulls: never add Docker Hub (or any registry) to Docker’s insecure-registries list.
  • WebODM UI: serve it over HTTPS, even when only the office can reach it.

KMS (optional):

If a client contract requires encryption keys you control, create a customer-managed KMS key. That’s $1/month per key, plus $0.03 per 10,000 requests beyond a free tier of 20,000 requests a month across all Regions. AWS-managed keys such as aws/s3 and aws/ebs have no monthly key charge (KMS pricing, checked 2026-11-11). For most drone mapping work, the AWS-managed defaults are enough.


Database backup and recovery

WebODM’s PostgreSQL database is small but critical: projects, tasks, user accounts and settings. In the stock Docker install it runs in the db container on the static node (WebODM docker-compose.yml); in the layout above it can live on RDS instead. Processed outputs are not in the database. They sit in WebODM’s media directory, so back those up separately (part 4 moves them to S3).

Daily backup (automated):

#!/bin/bash
# /usr/local/bin/backup-webodm-db.sh
set -euo pipefail
umask 077

DB_HOST="webodm-prod.crxxxxx.us-east-2.rds.amazonaws.com"
DB_NAME="webodm_prod"
DB_USER="webodm"
AWS_REGION="us-east-2"
S3_BUCKET="your-processing-bucket"   # never the ClusterODX results bucket
BACKUP_DIR="/var/backups/webodm"
DUMP="$BACKUP_DIR/webodm-$(date +%Y%m%d).sql.gz"

mkdir -p "$BACKUP_DIR"

# Password: fetched from Secrets Manager into a 0600 password file,
# never an environment variable, deleted when the script exits.
export PGPASSFILE="$BACKUP_DIR/.pgpass"
trap 'rm -f "$PGPASSFILE"' EXIT
SECRET=$(aws secretsmanager get-secret-value --region "$AWS_REGION" \
  --secret-id webodm/db-password --query SecretString --output text)
# RDS-style secrets are JSON with a "password" key; plain-text secrets are the password
if printf '%s' "$SECRET" | jq -e 'type == "object"' >/dev/null 2>&1; then
  DB_PASS=$(printf '%s' "$SECRET" | jq -r '.password')
else
  DB_PASS="$SECRET"
fi
# .pgpass needs ":" and "\" escaped with a backslash
DB_PASS_ESC=$(printf '%s' "$DB_PASS" | sed 's/[\\:]/\\&/g')
printf '%s:5432:%s:%s:%s\n' "$DB_HOST" "$DB_NAME" "$DB_USER" "$DB_PASS_ESC" > "$PGPASSFILE"
chmod 600 "$PGPASSFILE"

# Dump over TLS; on failure, remove the partial file and stop
if ! pg_dump "host=$DB_HOST dbname=$DB_NAME user=$DB_USER sslmode=require" | gzip > "$DUMP"; then
  rm -f "$DUMP"
  echo "pg_dump failed" >&2
  exit 1
fi

# Delete the local copy only after a successful upload
if aws s3 cp --region "$AWS_REGION" "$DUMP" "s3://$S3_BUCKET/backups/db/"; then
  rm -f "$DUMP"
else
  echo "S3 upload failed; keeping $DUMP" >&2
  exit 1
fi

Why the password file: PostgreSQL’s docs advise against PGPASSWORD because some systems let other users read a process’s environment with ps. They recommend a password file, which libpq ignores unless its permissions are 0600 (libpq environment variables, password file). The script escapes : and \ in the password, as the file format requires, and reads the password field when the secret is JSON, which is the structure Secrets Manager uses for RDS credentials. It needs jq, and a pg_dump at least as new as the server’s major version. pg_dump refuses to dump from a newer server.

If your database is the stock db container rather than RDS, run pg_dump inside it so the versions always match: docker exec db pg_dump -U postgres webodm_dev | gzip > "$DUMP". Keep the same upload-then-delete logic. Since WebODM 4.0.0 (November 4, 2026), that container runs PostgreSQL 18, and WebODM’s release notes say database backups can’t be restored from 4.x to 3.x or the other way round. WebODM 4.0.1 (November 15, 2026) lists no database or backup changes. Take a fresh dump right after you upgrade. Older dumps only restore into a 3.x install.

Cron job (static node):

0 2 * * * /usr/local/bin/backup-webodm-db.sh >> /var/log/backup.log 2>&1

Runs at 2 AM daily and uploads one compressed dump to S3.

S3 lifecycle (backups):

put-bucket-lifecycle-configuration replaces the bucket’s whole lifecycle configuration (CLI reference). If you applied part 4’s tiering rules, add these two rules to the same Rules array in that lifecycle.json and apply the combined file. Don’t apply them on their own, or you’ll wipe out part 4’s rules.

Convert part 4’s rules first. They use "Id" and a top-level "Prefix". The CLI’s JSON key is "ID", and AWS has deprecated the top-level Prefix in favour of Filter. Rewrite each of part 4’s rules as "ID": "Move-old-projects" and "Filter": { "Prefix": "projects/" } (and the same for temp/), so every rule in the file uses one form:

{
  "ID": "Expire-db-backups",
  "Status": "Enabled",
  "Filter": { "Prefix": "backups/db/" },
  "Expiration": { "Days": 30 }
},
{
  "ID": "Expire-old-versions",
  "Status": "Enabled",
  "Filter": { "Prefix": "" },
  "NoncurrentVersionExpiration": { "NoncurrentDays": 30 }
}

The first rule keeps 30 days of dumps. Because the bucket is versioned, an “expired” dump becomes a noncurrent version, and the second rule removes noncurrent versions bucket-wide 30 days later. That second rule also sets how long you have to undo an accidental delete: 30 days.

Tested recovery (quarterly):

  1. Start a scratch PostgreSQL server on the same major version as production (a small RDS instance, or for the stock 4.x install a local webodm/webodm_db:18 container).
  2. Download the latest dump from S3.
  3. Restore it into the scratch server.
  4. Compare row counts for projects, tasks and users against production.
  5. Delete the scratch server.

If it works, you’ve confirmed your recovery process. If it fails, you just found the problem before it mattered.


Disaster recovery runbook

Compromised worker or static node. Preserve evidence first, terminate last. AWS’s Security Incident Response Guide (PDF, pp. 39–41) gives this order for an EC2 instance: acquire metadata, enable protections, take EBS snapshots, acquire memory, optionally do live response, decommission, isolate, and only then shut it down. The steps below follow that order.

There’s one deliberate exception. If the instance is actively doing damage (exfiltrating data, launching instances with the ClusterODX key, attacking other hosts), isolate it first, at step 3, and accept that some volatile evidence may change. AWS’s GuardDuty remediation steps also put isolation early.

  1. Record the instance ID, IPs, subnet, security groups, AMI and launch time.
  2. Protect it. Set DeleteOnTermination=false on its volumes so they survive if the instance dies (preserving volumes). This matters most for workers. They’re Spot Instances, and you can’t enable termination protection on Spot Instances, so AWS or ClusterODX’s maxRuntime could end one mid-investigation. For the static node (if it isn’t a Spot Instance), enable termination protection too, and set its shutdown behavior to stop. Tag the instance (for example Status=Quarantine) so nobody mistakes it for a healthy node.
  3. Snapshot every attached volume. Snapshots are asynchronous and stay pending until all the data is copied (EBS snapshots).
  4. Capture memory, if you can. A snapshot holds only what was written to disk. Running processes, network connections, and anything cached in RAM are lost at shutdown. AWS’s guide says to use a third-party memory acquisition tool for this. If you have no such tool ready, write that gap down and move on.
  5. Decommission. Rotate the ClusterODX access key (every worker had a copy), and detach the instance’s instance profile or replace it with one that grants nothing.
  6. Isolate. Swap its security groups for an isolation group with no inbound rules, and delete the allow-all outbound rule a new security group starts with. Changing security groups doesn’t cut connections that are already tracked, only new ones (GuardDuty remediation guide). Use a network ACL if you need to cut a live session.
  7. Pull the trail. CloudTrail’s Event history keeps 90 days of management events per Region, free and on by default (CloudTrail docs). Filter by the access key and the instance ID.
  8. Shut down and terminate only after the snapshots show completed. Then resubmit the affected job.
ID=i-0123456789abcdef0

# 1. Record
aws ec2 describe-instances --instance-ids $ID > incident-$ID.json

# 2. Protect: keep the root volume (use the device name shown in incident-$ID.json)
cat > keep-volume.json << 'EOF'
[{ "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": false } }]
EOF
aws ec2 modify-instance-attribute --instance-id $ID --block-device-mappings file://keep-volume.json

# 3. Snapshot each attached volume
for VOL in $(aws ec2 describe-volumes \
    --filters Name=attachment.instance-id,Values=$ID \
    --query 'Volumes[].VolumeId' --output text); do
  aws ec2 create-snapshot --volume-id $VOL --description "incident $ID"
done

# 6. Isolate (replaces all of the instance's security groups)
aws ec2 modify-instance-attribute --instance-id $ID --groups sg-isolation

# 8. After every snapshot reaches "completed" (check with describe-snapshots)
aws ec2 terminate-instances --instance-ids $ID

Database corrupted. Stop the WebODM UI so nothing else writes. Snapshot the corrupted database before you touch it; you may need it to work out what happened. Restore the most recent clean dump into a fresh database, check row counts against what you expect, point WebODM at it, and restart. How long this takes depends on the size of your database. Time it during your quarterly drill so you know.

Objects or a bucket deleted. With versioning on, a simple delete only adds a delete marker. Remove the marker, or copy the previous version back, and the object returns. The 30-day noncurrent rule above is your window. A deleted bucket is harder: S3 won’t delete a bucket until every object, version and delete marker is gone (delete-bucket), so getting there means everything was purged first. Recovery then means copying data back from a replica. How long that takes depends on how many terabytes you have, so measure it before you need it. No replica and no versions? That data is gone. Set up protection before you need it.


Cross-region replication: When it’s worth it

S3 Cross-Region Replication copies new objects to a bucket in a second Region. You pay for storage in both Regions plus per-GB inter-region transfer (see S3 pricing). Both buckets must have versioning on (S3 security best practices).

It also gives you a specific protection against malicious deletion. When someone deletes a specific object version in the source bucket, S3 doesn’t replicate that deletion. And with current replication configurations, delete markers aren’t replicated unless you turn that on (what S3 replicates). An attacker who wipes the source bucket doesn’t automatically wipe the replica.

It’s worth the cost when a client contract or regulation requires geographic redundancy, or when losing your processed archive would be unrecoverable. Skip it when you can re-process from raw imagery you keep elsewhere, or when cost is the binding constraint.

For many drone mapping operations, versioning plus a daily database dump covers the common failures: accidental deletes, a bad overwrite, a corrupted database. Replication covers the rarer one, losing the bucket itself.


Incident response checklist

  • Page on-call
  • Start a written timeline
  • Record metadata for affected instances
  • Set DeleteOnTermination=false; termination protection on non-Spot instances; tag Quarantine
  • Snapshot attached EBS volumes
  • Capture memory if a tool is ready (or record that you couldn’t)
  • Rotate the ClusterODX access key and any other exposed credentials
  • Isolate affected instances (isolation security group; network ACL for live sessions); isolate first if the attack is still active
  • Pull CloudTrail Event history for the affected key and instances
  • Review CloudWatch alarms and VPC Flow Logs (if enabled)
  • Terminate compromised instances once snapshots complete
  • Begin recovery if data was lost
  • Notify affected clients
  • Post-mortem: what failed, how to prevent it
  • Update policies and this runbook

Security audit (quarterly)

IAM & credentials:

  • Review each role and the ClusterODX policy for over-granting (no * actions); results key is write-only to its own bucket
  • No AWS access keys in repos (grep for AKIA)
  • Delete IAM users unused for 90+ days
  • Rotate the ClusterODX access key
  • Rotate Secrets Manager secrets

VPC & network:

  • SSH restricted to known IPs
  • No 0.0.0.0/0 on ports 22, 3306, 5432
  • Worker group: 22 and 2376 only from the ClusterODX host group, no rules added by docker-machine
  • Workers in private subnets (if you took the NAT hardening step)
  • Review VPC Flow Logs for anomalies

S3 & storage:

  • Block Public Access: all four settings on
  • get-bucket-policy-status shows IsPublic false
  • Anonymous --no-sign-request listing returns AccessDenied
  • Presigned URLs work, bucket not public

Encryption:

  • EBS encryption by default enabled in every Region you use
  • S3 default encryption set (SSE-S3 or SSE-KMS)
  • RDS storage encrypted

Backups & recovery:

  • Test restore of the latest database dump
  • Backup and noncurrent-version retention at 30 days
  • Lifecycle file still contains part 4’s rules and the backup rules

Monitoring:

  • CloudWatch alarms still relevant
  • A CloudTrail trail recording all Regions (beyond the 90-day Event history)
  • MFA on the AWS root user

Docs:

  • Runbook updated
  • Disaster recovery drill completed
  • New risks documented

What this costs

Most of these controls are free: IAM, security groups, Block Public Access, SSE-S3, versioning (apart from the extra storage), and CloudTrail’s Event history. EBS encryption with the AWS-managed aws/ebs key carries no key fee, though AWS’s KMS pricing charges for API requests to AWS-managed keys. So does SSE-KMS on S3, which is why the Bucket Key matters. Part 8’s public-subnet layout adds nothing for the network beyond the $0.005 per hour each worker’s public IPv4 address costs while it runs.

The optional private-subnet hardening is what costs money. A NAT gateway in US East (Ohio) runs $0.045 per hour, plus $0.045 per GB processed and $0.005 per hour for its public IPv4 address (VPC pricing, checked 2026-11-11). Over a 730-hour month (24 × 365 ÷ 12 = 730):

  • NAT gateway hours: 730 × $0.045 = $32.85/month
  • Public IPv4 address: 730 × $0.005 = $3.65/month
  • Fixed subtotal: $36.50/month, before any data
  • Data: 250 GB of worker traffic through the NAT gateway adds 250 × $0.045 = $11.25

The S3 gateway endpoint keeps S3 traffic off that per-GB meter. Smaller items: Secrets Manager is $0.40 per secret per month plus $0.05 per 10,000 API calls (pricing), a customer-managed KMS key is $1/month, and Flow Logs bill at CloudWatch’s vended-log rates. An RDS instance, if you use one, is its own line item.

Setting this up isn’t free in time either, but it’s a fraction of what one incident costs to clean up.


Bottom Line

Security is the price of running cloud infrastructure. IAM least privilege confines the blast radius, and that includes knowing that ClusterODX shares its key with every worker. Group-limited security group rules, created before docker-machine can add its own, keep processing nodes unreachable from the internet; a private subnet makes that hold even when a rule is wrong. Block Public Access prevents the public-bucket mistake that makes the news. Encryption covers you at rest and in transit, mostly by default now. Backups with tested recovery mean data loss is a bad day, not a catastrophe. And the incident runbook preserves the evidence you need to figure out what happened.

Run a quarterly audit. Actually test incident response and disaster recovery — don’t just write the runbook and assume it works. Procedures that look great on paper fail in production all the time.

Your cluster handles client data. Treat it accordingly.


Related reading

Written by Eric

Eric

M.S. Geography (GIS specialization) from St. Cloud State University, FAA Part 107. Pacific Northwest-based; active public-sector Blue UAS operator. Geospatial background covering spatial data, remote sensing, and coordinate systems — applied to drone mapping workflows and deliverables.

About Eric

Get the Free Drone Mapping Workflow Guide

The 5-stage workflow from planning to deliverables. 30+ pages of field-tested methodology, delivered to your inbox.

No spam. Unsubscribe anytime.

← Back to the Library Questions or feedback? Get in touch →