Repository navigation
fix(plesk): open zone transfers through Plesk's transfer ACL, not options - #99
Conversation
…ions
Plesk writes allow-transfer { common-allow-transfer; } into every zone,
so the IP the installer put into the options block never opened a
transfer. The installer now adds our IPs with plesk bin server_dns -u
-add-acl (skipping those already in misc.DNS_Allow_Transfer*), checks
that they appear in acl common-allow-transfer, and no longer edits
options or advises allow-transfer in the server-wide settings; NOTIFY
stays there. Uninstall says where to remove the IPs, since server_dns
cannot. Verified on a live Plesk 18.0.81 (AlmaLinux 9): the call rewrites
named.conf and reloads named at once.
|
APPROVED at 91a2426. Verified: the Plesk installer no longer edits the Noted, not a point: the old installer also wrote |
Defect. Plesk writes
allow-transfer { common-allow-transfer; };into every zone, which overridesoptions. The Plesk installer put our IP intooptionsand told customers to addallow-transferto Server-wide Settings → Additional DNS settings, which lands inoptionstoo. Neither opened a transfer for Plesk zones.Seen read-only on a live Plesk Obsidian 18.0.81.2 (AlmaLinux 9.8, BIND in chroot): 150 of 152 zones carry the ACL, the ACL was
{ none; }, andnamed-user-options.conf(the server-wide settings) is included inoptions. No zone in prod SecondDNS is affected right now: the two stale zones have a private and an unreachable primary.How Plesk keeps the ACL. Verified on that server (the owner ran the command, I checked before and after):
misc.DNS_Allow_Transfer0..Nin the Plesk database, notdns_recs_t.plesk bin server_dns -u -add-acl <ip>adds to it. Within the same second it rewrotenamed.conf, put the IP intoacl common-allow-transferand reloaded named ("reloading configuration succeeded"). Recursion, zone count and answers were unchanged.The Plesk docs (CLI server_dns) give only the syntax. The installer therefore checks the result instead of assuming it.
Change:
plesk/install.sh:configure_named_axfr(theoptionsedit) removed. Newconfigure_plesk_acl:misc.DNS_Allow_Transfer*;server_dns -u -add-aclonce for the missing IPs (all ofDNS_IPS, so IPv4 and IPv6 when both are chosen);acl common-allow-transferof the resolvednamed.conf, and says so with the UI path when one is missing.The prompt and the final summary no longer advise
allow-transferin the server-wide settings.also-notifystays there: zones do not set it, so it applies.plesk/uninstall.sh: the existing note aboutoptionsremains for old installs. A new note says to remove the IPs in Transfer Restrictions Template, becauseserver_dnshas no remove command; the XML API one would need an API key created on the customer's server.READMEs updated.
Tests:
test_plesk_acl.sh(13 checks): runs the function from the installer against a stand-inpleskthat behaves as observed. Covers: empty ACL (one call with both IPs), rerun (no call), one present (only the other),203.0.113.90not mistaken for203.0.113.9,named.confnot rewritten (reported, non-zero),add-aclfailing (reported, ACL untouched).test_plesk_acl_named.sh(4 checks, realnamed, Plesk-stylenamed.conf), the discriminating pair:options: AXFR refused;configure_plesk_acl: AXFR transfers, an address outside the ACL stays refused.test_named_conf_edit.sh: theoptionschecks now cover cPanel and DirectAdmin; Plesk is asserted not to editoptionsand to use the ACL.test_plesk_acl_named4/4,test_plesk_acl13/13,test_named_conf_edit28/28,test_tsig_bind_named9/9.The customer guide in k8s_web gets a separate PR (two sentences in five languages). TSIG for Plesk follows after this.