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

- path_regex of .sops.yaml uses wrong input #104

Closed
toralf opened this issue Jun 2, 2022 · 4 comments
Closed

- path_regex of .sops.yaml uses wrong input #104

toralf opened this issue Jun 2, 2022 · 4 comments

Comments

@toralf
Copy link

toralf commented Jun 2, 2022

SUMMARY

It checks the value of the current working directory instead the path of the file

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.sops.sops_encrypt

ANSIBLE VERSION

$ ansible --version
ansible [core 2.12.5]
config file = None
configured module search path = ['/home/tfoerste/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /home/tfoerste/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/lib/python-exec/python3.9/ansible
python version = 3.9.12 (main, Apr 29 2022, 22:11:52) [GCC 11.2.1 20220115]
jinja version = 3.1.2
libyaml = True

OS / ENVIRONMENT

LInux (Gentoo), Mac

@toralf
Copy link
Author

toralf commented Jun 2, 2022

If works as designed then "chdir" should be implemented as a new feature.

@felixfontein
Copy link
Collaborator

If the provided path is not just a filename but contains a path, the module will change into that directory before executing sops.

(Please note that sops does not know the filename, since the data is piped into and out from sops, and only written to disk by the module once sops returns.)

@toralf
Copy link
Author

toralf commented Jun 2, 2022

Hhm, the paths contains the whole paths to the file, but it seems we do suffer from getsops/sops#594

$  echo "key: value"  | sops --encrypt /dev/stdin --config .sops.yaml --output foo.yaml
error loading config: no matching creation rules found

whereas this works:

$  echo "key: value" > devinfra/database/foo.yaml; sops --encrypt devinfra/database/foo.yaml --config .sops.yaml --output devinfra/database/bar.yaml
key: ENC[AES256_GCM,data:<snip>=,tag:<snip>==,type:str]
sops:
    kms:
        - arn: arn:aws:kms:eu-central-1<snip>:alias/mozilla-sops


@toralf-hlag
Copy link

ok, so it seems, that path_regex cannot be used in .sops.yaml, b/c it is just /dev/stdin.

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

3 participants