Skip to content
This repository was archived by the owner on Nov 10, 2019. It is now read-only.

Commit 9ba6886

Browse files
Vault plugin (#47)
* Vault plugin * Vault plugin * Vault plugin * Vault plugin * Vault plugin * Vault plugin
1 parent 616b998 commit 9ba6886

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ See each plugin readme for more info and usage instructions.
2323
| [Import Docker Images](plugins/import-docker-images/README.md) | Import Docker images metadata into Codefresh| `docker` `codefresh`|
2424
| [Google KMS](plugins/google-kms/README.md) | Encryption/Decryption with Google KMS| `KMS` `codefresh`|
2525
| [Github Release](plugins/github-release/README.md) | Managing GitHub releases | `github` `release`|
26-
| [Google GKE](plugins/gke/README.md) | GKE Clusters | `GKE` `codefresh`|
26+
| [Google GKE](plugins/gke/README.md) | GKE Clusters | `GKE` `codefresh`|
27+
| [Vault](plugins/vault/README.md) | Export Vault Key/Value pairs as ENV variables | `Vault` `codefresh`|

plugins/vault/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# cf-vault-plugin
2+
3+
Use Codefresh [Vault](https://www.vaultproject.io) plugin to make key-value pairs stored in a vault available as environment variables for further steps.
4+
5+
NOTE: this plugin currently supports token authentication and Key/Value secrets engine only.
6+
7+
8+
## Usage
9+
10+
Set required and optional environment variables and add the following step to your Codefresh pipeline:
11+
12+
Example Variables:
13+
14+
The example below will authenticate to vault server `https://vault.testdomain.io:8200` using token `s.4wtaMJuZ7dv0c4XuRaasLUOG` and export all secrets found in path `secret/codefreshsecret` as ENV variables available for further steps.
15+
16+
```text
17+
VAULT_ADDR=https://vault.testdomain.io:8200
18+
VAULT_PATH=secret/codefreshsecret
19+
VAULT_AUTH_TOKEN=s.4wtaMJuZ7dv0c4XuRaasLUOG
20+
```
21+
22+
23+
```yaml
24+
---
25+
version: '1.0'
26+
27+
steps:
28+
29+
...
30+
31+
Vault_to_Env:
32+
title: Importing vault values
33+
image: 'codefresh/cf-vault-plugin'
34+
environment:
35+
- VAULT_ADDR=${{VAULT_ADDR}}
36+
- VAULT_PATH=${{VAULT_PATH}}
37+
- VAULT_AUTH_TOKEN=${{VAULT_AUTH_TOKEN}}
38+
39+
...
40+
41+
```
42+
43+
## Environment Variables
44+
45+
| Variables | Required | Default | Description |
46+
|----------------|----------|---------|-----------------------------------------------------------------------------------------|
47+
| VAULT_ADDR | YES | | Vault server URI |
48+
| VAULT_PATH | YES | | Path to secrets in vault |
49+
| VAULT_AUTH_TOKEN | YES | | Vault authentication token |
50+
| VAULT_CLIENT_CERT_BASE64 | NO | | Base64 encoded client cerificate |
51+
| VAULT_CLIENT_KEY_BASE64 | NO | | Base64 encoded client key

plugins/vault/plugin.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
image: codefresh/cf-vault-plugin
2+
tag: latest
3+
version: 0.1.0
4+
description: The plugin exports KV pairs from Hashicorp Vault to Codefresh pipeline ENV variables
5+
keywords:
6+
- vault
7+
- hashicorp
8+
home: https://github.com/codefresh-io/cf-vault-plugin
9+
sources:
10+
- https://github.com/codefresh-io/cf-vault-plugin
11+
maintainers: # (optional)
12+
- name: Alexander Aladov
13+
email: a.aladov@codefresh.io
14+
envs:
15+
- name: VAULT_ADDR
16+
type: required
17+
description: "Vault server URI. Example: https://vault.testdomain.io:8200"
18+
- name: VAULT_PATH
19+
type: required
20+
description: "Path to secrets in vault. Example: secret/codefreshsecret"
21+
- name: VAULT_AUTH_TOKEN
22+
type: required
23+
description: "Vault authentication token"
24+
- name: VAULT_CLIENT_CERT_BASE64
25+
description: "Base64 encoded client cerificate"
26+
- name: VAULT_CLIENT_KEY_BASE64
27+
description: "Base64 encoded client key"

0 commit comments

Comments
 (0)