Skip to main content

🧠 Azure PostgreSQL Single Server log_connections Parameter is not set to ON - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Azure PostgreSQL ServerCA10Z1__CaAzurePostgreSqlServer__c719

Uses​

Test Results πŸŸ’β€‹

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

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10Z1__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 399βœ”οΈ extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'log_connections\'].value | [0]') == 'on'βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ extract('caJsonFrom__configurations__c').jsonQueryText('[? name == \'log_connections\'].value | [0]') == 'off'βœ”οΈ null
🟒test4βœ”οΈ 400βœ”οΈ otherwiseβœ”οΈ null
🟒test5βœ”οΈ 201βœ”οΈ CA10Z1__configurations__c.delegatedTo(CA10Z1__configurations__c).isEmpty()βœ”οΈ null
🟒test6βœ”οΈ 199βœ”οΈ extract('CA10Z1__deploymentMode__c') != 'Single'βœ”οΈ null

Generation​

FileMD5
Open/ce/ca/azure/postgresql-database/single-server-log-connections-parameter/policy.yaml157C6A50F7424A854077944580F65083
Open/ce/ca/azure/postgresql-database/single-server-log-connections-parameter/prod.logic.yaml37AFE819031A16588947E63FE08368F4
Open/types/CA10Z1__CaAzurePostgreSqlServer__c/object.extracts.yaml08BBA6DB6D72395AA7E05F67B74F9223
Open/ce/ca/azure/postgresql-database/single-server-log-connections-parameter/test-data.json87B5DDB4D4DDB402924C4B927686B3C7

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/postgresql-database/single-server-log-connections-parameter/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/postgresql-database/single-server-log-connections-parameter/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/postgresql-database/single-server-log-connections-parameter/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/postgresql-database/single-server-log-connections-parameter/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/postgresql-database/single-server-log-connections-parameter/prod.logic.yaml

Content​

Open File

---
inputType: "CA10Z1__CaAzurePostgreSqlServer__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10Z1__CaAzurePostgreSqlServer__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is not the Single Server deployment mode."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10Z1__deploymentMode__c"
right:
TEXT: "Single"
- status: "INCOMPLIANT"
currentStateMessage: "PostgreSQL Server log_connections configuration is not enabled."
remediationMessage: "Consider enabling PostgreSQL Server log_connections."
check:
IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'log_connections'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "off"
- status: "COMPLIANT"
currentStateMessage: "PostgreSQL Server log_connections configuration is enabled."
check:
IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__configurations__c"
expression: "[? name == 'log_connections'].value | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return text type."
right:
TEXT: "on"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected value in the field."