Page MenuHomeDevCentral

Test if PostgreSQL connections for pg_hba.conf use CIDR notation
ClosedPublic

Authored by dereckson on Nov 11 2025, 15:50.
Tags
None
Referenced Files
F24594014: D3878.diff
Sat, Feb 28, 21:51
F24592529: D3878.id10035.diff
Sat, Feb 28, 20:22
F24592521: D3878.id10034.diff
Sat, Feb 28, 20:22
F24592100: D3878.id10034.diff
Sat, Feb 28, 19:57
F24591603: D3878.diff
Sat, Feb 28, 19:20
Unknown Object (File)
Fri, Feb 27, 19:59
Unknown Object (File)
Fri, Feb 27, 19:05
Unknown Object (File)
Fri, Feb 27, 16:43
Subscribers
None

Details

Summary

[ Context ]

PostgreSQL doesn't accept "127.0.0.1" anymore in pg_hba.conf, as
it accepts two notation, IP range or "ip-address ip-mask".

To represent the "127.0.0.1" address, two notations are valid:
"127.0.0.1/32" or "127.0.0.1 255.255.255.255".

Nasqueron configuration uses the CIDR notation format.

[ Test suite for connections ]

  • Check all mandatory keys are there
  • Check no unknown key is there (would be ignored by our template)
  • Check the ips parameter is a CIDR range (contains "/")

Reference: https://www.postgresql.org/docs/17/auth-pg-hba-conf.html

Test Plan
  • New tests pass for current configuration
  • Tests fail for "ips: 127.0.0.1"
  • Tests fail if we mess with the keys
  • DNS test still pass

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable