-
Notifications
You must be signed in to change notification settings - Fork 545
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
improve CA and certificate generation #2834
improve CA and certificate generation #2834
Conversation
Recently during an audit on a user's cluster, it was discovered that OLM's certificate generation functionality has a few minor shortcomings. 1) The generated CA and server cert do not include a common name, which causes some tooling to have trouble tracing the cert chain. 2) The generated CA and server cert include unnecessary key usages, which means those certificates can be used for more than their intended purposes. This commit resolves the above issues by ensuring the certificates include common names and by using the minimal key usages necessary. Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dinhxuanvu, joelanford The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -120,12 +120,12 @@ func CreateSignedServingPair(notAfter time.Time, organization string, ca *KeyPai | |||
certDetails := &x509.Certificate{ | |||
SerialNumber: serial, | |||
Subject: pkix.Name{ | |||
CommonName: hosts[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we do any length checking for the hosts array length anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, it always has exactly two items:
<svcName>.<svcNamespace>
<svcName>.<svcNamespace>.svc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, works for me.
/lgtm
Just one quick question, but otherwise this lgtm. |
Motivation for the change:
Recently during an audit on a user's cluster, it was discovered that
OLM's certificate generation functionality has a few minor shortcomings.
which causes some tooling to have trouble tracing the cert chain.
which means those certificates can be used for more than their
intended purposes.
Description of the change:
This commit resolves the above issues by ensuring the certificates
include common names and by using the minimal key usages necessary.
Testing remarks:
Thus far, I have only manually tested via
run-local
and verified that:Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue