--- policy: /ce/ca/aws/rds/cluster-encryption logic: /ce/ca/aws/rds/cluster-encryption/prod.logic.yaml executionTime: 2026-06-06T12:03:12.849066631Z generationMs: 51 executionMs: 926 rows: - id: test1 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10__storageEncrypted__c') == true actual: extract('CA10__storageEncrypted__c') == true runtimeError: {} - id: test2 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 200 actual: 200 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/aws/rds/cluster-encryption/policy.yaml md5Hash: 31AABFC3DD8777A3E1648E629A854686 content: "---\nnames:\n full: \"AWS RDS Cluster Encryption is not enabled\"\n\ \ contextual: \"Cluster Encryption is not enabled\"\ndescription: >\n Ensure\ \ that Amazon RDS Database Clusters have storage encryption enabled to protect\ \ data at rest.\ntype: \"COMPLIANCE_POLICY\"\ncategories:\n - \"SECURITY\"\n\ frameworkMappings:\n - \"/frameworks/cloudaware/resource-security/data-encryption\"\ \n - \"/frameworks/aws-fsbp-v1.0.0/rds/27\"\n - \"/frameworks/aws-fsbp-v1.0.0/documentdb/01\"\ \n - \"/frameworks/aws-fsbp-v1.0.0/neptune/01\"\n - \"/frameworks/aws-well-architected/sec/08/02\"\ \nsimilarPolicies:\n awsSecurityHub:\n - name: \"[RDS.27] RDS DB clusters\ \ should be encrypted at rest\"\n url: \"https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-27\"\ \n - name: \"[DocumentDB.1] Amazon DocumentDB clusters should be encrypted\ \ at rest\" \n url: \"https://docs.aws.amazon.com/securityhub/latest/userguide/documentdb-controls.html#documentdb-1\"\ \n - name: \"[Neptune.1] Neptune DB clusters should be encrypted at rest\"\ \ \n url: \"https://docs.aws.amazon.com/securityhub/latest/userguide/neptune-controls.html#neptune-1\"\ \n" - path: /ce/ca/aws/rds/cluster-encryption/prod.logic.yaml md5Hash: 99D3CF1E95D627B19B7E269494555276 content: "---\ninputType: \"CA10__CaAwsDbCluster__c\"\ntestData:\n - file: test-data.json\n\ importExtracts:\n - file: /types/CA10__CaAwsDbCluster__c/object.extracts.yaml\n\ conditions:\n - status: \"COMPLIANT\"\n currentStateMessage: \"RDS cluster\ \ storage encryption is enabled.\"\n check:\n IS_EQUAL:\n left:\n\ \ EXTRACT: CA10__storageEncrypted__c\n right:\n BOOLEAN:\ \ true \notherwise:\n status: \"INCOMPLIANT\"\n currentStateMessage: \"RDS\ \ cluster storage encryption is disabled.\"\n remediationMessage: \"Enable\ \ RDS cluster storage encryption.\"\n" - path: /ce/ca/aws/rds/cluster-encryption/test-data.json md5Hash: 543955F6C011435E9B1BBA2D53060B55 content: | [ { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "199", "conditionText": "extract('CA10__storageEncrypted__c') == true", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "test1", "CA10__disappearanceTime__c": null, "CA10__storageEncrypted__c": true }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "200", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "test2", "CA10__disappearanceTime__c": null, "CA10__storageEncrypted__c": false } ] - path: /types/CA10__CaAwsDbCluster__c/object.extracts.yaml md5Hash: 8AACD486F39325BBBA7FE4FA3BE340E9 content: | --- extracts: - name: CA10__engine__c value: FIELD: path: CA10__engine__c undeterminedIf: # https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-clusters.html # "Engine" attribute represents a non-nullable string. isEmpty: DB Engine value cannot be empty. Potential data corruption. # Values: Yes | No. Not nullable. Cannot have no access, retrieved via rds:DescribeDBClusters - name: CA10__autoMinorVersionUpgrade__c value: FIELD: path: CA10__autoMinorVersionUpgrade__c # Number. Can't have no access, retrieved via rds:DescribeDBClusters - name: CA10__backupRetentionPeriod__c value: FIELD: path: CA10__backupRetentionPeriod__c # Number. Can't have no access, retrieved via rds:DescribeDBClusters - name: CA10__backtrackWindow__c value: FIELD: path: CA10__backtrackWindow__c # Checkbox. - name: CA10__multiAZ__c value: FIELD: path: CA10__multiAZ__c # Checkbox. - name: CA10__storageEncrypted__c value: FIELD: path: CA10__storageEncrypted__c # Text. - name: CA10__masterUsername__c value: FIELD: path: CA10__masterUsername__c # Checkbox. - name: CA10__iamDatabaseAuthenticationEnabled__c value: FIELD: path: CA10__iamDatabaseAuthenticationEnabled__c - name: CA10__status__c value: FIELD: path: CA10__status__c undeterminedIf: # https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-clusters.html # "Engine" attribute represents a non-nullable string. isEmpty: DB Status value cannot be empty. Potential data corruption. # Nullable. Can't have no access, retrieved via rds:DescribeDBClusters - name: CA10__enabledCloudwatchLogsExports__c value: FIELD: path: CA10__enabledCloudwatchLogsExports__c # Checkbox. - name: CA10__copyTagsToSnapshot__c value: FIELD: path: CA10__copyTagsToSnapshot__c script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "test1", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('CA10__storageEncrypted__c') == true", "runtimeError" : null } }, { "Id" : "test2", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "200", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAwsDbCluster__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__storageEncrypted__c" : true, "Id" : "test1" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__storageEncrypted__c" : false, "Id" : "test2" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAwsDbCluster__c( obj STRUCT< CA10__disappearanceTime__c TIMESTAMP, CA10__storageEncrypted__c BOOLEAN, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" var references1 = []; // condition[0], conditionIndex:[0..99] references1.push('Deleted From AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c); if (obj.CA10__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[1], conditionIndex:[100..199] function extract3() { if (!this.out) { this.out = obj.CA10__storageEncrypted__c; } return this.out; }; references1.push('Storage Encrypted [obj.CA10__storageEncrypted__c]: ' + obj.CA10__storageEncrypted__c); if (extract3.call(extract3) == true) { return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "extract('CA10__storageEncrypted__c') == true", currentStateMessage: "RDS cluster storage encryption is enabled.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "RDS cluster storage encryption is disabled.", currentStateReferences: references1.join('\n'), remediation: "Enable RDS cluster storage encryption.", runtimeError: null}; """; SELECT expectedResult.Id as Id, IF ( IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '') AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1) AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '') AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''), "MATCH", "FAIL" ) as match, expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus, expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex, expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText, expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError FROM UNNEST(mock_ExpectedResult()) expectedResult LEFT JOIN ( SELECT sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__storageEncrypted__c AS CA10__storageEncrypted__c, sObject.Id AS Id, process_CA10__CaAwsDbCluster__c( STRUCT( sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__storageEncrypted__c AS CA10__storageEncrypted__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10__CaAwsDbCluster__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;