Fix CIDR mask for replication peer_ip - #1299#1317
Fix CIDR mask for replication peer_ip - #1299#1317hloeung wants to merge 1 commit intocanonical:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1317 +/- ##
=======================================
Coverage 75.75% 75.75%
=======================================
Files 16 16
Lines 4187 4187
Branches 633 633
=======================================
Hits 3172 3172
Misses 793 793
Partials 222 222 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi, @hloeung! I'll schedule the investigation of the CI failures for the next pulse, because when trying to do it as a side task, I found that it needs more time. |
|
Thanks, much appreciated. This isn't so urgent and more of an improvement - from IS's side, we have multiple layers of security already - password authentication which the charm by default uses, OpenStack security group firewalling as well as NGFW / dedicated firewalling in front of the databases we manage. |
There was a problem hiding this comment.
The changes itself looks OK and logical, but it looks they brake TLS test at least (here):
Exception: Expected command 'grep 'connection authorized: user=rewind database=postgres SSL enabled' /var/snap/charmed-postgresql/common/var/log/postgresql/postgresql-*.log' to succeed instead it failed: 1
So, it looks like PostgreSQL was not able to connect and rewind SQL transactions from peer. It requires careful re-checking before merging.
The self-healing test is also unhappy after the full cluster restart (rewind in place?):
AssertionError: secondary not up to date with the cluster after restarting.
CC: @hloeung
I believe the main trouble-maker here is a cluster<->cluster async replication functionality, where IPs can be anything for different cluster. Sure /0 security can be improved, but it looks like it is not as simple as /32 nor /24.
Issue
The
replicationusers'peer_ipCIDR mask is too open. A/0usually meansALL.See #1299
Solution
Reduce CIDR mask to a single IP, with
/32which is safest. If not, we can go with something a little more relaxed such as a/24.Checklist