-
Notifications
You must be signed in to change notification settings - Fork 282
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
Generate new demo certs with IPv6 loopback added to SAN in node certificate #3268
Generate new demo certs with IPv6 loopback added to SAN in node certificate #3268
Conversation
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
…um calculator tool to allow easier generation of checksums whenever certificates are rotated Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #3268 +/- ##
============================================
+ Coverage 62.49% 63.23% +0.74%
- Complexity 3399 3448 +49
============================================
Files 259 263 +4
Lines 20055 20029 -26
Branches 3370 3341 -29
============================================
+ Hits 12533 12665 +132
+ Misses 5872 5737 -135
+ Partials 1650 1627 -23
|
Looking into plugin-install failures now. Seems like we need to generate a new JKS file for sanity tests since the certificates were updated. |
@@ -0,0 +1,71 @@ | |||
/* |
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.
Why do we need a tool for this? There are many command line tools available for this kind of purpose, e.g. https://stackoverflow.com/questions/3358420/generating-a-sha-256-hash-from-the-linux-command-line
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.
Thought it'd be of value to add capability to generate shas of all files in a folder with a given extension. Otherwise they'd have to cat each file manually and run sha256sum. i.e. cd <cert-folder>; cat cert.pem | sha256sum
But the main purpose was to seek feedback on PR whether we should ship with this or not. I felt it might be useful down the line so I added it.
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.
If instead this tool that generated the certs and then updated all of the relevant locations (including creating the checksums) - I would be onboard.
ef512ed
to
2bd4eae
Compare
Signed-off-by: Darshit Chanpura <[email protected]>
2bd4eae
to
0e4d427
Compare
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.
We should not ship ChecksumCalcuator as part of the plugin distribution, its purpose is to automate making changes in the java code, not something a consumer of the plugin would need.
Signed-off-by: Darshit Chanpura <[email protected]>
2fa9757
to
6aacfc0
Compare
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
6ab4ae4
to
804f377
Compare
Agreed. I have added a section in Developer guide on steps to refresh demo certs. |
@DarshitChanpura Is there any way to 'diff' the certs? i.e. I'd like to verify that the only differences are:
|
You can compare certs by running |
This is the diff I created locally for reference. Most of the differences look ok to me: (Cleaned up the diff to make it easier to read) Expand to see the diff:diff esnode.txt esnode-new.txt
diff1
< Not Before: Apr 22 03:43:47 2018 GMT
< Not After : Apr 19 03:43:47 2028 GMT
< Subject: DC = de, L = test, O = node, OU = node, CN = node-0.example.com
---
> Not Before: Aug 29 19:44:42 2023 GMT
> Not After : Aug 26 19:44:42 2033 GMT
> Subject: C = de, L = test, O = node, OU = node, CN = node-0.example.com
diff2
< X509v3 Authority Key Identifier:
< keyid:92:35:0C:E0:0F:1E:2B:45:F6:4D:39:F3:7B:5F:A2:E6:12:97:40:73
< DirName:/DC=com/DC=example/O=Example Com Inc./OU=Example Com Inc. Root CA/CN=Example Com Inc. Root CA
< serial:01
---
> X509v3 Authority Key Identifier:
> 17:87:DF:A0:5A:EB:66:12:A7:D5:D0:F8:BA:12:45:3C:B7:2B:00:9C
diff3
< X509v3 Key Usage: critical
< X509v3 Extended Key Usage: critical
---
> X509v3 Key Usage:
> X509v3 Extended Key Usage:
diff4
< X509v3 Subject Alternative Name:
< Registered ID:1.2.3.4.5.5, DNS:node-0.example.com, DNS:localhost, IP Address:127.0.0.1
Address:127.0.0.1
---
> X509v3 Subject Alternative Name:
> Registered ID:1.2.3.4.5.5, DNS:node-0.example.com, DNS:localhost, IP Address:0:0:0:0:0:0:0:1, IP |
@cwperks What do you think is missing? By virtue of BWC tests passing, and Plugin Install passing - I am assuming they work. |
@peternied Just trying to cover all the bases. This PR looks good to me. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-3268-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a4f8f0399a41b11a52e7d3a8f00dca49cae7be4f
# Push it to GitHub
git push --set-upstream origin backport/backport-3268-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x Then, create a pull request where the |
…ficate (opensearch-project#3268) Solves bug where backwards compatibility tests would fail for IPv6 loopback address (`::1`) with: `No subject alternative names matching IP address ::1 found` Signed-off-by: Darshit Chanpura <[email protected]> (cherry picked from commit a4f8f03)
Unfortunately this has generated an already expired root CA certificate : valid from 29/08/2023 to 28/09/2023 |
…expired root ca certificate (#4061) ### Description During the last renewal of certs #3268, the option `-days 3650` was missed for root-ca.pem cert causing it to set the default expiry of 30 days. This PR regenerates the public cert root-ca.pem, using the same private-key, and it also regenerate public certs `es-node.pem` and `kirk.pem` so that they can be verified with this new certificate. * Category : Bug fix * Why these changes are required? - To ensure the expiry is in 10 years from now * What is the old behavior before changes and new behavior after changes? - root-ca is currently expired, and this change will set expiry to 2034 ### Issues Resolved - Resolves #4047 ### Testing - Automated testing + [Manual Testing](#4061 (comment)) --------- Signed-off-by: Darshit Chanpura <[email protected]>
…expired root ca certificate (#4061) ### Description During the last renewal of certs #3268, the option `-days 3650` was missed for root-ca.pem cert causing it to set the default expiry of 30 days. This PR regenerates the public cert root-ca.pem, using the same private-key, and it also regenerate public certs `es-node.pem` and `kirk.pem` so that they can be verified with this new certificate. * Category : Bug fix * Why these changes are required? - To ensure the expiry is in 10 years from now * What is the old behavior before changes and new behavior after changes? - root-ca is currently expired, and this change will set expiry to 2034 ### Issues Resolved - Resolves #4047 ### Testing - Automated testing + [Manual Testing](#4061 (comment)) --------- Signed-off-by: Darshit Chanpura <[email protected]> (cherry picked from commit 9a6a018) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…expired root ca certificate (opensearch-project#4061) ### Description During the last renewal of certs opensearch-project#3268, the option `-days 3650` was missed for root-ca.pem cert causing it to set the default expiry of 30 days. This PR regenerates the public cert root-ca.pem, using the same private-key, and it also regenerate public certs `es-node.pem` and `kirk.pem` so that they can be verified with this new certificate. * Category : Bug fix * Why these changes are required? - To ensure the expiry is in 10 years from now * What is the old behavior before changes and new behavior after changes? - root-ca is currently expired, and this change will set expiry to 2034 ### Issues Resolved - Resolves opensearch-project#4047 ### Testing - Automated testing + [Manual Testing](opensearch-project#4061 (comment)) --------- Signed-off-by: Darshit Chanpura <[email protected]>
Description
This PR solves bug where backwards compatibility tests would fail for IPv6 loopback address (
::1
) with:No subject alternative names matching IP address ::1 found
Exit criteria:
Issues Resolved
::1
#3174Testing
Manual testing
Check List
New functionality includes testingNew functionality has been documentedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.