Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secrets missing when a path contains both secrets and additional paths with secrets. #19

Open
obautista-clgx opened this issue Aug 7, 2020 · 0 comments

Comments

@obautista-clgx
Copy link

obautista-clgx commented Aug 7, 2020

Hello,

I have a KV v2 structure like this in Vault v1.4.3:

secret
└── nonprd
└── wrong_org
└── wrong_ecosystem
└── app
├── myownpath
│   ├── test3
│   └── test4
├── test1
└── test2

Where:

  • test[1,2] are secrets under folder 'app'
  • myownpath is another folder under 'app'
  • test[3,4] are secrets under folder 'myownpath'

Then I exported all secrets with vault-backend-migrator v0.2.1-dev:
./vault-backend-migrator -export secret/data/ -metadata secret/metadata/ -file all_secrets.json -ver 2

For some reason the secrets under secret/data/nonprd/wrong_org/wrong_ecosystem/app are missing in my output file and path secret/data/nonprd/wrong_org/wrong_ecosystem/app/myownpath is showing up twice:

{
"path": "secret/data/nonprd/wrong_org/wrong_ecosystem/app/myownpath",
"pairs": [
{
"key": "test3",
"value": "Mw=="
},
{
"key": "test4",
"value": "NA=="
}
]
},
{
"path": "secret/data/nonprd/wrong_org/wrong_ecosystem/app/myownpath",
"pairs": [
{
"key": "test3",
"value": "Mw=="
},
{
"key": "test4",
"value": "NA=="
}
]
},

The same happens if I set -export=secret/data/nonprd/wrong_org/wrong_ecosystem/ at extraction time:
./vault-backend-migrator -export secret/data/nonprd/wrong_org/wrong_ecosystem/ -metadata secret/metadata/nonprd/wrong_org/wrong_ecosystem/ -file wrong_ecosystem.json -ver 2

Is this a known limitation in vault-backend-migrator?
Is there a way to work around it?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant