CNAME record leaks into juju's private-address, breaks host based access control
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Raphaël Badin | ||
maas (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Mailing list thread, for reference: https:/
Some charms use the relation value "private-address" to set host based access controls. Postgresql, for example, uses this value for the pg_hba.conf line like this:
host all all kmkxr.maaslocal md5
In the case of MAAS, that value is the CNAME record for that host:
# host kmkxr.maaslocal
kmkxr.maaslocal is an alias for 10-0-5-
10-0-5-
And this breaks the access control:
2013-11-07 13:47:02 UTC FATAL: no pg_hba.conf entry for host "10.0.5.100",
user "landscape", database "landscape-
2013-11-07 13:47:02 UTC DETAIL: Client IP address resolved to
"10-0-5-
It's also how openssh behaves. If you setup a key in authorized_hosts to only accept connections from a specific hostname, this is what happens:
Nov 11 11:45:49 wfaxq sshd[2332]: Authentication tried for ubuntu with correct key but not from a permitted host (host=10-
Nov 11 11:45:49 wfaxq sshd[2332]: Connection closed by 10.0.5.103 [preauth]
/home/ubuntu/
from="k8q9m.
# host k8q9m.maaslocal
k8q9m.maaslocal is an alias for 10-0-5-
10-0-5-
As long as the CNAME record is what shows up in juju's private-address, these types of access controls won't work. It doesn't happen with the AWS, LXC and OpenStack providers (didn't test others).
Some options were briefly discussed:
a) Drop the CNAME entirely and keep the generated A and PTR records only
b) Keep the CNAME, but use the A record for the private-address (and probably the actual $(hostname -f) of the unit)
c) Drop the CNAME and use the "friendly" name for the A record
Possibly others I forgot.
Related branches
- Stuart Bishop (community): Approve
-
Diff: 20 lines (+10/-0)1 file modifiedhooks/hooks.py (+10/-0)
- Julian Edwards (community): Approve
-
Diff: 776 lines (+108/-326)7 files modifiedsrc/maasserver/dns.py (+17/-9)
src/maasserver/tests/test_dns.py (+26/-43)
src/provisioningserver/dns/config.py (+36/-94)
src/provisioningserver/dns/tests/test_config.py (+27/-107)
src/provisioningserver/dns/tests/test_utils.py (+0/-38)
src/provisioningserver/dns/utils.py (+0/-32)
src/provisioningserver/tests/test_tasks.py (+2/-3)
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 14.04 |
tags: | added: dns papercut |
tags: | added: landscape |
tags: | added: canonical-is |
Changed in maas: | |
importance: | Critical → High |
Changed in maas: | |
milestone: | 14.04 → 14.10 |
Changed in maas: | |
assignee: | nobody → Raphaël Badin (rvb) |
status: | Triaged → In Progress |
Changed in maas (Ubuntu): | |
status: | New → Triaged |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Escalated by Dean.