Skip to main content

🧠 AWS RDS Snapshot is publicly accessible - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS RDS SnapshotCA10__CaAwsDbSnapshot__c411

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:45:06.933900665Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ extract('CA10__encrypted__c') == trueβœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ extract('CA10__snapshotType__c') == 'automated' || extract('CA10__snapshotType__c') == 'awsbackup'βœ”οΈ null
🟒test4βœ”οΈ 399βœ”οΈ extract('CA10__snapshotType__c') == 'public'βœ”οΈ null
🟒test5βœ”οΈ 401βœ”οΈ CA10__attributesJson__c.delegatedTo(CA10__attributesJson__c).isEmpty()βœ”οΈ null
🟒test6βœ”οΈ 499βœ”οΈ extract('caJsonFrom__attributesJson__c').jsonQueryText('to_string(restore[0])') == 'all'βœ”οΈ null
🟒test7βœ”οΈ 500βœ”οΈ otherwiseβœ”οΈ null
🟒test8βœ”οΈ 500βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/aws/rds/snapshot-publicly-accessible/policy.yaml6D60AC2FE0D7FC6DC4658EE132A35FB3
Open/ce/ca/aws/rds/snapshot-publicly-accessible/prod.logic.yamlFB926F9ED434E1BEBE1917C3B2E91EA4
Open/ce/ca/aws/rds/snapshot-publicly-accessible/test-data.jsonF925F0C16F8C3C8D5244C998646C0A4E
Open/types/CA10__CaAwsDbSnapshot__c/object.extracts.yamlE565EC7B175FE1579DD0C2940700B20F

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/aws/rds/snapshot-publicly-accessible/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/rds/snapshot-publicly-accessible/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/rds/snapshot-publicly-accessible/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/rds/snapshot-publicly-accessible/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/aws/rds/snapshot-publicly-accessible/prod.logic.yaml

Content​

Open File

---
inputType: CA10__CaAwsDbSnapshot__c
importExtracts:
- file: "/types/CA10__CaAwsDbSnapshot__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: INAPPLICABLE
currentStateMessage: Encrypted RDS Snapshots cannot be public # cannot be set to restore:all
check:
IS_EQUAL:
left:
EXTRACT: CA10__encrypted__c
right:
BOOLEAN: true
- status: INAPPLICABLE
currentStateMessage: RDS Snapshots created automatically or via AWS Backup Service cannot be public
check:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: CA10__snapshotType__c
right:
TEXT: automated
- IS_EQUAL:
left:
EXTRACT: CA10__snapshotType__c
right:
TEXT: awsbackup
- status: INCOMPLIANT
currentStateMessage: RDS Snapshot is publicly accessible
remediationMessage: Consider making the snapshot completely private or scoping the access to a subset of AWS Accounts.
check:
IS_EQUAL:
left:
EXTRACT: CA10__snapshotType__c
right:
TEXT: public
# TODO: modify the INCOMPLIANT status logic to use map ops when released.
- status: INCOMPLIANT
currentStateMessage: RDS snapshot is publicly accessible
remediationMessage: Consider making the snapshot completely private or scoping the access to a subset of AWS Accounts.
check:
IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: caJsonFrom__attributesJson__c
expression: "to_string(restore[0])"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "all"
otherwise:
status: COMPLIANT
currentStateMessage: RDS snapshot is not publicly accessible