Ravindra BagaleCourses & study guides मराठी Track your progress

15. Amazon RDS for MySQL: Create, Connect, Back Up and Keep It Private

15.5 Automated Backups, Snapshots and Restore

Backup nahi tar database nahi – asa samja. RDS don prakarache backups deto:

Type How Kept until Use
Automated backups Daily snapshot + transaction logs, automatic Retention period (1–35 days) Point-in-time restore to any second in the window
Manual snapshots You click Take snapshot or run CLI You delete them Before upgrades, big changes, or to copy to another region/account
aws rds create-db-snapshot --db-instance-identifier reels-db --db-snapshot-identifier reels-db-before-v2
aws rds describe-db-snapshots --db-instance-identifier reels-db --query "DBSnapshots[].[DBSnapshotIdentifier,Status]"
# point-in-time restore ALWAYS creates a NEW instance
aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier reels-db \
  --target-db-instance-identifier reels-db-restored --restore-time 2026-09-27T04:30:00Z \
  --db-subnet-group-name reels-db-subnets --vpc-security-group-ids sg-0db11111 --no-publicly-accessible

Restore never overwrites the original. You get a new instance with a new endpoint; test it, then point the app to it (or copy the rows you need back). Logical backups with mysqldump from EC2 still work and are handy for moving data:

mysqldump -h <endpoint> -u admin -p --single-transaction reelsdb > reelsdb.sql

Why this matters for security

Backups are your last line of defence against ransomware and destructive attacks. Encrypted snapshots stay encrypted; share snapshots only with accounts you trust and never mark one public – public RDS snapshots can be copied by any AWS account.

Ravindra Bagale's Tip

Students restore and wait for the old database to change – but a restore always creates a new instance with a new endpoint! Change the endpoint in the app config, or copy the data back. And when deleting an instance, never skip the "final snapshot" option.

Practice task

Take a manual snapshot, insert a test row, then do a point-in-time restore to a time before the insert. Connect to the restored instance and prove the row is missing. Delete the restored instance afterwards.

Extended teaching notes

Why this lesson matters

Cameras, sensors and plant controllers often ship with weak defaults. Segment them from IT, change passwords, block inbound internet, and watch outbound traffic.

Real examples

Global: Mirai showed what default passwords on routers/cameras can do at scale. Indian SME (sample): a factory puts PLCs on a separate VLAN reachable only via a jump host.

Mini case study

Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.

Defender's worksheet (do this today)

  1. Write the lesson title, date and the exact lab target you are allowed to use.
  2. List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
  3. Run one safe check from the lesson on a lab system only. Paste the command and output.
  4. Write a two-sentence fix you would give a teammate.
  5. Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.

Indian workplace (sample data)

Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).

Global practice

Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.

Everyday analogy

Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.

Key terms

  • Control: a safeguard (patch, config, process, detection).
  • Finding: a weakness backed by evidence.
  • Remediation: the fix plus how you verified it.
  • Scope: systems you have written permission to touch.
  • Least privilege: only the access the task needs.
  • Defence in depth: several layers so one failure does not end the story.

Common mistakes

  • Skipping written permission "just for a quick scan".
  • Practising on hostel, office or public targets without authorisation.
  • Collecting tool output without writing the fix.
  • Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
  • Publishing screenshots that contain secrets, cookies or internal hostnames.

Recap

  • Evidence, fix, owner, date.
  • Own lab only.
  • Fix > spectacle.