RDS Instance Auditor
Quick start
- Verdict order (first match wins): PUBLIC → UNENCRYPTED → NO_DELETION_PROTECTION → SINGLE_AZ → CONFIG_GAP → OK. Emit all dimensions in FINDINGS regardless.
- Aurora is cluster-scoped: for
aurora-* engines, encryption/deletion-protection/Multi-AZ/retention live on the DBCluster; defer to describe-db-clusters.
- Encryption is immutable:
StorageEncrypted cannot be toggled in place — remediation is snapshot → encrypted-copy → restore-new → cutover.
Mindset
Audit RDS configuration metadata against seven high-impact dimensions and
emit the worst finding as the verdict, with every dimension enumerated
regardless of the headline.
Philosophy
Moved verbatim to references/advanced-patterns.md — load on demand.
Quick reference — severity thresholds
The verdict enum is ordered worst → least. The first matching dimension in the
ordered steps below is the verdict; remaining dimensions are still enumerated
in the FINDINGS list.
| Condition |
Verdict |
Step |
PubliclyAccessible: true on a non-Aurora instance |
PUBLIC |
Step 1 |
StorageEncrypted: false (non-Aurora, or DBCluster for Aurora) |
UNENCRYPTED |
Step 2 |
DeletionProtection: false on the instance (or cluster, Aurora) |
NO_DELETION_PROTECTION |
Step 3 |
MultiAZ: false on a primary, non-Aurora, non-Read-Replica instance |
SINGLE_AZ |
Step 4 |
BackupRetentionPeriod: 0 OR AutoMinorVersionUpgrade: false OR MonitoringInterval: 0 |
CONFIG_GAP |
Step 5-7 |
| All seven dimensions pass |
OK |
Step 8 |
See the ordered steps for Aurora/replica edge cases. Deep RDS-specific
behaviours (immutability, cluster scope, standby semantics, maintenance-window
interactions) are in the Expert edge cases section.
Pre-flight: instance metadata gate (run before classification)
Several instance attributes short-circuit or redirect the audit.
Misclassifying them produces false positives that erode trust.
Account-wide sweep (pagination): describe-db-instances caps at 100
records/page. Drain the Marker to completion:
Moved verbatim to references/diagnostic-commands.md — load on demand.
| Attribute |
Value |
Effect on audit |
Engine |
aurora-mysql, aurora-postgresql |
Aurora instance. Encryption, deletion protection, and Multi-AZ live on the DBCluster. Do NOT flag instance-level StorageEncrypted/DeletionProtection/MultiAZ — defer to cluster metadata (Steps 2-4 cluster branch). Backup retention is also cluster-level and 0 is rejected by the API. |
DBInstanceStatus |
deleting |
Instance is being torn down. Skip audit, emit VERDICT: OK with note "instance is deleting — no remediation applicable." Do NOT propose modifications against a deleting instance. |
DBInstanceStatus |
failed, inaccessible, incompatible-* |
Instance is non-functional. Surface as an operational finding but still audit the seven dimensions on the stored configuration. |
ReadReplicaSourceDBInstanceIdentifier |
present |
Read Replica. Read-only by design. SINGLE_AZ on a replica is lower acuity (the primary's Multi-AZ is the availability gate for writes); downgrade SINGLE_AZ from a hard fail to a note unless the replica is itself a production read endpoint. |
InstanceClass |
db.serverless |
Aurora Serverless v1/v2 scaling is cluster-governed; MultiAZ semantics differ. Defer to cluster. |
PendingModifiedValues |
any field populated |
An in-flight modification is queued. Audit the CURRENT value (not the pending one); note the pending change in REMEDIATION so the operator knows whether the gap is already being addressed. |
StorageEncrypted: true + KmsKeyId absent |
— |
RDS uses the AWS-managed aws/rds key. It IS encrypted — do NOT flag UNENCRYPTED. Key-policy / rotation concerns are the kms-key-policy-auditor's scope, not this skill. |
If the instance metadata is malformed (missing DBInstanceIdentifier,
absent Engine, or unparseable), output:
INSTANCE: <identifier or unknown>
VERDICT: ERROR
REASON: RDS instance metadata is missing required fields (DBInstanceIdentifier, Engine) — cannot classify.
REMEDIATION: Re-fetch with `aws rds describe-db-instances --db-instance-identifier <id> --output json` and re-audit.
Process — Classification logic (apply in order, aggregate worst)
Step 0: Expert knowledge — non-obvious RDS behaviours that change classification
Moved verbatim to references/advanced-patterns.md — load on demand.
Step 1: Public accessibility (highest priority — internet exposure)
If PubliclyAccessible: true on the instance, the dimension verdict is
PUBLIC. This is the worst verdict in the enum — an internet-reachable
database is the highest-impact RDS misconfiguration. The flag is evaluated
first because exposure compounds every other finding: an unencrypted, no-backup
public database is a write-once ransomware target.
For Aurora instances, PubliclyAccessible is still instance-level (each
instance gets its own flag), so this step applies the same way.
A 0.0.0.0/0 security-group inbound rule is NOT required to produce PUBLIC —
the flag alone is sufficient. Note permissive SGs in REMEDIATION regardless.
Step 2: Encryption-at-rest (immutable — migration required)
For non-Aurora engines: if StorageEncrypted: false, the dimension verdict is
UNENCRYPTED.
For Aurora engines: defer to the DBCluster.StorageEncrypted field. If the
cluster block is not provided in the input, emit an AURORA_SCOPE note and do
NOT classify this dimension from the instance-level echo — flag it as needing
cluster metadata. If DBCluster.StorageEncrypted: false, the verdict is
UNENCRYPTED at the cluster level. Missing-cluster fallback: when no
DBCluster block is provided, append to FINDINGS:
[AURORA_SCOPE] Cluster metadata missing — run: aws rds describe-db-clusters --db-cluster-identifier <cluster-id> --output json. Cannot classify encryption/deletion-protection/Multi-AZ from instance echoes. Verdict reflects instance-level checks only (PubliclyAccessible).
This prevents silent false-positives while giving the operator the exact CLI
to fetch the missing data.
StorageEncrypted: true with absent KmsKeyId is OK — RDS uses the
AWS-managed aws/rds key. Do NOT flag this as UNENCRYPTED.
Step 3: Deletion protection (accidental deletion guardrail)
For non-Aurora: if DeletionProtection: false, the dimension verdict is
NO_DELETION_PROTECTION. With protection off, a single
delete-db-instance call (with --skip-final-snapshot) destroys the instance
and its data. The guardrail exists to force a deliberate disable step before
destructive actions.
For Aurora: defer to DBCluster.DeletionProtection. Instance-level deletion
protection is not the gate for Aurora — the cluster is the deletable unit.
Step 4: Multi-AZ (availability — AZ failure resilience)
For non-Aurora primary instances: if MultiAZ: false, the dimension verdict
is SINGLE_AZ. With no standby, an AZ-level failure (power, network, host)
causes an outage until RDS provisions a replacement — typically minutes to
tens of minutes. Multi-AZ provides a synchronous standby in a second AZ with
automatic failover (60-120 seconds of connection drop).
Downgrade cases (note in FINDINGS, do not drive the verdict):
- Read Replica (
ReadReplicaSourceDBInstanceIdentifier present): the
replica is read-only; the primary's Multi-AZ is the write-availability gate.
Emit SINGLE_AZ as a note, not a hard finding, unless this replica is a
production read endpoint with strict read SLAs.
- Aurora instance: Multi-AZ is a cluster-level property (replicas across
AZs). Defer to the cluster; do not flag instance-level
MultiAZ.
Step 5: Automated backups (PITR coverage)
If BackupRetentionPeriod: 0 on a non-Aurora instance, this is a CONFIG_GAP
contributor. 0 disables automated backups and point-in-time recovery
entirely — there is no transaction-log archive and the only restore path is a
manual snapshot. The valid range is 0-35 days; AWS default is 7.
For Aurora: BackupRetentionPeriod is cluster-level and 0 is rejected by
the API (continuous backups, 1-35). A reported 0 on Aurora is stale or
invalid metadata — note it but do NOT flag CONFIG_GAP from this field.
Step 6: Auto minor-version upgrade (patching hygiene)
If AutoMinorVersionUpgrade: false, this is a CONFIG_GAP contributor. The
instance will not pick up minor-engine-version patches during the maintenance
window — these include security fixes and stability improvements. Major
versions are always opt-in and are out of scope for this flag.
Step 7: Enhanced Monitoring (OS-level observability)
If MonitoringInterval: 0 (or absent), Enhanced Monitoring is OFF and this
is a CONFIG_GAP contributor. Without it, only engine-level CloudWatch metrics
exist — there is no OS-level signal for CPU steal, swap pressure, or file
system fill, which are the precursors to most "the database is slow but
CloudWatch looks fine" incidents.
Step 8: Aggregation — worst finding wins
The final verdict is the worst dimension verdict in this fixed order,
where PUBLIC > UNENCRYPTED > NO_DELETION_PROTECTION > SINGLE_AZ > CONFIG_GAP >
OK:
verdict = first_match(
Step 1 PUBLIC,
Step 2 UNENCRYPTED,
Step 3 NO_DELETION_PROTECTION,
Step 4 SINGLE_AZ,
Step 5-7 CONFIG_GAP,
OK
)
All dimensions are still enumerated in the FINDINGS list regardless of the
verdict, so the operator sees the full posture (a PUBLIC instance that is
also UNENCRYPTED shows both, with PUBLIC as the headline verdict).
Output format (per instance)
INSTANCE: <db-instance-identifier>
VERDICT: PUBLIC | UNENCRYPTED | NO_DELETION_PROTECTION | SINGLE_AZ | CONFIG_GAP | OK
REASON: <1-2 sentences citing the worst finding and its step number>
FINDINGS:
- [PUBLIC] <finding description (Step 1)>
- [UNENCRYPTED] <finding description (Step 2)>
- [OK] <dimension that passed>
- [PENDING] <field> is queued to change to <value> at next window / on --apply-immediately (audited on CURRENT value; do not double-remediate)
REMEDIATION: <specific action per finding, or "None required" if OK>
CONFIRM: Before executing any state-changing CLI above, emit and await operator
approval: "CONFIRM: About to <action> on <id> in <region>. Proceed? (yes/no)"
The [PENDING] line is emitted ONLY when PendingModifiedValues contains a
queued change to one of the seven audited fields. It is informational — the
verdict and FINDINGS reflect the CURRENT value. Skip the [PENDING] line when
no fields are pending.
Concrete error-handling example — malformed metadata
Moved verbatim to references/error-handling.md — load on demand.
Worked example — public and unencrypted dev instance
INSTANCE: db-public-and-unencrypted
VERDICT: PUBLIC
REASON: PubliclyAccessible is true on a non-Aurora instance — the database
has a public IP and is internet-reachable subject to VPC routing (Step 1).
StorageEncrypted is also false, compounding exposure (Step 2).
FINDINGS:
- [PUBLIC] PubliclyAccessible: true — internet-exposed database (Step 1)
- [UNENCRYPTED] StorageEncrypted: false — data at rest is plaintext;
remediation is a snapshot migration, not a toggle (Step 2)
- [NO_DELETION_PROTECTION] DeletionProtection: false (Step 3)
- [OK] MultiAZ: true, BackupRetentionPeriod: 7, AutoMinorVersionUpgrade: true,
MonitoringInterval: 60
REMEDIATION:
1. PUBLIC — Remove the public IP immediately:
aws rds modify-db-instance --db-instance-identifier db-public-and-unencrypted
--publicly-accessible false --apply-immediately --profile <p>
2. UNENCRYPTED — Plan the encryption migration (cannot be done in place):
aws rds create-db-snapshot --db-instance-identifier db-public-and-unencrypted
--db-snapshot-identifier pre-encrypt-$(date +%s) --profile <p>
aws rds copy-db-snapshot --source-db-snapshot-identifier pre-encrypt-...
--target-db-snapshot-identifier encrypted-copy --kms-key-id <kms-id> --profile <p>
aws rds restore-db-instance-from-db-snapshot --db-instance-identifier
db-public-and-unencrypted-enc --db-snapshot-identifier encrypted-copy --profile <p>
Then promote and cut over the endpoint.
3. NO_DELETION_PROTECTION — Enable after confirming no in-flight deletion:
aws rds modify-db-instance --db-instance-identifier db-public-and-unencrypted
--deletion-protection --apply-immediately --profile <p>
CONFIRM: Before executing any CLI above, emit and await:
"CONFIRM: About to modify-db-instance on db-public-and-unencrypted in
us-east-1. This changes public accessibility and deletion-protection
(existing public-IP connections will drop). Proceed? (yes/no)"
Do NOT run the CLI until the operator replies yes.
Anti-Patterns — NEVER
NEVER recommend enabling encryption on an existing unencrypted instance
with modify-db-instance. The StorageEncrypted flag is immutable after
creation; modify-db-instance will reject the change. The only path is
snapshot → encrypted copy → restore-new → cutover. Pretending otherwise
produces a remediation that fails at execution time.
NEVER flag StorageEncrypted: true with absent KmsKeyId as UNENCRYPTED.
RDS transparently uses the AWS-managed aws/rds key in this case — the
data IS encrypted at rest. Key-policy and rotation concerns are out of
scope for this skill (route to kms-key-policy-auditor).
NEVER flag a Read Replica as a hard SINGLE_AZ finding without noting it is
a replica. Read Replicas are read-only scaling instances; their Multi-AZ
posture is materially less critical than the primary's. Over-flagging
produces alert fatigue and trains operators to ignore the verdict.
NEVER flag MultiAZ: false, StorageEncrypted, or DeletionProtection on
an Aurora instance from the instance-level fields alone. For Aurora these
are DBCluster properties and the instance echoes are not authoritative.
Doing so produces false positives on every Aurora audit.
NEVER flag BackupRetentionPeriod: 0 on an Aurora instance. The API
rejects 0 for Aurora (continuous backups, retention 1-35 enforced
server-side at modify-db-cluster time); a reported 0 is stale cache,
malformed describe output, or a fabricated test payload — never a live
configuration. Operational impact of flagging it anyway: the operator opens
a phantom incident, drains engineering cycles chasing metadata the RDS
control plane will not even accept, and learns to dismiss other findings as
"API noise," eroding the credibility of legitimate findings on the same
report.
NEVER treat PubliclyAccessible: false as the complete public-access
picture for defense-in-depth. A 0.0.0.0/0 inbound security-group rule is
still a smell — the instance is one modify-db-instance --publicly-accessible true away from internet exposure. Note permissive SGs in REMEDIATION
regardless of the verdict, but do NOT upgrade PUBLIC to a worse verdict
(there is none) and do NOT invent a new verdict.
NEVER downgrade PubliclyAccessible: true to a non-PUBLIC verdict because
the security group looks locked down. The public IP is published; a future
SG edit, ELB attachment, or VPC peering change exposes the database. The
flag itself is the verdict driver.
NEVER treat DeletionProtection: true as a security control. Any principal
with rds:ModifyDBInstance can disable it and delete. It is an
accidental-deletion guardrail for operators and pipelines, not a defence
against a determined attacker with database-admin rights.
NEVER treat AutoMinorVersionUpgrade: true as "fully patched." It covers
minor versions only, runs only during the maintenance window, and is
blocked if a PendingModifiedValues modification is queued. Major-version
upgrades are always opt-in. true is necessary but not sufficient.
NEVER recommend --apply-immediately for every remediation. Use it for
PUBLIC (close the exposure now) and NO_DELETION_PROTECTION (cheap to apply).
Prefer the maintenance window for Multi-AZ enablement (causes brief I/O
suspension), minor-version upgrades (engine restart), and Enhanced
Monitoring role wiring. Stacking --apply-immediately modifications on a
production instance can cause an unplanned multi-minute restart window.
NEVER audit only the first page of describe-db-instances. The API caps at
100 records per page. The long-tail instances (dev, test, forgotten
production) are disproportionately likely to be misconfigured. Always drain
the Marker to completion:
# Paginate all instances
aws rds describe-db-instances --output json --query 'DBInstances[*].[DBInstanceIdentifier,Engine,PubliclyAccessible,StorageEncrypted,MultiAZ,DeletionProtection,BackupRetentionPeriod,AutoMinorVersionUpgrade,MonitoringInterval]' --starting-token "<Marker from prior call>"
# Fetch Aurora cluster metadata separately
aws rds describe-db-clusters --output json --query 'DBClusters[*].[DBClusterIdentifier,Engine,StorageEncrypted,DeletionProtection,BackupRetentionPeriod]'
NEVER modify an instance with DBInstanceStatus: deleting,
incompatible-parameters, or incompatible-restore. The API rejects
modifications and the operator may be mid-recovery. Surface the status and
abort remediation.
NEVER assume a cross-region Read Replica is encrypted because the source is
encrypted. Cross-region replicas require a separate KMS CMK in the
destination region; if the replica was created with a misconfigured or
deleted key, its StorageEncrypted may read true while the key is
unusable. When auditing a cross-region replica, verify KmsKeyId resolves
to an active key in the replica's region, not just that the boolean is set.
Pre-flight safety checks (run before any remediation CLI)
- MANDATORY CONFIRMATION GATE. Before any state-changing RDS operation
(
modify-db-instance, delete-db-instance, create-db-snapshot), the
auditor MUST emit:
CONFIRM: About to <action> on <db-instance-identifier> in <region>. This affects <consequence>. Proceed? (yes/no)
Do NOT execute the CLI until the operator confirms. This gate prevents
automated pipelines from silently modifying production databases.
- Snapshot before destructive modifications. Before Multi-AZ enablement,
encryption migration, or major remediation, capture a snapshot:
aws rds create-db-snapshot --db-instance-identifier <id> --db-snapshot-identifier pre-remediation-$(date +%s) --profile <p>.
Encryption migration in particular is irreversible without a snapshot of
the original.
- Verify the instance is
available before modifying.
aws rds describe-db-instances --db-instance-identifier <id> — confirm
DBInstanceStatus is available. Modifying a modifying, backing-up,
or creating instance fails or queues behind existing work.
- Encryption migration is a cutover, not a patch. The restore-new
instance has a new endpoint. Plan DNS/endpoint cutover, application
connection-string updates, and a rollback path (keep the original
unencrypted instance until cutover is verified). Never delete the original
until the encrypted replacement is confirmed serving traffic.
- Multi-AZ enablement causes a brief I/O suspension. Synchronous standby
creation suspends I/O for a few minutes during standby provisioning. Schedule
outside peak write windows. The instance stays available but latency spikes.
--apply-immediately vs maintenance window. For PUBLIC and
NO_DELETION_PROTECTION findings, --apply-immediately is appropriate
(security/accidental-loss prevention). For SINGLE_AZ enablement and CONFIG_GAP
dimensions, ALWAYS omit --apply-immediately — Multi-AZ standby provisioning
causes an I/O suspension of 1-3 minutes that will interrupt live writes. Queue
to the next maintenance window explicitly. Stacking --apply-immediately on
multiple dimensions at once compounds the disruption.
- Confirm the caller has
rds:ModifyDBInstance. Many read-only auditor
roles cannot modify. Surface this before the operator approves a change
that will fail with AccessDenied.
- Bulk-operation safety limit (enforced by the skill). Remediation across
an account sweep MUST follow this exact algorithm:
- Sort flagged instances verdict-first (PUBLIC before UNENCRYPTED, etc.).
- Slice into batches of at most 5 instances.
- For each batch: emit the per-instance REMEDIATION block, then a single
CONFIRM: About to modify <id1, id2, …, idN> in <region>. Proceed? (yes/no).
- After the operator confirms and the CLI runs, re-query with
aws rds describe-db-instances --db-instance-identifier <each modified id>
and verify the intended state landed before emitting the NEXT batch.
- Abort the sweep if any instance in a batch enters
modifying, failed,
or incompatible-* state — do NOT proceed to the next batch.
The skill MUST NOT emit remediation CLI for more than 5 instances in a
single output block. Auto-applying across an entire account in one pass is
forbidden: a single systematic misclassification or IaC-drift mismatch
cascades into mass disruption, and batched execution contains the blast
radius of any one mistake.
Remediation guidance
Ordering principle: remediate findings in severity order (PUBLIC first),
and prefer additive/online changes over migrations where possible. Encryption
is the only dimension that requires a migration — every other dimension has a
modify-db-instance path.
For PUBLIC — internet-exposed database (Step 1)
- Immediately remove the public IP:
aws rds modify-db-instance --db-instance-identifier <id> --publicly-accessible false --apply-immediately --profile <p>.
Existing public-IP connections drop; private-IP connections are unaffected.
- Audit the security group: if any inbound rule is
0.0.0.0/0 on the DB
port (3306/5432/1433/etc.), tighten to the application's CIDR or security
group reference.
- If public access is genuinely required (rare — use a bastion or SSM Session
Manager instead), require TLS at the engine level (parameter group:
rds.force_ssl=1 for PostgreSQL, require_secure_transport for MySQL) and
restrict the SG to a known egress CIDR.
For UNENCRYPTED — plaintext data at rest (Step 2)
- Snapshot:
aws rds create-db-snapshot --db-instance-identifier <id> --db-snapshot-identifier pre-encrypt-$(date +%s) --profile <p>.
- Copy with encryption:
aws rds copy-db-snapshot --source-db-snapshot-identifier <snap> --target-db-snapshot-identifier <snap>-enc --kms-key-id <kms-id> --profile <p>.
- Restore new encrypted instance:
aws rds restore-db-instance-from-db-snapshot --db-instance-identifier <id>-enc --db-snapshot-identifier <snap>-enc --profile <p>.
- Cutover: rename the old instance (
--new-db-instance-identifier <id>-old)
and rename the encrypted instance to the original identifier so the
endpoint absorbs. Verify application connectivity, then delete the old
unencrypted instance after a confirmation window.
- Enable deletion protection on the new encrypted instance as the last step.
For NO_DELETION_PROTECTION — accidental deletion (Step 3)
aws rds modify-db-instance --db-instance-identifier <id> --deletion-protection --apply-immediately --profile <p>.
For Aurora, apply at the cluster: aws rds modify-db-cluster.
For SINGLE_AZ — availability gap (Step 4)
aws rds modify-db-instance --db-instance-identifier <id> --multi-az --profile <p> (omit --apply-immediately — let it run in the next window).
Brief I/O suspension occurs during standby provisioning. Note: the standby is
not read-capable; for read scaling, provision Read Replicas separately.
For CONFIG_GAP — backups / patching / monitoring (Steps 5-7)
- Backups disabled (
BackupRetentionPeriod: 0):
aws rds modify-db-instance --db-instance-identifier <id> --backup-retention-period 7 --profile <p>. Setting > 0 enables PITR and
triggers the first automated backup.
- Minor-version upgrade off (
AutoMinorVersionUpgrade: false):
aws rds modify-db-instance --db-instance-identifier <id> --auto-minor-version-upgrade --profile <p>. The upgrade runs in the next
maintenance window.
- Enhanced Monitoring off (
MonitoringInterval: 0): first create or
reuse the AmazonRDSEnhancedMonitoringRole IAM role, then:
aws rds modify-db-instance --db-instance-identifier <id> --monitoring-interval 60 --monitoring-role-arn <role-arn> --profile <p>.
For OK
- No remediation required for the current posture.
- Recommend a defense-in-depth SG review (no
0.0.0.0/0 inbound) and TLS
enforcement at the parameter-group level.
- For Aurora, verify the DBCluster posture independently (this skill audits
instance-level fields; cluster-level audit is a separate scope).
Reference — edge cases
Moved verbatim to references/advanced-patterns.md — load on demand.
Recent AWS features (2024-2026)
Moved verbatim to references/advanced-patterns.md — load on demand.
References (load on demand)
- references/diagnostic-commands.md — account-wide paginated describe-db-instances / describe-db-clusters sweep.
- references/error-handling.md — malformed-metadata ERROR contract deep dive (missing fields, type mismatches).
- references/advanced-patterns.md — philosophy, Step 0 expert RDS behaviours, edge-case catalog, recent AWS features.
Domain
AWS CloudOps / RDS Database Security, Availability & Operational Posture.
AWS documentation
1---2name: rds-instance-auditor3description: Audits AWS RDS DB instances for the seven high-impact configuration risks that drive data-loss and outage incidents — public accessibility (internet-exposed database), encryption-at-rest (immutable post-creation), deletion protection, Multi-AZ availability, automated-backup / PITR retention, auto minor-version upgrade, and Enhanced Monitoring. Emits a deterministic verdict (PUBLIC | UNENCRYPTED | NO_DELETION_PROTECTION | SINGLE_AZ | CONFIG_GAP | OK) per instance with enumerated findings and specific remediation CLI. Use when reviewing RDS posture, checking for internet-reachable databases, validating encryption enablement, auditing deletion-protection / backup coverage before production deployment, or hardening database instance configuration.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline metadata classification. Live-account audits use aws rds describe-db-instances and aws rds describe-db-clusters (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/rds-instance-auditor8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Databases15 verdict_shape: PUBLIC | UNENCRYPTED | NO_DELETION_PROTECTION | SINGLE_AZ | CONFIG_GAP | OK16 when_to_use: Reviewing an RDS DB instance configuration before production deployment, checking whether a database is internet-reachable, validating encryption-at-rest, auditing deletion-protection or backup coverage, verifying Multi-AZ posture, or hardening database instance configuration across an account.17 when_not_to_use: Aurora cluster-level posture audits (use the DBCluster block directly), performance-tuning or query optimization, IAM/auth analysis (password policies, IAM database authentication), certificate/TLS expiry checks (acm-certificate-expiry-auditor), KMS key-policy or rotation audits (kms-key-policy-auditor), or subnet/route-table reachability analysis. This skill classifies configuration posture from instance metadata — it does not perform live connectivity or penetration testing.18 activation_triggers: audit this RDS instance, is my database public, check RDS encryption, is deletion protection enabled, are automated backups on, Multi-AZ check, minor version upgrade, Enhanced Monitoring off, harden RDS instance, PubliclyAccessible true, BackupRetentionPeriod zero19 invocation_schema: 'Input: either (a) an RDS DB instance configuration (describe-db-instances metadata), optionally paired with the DBCluster block for Aurora engines, OR (b) a db-instance-identifier for live-account audit. Output: deterministic INSTANCE/VERDICT/REASON/FINDINGS/REMEDIATION block per instance, where VERDICT ∈ {PUBLIC, UNENCRYPTED, NO_DELETION_PROTECTION, SINGLE_AZ, CONFIG_GAP, OK, ERROR}.'20 invocation_example: '# Minimal valid input (offline metadata classification):2122 DBInstanceIdentifier: db-prod-mysql-012324 Engine: mysql2526 DBInstanceStatus: available2728 PubliclyAccessible: false2930 StorageEncrypted: true3132 KmsKeyId: arn:aws:kms:us-east-1:111111111111:key/abc3334 MultiAZ: true3536 DeletionProtection: false3738 BackupRetentionPeriod: 73940 AutoMinorVersionUpgrade: true4142 MonitoringInterval: 604344 # For Aurora, also supply the DBCluster block:4546 # DBClusterIdentifier, StorageEncrypted, DeletionProtection,4748 # BackupRetentionPeriod (cluster is authoritative for these).'49 version: 0.1.050 author: Jacky Chan — AWS Community Builder51 keywords: RDS, DB instance, public accessibility, encryption-at-rest, StorageEncrypted, Multi-AZ, deletion protection, automated backups, BackupRetentionPeriod, minor version upgrade, Enhanced Monitoring, PITR, Aurora cluster scope, database audit, data loss prevention, PubliclyAccessible, DB instance hardening52 tags: rds, databases, security, availability, encryption, backups, multi-az, audit53---5455# RDS Instance Auditor5657## Quick start5859- **Verdict order (first match wins):** PUBLIC → UNENCRYPTED → NO_DELETION_PROTECTION → SINGLE_AZ → CONFIG_GAP → OK. Emit all dimensions in FINDINGS regardless.60- **Aurora is cluster-scoped:** for `aurora-*` engines, encryption/deletion-protection/Multi-AZ/retention live on the `DBCluster`; defer to `describe-db-clusters`.61- **Encryption is immutable:** `StorageEncrypted` cannot be toggled in place — remediation is snapshot → encrypted-copy → restore-new → cutover.6263## Mindset6465Audit RDS configuration metadata against seven high-impact dimensions and66emit the worst finding as the verdict, with every dimension enumerated67regardless of the headline.6869## Philosophy7071> Moved verbatim to [`references/advanced-patterns.md`](references/advanced-patterns.md) — load on demand.727374## Quick reference — severity thresholds7576The verdict enum is ordered worst → least. The first matching dimension in the77ordered steps below is the verdict; remaining dimensions are still enumerated78in the FINDINGS list.7980| Condition | Verdict | Step |81|---|---|---|82| `PubliclyAccessible: true` on a non-Aurora instance | **PUBLIC** | Step 1 |83| `StorageEncrypted: false` (non-Aurora, or DBCluster for Aurora) | **UNENCRYPTED** | Step 2 |84| `DeletionProtection: false` on the instance (or cluster, Aurora) | **NO_DELETION_PROTECTION** | Step 3 |85| `MultiAZ: false` on a primary, non-Aurora, non-Read-Replica instance | **SINGLE_AZ** | Step 4 |86| `BackupRetentionPeriod: 0` OR `AutoMinorVersionUpgrade: false` OR `MonitoringInterval: 0` | **CONFIG_GAP** | Step 5-7 |87| All seven dimensions pass | **OK** | Step 8 |8889See the ordered steps for Aurora/replica edge cases. Deep RDS-specific90behaviours (immutability, cluster scope, standby semantics, maintenance-window91interactions) are in the [Expert edge cases](#expert-edge-cases) section.9293## Pre-flight: instance metadata gate (run before classification)9495Several instance attributes **short-circuit** or **redirect** the audit.96Misclassifying them produces false positives that erode trust.9798**Account-wide sweep (pagination):** `describe-db-instances` caps at 10099records/page. Drain the `Marker` to completion:100> Moved verbatim to [`references/diagnostic-commands.md`](references/diagnostic-commands.md) — load on demand.101102103| Attribute | Value | Effect on audit |104|---|---|---|105| `Engine` | `aurora-mysql`, `aurora-postgresql` | **Aurora instance.** Encryption, deletion protection, and Multi-AZ live on the DBCluster. Do NOT flag instance-level `StorageEncrypted`/`DeletionProtection`/`MultiAZ` — defer to cluster metadata (Steps 2-4 cluster branch). Backup retention is also cluster-level and `0` is rejected by the API. |106| `DBInstanceStatus` | `deleting` | Instance is being torn down. Skip audit, emit `VERDICT: OK` with note "instance is deleting — no remediation applicable." Do NOT propose modifications against a deleting instance. |107| `DBInstanceStatus` | `failed`, `inaccessible`, `incompatible-*` | Instance is non-functional. Surface as an operational finding but still audit the seven dimensions on the stored configuration. |108| `ReadReplicaSourceDBInstanceIdentifier` | present | **Read Replica.** Read-only by design. SINGLE_AZ on a replica is lower acuity (the primary's Multi-AZ is the availability gate for writes); downgrade SINGLE_AZ from a hard fail to a note unless the replica is itself a production read endpoint. |109| `InstanceClass` | `db.serverless` | Aurora Serverless v1/v2 scaling is cluster-governed; MultiAZ semantics differ. Defer to cluster. |110| `PendingModifiedValues` | any field populated | An in-flight modification is queued. Audit the CURRENT value (not the pending one); note the pending change in REMEDIATION so the operator knows whether the gap is already being addressed. |111| `StorageEncrypted: true` + `KmsKeyId` absent | — | RDS uses the AWS-managed `aws/rds` key. **It IS encrypted** — do NOT flag UNENCRYPTED. Key-policy / rotation concerns are the kms-key-policy-auditor's scope, not this skill. |112113**If the instance metadata is malformed** (missing `DBInstanceIdentifier`,114absent `Engine`, or unparseable), output:115116```text117INSTANCE: <identifier or unknown>118VERDICT: ERROR119REASON: RDS instance metadata is missing required fields (DBInstanceIdentifier, Engine) — cannot classify.120REMEDIATION: Re-fetch with `aws rds describe-db-instances --db-instance-identifier <id> --output json` and re-audit.121```122123## Process — Classification logic (apply in order, aggregate worst)124125### Step 0: Expert knowledge — non-obvious RDS behaviours that change classification126127> Moved verbatim to [`references/advanced-patterns.md`](references/advanced-patterns.md) — load on demand.128129130### Step 1: Public accessibility (highest priority — internet exposure)131132If `PubliclyAccessible: true` on the instance, the dimension verdict is133**PUBLIC**. This is the worst verdict in the enum — an internet-reachable134database is the highest-impact RDS misconfiguration. The flag is evaluated135first because exposure compounds every other finding: an unencrypted, no-backup136public database is a write-once ransomware target.137138For Aurora instances, `PubliclyAccessible` is still instance-level (each139instance gets its own flag), so this step applies the same way.140141A `0.0.0.0/0` security-group inbound rule is NOT required to produce PUBLIC —142the flag alone is sufficient. Note permissive SGs in REMEDIATION regardless.143144### Step 2: Encryption-at-rest (immutable — migration required)145146For non-Aurora engines: if `StorageEncrypted: false`, the dimension verdict is147**UNENCRYPTED**.148149For Aurora engines: defer to the `DBCluster.StorageEncrypted` field. If the150cluster block is not provided in the input, emit an AURORA_SCOPE note and do151NOT classify this dimension from the instance-level echo — flag it as needing152cluster metadata. If `DBCluster.StorageEncrypted: false`, the verdict is153UNENCRYPTED at the cluster level. **Missing-cluster fallback:** when no154DBCluster block is provided, append to FINDINGS:155`[AURORA_SCOPE] Cluster metadata missing — run: aws rds describe-db-clusters --db-cluster-identifier <cluster-id> --output json. Cannot classify encryption/deletion-protection/Multi-AZ from instance echoes. Verdict reflects instance-level checks only (PubliclyAccessible).`156This prevents silent false-positives while giving the operator the exact CLI157to fetch the missing data.158159`StorageEncrypted: true` with absent `KmsKeyId` is OK — RDS uses the160AWS-managed `aws/rds` key. Do NOT flag this as UNENCRYPTED.161162### Step 3: Deletion protection (accidental deletion guardrail)163164For non-Aurora: if `DeletionProtection: false`, the dimension verdict is165**NO_DELETION_PROTECTION**. With protection off, a single166`delete-db-instance` call (with `--skip-final-snapshot`) destroys the instance167and its data. The guardrail exists to force a deliberate disable step before168destructive actions.169170For Aurora: defer to `DBCluster.DeletionProtection`. Instance-level deletion171protection is not the gate for Aurora — the cluster is the deletable unit.172173### Step 4: Multi-AZ (availability — AZ failure resilience)174175For non-Aurora primary instances: if `MultiAZ: false`, the dimension verdict176is **SINGLE_AZ**. With no standby, an AZ-level failure (power, network, host)177causes an outage until RDS provisions a replacement — typically minutes to178tens of minutes. Multi-AZ provides a synchronous standby in a second AZ with179automatic failover (60-120 seconds of connection drop).180181**Downgrade cases (note in FINDINGS, do not drive the verdict):**182- **Read Replica** (`ReadReplicaSourceDBInstanceIdentifier` present): the183 replica is read-only; the primary's Multi-AZ is the write-availability gate.184 Emit SINGLE_AZ as a note, not a hard finding, unless this replica is a185 production read endpoint with strict read SLAs.186- **Aurora instance**: Multi-AZ is a cluster-level property (replicas across187 AZs). Defer to the cluster; do not flag instance-level `MultiAZ`.188189### Step 5: Automated backups (PITR coverage)190191If `BackupRetentionPeriod: 0` on a non-Aurora instance, this is a CONFIG_GAP192contributor. `0` disables automated backups and point-in-time recovery193entirely — there is no transaction-log archive and the only restore path is a194manual snapshot. The valid range is 0-35 days; AWS default is 7.195196For Aurora: `BackupRetentionPeriod` is cluster-level and `0` is rejected by197the API (continuous backups, 1-35). A reported `0` on Aurora is stale or198invalid metadata — note it but do NOT flag CONFIG_GAP from this field.199200### Step 6: Auto minor-version upgrade (patching hygiene)201202If `AutoMinorVersionUpgrade: false`, this is a CONFIG_GAP contributor. The203instance will not pick up minor-engine-version patches during the maintenance204window — these include security fixes and stability improvements. Major205versions are always opt-in and are out of scope for this flag.206207### Step 7: Enhanced Monitoring (OS-level observability)208209If `MonitoringInterval: 0` (or absent), Enhanced Monitoring is OFF and this210is a CONFIG_GAP contributor. Without it, only engine-level CloudWatch metrics211exist — there is no OS-level signal for CPU steal, swap pressure, or file212system fill, which are the precursors to most "the database is slow but213CloudWatch looks fine" incidents.214215### Step 8: Aggregation — worst finding wins216217The final verdict is the **worst** dimension verdict in this fixed order,218where PUBLIC > UNENCRYPTED > NO_DELETION_PROTECTION > SINGLE_AZ > CONFIG_GAP >219OK:220221```text222verdict = first_match(223 Step 1 PUBLIC,224 Step 2 UNENCRYPTED,225 Step 3 NO_DELETION_PROTECTION,226 Step 4 SINGLE_AZ,227 Step 5-7 CONFIG_GAP,228 OK229)230```231232All dimensions are still enumerated in the FINDINGS list regardless of the233verdict, so the operator sees the full posture (a PUBLIC instance that is234also UNENCRYPTED shows both, with PUBLIC as the headline verdict).235236## Output format (per instance)237238```text239INSTANCE: <db-instance-identifier>240VERDICT: PUBLIC | UNENCRYPTED | NO_DELETION_PROTECTION | SINGLE_AZ | CONFIG_GAP | OK241REASON: <1-2 sentences citing the worst finding and its step number>242FINDINGS:243 - [PUBLIC] <finding description (Step 1)>244 - [UNENCRYPTED] <finding description (Step 2)>245 - [OK] <dimension that passed>246 - [PENDING] <field> is queued to change to <value> at next window / on --apply-immediately (audited on CURRENT value; do not double-remediate)247REMEDIATION: <specific action per finding, or "None required" if OK>248CONFIRM: Before executing any state-changing CLI above, emit and await operator249approval: "CONFIRM: About to <action> on <id> in <region>. Proceed? (yes/no)"250```251252The `[PENDING]` line is emitted ONLY when `PendingModifiedValues` contains a253queued change to one of the seven audited fields. It is informational — the254verdict and FINDINGS reflect the CURRENT value. Skip the `[PENDING]` line when255no fields are pending.256257### Concrete error-handling example — malformed metadata258259> Moved verbatim to [`references/error-handling.md`](references/error-handling.md) — load on demand.260261262### Worked example — public and unencrypted dev instance263264```text265INSTANCE: db-public-and-unencrypted266VERDICT: PUBLIC267REASON: PubliclyAccessible is true on a non-Aurora instance — the database268has a public IP and is internet-reachable subject to VPC routing (Step 1).269StorageEncrypted is also false, compounding exposure (Step 2).270FINDINGS:271 - [PUBLIC] PubliclyAccessible: true — internet-exposed database (Step 1)272 - [UNENCRYPTED] StorageEncrypted: false — data at rest is plaintext;273 remediation is a snapshot migration, not a toggle (Step 2)274 - [NO_DELETION_PROTECTION] DeletionProtection: false (Step 3)275 - [OK] MultiAZ: true, BackupRetentionPeriod: 7, AutoMinorVersionUpgrade: true,276 MonitoringInterval: 60277REMEDIATION:278 1. PUBLIC — Remove the public IP immediately:279 aws rds modify-db-instance --db-instance-identifier db-public-and-unencrypted280 --publicly-accessible false --apply-immediately --profile <p>281 2. UNENCRYPTED — Plan the encryption migration (cannot be done in place):282 aws rds create-db-snapshot --db-instance-identifier db-public-and-unencrypted283 --db-snapshot-identifier pre-encrypt-$(date +%s) --profile <p>284 aws rds copy-db-snapshot --source-db-snapshot-identifier pre-encrypt-...285 --target-db-snapshot-identifier encrypted-copy --kms-key-id <kms-id> --profile <p>286 aws rds restore-db-instance-from-db-snapshot --db-instance-identifier287 db-public-and-unencrypted-enc --db-snapshot-identifier encrypted-copy --profile <p>288 Then promote and cut over the endpoint.289 3. NO_DELETION_PROTECTION — Enable after confirming no in-flight deletion:290 aws rds modify-db-instance --db-instance-identifier db-public-and-unencrypted291 --deletion-protection --apply-immediately --profile <p>292CONFIRM: Before executing any CLI above, emit and await:293 "CONFIRM: About to modify-db-instance on db-public-and-unencrypted in294 us-east-1. This changes public accessibility and deletion-protection295 (existing public-IP connections will drop). Proceed? (yes/no)"296 Do NOT run the CLI until the operator replies yes.297```298299## Anti-Patterns — NEVER300301- NEVER recommend enabling encryption on an existing unencrypted instance302 with `modify-db-instance`. The `StorageEncrypted` flag is immutable after303 creation; `modify-db-instance` will reject the change. The only path is304 snapshot → encrypted copy → restore-new → cutover. Pretending otherwise305 produces a remediation that fails at execution time.306307- NEVER flag `StorageEncrypted: true` with absent `KmsKeyId` as UNENCRYPTED.308 RDS transparently uses the AWS-managed `aws/rds` key in this case — the309 data IS encrypted at rest. Key-policy and rotation concerns are out of310 scope for this skill (route to kms-key-policy-auditor).311312- NEVER flag a Read Replica as a hard SINGLE_AZ finding without noting it is313 a replica. Read Replicas are read-only scaling instances; their Multi-AZ314 posture is materially less critical than the primary's. Over-flagging315 produces alert fatigue and trains operators to ignore the verdict.316317- NEVER flag `MultiAZ: false`, `StorageEncrypted`, or `DeletionProtection` on318 an Aurora instance from the instance-level fields alone. For Aurora these319 are DBCluster properties and the instance echoes are not authoritative.320 Doing so produces false positives on every Aurora audit.321322- NEVER flag `BackupRetentionPeriod: 0` on an Aurora instance. The API323 rejects `0` for Aurora (continuous backups, retention 1-35 enforced324 server-side at `modify-db-cluster` time); a reported `0` is stale cache,325 malformed `describe` output, or a fabricated test payload — never a live326 configuration. Operational impact of flagging it anyway: the operator opens327 a phantom incident, drains engineering cycles chasing metadata the RDS328 control plane will not even accept, and learns to dismiss other findings as329 "API noise," eroding the credibility of legitimate findings on the same330 report.331332- NEVER treat `PubliclyAccessible: false` as the complete public-access333 picture for defense-in-depth. A `0.0.0.0/0` inbound security-group rule is334 still a smell — the instance is one `modify-db-instance --publicly-accessible335 true` away from internet exposure. Note permissive SGs in REMEDIATION336 regardless of the verdict, but do NOT upgrade PUBLIC to a worse verdict337 (there is none) and do NOT invent a new verdict.338339- NEVER downgrade `PubliclyAccessible: true` to a non-PUBLIC verdict because340 the security group looks locked down. The public IP is published; a future341 SG edit, ELB attachment, or VPC peering change exposes the database. The342 flag itself is the verdict driver.343344- NEVER treat `DeletionProtection: true` as a security control. Any principal345 with `rds:ModifyDBInstance` can disable it and delete. It is an346 accidental-deletion guardrail for operators and pipelines, not a defence347 against a determined attacker with database-admin rights.348349- NEVER treat `AutoMinorVersionUpgrade: true` as "fully patched." It covers350 minor versions only, runs only during the maintenance window, and is351 blocked if a `PendingModifiedValues` modification is queued. Major-version352 upgrades are always opt-in. `true` is necessary but not sufficient.353354- NEVER recommend `--apply-immediately` for every remediation. Use it for355 PUBLIC (close the exposure now) and NO_DELETION_PROTECTION (cheap to apply).356 Prefer the maintenance window for Multi-AZ enablement (causes brief I/O357 suspension), minor-version upgrades (engine restart), and Enhanced358 Monitoring role wiring. Stacking `--apply-immediately` modifications on a359 production instance can cause an unplanned multi-minute restart window.360361- NEVER audit only the first page of `describe-db-instances`. The API caps at362 100 records per page. The long-tail instances (dev, test, forgotten363 production) are disproportionately likely to be misconfigured. Always drain364 the `Marker` to completion:365 ```bash366 # Paginate all instances367 aws rds describe-db-instances --output json --query 'DBInstances[*].[DBInstanceIdentifier,Engine,PubliclyAccessible,StorageEncrypted,MultiAZ,DeletionProtection,BackupRetentionPeriod,AutoMinorVersionUpgrade,MonitoringInterval]' --starting-token "<Marker from prior call>"368 # Fetch Aurora cluster metadata separately369 aws rds describe-db-clusters --output json --query 'DBClusters[*].[DBClusterIdentifier,Engine,StorageEncrypted,DeletionProtection,BackupRetentionPeriod]'370 ```371372- NEVER modify an instance with `DBInstanceStatus: deleting`,373 `incompatible-parameters`, or `incompatible-restore`. The API rejects374 modifications and the operator may be mid-recovery. Surface the status and375 abort remediation.376377- NEVER assume a cross-region Read Replica is encrypted because the source is378 encrypted. Cross-region replicas require a separate KMS CMK in the379 destination region; if the replica was created with a misconfigured or380 deleted key, its `StorageEncrypted` may read `true` while the key is381 unusable. When auditing a cross-region replica, verify `KmsKeyId` resolves382 to an active key in the replica's region, not just that the boolean is set.383384## Pre-flight safety checks (run before any remediation CLI)385386- **MANDATORY CONFIRMATION GATE.** Before any state-changing RDS operation387 (`modify-db-instance`, `delete-db-instance`, `create-db-snapshot`), the388 auditor MUST emit:389 `CONFIRM: About to <action> on <db-instance-identifier> in <region>. This390 affects <consequence>. Proceed? (yes/no)`391 Do NOT execute the CLI until the operator confirms. This gate prevents392 automated pipelines from silently modifying production databases.393- **Snapshot before destructive modifications.** Before Multi-AZ enablement,394 encryption migration, or major remediation, capture a snapshot:395 `aws rds create-db-snapshot --db-instance-identifier <id>396 --db-snapshot-identifier pre-remediation-$(date +%s) --profile <p>`.397 Encryption migration in particular is irreversible without a snapshot of398 the original.399- **Verify the instance is `available` before modifying.**400 `aws rds describe-db-instances --db-instance-identifier <id>` — confirm401 `DBInstanceStatus` is `available`. Modifying a `modifying`, `backing-up`,402 or `creating` instance fails or queues behind existing work.403- **Encryption migration is a cutover, not a patch.** The restore-new404 instance has a new endpoint. Plan DNS/endpoint cutover, application405 connection-string updates, and a rollback path (keep the original406 unencrypted instance until cutover is verified). Never delete the original407 until the encrypted replacement is confirmed serving traffic.408- **Multi-AZ enablement causes a brief I/O suspension.** Synchronous standby409 creation suspends I/O for a few minutes during standby provisioning. Schedule410 outside peak write windows. The instance stays available but latency spikes.411- **`--apply-immediately` vs maintenance window.** For PUBLIC and412 NO_DELETION_PROTECTION findings, `--apply-immediately` is appropriate413 (security/accidental-loss prevention). For SINGLE_AZ enablement and CONFIG_GAP414 dimensions, ALWAYS omit `--apply-immediately` — Multi-AZ standby provisioning415 causes an I/O suspension of 1-3 minutes that will interrupt live writes. Queue416 to the next maintenance window explicitly. Stacking `--apply-immediately` on417 multiple dimensions at once compounds the disruption.418- **Confirm the caller has `rds:ModifyDBInstance`.** Many read-only auditor419 roles cannot modify. Surface this before the operator approves a change420 that will fail with `AccessDenied`.421- **Bulk-operation safety limit (enforced by the skill).** Remediation across422 an account sweep MUST follow this exact algorithm:423 1. Sort flagged instances verdict-first (PUBLIC before UNENCRYPTED, etc.).424 2. Slice into batches of **at most 5 instances**.425 3. For each batch: emit the per-instance REMEDIATION block, then a single426 `CONFIRM: About to modify <id1, id2, …, idN> in <region>. Proceed? (yes/no)`.427 4. After the operator confirms and the CLI runs, re-query with428 `aws rds describe-db-instances --db-instance-identifier <each modified id>`429 and verify the intended state landed before emitting the NEXT batch.430 5. Abort the sweep if any instance in a batch enters `modifying`, `failed`,431 or `incompatible-*` state — do NOT proceed to the next batch.432 The skill MUST NOT emit remediation CLI for more than 5 instances in a433 single output block. Auto-applying across an entire account in one pass is434 forbidden: a single systematic misclassification or IaC-drift mismatch435 cascades into mass disruption, and batched execution contains the blast436 radius of any one mistake.437438## Remediation guidance439440**Ordering principle:** remediate findings in severity order (PUBLIC first),441and prefer additive/online changes over migrations where possible. Encryption442is the only dimension that requires a migration — every other dimension has a443`modify-db-instance` path.444445### For PUBLIC — internet-exposed database (Step 1)4464471. Immediately remove the public IP:448 `aws rds modify-db-instance --db-instance-identifier <id>449 --publicly-accessible false --apply-immediately --profile <p>`.450 Existing public-IP connections drop; private-IP connections are unaffected.4512. Audit the security group: if any inbound rule is `0.0.0.0/0` on the DB452 port (3306/5432/1433/etc.), tighten to the application's CIDR or security453 group reference.4543. If public access is genuinely required (rare — use a bastion or SSM Session455 Manager instead), require TLS at the engine level (parameter group:456 `rds.force_ssl=1` for PostgreSQL, require_secure_transport for MySQL) and457 restrict the SG to a known egress CIDR.458459### For UNENCRYPTED — plaintext data at rest (Step 2)4604611. Snapshot:462 `aws rds create-db-snapshot --db-instance-identifier <id>463 --db-snapshot-identifier pre-encrypt-$(date +%s) --profile <p>`.4642. Copy with encryption:465 `aws rds copy-db-snapshot --source-db-snapshot-identifier <snap>466 --target-db-snapshot-identifier <snap>-enc --kms-key-id <kms-id> --profile <p>`.4673. Restore new encrypted instance:468 `aws rds restore-db-instance-from-db-snapshot --db-instance-identifier469 <id>-enc --db-snapshot-identifier <snap>-enc --profile <p>`.4704. Cutover: rename the old instance (`--new-db-instance-identifier <id>-old`)471 and rename the encrypted instance to the original identifier so the472 endpoint absorbs. Verify application connectivity, then delete the old473 unencrypted instance after a confirmation window.4745. Enable deletion protection on the new encrypted instance as the last step.475476### For NO_DELETION_PROTECTION — accidental deletion (Step 3)477478`aws rds modify-db-instance --db-instance-identifier <id>479--deletion-protection --apply-immediately --profile <p>`.480For Aurora, apply at the cluster: `aws rds modify-db-cluster`.481482### For SINGLE_AZ — availability gap (Step 4)483484`aws rds modify-db-instance --db-instance-identifier <id> --multi-az485--profile <p>` (omit `--apply-immediately` — let it run in the next window).486Brief I/O suspension occurs during standby provisioning. Note: the standby is487not read-capable; for read scaling, provision Read Replicas separately.488489### For CONFIG_GAP — backups / patching / monitoring (Steps 5-7)490491- **Backups disabled** (`BackupRetentionPeriod: 0`):492 `aws rds modify-db-instance --db-instance-identifier <id>493 --backup-retention-period 7 --profile <p>`. Setting > 0 enables PITR and494 triggers the first automated backup.495- **Minor-version upgrade off** (`AutoMinorVersionUpgrade: false`):496 `aws rds modify-db-instance --db-instance-identifier <id>497 --auto-minor-version-upgrade --profile <p>`. The upgrade runs in the next498 maintenance window.499- **Enhanced Monitoring off** (`MonitoringInterval: 0`): first create or500 reuse the `AmazonRDSEnhancedMonitoringRole` IAM role, then:501 `aws rds modify-db-instance --db-instance-identifier <id>502 --monitoring-interval 60 --monitoring-role-arn <role-arn> --profile <p>`.503504### For OK5055061. No remediation required for the current posture.5072. Recommend a defense-in-depth SG review (no `0.0.0.0/0` inbound) and TLS508 enforcement at the parameter-group level.5093. For Aurora, verify the DBCluster posture independently (this skill audits510 instance-level fields; cluster-level audit is a separate scope).511512## Reference — edge cases513514> Moved verbatim to [`references/advanced-patterns.md`](references/advanced-patterns.md) — load on demand.515516517## Recent AWS features (2024-2026)518519> Moved verbatim to [`references/advanced-patterns.md`](references/advanced-patterns.md) — load on demand.520521522## References (load on demand)523524- [references/diagnostic-commands.md](references/diagnostic-commands.md) — account-wide paginated describe-db-instances / describe-db-clusters sweep.525- [references/error-handling.md](references/error-handling.md) — malformed-metadata ERROR contract deep dive (missing fields, type mismatches).526- [references/advanced-patterns.md](references/advanced-patterns.md) — philosophy, Step 0 expert RDS behaviours, edge-case catalog, recent AWS features.527528## Domain529530AWS CloudOps / RDS Database Security, Availability & Operational Posture.531532## AWS documentation533534- **Amazon RDS User Guide** — https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html535- **Security in Amazon RDS** — https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.html536- **Amazon RDS API Reference** — https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/537- **AWS CLI RDS reference** — https://docs.aws.amazon.com/cli/latest/reference/rds/538- **Blue/Green deployments** — https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html