Skip to content

Commit

Permalink
Merge pull request #116 from Skwie/PostgreSQL-api-version-fix
Browse files Browse the repository at this point in the history
Fix api versions for logretention and firewall
  • Loading branch information
Skwie authored Dec 4, 2024
2 parents 56db720 + 68bc597 commit e12f362
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WAFAzCli.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ foreach ($sub in $AllSubscriptions) {
}

# Implement network security groups and firewalls to control access to your database
$uri = "https://management.azure.com$($server.id)/firewallRules?api-version=2022-12-01"
$uri = "https://management.azure.com$($server.id)/firewallRules?api-version=2017-12-01"
$firewallRules = ((Invoke-WebRequest -Uri $uri -Headers $headers -Method Get).Content | ConvertFrom-Json -Depth 10).value
if (!$?) {
$tempPostgreSQLResults += "Informational: Private Access is enabled for PostgreSQL server $($server.name), so the firewall rules are not evaluated."
Expand Down Expand Up @@ -1948,7 +1948,7 @@ foreach ($sub in $AllSubscriptions) {
}

# Check for PostgreSQL Log Retention Period
$uri = "https://management.azure.com$($server.id)/configurations/logfiles.retention_days?api-version=2022-12-01"
$uri = "https://management.azure.com$($server.id)/configurations/logfiles.retention_days?api-version=2017-12-01"
$logretention = ((Invoke-WebRequest -Uri $uri -Headers $headers -Method Get).Content | ConvertFrom-Json -Depth 10).properties.value
if ($logretention.value -ge 7) {
$tempPostgreSQLResults += "Good: Log retention period is sufficient for PostgreSQL server $($server.name)"
Expand Down

0 comments on commit e12f362

Please sign in to comment.