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

Warn in cert-request if CSR doesn't contain SAN #781

Closed
wants to merge 1 commit into from

Conversation

felipevolpone
Copy link
Member

The code is not "production-ready", however, I would like to know if I'm on the right path.

AFAIK we should check if the SAN extension is provided and if it has DNSName info.

Fix: https://pagure.io/freeipa/issue/6663

@felipevolpone
Copy link
Member Author

Hi everyone,

after a long long day, I did a great job deleting the branch from PR #773, then Github closed it.
If someone knows how to reopen it, great. Otherwise, I create a new branch and this new PR.

Sorry about that :(

Notifying people that were following that thread: @stlaz @MartinBasti @frasertweedale @HonzaCholasta @pvoborni

has_dns_in_san_ext = True

if not ext_san or not has_dns_in_san_ext:
print('Warning: The SAN extension '
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should say "Subject Alternative Name" instead of the abbreviation "SAN".

has_dns_in_san_ext = True

if not ext_san or not has_dns_in_san_ext:
print('Warning: The SAN extension '
Copy link
Contributor

Choose a reason for hiding this comment

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

Also recalling the review comments from #773 (review) about sending the warning back to the client, and the print is just placeholder while final version
of patch is worked out.


if not ext_san or not has_dns_in_san_ext:
print('Warning: The SAN extension '
'should be provided. Please, check the RFC 2818.')
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to reference the RFC.

Ideally we should suggest to the user what to do, but because we don't know what tool created the CSR
(certmonger, certutil, openssl, ...?) it is a bit hard to give concrete steps to user about how to solve their problem.

I would say something like: "Certificate request for a {host,service} certificate did not contain Subject Alternative Name, which is required for many use cases."

This warning will be suprious if the profile uses the new CommonNameToSANDefault component (assuming the CN looks like a DNS name). I have a PR to add this component to caIPAserviceCert (the default profile) for new installs only.

I'm just not sure if this won't create more support load than it avoids. It is hard to guess what will happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the message, please, checks if it looks good.

I'm just not sure if this won't create more support load than it avoids.

IMHO I think it more useful to show the message to the user instead of not showing it. As you said, if the user does not provide SAN in certificate this could lead to fails in the future, since it is required for many use cases.

Adding a warning in the cert-request command when the
request certificate doesn't contain a Subject Alternative
Name according to RFC 2818.

https://pagure.io/freeipa/issue/6663
@felipevolpone
Copy link
Member Author

felipevolpone commented Jun 13, 2017

@frasertweedale I did the changes you proposed, however I'm not sure if there is an agreement in the team that this ticket should be done. I'm saying that based on the comments on previous PR #773

@frasertweedale
Copy link
Contributor

@felipevolpone I've put the ticket up for re-triage. Let's see what comes out of that.

@felipevolpone felipevolpone changed the title [WIP] Warn in cert-request if CSR doesn't contain SAN Warn in cert-request if CSR doesn't contain SAN Jun 16, 2017
@felipevolpone
Copy link
Member Author

Closing it. It was decided to do not have this feature/warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants