-
Notifications
You must be signed in to change notification settings - Fork 275
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
Introduce BWC tests in security plugin #1685
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1685 +/- ##
============================================
+ Coverage 62.92% 62.94% +0.02%
- Complexity 3259 3261 +2
============================================
Files 253 253
Lines 18126 18126
Branches 3258 3258
============================================
+ Hits 11406 11410 +4
+ Misses 5071 5067 -4
Partials 1649 1649
Continue to review full report at Codecov.
|
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.
Can we generate the cert files at runtime instead of including them as binaries?
1eab15d
to
d899401
Compare
Signed-off-by: cliu123 <lc12251109@gmail.com>
d899401
to
139fc01
Compare
@peternied Great question! There's no way to generate these certs in runtime. They must be provided as test resources. Same case in other plugins, for example index-management-plugin. And these are just demo certs, so they are safe to provided as test resources. There're other similar certs provided as test resource in security plugin, for example, these and these . BTW, there's no need to block this PR with this comment. PRs won't be merged until all comments are resolved. |
I don't mean the OpenSearch service runtime, but during a setup phase before the bwc test are actually run? The heart of my goal is avoiding following the anti-pattern of checking in certificates |
Yes, that's not ideal, but this is the best we can do since there's no way to generate those demo certs in runtime or setup phase. But this doesn't introduce any security vulnerability because those are just demo certs like the certs that have already existed in security plugin and other plugins such as Index Management Plugin as I mentioned above. |
Why not, could you explain why this is not possible? |
These are all existing hardcoded demo certs that nobody uses in Prod env. I don't see any new risk being introduced by this PR as I mentioned above. This is a common way to provide demo certs as test resources across the OpenSearch community plugins as I mentioned above. |
We should be able to use command line tools such as openssl, how to, I am happy to make a PR onto this change to keep the security posture of this new code high. |
Cool! That is something unrelated to BWC tests. Let's include those changes in a separate PR. We can either merge this PR first if we haven't had a clear timeline on when the separate PR will be ready, or I can rebase this branch after you merge the separate PR into |
Agree with @cliu123 as this removal of hardcoded certs is probably best as a follower PR/issue. For example, if we decide not to merge this one and we don't work on the removal of hardcoded certs, 2.0 will still have them. I suggest we go ahead and merge this one and then track the other work perhaps linking it to the overarching work of improving the getting started experience that @setiah is leading. |
@peternied Thanks for the comment! The comment brings up a valid community-wide area to improve. Let's track this effort in a separate track to eliminate all the hardcoded demo certificates in security plugin and other downstream plugins if you don't mind.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-1685-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e638c760cbc4a56d6eda1221e97747f29326c194
# Push it to GitHub
git push --set-upstream origin backport/backport-1685-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-1685-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e638c760cbc4a56d6eda1221e97747f29326c194
# Push it to GitHub
git push --set-upstream origin backport/backport-1685-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3 Then, create a pull request where the |
@opensearch-project/security Thanks for the feedback, we can work on improving the security posture separately with this change in place. |
Signed-off-by: cliu123 <lc12251109@gmail.com>
Signed-off-by: cliu123 lc12251109@gmail.com
Description
[Describe what this change achieves]
Issues Resolved
#1417
Is this a backport? If so, please add backport PR # and/or commits #
Testing
BWC tests run in CI.
Check List
By 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.