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

feature request: write secrets to vault #481

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vikas-pundir-learnings
Copy link

Description

This PR adds supports to write secrets to vault.

  1. Added a new action input secretsMethod which indicates if you want to read or write to vault. Supported values are read and write. If not provided default is read

Write Secrets

This action can write secrets to vault, so say you had your AWS access Key and you want them to write to vault. You can provide secretsMethod: write and provide the secret data as below:

with:
    secretsMethod: write
    secrets: |
        secret/data/ci/aws accessKey=someAccessKey;

vault-action create the secret at provided vault path. You will get SUCCESS in response for you saved secrets.

You can also write the multiple secrets at a single path. You can do:

with:
    secretsMethod: write
    secrets: |
        secret/data/ci/aws accessKey=someAccessKey secretKey=someSecretKey;

Write Multiple Secrets

This action can take multi-line input, so say you had your AWS keys to be saved to vault. You can do:

with:
    secretsMethod: write
    secrets: |
        secret/data/ci/aws/key accessKey=someAccessKey ;
        secret/data/ci/aws/secret secretKey=someAccessKey ;

Write Json Secrets

This action can take json string input as a secret value and save it to vault as a json string. You can do:

with:
    secretsMethod: write
    secrets: |
        secret/data/ci/aws/ secret={"accessKey":"someAccessKey","secretKey":"someAccessKey"} ;

feature request: write secrets to vault
@hashicorp-cla
Copy link

hashicorp-cla commented Jul 16, 2023

CLA assistant check
All committers have signed the CLA.

@fairclothjm
Copy link
Contributor

Hello @vikas-pundir-learnings

The Vault GitHub Action is meant to be a read-only action, and in general is not meant to modify Vault’s state (the only exception in this case might be the token). Since this PR expects vault-action to modify the Vault state, this is currently out of scope for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants