-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Defise
committed
Apr 9, 2024
1 parent
f76c19e
commit 7af35a8
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
policyDefinitions/SQL/postgresql-flexible-servers-should-log-checkpoints/azurepolicy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "7a2deb93-6f4f-4668-8697-be314e342085", | ||
"type": "Microsoft.Authorization/policyDefinitions", | ||
"properties": { | ||
"displayName": "PostgreSQL flexible servers should log checkpoints", | ||
"description": "This policy helps audit any PostgreSQL databases in your environment without log_checkpoints setting enabled.", | ||
"metadata": { | ||
"version": "1.0.0", | ||
"category": "SQL" | ||
}, | ||
"mode": "All", | ||
"parameters": { | ||
"effect": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Effect", | ||
"description": "AuditIfNotExists or Disabled the execution of the Policy" | ||
}, | ||
"allowedValues": [ | ||
"AuditIfNotExists", | ||
"Disabled" | ||
], | ||
"defaultValue": "AuditIfNotExists" | ||
} | ||
}, | ||
"policyRule": { | ||
"if": { | ||
"field": "type", | ||
"equals": "Microsoft.DBforPostgreSQL/flexibleServers" | ||
}, | ||
"then": { | ||
"effect": "[parameters('effect')]", | ||
"details": { | ||
"type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations", | ||
"name": "log_checkpoints", | ||
"existenceCondition": { | ||
"field": "Microsoft.DBforPostgreSQL/flexibleServers/configurations/value", | ||
"equals": "ON" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...itions/SQL/postgresql-flexible-servers-should-log-checkpoints/azurepolicy.parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"effect": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Effect", | ||
"description": "AuditIfNotExists or Disabled the execution of the Policy" | ||
}, | ||
"allowedValues": [ | ||
"AuditIfNotExists", | ||
"Disabled" | ||
], | ||
"defaultValue": "AuditIfNotExists" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...Definitions/SQL/postgresql-flexible-servers-should-log-checkpoints/azurepolicy.rules.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"if": { | ||
"field": "type", | ||
"equals": "Microsoft.DBforPostgreSQL/flexibleServers" | ||
}, | ||
"then": { | ||
"effect": "[parameters('effect')]", | ||
"details": { | ||
"type": "Microsoft.DBforPostgreSQL/flexibleServers/configurations", | ||
"name": "log_checkpoints", | ||
"existenceCondition": { | ||
"field": "Microsoft.DBforPostgreSQL/flexibleServers/configurations/value", | ||
"equals": "ON" | ||
} | ||
} | ||
} | ||
} |