From 124d3fbd59115fead975f6415b45534b9493815a Mon Sep 17 00:00:00 2001 From: cliu123 Date: Tue, 23 Aug 2022 13:42:55 -0700 Subject: [PATCH] Add allowlist.yml to 3 places in securityadmin tool Signed-off-by: cliu123 --- .../java/org/opensearch/security/tools/SecurityAdmin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/opensearch/security/tools/SecurityAdmin.java b/src/main/java/org/opensearch/security/tools/SecurityAdmin.java index 6360f508b3..dcfb34e9b1 100644 --- a/src/main/java/org/opensearch/security/tools/SecurityAdmin.java +++ b/src/main/java/org/opensearch/security/tools/SecurityAdmin.java @@ -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); } @@ -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; @@ -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");