opensearch-project/opensearch-cli

[BUG] Config file permissions error output can be misleading

Closed this issue · 2 comments

What is the bug?
I am embedding this cli into an opensearch image intended for localhost development with a preconfigured default profile. There is zero reason for this to be edited post construction, therefore I set the perms to 0400 in the image.

That resulted in the error:

Reason: permissions 400 for '/usr/share/opensearch/.opensearch-cli/config.yaml' are too open. It is required that your config file is NOT accessible by others

That error message is a bit misleading, as 400 is doing exactly what the error message is suggesting that I need to do.

I suggest one of two things:

  1. Change the message to: ...are incorrect. Please change permissions to %d where %d is the value of FilePermission
  2. Enable a "readonly" mode, whereby the ability to edit profiles is disabled when config file permissions do now allow for it.

Obviously the first option is the easiest :)

This is a good catch.

Feel free to submit a PR

This was fixed in PR #67