infisical icon indicating copy to clipboard operation
infisical copied to clipboard

GitLab Integration: Sync fails if masked is enabled and one value does not meet the masking requirements (min: 8, no spaces)

Open JanHolger opened this issue 7 months ago • 0 comments

Describe the bug

When the masking is enabled on an integration and a secret value does not meet GitLab's masking requirements (min: 8, no spaces), the sync will fail with the error message { "message": { "value": [ "is invalid" ] } }

To Reproduce

Steps to reproduce the behavior:

  1. Create a secret with the value "hello world"
  2. Create a GitLab integration with the masked option enabled
  3. Watch the sync fail 💥

Expected behavior

I thought a little bit about this and the most simple approach would be to only set masked to true when the value of a secret meets the requirements, otherwise setting it to false. This might be causing confusion to some users though so if implemented in this way it should probably be combined with at least some hint next to / below the option about this behavior.

The best option would be to be able to enable it per secret but I don't see how this could be implemented in a nice and generic way. One option would be to optionally let the user define a regex that secret key's need to match in order to be masked. This way the regex could match for every key that contains keywords like "password", "token" or "secret".

Screenshots

If applicable, add screenshots to help explain your problem.

Platform you are having the issue on:

Self-Hosted, Version: 0.72.3

JanHolger avatar Jun 27 '24 16:06 JanHolger