Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hosts to read DNS records for IP SAN #4355

Closed
wants to merge 1 commit into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Mar 13, 2020

For SAN IPAddress extension the cert plugin verifies that the IP address
matches the host entry. Certmonger uses the host principal to
authenticate and retrieve certificates. But the host principal did not
have permission to read DNS entries from LDAP.

Allow all hosts to read some entries from active DNS records.

Fixes: https://pagure.io/freeipa/issue/8098
Signed-off-by: Christian Heimes cheimes@redhat.com

@tiran tiran added prioritized Pull Request has higher priority for PR-CI needs review Pull Request is waiting for a review ipa-4-8 Mark for backport to ipa 4.8 labels Mar 13, 2020
@abbra
Copy link
Contributor

abbra commented Mar 13, 2020

LGTM

@tiran tiran force-pushed the issue8098-ipsan-aci branch 3 times, most recently from f0beae3 to 5dbc04a Compare March 13, 2020 11:12
@stanislavlevin
Copy link
Contributor

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rcritten
Copy link
Contributor

You add another SAN for the host but it is currently unused. Is that some future change? Should it be removed since it is unused?

@tiran tiran force-pushed the issue8098-ipsan-aci branch 6 times, most recently from 5067b14 to 8547f51 Compare March 13, 2020 19:31
# assert dnsnames == {self.clients[0].hostname, self.altname}
assert dnsnames == {self.clients[0].hostname}
ipaddrs = set(ext.value.get_values_for_type(x509.IPAddress))
assert ipaddrs == {self.clients[0].ip}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assert for ipaddrs fails because you get str in the set on the right side and IPv4Address instance on the lest side:

>       assert ipaddrs == {self.clients[0].ip}
E       AssertionError: assert {IPv4Address(...168.122.193')} == {'192.168.122.193'}
E         Extra items in the left set:
E         IPv4Address('192.168.122.193')
E         Extra items in the right set:
E         '192.168.122.193'
E         Full diff:
E         - {IPv4Address('192.168.122.193')}
E         + {'192.168.122.193'}

I think you either need to convert self.clients[0].ip to an IPAddress instance:

from ipaddress import ip_address
...
assert ipaddrs == {ip_address(self.clients[0].ip)}

@abbra
Copy link
Contributor

abbra commented Mar 16, 2020

LGTM

@abbra abbra removed the needs review Pull Request is waiting for a review label Mar 16, 2020
For SAN IPAddress extension the cert plugin verifies that the IP address
matches the host entry. Certmonger uses the host principal to
authenticate and retrieve certificates. But the host principal did not
have permission to read DNS entries from LDAP.

Allow all hosts to read some entries from active DNS records.

Fixes: https://pagure.io/freeipa/issue/8098
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@abbra abbra added the ack Pull Request approved, can be merged label Mar 16, 2020
@tiran tiran added the pushed Pull Request has already been pushed label Mar 16, 2020
@tiran
Copy link
Member Author

tiran commented Mar 16, 2020

master:

  • 7a9ac1f Allow hosts to read DNS records for IP SAN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged ipa-4-8 Mark for backport to ipa 4.8 prioritized Pull Request has higher priority for PR-CI pushed Pull Request has already been pushed
Projects
None yet
4 participants