Skip to content

Commit

Permalink
Add allowlist.yml to 3 places in securityadmin tool (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#2046)

Signed-off-by: cliu123 <lc12251109@gmail.com>
  • Loading branch information
cliu123 authored Aug 23, 2022
1 parent 618d30d commit 287e945
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ public static int execute(final String[] args) throws Exception {
final boolean populateFileIfEmpty = true;
success = retrieveFile(restHighLevelClient, cd+"nodes_dn_"+date+".yml", index, "nodesdn", legacy, populateFileIfEmpty) && success;
success = retrieveFile(restHighLevelClient, cd+"whitelist_"+date+".yml", index, "whitelist", legacy, populateFileIfEmpty) && success;
success = retrieveFile(restHighLevelClient, cd+"allowlist_"+date+".yml", index, "allowlist", legacy, populateFileIfEmpty) && success;
return (success?0:-1);
}

Expand Down Expand Up @@ -1195,6 +1196,7 @@ private static int backup(RestHighLevelClient tc, String index, File backupDir,
}
success = retrieveFile(tc, backupDir.getAbsolutePath()+"/nodes_dn.yml", index, "nodesdn", legacy, true) && success;
success = retrieveFile(tc, backupDir.getAbsolutePath()+"/whitelist.yml", index, "whitelist", legacy, true) && success;
success = retrieveFile(tc, backupDir.getAbsolutePath()+"/allowlist.yml", index, "allowlist", legacy, true) && success;
success = retrieveFile(tc, backupDir.getAbsolutePath() + "/audit.yml", index, "audit", legacy) && success;

return success?0:-1;
Expand All @@ -1218,6 +1220,9 @@ private static int upload(RestHighLevelClient tc, String index, String cd, boole
if (new File(cd+"audit.yml").exists()) {
success = uploadFile(tc, cd + "audit.yml", index, "audit", legacy, resolveEnvVars) && success;
}
if (new File(cd+"allowlist.yml").exists()) {
success = uploadFile(tc, cd + "allowlist.yml", index, "allowlist", legacy, resolveEnvVars) && success;
}

if(!success) {
System.out.println("ERR: cannot upload configuration, see errors above");
Expand Down

0 comments on commit 287e945

Please sign in to comment.