-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Block access to system indices from REST APIs #7936
Comments
What will be the supported replacement method for accessing these indices? In particular, many plugin integration tests clean up indices at the end of a test class in order to not impact another test class. See https://github.com/search?q=org%3Aopensearch-project+wipeAllODFEIndices&type=code @After
protected void wipeAllODFEIndices() throws IOException {
Response response = client().performRequest(new Request("GET", "/_cat/indices?format=json&expand_wildcards=all"));
// parse response
for (Object index : parser.list()) {
Map<String, Object> jsonObject = (Map<String, Object>) index;
String indexName = jsonObject.get("index").toString();
if (!".opendistro_security".equals(indexName)) {
Request request = new Request("DELETE", String.format(Locale.getDefault(), "/%s", indexName));
// process
}
}
} |
@dbwiddis OpenSearch already has system index protection by default in the default distribution of OpenSearch w/ the security plugin installed. (Strong) System Index Protection is provided by the security plugin which only allows system index access in 2 cases:
Many plugins already account for this and in the snippet you provide above the W/o the security plugin installed is a different story. W/o encryption, there isn't a foolproof way to secure system indices. At best, OpenSearch could require a certain HTTP Header to be present in the request to declare the intent to make a request on a system index, but since the requests are unencrypted you can't ensure the integrity of any secrets. Check out this comment from @nibix here: opensearch-project/security#4896 (comment)
|
The But I notice that class uses To be clear, while the above explanation is very useful, my primary goal here is to update my plugin to not break with 3.0, and all my integ tests (run without security plugin) currently produce this deprecation warning on the delete step. |
The deprecation message is coming from a commit before the fork. I agree with @nibix that there should be an effort to clean this up bc the message is there in perpetuity otherwise.
When using the security plugin, plugins should configure the admin client with the admin certificate (example). Using the demo security config, Plugins sometimes checkin the demo certs to their repositories, or they can obtain them from the security repo like this: https://github.com/opensearch-project/job-scheduler/blob/main/build.gradle#L54-L65 |
Access to system indices via the REST APIs has been deprecated since OpenSearch 1.x (and ES 7.10 before that). This issue is to complete the deprecation and block access to system indices via the REST API. This is obviously a breaking change and can only be completed in the next major version (3.0).
The text was updated successfully, but these errors were encountered: