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

Decrypt SopsSecret objects only in specific namespace #176

Closed
rjeczkow opened this issue Jun 11, 2024 · 9 comments
Closed

Decrypt SopsSecret objects only in specific namespace #176

rjeczkow opened this issue Jun 11, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@rjeczkow
Copy link

rjeczkow commented Jun 11, 2024

Hi

Is there a possibility to create SopsSecret object that would be possible to decrypt into a Secret object only in a specific namespace? Similar to 'strict' scope in Bitnami Sealed Secrets.

strict (default): the secret must be sealed with exactly the same name and namespace. These attributes become part of the encrypted data and thus changing name and/or namespace would lead to "decryption error".

I'd like to avoid having cluster-wide secrets so that not everyone who has access to the SopsSecret object (in a git repo) is able to decrypt it in his own namespace.

@rjeczkow rjeczkow changed the title Secrets objects created only in specific namespace. Decrypt SopsSecret objects only in specific namespace Jun 11, 2024
@isindir isindir self-assigned this Jun 11, 2024
@isindir isindir added the enhancement New feature or request label Jun 11, 2024
@isindir
Copy link
Owner

isindir commented Jun 12, 2024

@rjeczkow thanks for reporting, I added section in README please let me know if this method works for you.

@rjeczkow
Copy link
Author

Thank you very much for quick response!

I see one problem:
If you change to enforceNamespace: false or delete enforceNamespace in the encrypted SopsSecret object you can still create that object in any namespace with Healthy status and it'd be decrypted successfully.

@Kajot-dev
Copy link

The idea (at least for the Bitnami Sealed Secrets) is that namespace name is added to encryption/decryption key

@isindir
Copy link
Owner

isindir commented Jun 13, 2024

I missed it out yesterday, tested now - I'm afraid it is not possible to implement this feature due to the fact I'm by design avoiding wrapping encrypted object to the spec.field . From the day one, I have decided for the simplicity of the operation to encrypt the whole SopsSecret resource using sops cli tool. For a tool which potentially could work the desired way, please see here: https://github.com/craftypath/sops-operator . Also see https://github.com/isindir/sops-secrets-operator?tab=readme-ov-file#known-issues second point there. If that is a security concern for your use case, I'd highly recommend not to use this operator.

@isindir
Copy link
Owner

isindir commented Jun 13, 2024

I have reverted the change and removed release.

@isindir isindir closed this as completed Jun 13, 2024
@isindir isindir added the wontfix This will not be worked on label Jun 13, 2024
@isindir
Copy link
Owner

isindir commented Jun 14, 2024

Updated known issues section with better explanation.

@rjeczkow
Copy link
Author

Thank you for your time and effort.

@isindir
Copy link
Owner

isindir commented Jun 30, 2024

@rjeczkow : it may be possible to restrict which namespace a copy of operator can run on, either:

  • either a copy of operator per namespace where it is needed (namespaced scoped operator)
  • or list of namespaces via configuration flags where it will be watching for SopsSecrets within cluster

Would you be interested in one of these options ? And which one would be more interesting ?

@blankdots
Copy link

blankdots commented Jul 1, 2024

I know I am not the reporter of the issue, but reading the issue, got interested in the options.
If there is a possibility to vote I would argue for the 2nd option of

list of namespaces via configuration flags where it will be watching for SopsSecrets within cluster

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants