vault-action icon indicating copy to clipboard operation
vault-action copied to clipboard

[BUG] Vault-action does not support authentication only usage

Open Ameausoone opened this issue 4 years ago • 2 comments

Describe the bug I want to use vault-action only to authenticate to vault instance with an approle, and generate a VAULT_TOKEN to use with Terraform and vault-provider, and without retrieve secrets. But vault-action require to specify secrets.

To Reproduce Use vault-action without secrets :

      - name: Authenticate to Vault
        uses: hashicorp/[email protected]
        with:
          url: https://my-vault-instance
          method: approle
          roleId: ${{ secrets.VAULT_ROLE_ID }}
          secretId: ${{ secrets.VAULT_SECRET_ID }}
          exportToken: true

Expected behavior

vault-action should authenticate and produces a masked environment variable VAULT_TOKEN.

Log Output

Error: Input required and not supplied: secrets

Additional context N/A

Ameausoone avatar Nov 09 '20 08:11 Ameausoone

@Ameausoone One way to trick this would be to do a look-up self: https://www.vaultproject.io/api-docs/auth/token#lookup-a-token-self.

We should definitely have support for exporting tokens only, though!

jasonodonnell avatar Nov 10 '20 17:11 jasonodonnell

Is this a duplicate of https://github.com/hashicorp/vault-action/issues/289, which is now solved by https://github.com/hashicorp/vault-action/pull/299 (and released in https://github.com/hashicorp/vault-action/releases/tag/v2.4.1) ?

ps-jay avatar Jun 07 '22 07:06 ps-jay

Yep, looks like this was solved in #299. Thanks!

tvoran avatar Nov 09 '22 23:11 tvoran