Skip to main content

Triage and Remediation

Remediation

Using Console

To fix a public Neptune DB cluster snapshot (or RDS snapshot) using the AWS Management Console, you need to remove the “public” sharing setting and restrict it to specific AWS accounts (or keep it private).

Step 1: Open the Neptune (or RDS) Console

  1. Sign in to the AWS Management Console.
  2. Go to:
    • For Neptune: Services → Neptune
    • For RDS: Services → RDS
(The steps are almost identical; use the service where the snapshot lives.)

Step 2: Locate the Public Snapshot

  1. In the left navigation pane:
    • Neptune: click Snapshots
    • RDS: click Snapshots
  2. In the Snapshots list:
    • Use the Filter dropdown to select Cluster snapshots (for Neptune) or the relevant snapshot type.
    • Look for snapshots with Type = Manual or Automated as needed.
  3. Identify snapshots that are public:
    • For RDS: a snapshot is public if “Public” column shows Yes.
    • For Neptune: check the “Public”/“Shared” indicator or check its attributes in the next step.

Step 3: View and Edit Snapshot Permissions

  1. Select the snapshot you want to fix (check the box next to it).
  2. Choose Actions → Share snapshot (Neptune/RDS wording is similar, may be “Share” or “Modify snapshot permissions”).
  3. A panel opens showing:
    • Whether the snapshot is Public
    • A list of AWS account IDs the snapshot is shared with (if any)

Step 4: Remove Public Access

  1. In the Snapshot visibility or Public access section:
    • If there is a checkbox or toggle such as “Public”, “Make snapshot public”, or “Share snapshot publicly”, clear/disable it.
  2. Verify that:
    • The snapshot is not marked as public.
    • No option indicates “accessible by all AWS accounts”.
If you need the snapshot to remain shared with specific accounts:
  • Leave “Public” turned off.
  • In “Add AWS account ID”, enter only the specific AWS Account IDs you trust and click Add.

Step 5: Save Changes

  1. Click Save, Modify, or Share (button name varies).
  2. Wait a few moments for the changes to apply.

Step 6: Confirm It’s No Longer Public

  1. Back in the Snapshots list:
    • Confirm that the Public column for that snapshot is now No (for RDS), or that the visibility/permissions show not public for Neptune.
  2. If applicable, try using Describe or Details to verify that the snapshot is only shared with specific account IDs or is private.
Repeat these steps for any other snapshots that are currently public.
To ensure Neptune (or RDS) DB cluster snapshots are not public using the AWS CLI, you need to remove the all value from the restore attribute on each snapshot.Below are step‑by‑step commands.

1. List all DB cluster snapshots

If you only want manual snapshots:
Note/copy the snapshot identifiers you want to check or fix.

2. Check if a cluster snapshot is public

Run for each snapshot:
If you see:
then the snapshot is public (because all is present).

3. Make the snapshot private (remove public access)

Remove all from the restore attribute:
This keeps any specific AWS account IDs that are listed but removes public access.

4. Verify the snapshot is no longer public

Ensure AttributeValues does not contain "all".

5. (Optional) Bulk remediation for all public cluster snapshots

You can use a small shell loop (bash):
This will automatically remove public access from all public manual DB cluster snapshots.
Below is a Python/boto3 approach to detect and fix public Neptune DB cluster snapshots (i.e., snapshots whose restore permissions include all).
Note: This is for Amazon Neptune cluster snapshots (different from standard RDS engines), but the API is under the same rds/Neptune family in boto3 via client = boto3.client("neptune").

1. Prerequisites

  • Python 3.x
  • boto3 installed:
  • AWS credentials configured with permissions:
    • neptune:DescribeDBClusterSnapshots
    • neptune:DescribeDBClusterSnapshotAttributes
    • neptune:ModifyDBClusterSnapshotAttribute

2. Logic

  1. List all Neptune DB cluster snapshots.
  2. For each snapshot, retrieve its restore attributes.
  3. If all is present in the AttributeValues for the restore attribute, the snapshot is public.
  4. Remove all from restore permissions using ModifyDBClusterSnapshotAttribute.

3. Python Script to Identify and Fix Public Snapshots


4. Steps to Use

  1. Save the script as fix_neptune_public_snapshots.py.
  2. Run a dry run:
  3. Confirm the list of snapshots marked as “PUBLIC and would be fixed”.
  4. Uncomment the last line and run with dry_run=False to actually remove public access:
This will ensure all Neptune DB cluster snapshots in the selected region no longer have all in their restore attribute, making them private.