1

I am trying to copy all the secrets along with the subfolders from one VAULT path to another. Example:

source = "/path/namespace/TEAM1/jenkins"

(note: the above source path consists of subfolders like job1,job2,job3... and all these subfolders contains the respective secrets in the form of key-value pairs)

destination="/path/namespace/team1/jenkins"

I could able to manually copy each secret to the destination folder, but wondering any code snippet would help me here to achieve this. Like recursively copy all the secrets along with the respective sub-folders to the destination PATH.

Rohith
  • 1,077
  • 5
  • 16
  • 36

1 Answers1

0

Taking vault secret backup from one path to another like. input_path: secret/tmp1 output_path: secret/tmp2 so now with this python script you can sync all secret from secret/tmp1 to secret/tmp2

Need to add input_path and output_path in python script then just run. Link for python script. https://github.com/vinamra1502/vault-backup-restore

With this script you can copy all secrets along with the subfolders from one vault path to others. Ex. secret/tmp1 secret copy to secret/tmp2 path.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 28 '22 at 14:09
  • Hi, welcome to SO! Can you just post the script code here? An answer should be self-sufficient. It's impossible to understand if your answer would work at all without following an external link. Such answers usually get deleted – Arseny Feb 02 '22 at 23:01
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30920884) – Arseny Feb 02 '22 at 23:01
  • And unfortunately this script does not want to work – TheDESTROS May 17 '23 at 15:36