-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add bouncycastle permissions to security.policy #9770
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Tested by performing plugin install manually of the security plugin.
There should be no errors on startup. The security plugin has an automated CI check for plugin install, but the check will not work until this PR is merged. |
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.
Is there a danger that this lowers the security posture of the SSL in such a way that any plugins can manipulate the SSL configuration, whereas previously this was isolated to plugins with this policy?
Yes that's correct. Any plugin would be able to execute this same block as the security plugin: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java#L334-L342 With the |
@@ -85,6 +85,12 @@ grant codeBase "${codebase.zstd-jni}" { | |||
permission java.lang.RuntimePermission "loadLibrary.*"; | |||
}; | |||
|
|||
grant codeBase "${codebase.bcprov-jdk15to18}" { |
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 need this for jdk 11?
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.
This is the way that bouncycastle releases artifacts. Until last month the securityplugin was using jdk15on, but then switched to jdk15to18 (PR where it was changed: opensearch-project/security#2901). I plan to open an issue about using jdk18on.
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.
No, this is due to #9289, the BC has moved to core and now we need this permission to manage security providers.
Compatibility status:Checks if related components are compatible with change 8c85f27 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/reporting.git] |
Compatibility status:Checks if related components are compatible with change a3f35b2 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/reporting.git] |
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #9770 +/- ##
============================================
+ Coverage 71.14% 71.19% +0.04%
+ Complexity 57973 57965 -8
============================================
Files 4825 4825
Lines 273348 273348
Branches 39841 39841
============================================
+ Hits 194473 194598 +125
+ Misses 62523 62371 -152
- Partials 16352 16379 +27 |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Craig Perkins <[email protected]>
@cwperks I think this is a good moment to fix that, we know that plugins should not be adding security providers for a two reasons:
|
Thats why it is a workaround for 2.10. But it needs to be addressed asap. |
@peternied @cwperks @willyborankin the problem is more severe than that, the permissions in this pull request only grant the add/remove provider privileges, but we need much more, the plugin will fail down the line, for example I just added this small piece of code into security plugin initialization sequence:
It fails with |
Compatibility status:Checks if related components are compatible with change 9e43830 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/neural-search.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git] |
Signed-off-by: Craig Perkins <[email protected]>
…earch into add-bc-permissions
I'm afraid not only the sec plugin. Oh boy oh boy. This is a security hole. Since technically any plugin can chnage SSL behave for example or revoke access to the important functionality. |
@willyborankin I see you mentioned there is a performance hit if the security plugin explicitly passes in a provider in calls that take a provider. opensearch-project/security#3317 (comment) i.e.
instead of
If the provider is passed in explicitly within the security plugin to calls that need one, which policy file is in effect? Any idea what the performance tax is for explicitly passing the provider in each call? |
Gradle Check (Jenkins) Run Completed with:
|
the policy file is OpenSerach requirements. If library is in |
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.
From the dialog I see on this issue it looks like this is creating a new category of risk where previously only individual plugins needed to modify their policy file to gain access to restricted APIs, but by adding this privilege up to core there is no longer a clear isolation.
A change to security posture needs to go through a security review process as opposed to an ad-hoc 11th hour patch.
Closing this PR. Any further discussion on this issue should happen in the security issue: opensearch-project/security#3309 |
Compatibility status:Checks if related components are compatible with change 037efca Incompatible componentsIncompatible components: [https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git] |
Gradle Check (Jenkins) Run Completed with:
|
Description
Adds bouncycastle permissions into core's
security.policy
file. With the introduction of opensearch-encryption-sdk, the bouncycastle provider (bcprovp-jdk15to18
) is now a dependency of core. The security plugin also has a direct dependency on the same artifact and has permissions in itsplugin-security.policy
file to grant the security plugin permission to add the bouncy castle provider.There is an issue bringing up a node with the security plugin installed and TLS enabled because the permissions are not present in
bootstrap/security.policy
and the dependency has now been moved to coreRelated Issues
Resolves opensearch-project/security#3309
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.