Skip to content

[BUG]: varlockEnclave cannot read secrets created in keystore via secrets CLI #819

Description

@bjesuiter

varlock version

1.7.2

Steps to reproduce

On macOS:

  1. Create a secret in Keychain using the secrets CLI.

    Example shape:

    secrets set <service-or-collection> <account-or-key> <value>
  2. Configure Varlock to read the same secret through the native Keychain/enclave-backed resolver path (varlockEnclave / native local encryption / keychain resolver).

  3. Run a Varlock command that resolves the value, for example:

    varlock load
    # or
    varlock run -- <command>

What is expected?

A secret created for Varlock's native Keychain/enclave workflow should be readable by Varlock when the service/account/key identifiers match.

What is actually happening?

Varlock's enclave/native Keychain path fails to read the secret when that secret was created by the external secrets CLI.

The underlying problem appears to be macOS Keychain access control: secrets created by the secrets CLI are scoped/authorized for the secrets CLI process, and are not automatically allowed to be read by other processes. This was confirmed by the user.

Possible solutions

  1. Fix/update the Keychain item access control after creation so Varlock's process/native helper is allowed to read it. This appears to be possible in code already.
  2. Preferably, avoid creating these Keychain secrets via the external secrets CLI at all. Instead, create/write them via the varlock CLI through Varlock's own daemon/helper, so the stored Keychain item is created with the correct access controls from the start and this mismatch cannot happen.

System Info

macOS Keychain / Varlock 1.7.2

Any additional comments?

Related but not the same:

Those do not appear to cover the specific case where a secret created by the external secrets CLI cannot be read by Varlock's enclave/native Keychain integration due to Keychain access-control scoping.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions