π§ Azure MySQL Flexible Server audit_log_events Parameter is not set with the CONNECTION event - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml
- Located in: π Azure MySQL Flexible Server audit_log_events Parameter is not set with the CONNECTION event π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Azure MySQL Server | CA10Z1__CaAzureMySqlServer__c | 5 | 1 | 4 |
Usesβ
Test Results π’β
Generated at: 2025-05-10T12:02:54.631504848Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10Z1__disappearanceTime__c) | βοΈ null |
π’ | test2 | βοΈ 499 | βοΈ extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'audit_log_enabled\'].value | [0]') == 'on' && extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'audit_log_events\'].value | [0]') == 'CONNECTION' | βοΈ null |
π’ | test3 | βοΈ 299 | βοΈ extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'audit_log_enabled\'].value | [0]') == 'off' | βοΈ null |
π’ | test4 | βοΈ 500 | βοΈ otherwise | βοΈ null |
π’ | test5 | βοΈ 201 | βοΈ CA10Z1__configurations__c.delegatedTo(CA10Z1__configurations__c).isEmpty() | βοΈ null |
π’ | test6 | βοΈ 199 | βοΈ extract('CA10Z1__deploymentMode__c') != 'Flexible' | βοΈ null |
π’ | test7 | βοΈ 399 | βοΈ extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'audit_log_enabled\'].value | [0]') == 'on' && extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'audit_log_events\'].value | [0]') != 'CONNECTION' | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/policy.yaml | 08B32B3A47DDFBAEB5D38086EB367D91 |
Open | /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml | D1D9B7C427FB7475BEB932E147598AA1 |
Open | /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/test-data.json | A820ED1D2BE98D6B54D79E291EC30D7E |
Open | /types/CA10Z1__CaAzureMySqlServer__c/object.extracts.yaml | 990A7F1866AD74ACB9B3004B364BDA8A |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/azure/mysql-database/flexible-server-audit-log-events-parameter/prod.logic.yaml
Contentβ
---
inputType: "CA10Z1__CaAzureMySqlServer__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10Z1__CaAzureMySqlServer__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is not the Flexible Server deployment mode."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__deploymentMode__c"
right:
TEXT: "Flexible"
- status: "INCOMPLIANT"
currentStateMessage: "MySQL Flexible Server audit_log_enabled configuration parameter is disabled."
remediationMessage: "Consider enabling MySQL Flexible Server audit_log_enabled configuration."
check:
IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'audit_log_enabled'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "off"
- status: "INCOMPLIANT"
currentStateMessage: "MySQL Flexible Server audit_log_events configuration parameter is not set to CONNECTION."
remediationMessage: "Consider setting MySQL Flexible Server audit_log_events configuration to CONNECTION."
check:
AND:
args:
- IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'audit_log_enabled'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "on"
- NOT_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'audit_log_events'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "CONNECTION"
- status: "COMPLIANT"
currentStateMessage: "MySQL Flexible Server audit_log_events configuration parameter is set to CONNECTION."
check:
AND:
args:
- IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'audit_log_enabled'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "on"
- IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'audit_log_events'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "CONNECTION"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected value in the field."