Triage and Remediation
- Remediation
Remediation
Using Console
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
- Sign in to the AWS Management Console.
- Go to:
- For Neptune: Services → Neptune
- For RDS: Services → RDS
Step 2: Locate the Public Snapshot
- In the left navigation pane:
- Neptune: click Snapshots
- RDS: click Snapshots
- 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.
- 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
- Select the snapshot you want to fix (check the box next to it).
- Choose Actions → Share snapshot (Neptune/RDS wording is similar, may be “Share” or “Modify snapshot permissions”).
- 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
- 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.
- Verify that:
- The snapshot is not marked as public.
- No option indicates “accessible by all AWS 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
- Click Save, Modify, or Share (button name varies).
- Wait a few moments for the changes to apply.
Step 6: Confirm It’s No Longer Public
- 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.
- If applicable, try using Describe or Details to verify that the snapshot is only shared with specific account IDs or is private.
Using CLI
Using CLI
To ensure Neptune (or RDS) DB cluster snapshots are not public using the AWS CLI, you need to remove the
If you only want manual snapshots:Note/copy the snapshot identifiers you want to check or fix.
If you see:then the snapshot is public (because
This keeps any specific AWS account IDs that are listed but removes public access.
Ensure
This will automatically remove public access from all public manual DB cluster snapshots.
all value from the restore attribute on each snapshot.Below are step‑by‑step commands.1. List all DB cluster snapshots
2. Check if a cluster snapshot is public
Run for each snapshot:all is present).3. Make the snapshot private (remove public access)
Removeall from the restore attribute:4. Verify the snapshot is no longer public
AttributeValues does not contain "all".5. (Optional) Bulk remediation for all public cluster snapshots
You can use a small shell loop (bash):Using Python
Using Python
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 samerds/Neptune family in boto3 viaclient = boto3.client("neptune").
1. Prerequisites
- Python 3.x
boto3installed:- AWS credentials configured with permissions:
neptune:DescribeDBClusterSnapshotsneptune:DescribeDBClusterSnapshotAttributesneptune:ModifyDBClusterSnapshotAttribute
2. Logic
- List all Neptune DB cluster snapshots.
- For each snapshot, retrieve its restore attributes.
- If
allis present in theAttributeValuesfor therestoreattribute, the snapshot is public. - Remove
allfrom restore permissions usingModifyDBClusterSnapshotAttribute.
3. Python Script to Identify and Fix Public Snapshots
4. Steps to Use
- Save the script as
fix_neptune_public_snapshots.py. - Run a dry run:
- Confirm the list of snapshots marked as “PUBLIC and would be fixed”.
- Uncomment the last line and run with
dry_run=Falseto actually remove public access:
all in their restore attribute, making them private.Using Terraform
Using Terraform

