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
  • Loading branch information
DarshitChanpura authored Nov 17, 2023
1 parent 9be1b27 commit 4496440
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 4496440

Please sign in to comment.