From 53bfae5fbaca01def9c810ef34016b007c6f8660 Mon Sep 17 00:00:00 2001 From: Shaun Ford Date: Tue, 30 May 2017 09:15:23 -0700 Subject: [PATCH] Make sure vault policies exist after restore (#45) --- gradle.properties | 2 +- .../java/com/nike/cerberus/service/SafeDepositBoxService.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 60974ba07..ace379964 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ # limitations under the License. # -version=0.20.0 +version=0.20.2 groupId=com.nike.cerberus artifactId=cms diff --git a/src/main/java/com/nike/cerberus/service/SafeDepositBoxService.java b/src/main/java/com/nike/cerberus/service/SafeDepositBoxService.java index e1e579f38..acdc10e9d 100644 --- a/src/main/java/com/nike/cerberus/service/SafeDepositBoxService.java +++ b/src/main/java/com/nike/cerberus/service/SafeDepositBoxService.java @@ -749,6 +749,9 @@ public void restoreSafeDepositBox(SafeDepositBoxV2 safeDepositBox, updateOwner(safeDepositBox.getId(), safeDepositBox.getOwner(), adminUser, now); modifyUserGroupPermissions(existingBox, safeDepositBox.getUserGroupPermissions(), adminUser, now); modifyIamPrincipalPermissions(existingBox, safeDepositBox.getIamPrincipalPermissions(), adminUser, now); + + // add/update the vault policies, in case they were tampered with or deleted + vaultPolicyService.createStandardPolicies(safeDepositBox.getName(), safeDepositBox.getPath()); } else { safeDepositBoxDao.createSafeDepositBox(boxToStore); addOwnerPermission(safeDepositBox.getUserGroupPermissions(), safeDepositBox.getOwner());