Skip to content

safe is not able to use a unix socket provided by a vault agent #225

@jouveits

Description

@jouveits

Vault agent (with auto-auth) can provide a local unix socket for other local clients to use (for instance vault cli).

Unfortunately, safe does not seem to be able to use it, unlike the vault cli:

# Poining the VAULT_ADDR to the socket provided by vault agent
$ export VAULT_ADDR=unix:///var/run/vault/agent.sock
# Local user can use it:
$ ls -l /var/run/vault/agent.sock
srwxrwx--- 1 vault vault 0 Jan 22 13:53 /var/run/vault/agent.sock
# Vault cli can use that socket, and use the authentication provided by vault agent:
$ vault kv list legacy/jouve-infradev
Keys
----
my-secrets/
# On the other end, safe is not able to use the socket:
$ $ safe version
safe v1.5.9
$ safe env
  VAULT_ADDR  unix:///var/run/vault/agent.sock
$ safe tree legacy
You are not authenticated to a Vault.
Try safe auth ldap
 or safe auth github
 or safe auth token
 or safe auth userpass
 or safe auth approle
$ safe auth status
Authenticating against  at unix:///var/run/vault/agent.sock
!! Transport Error: Get unix://:80//var/run/vault/agent.sock/v1/auth/token/lookup-self: unsupported protocol scheme "unix"

$ safe vault kv list legacy/jouve-infradev
Keys
----
my-secrets/

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