2024-04-11 14:23:07 +00:00
|
|
|
id: rds-public-snapshot
|
|
|
|
info:
|
|
|
|
name: RDS Public Snapshot Exposure
|
|
|
|
author: princechaddha
|
|
|
|
severity: high
|
|
|
|
description: |
|
|
|
|
Checks if AWS RDS database snapshots are publicly accessible, risking exposure of sensitive data.
|
|
|
|
impact: |
|
|
|
|
Public snapshots can expose sensitive data to unauthorized users, leading to potential data breaches.
|
|
|
|
remediation: |
|
|
|
|
Modify the snapshot's visibility settings to ensure it is not public, only shared with specific AWS accounts.
|
|
|
|
reference:
|
|
|
|
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html
|
2024-06-07 10:04:29 +00:00
|
|
|
metadata:
|
|
|
|
max-request: 2
|
2024-04-11 14:23:07 +00:00
|
|
|
tags: cloud,devops,aws,amazon,rds,aws-cloud-config
|
|
|
|
variables:
|
|
|
|
region: "ap-northeast-1"
|
|
|
|
|
|
|
|
flow: |
|
|
|
|
code(1)
|
|
|
|
for(let RDPsnaps of iterate(template.snapshots)){
|
|
|
|
set("snapshot", RDPsnaps)
|
|
|
|
code(2)
|
|
|
|
}
|
|
|
|
|
|
|
|
self-contained: true
|
|
|
|
code:
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws rds describe-db-snapshots --region $region --snapshot-type manual --output json --query 'DBSnapshots[*].DBSnapshotIdentifier'
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: json
|
|
|
|
name: snapshots
|
|
|
|
internal: true
|
|
|
|
json:
|
|
|
|
- '.[]'
|
|
|
|
|
|
|
|
- engine:
|
|
|
|
- sh
|
|
|
|
- bash
|
|
|
|
source: |
|
|
|
|
aws rds describe-db-snapshot-attributes --region $region --db-snapshot-identifier $snapshot --query 'DBSnapshotAttributesResult.DBSnapshotAttributes'
|
|
|
|
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- '"all"'
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: dsl
|
|
|
|
dsl:
|
|
|
|
- '"RDS snapshot " + snapshot + " is public"'
|
2024-06-08 16:02:17 +00:00
|
|
|
# digest: 490a004630440220406064aac939d4deee904e965a39e74b5b6a866aa0120dc7a3ac03683a464fcb02204c1c229f967d74c64b9b3ebc03c6d31678f471305d10f708528996202549111f:922c64590222798bb761d5b6d8e72950
|