--- policy: /ce/ca/aws/efs/file-system-encryption logic: /ce/ca/aws/efs/file-system-encryption/prod.logic.yaml executionTime: 2026-06-06T12:02:51.709412559Z generationMs: 44 executionMs: 1252 rows: - id: a61 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 200 actual: 200 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: a62 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10__encrypted__c') == true actual: extract('CA10__encrypted__c') == true runtimeError: {} usedFiles: - path: /ce/ca/aws/efs/file-system-encryption/policy.yaml md5Hash: C723ED8932E12FBBBC8C7DCFF7230EEA content: | --- names: full: AWS EFS File System encryption is not enabled contextual: File System encryption is not enabled description: EFS data should be encrypted at rest using AWS KMS (Key Management Service) type: COMPLIANCE_POLICY categories: - SECURITY frameworkMappings: - "/frameworks/cis-aws-v7.0.0/03/03/01" - "/frameworks/cloudaware/resource-security/data-encryption" - "/frameworks/aws-fsbp-v1.0.0/efs/08" - "/frameworks/aws-well-architected/sec/08/02" similarPolicies: internal: - dec-x-966d3183 cloudConformity: - url: https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/EFS/encryption-enabled.html name: EFS Encryption Enabled awsSecurityHub: - name: "[EFS.8] EFS file systems should be encrypted at rest" url: "https://docs.aws.amazon.com/securityhub/latest/userguide/efs-controls.html#efs-8" - path: /ce/ca/aws/efs/file-system-encryption/prod.logic.yaml md5Hash: F6B4643FB3717CE2B7AAA30F4AE011F7 content: "---\ninputType: \"CA10__CaAwsEfsFileSystem__c\"\ntestData:\n - file:\ \ test-data.json\nimportExtracts:\n - file: /types/CA10__CaAwsEfsFileSystem__c/object.extracts.yaml\n\ conditions:\n - status: \"COMPLIANT\"\n currentStateMessage: \"EFS file\ \ system data is encrypted.\"\n check:\n IS_EQUAL:\n left:\n\ \ EXTRACT: CA10__encrypted__c\n right:\n BOOLEAN: true\ \ \notherwise:\n status: \"INCOMPLIANT\"\n currentStateMessage: \"EFS file\ \ system data is not encrypted.\"\n remediationMessage: \"Enable EFS file system\ \ data encryption.\"\n" - path: /ce/ca/aws/efs/file-system-encryption/test-data.json md5Hash: 9EA48B262D9BC25412E92A076F7F5C85 content: | [ { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "200", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a61", "CA10__disappearanceTime__c": null, "CA10__encrypted__c": false }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "199", "conditionText": "extract('CA10__encrypted__c') == true", "runtimeError": null }, "context": { "snapshotTime": "2024-06-04T19:44:50Z" }, "Id": "a62", "CA10__disappearanceTime__c": null, "CA10__encrypted__c": true } ] - path: /types/CA10__CaAwsEfsFileSystem__c/object.extracts.yaml md5Hash: 3C7626729E41425BAD13D04E544D0213 content: "---\nextracts:\n# Boolean attribute\n - name: CA10__encrypted__c\n\ \ value: \n FIELD:\n path: CA10__encrypted__c\n" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "a61", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "200", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "a62", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('CA10__encrypted__c') == true", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAwsEfsFileSystem__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__encrypted__c" : false, "Id" : "a61" }, { "context" : { "snapshotTime" : new Date("2024-06-04T19:44:50Z") }, "CA10__encrypted__c" : true, "Id" : "a62" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAwsEfsFileSystem__c( obj STRUCT< CA10__disappearanceTime__c TIMESTAMP, CA10__encrypted__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__encrypted__c; } return this.out; }; references1.push('Encrypted [obj.CA10__encrypted__c]: ' + obj.CA10__encrypted__c); if (extract3.call(extract3) == true) { return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "extract('CA10__encrypted__c') == true", currentStateMessage: "EFS file system data is encrypted.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "EFS file system data is not encrypted.", currentStateReferences: references1.join('\n'), remediation: "Enable EFS file system data 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__encrypted__c AS CA10__encrypted__c, sObject.Id AS Id, process_CA10__CaAwsEfsFileSystem__c( STRUCT( sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__encrypted__c AS CA10__encrypted__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10__CaAwsEfsFileSystem__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;