--- policy: /ce/ca/oracle/iam/db-credentials-are-not-rotated-every-90-days logic: /ce/ca/oracle/iam/db-credentials-are-not-rotated-every-90-days/prod.logic.yaml executionTime: 2026-09-22T15:07:57.249824665Z generationMs: 45 executionMs: 783 rows: - id: test1 match: true status: expected: DISAPPEARED actual: DISAPPEARED conditionIndex: expected: 99 actual: 99 conditionText: expected: isDisappeared(CA10O1__disappearanceTime__c) actual: isDisappeared(CA10O1__disappearanceTime__c) runtimeError: {} - id: test2 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10O1__timeCreated__c').beyondLastDays(90) actual: extract('CA10O1__timeCreated__c').beyondLastDays(90) runtimeError: {} - id: test3 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 200 actual: 200 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: test4 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 101 actual: 101 conditionText: expected: CA10O1__timeCreated__c.isEmpty() actual: CA10O1__timeCreated__c.isEmpty() runtimeError: {} usedFiles: - path: /ce/ca/oracle/iam/db-credentials-are-not-rotated-every-90-days/policy.yaml md5Hash: 134056BE354D68116B64D2E9C9C070AE content: | --- names: full: "Oracle IAM DB Credentials are not rotated every 90 days" contextual: "DB Credentials are not rotated every 90 days" description: > Oracle IAM DB Credentials should be rotated at least every 90 days. Stale database passwords increase the exposure window for compromised long-term credentials used to access supported Oracle databases. type: "COMPLIANCE_POLICY" categories: - "SECURITY" frameworkMappings: - "/frameworks/cis-oracle-v3.1.0/01/11" - "/frameworks/cloudaware/identity-and-access-governance/credential-lifecycle-management" - path: /ce/ca/oracle/iam/db-credentials-are-not-rotated-every-90-days/prod.logic.yaml md5Hash: C1625B93AAC926096D13C64930B5D45B content: | --- inputType: "CA10O1__CaOracleIamDbCredential2__c" testData: - file: "test-data.json" importExtracts: - file: "/types/CA10O1__CaOracleIamDbCredential2__c/object.extracts.yaml" conditions: - status: "INCOMPLIANT" currentStateMessage: "This Oracle IAM database password is older than 90 days." remediationMessage: "Rotate this Oracle IAM database password and delete the stale password after dependent database clients are updated." check: IS_BEYOND_LAST_DAYS: arg: EXTRACT: "CA10O1__timeCreated__c" offsetDays: 90 otherwise: status: "COMPLIANT" currentStateMessage: "This Oracle IAM database password was created within the last 90 days." - path: /ce/ca/oracle/iam/db-credentials-are-not-rotated-every-90-days/test-data.json md5Hash: DB63AEB9904A62F5700522C838DB0607 content: | [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10O1__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test1", "CA10O1__disappearanceTime__c": "2026-04-11T00:00:00Z", "CA10O1__timeCreated__c": "2025-01-01T00:00:00Z" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "199", "conditionText": "extract('CA10O1__timeCreated__c').beyondLastDays(90)", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test2", "CA10O1__disappearanceTime__c": null, "CA10O1__timeCreated__c": "2025-01-01T00:00:00Z" }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "200", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test3", "CA10O1__disappearanceTime__c": null, "CA10O1__timeCreated__c": "2026-04-01T00:00:00Z" }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "101", "conditionText": "CA10O1__timeCreated__c.isEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2026-04-12T00:00:00Z" }, "Id": "test4", "CA10O1__disappearanceTime__c": null, "CA10O1__timeCreated__c": null } ] - path: /types/CA10O1__CaOracleIamDbCredential2__c/object.extracts.yaml md5Hash: 0A813C655F99C3A67A8427CE5AB7411B content: | --- extracts: - name: "CA10O1__timeCreated__c" value: FIELD: path: "CA10O1__timeCreated__c" undeterminedIf: isEmpty: "Unable to determine when this Oracle IAM database password was created." script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "test1", "expectedResult" : { "status" : "DISAPPEARED", "conditionIndex" : "99", "conditionText" : "isDisappeared(CA10O1__disappearanceTime__c)", "runtimeError" : null } }, { "Id" : "test2", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "199", "conditionText" : "extract('CA10O1__timeCreated__c').beyondLastDays(90)", "runtimeError" : null } }, { "Id" : "test3", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "200", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "test4", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "101", "conditionText" : "CA10O1__timeCreated__c.isEmpty()", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10O1__CaOracleIamDbCredential2__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__disappearanceTime__c" : new Date("2026-04-11T00:00:00Z"), "CA10O1__timeCreated__c" : new Date("2025-01-01T00:00:00Z"), "Id" : "test1" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__timeCreated__c" : new Date("2025-01-01T00:00:00Z"), "Id" : "test2" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "CA10O1__timeCreated__c" : new Date("2026-04-01T00:00:00Z"), "Id" : "test3" }, { "context" : { "snapshotTime" : new Date("2026-04-12T00:00:00Z") }, "Id" : "test4" } ]; """; CREATE TEMP FUNCTION process_CA10O1__CaOracleIamDbCredential2__c( obj STRUCT< CA10O1__disappearanceTime__c TIMESTAMP, CA10O1__timeCreated__c TIMESTAMP, Id STRING >, snapshotTime TIMESTAMP ) RETURNS STRUCT DETERMINISTIC LANGUAGE js AS r""" var IsEmptyLib = new function () { this.simpleIsEmpty = function(arg) { return arg == null; }; this.simpleIsNotEmpty = function(arg) { return arg != null; }; }(); var todayMinus90Day = new Date(snapshotTime.toISOString().substr(0,10)+'T00:00:00.000Z').getTime() + (-90 * 86400000); var references1 = []; // condition[0], conditionIndex:[0..99] references1.push('Deleted From Oracle [CA10O1__disappearanceTime__c]: ' + obj.CA10O1__disappearanceTime__c); if (obj.CA10O1__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10O1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[1], conditionIndex:[100..199] function fieldChecked4() { if (IsEmptyLib.simpleIsEmpty(obj.CA10O1__timeCreated__c)) { throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "CA10O1__timeCreated__c.isEmpty()", currentStateMessage: "Unable to determine when this Oracle IAM database password was created.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return obj.CA10O1__timeCreated__c; } function extract3() { if (!this.out) { this.out = fieldChecked4(); } return this.out; }; references1.push('Time Created [obj.CA10O1__timeCreated__c]: ' + obj.CA10O1__timeCreated__c); try { if (extract3.call(extract3) != null && extract3.call(extract3).getTime() < todayMinus90Day) { return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('CA10O1__timeCreated__c').beyondLastDays(90)", currentStateMessage: "This Oracle IAM database password is older than 90 days.", currentStateReferences: references1.join('\n'), remediation: "Rotate this Oracle IAM database password and delete the stale password after dependent database clients are updated.", runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } return {status: 'COMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "This Oracle IAM database password was created within the last 90 days.", currentStateReferences: references1.join('\n'), remediation: null, 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.CA10O1__disappearanceTime__c AS CA10O1__disappearanceTime__c, sObject.CA10O1__timeCreated__c AS CA10O1__timeCreated__c, sObject.Id AS Id, process_CA10O1__CaOracleIamDbCredential2__c( STRUCT( sObject.CA10O1__disappearanceTime__c AS CA10O1__disappearanceTime__c, sObject.CA10O1__timeCreated__c AS CA10O1__timeCreated__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10O1__CaOracleIamDbCredential2__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;