Skip to content

Commit

Permalink
Adds missing default security config lines when updating opensearch.y…
Browse files Browse the repository at this point in the history
…ml (opensearch-project#3734)

Adds 4 config lines that were missed in the original PR:
https://github.com/opensearch-project/security/blob/deff84265cd22badf9cca02a3240aeb000acb439/tools/install_demo_configuration.sh#L384C1-L388C1

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura committed Dec 13, 2023
1 parent 7d50492 commit 7abed50
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.security.tools.democonfig;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.security.tools.democonfig;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,13 @@ static String buildSecurityConfigString() {

securityConfigLines.append("plugins.security.authcz.admin_dn:\n - CN=kirk,OU=client,O=client,L=test, C=de\n\n");

securityConfigLines.append("plugins.security.system_indices.enabled: true\n" + "plugins.security.system_indices.indices: [")
.append(SYSTEM_INDICES)
.append("]\n");
securityConfigLines.append("plugins.security.audit.type: internal_opensearch\n");
securityConfigLines.append("plugins.security.enable_snapshot_restore_privilege: true\n");
securityConfigLines.append("plugins.security.check_snapshot_restore_write_privileges: true\n");
securityConfigLines.append("plugins.security.restapi.roles_enabled: [\"all_access\", \"security_rest_api_access\"]\n");

securityConfigLines.append("plugins.security.system_indices.enabled: true\n");
securityConfigLines.append("plugins.security.system_indices.indices: [").append(SYSTEM_INDICES).append("]\n");

if (!isNetworkHostAlreadyPresent(OPENSEARCH_CONF_FILE)) {
if (cluster_mode) {
Expand Down

0 comments on commit 7abed50

Please sign in to comment.