getsops / getsops/sops

`no matching destination found in config` when publishing to vault if directory have other files

Open
#1,620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

sops --config .sops.yml --verbose publish --recursive secrets

[SOPS]   INFO[0000] Data key recovered successfully              
[SOPS]   DEBU[0000] Decrypting tree                              
uploading /secrets/project/a/prod/credentials.enc.yml to 127.0.0.1:8200/v1/secrets/data//project/a/prod/credentials.enc.yml ? (y/n): y
error loading config: no matching destination found in config

Because of parameters.yml sops cannot publish further after that file, even if my regex doesn't capture it.

.
└── project
    ├── a
    │   └── prod
    │       ├── credentials.enc.yml
    │       └── parameters.yml <-- Cause of fail
    └── b
        └── base
            └── credentials.enc.yml

.sops.yaml

[...]
destination_rules:
  - vault_path: "/"
    vault_kv_mount_name: "secret/"
    vault_kv_version: 2
    path_regex: .*\/project\/.*\.enc\.yml$

Testing the regex:

find . -type f | grep -E '^.*/project/.*\.enc\.yml$'       

./secrets/project/a/prod/credentials.enc.yml
./secrets/project/b/base/credentials.enc.yml

If I remove parameters.yml (which is empty), publishing with sops works perfectly. I also tried copying the content of credentials.enc.yml to parameters.yml without success

Thanks for any help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the publish --recursive secrets command and the destination_rules handling for .sops.yml or .sops.yaml; reproduce the issue with the shown tree, including empty parameters.yml. Trace why an unmatched file stops publishing, then verify that matching *.enc.yml files are still uploaded while unrelated files are skipped.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.