diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fa8c86 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.terraform diff --git a/README.md b/README.md index 3d92342..82b7770 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# hashitalks-demo \ No newline at end of file +# hashitalks-demo + +This repo contains an example on how to use [Vault reponse wrapping](https://www.vaultproject.io/docs/concepts/response-wrapping/) feature to fetch Vault secrets from a Jenkins pipeline. + +The example has been used during the [HashiTalks2020](https://events.hashicorp.com/hashitalks2020) "Vault Response Wrapping Makes Secret Zero Challenge A Piece Of Cake" presentation demo. + +## terraform folder + +Terraform configuration files to configure both the Jenkins pipeline AppRole and the wrapping policy. + +## Jenkinsfile + +Stages simplify the following workflow: + +![Vault Response Wrapping Jenkins Workflow](/images/vault-jenkins-response-wrapping.png) + diff --git a/images/vault-jenkins-response-wrapping.png b/images/vault-jenkins-response-wrapping.png new file mode 100644 index 0000000..c045f09 Binary files /dev/null and b/images/vault-jenkins-response-wrapping.png differ diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..dca4163 --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,56 @@ +resource "vault_mount" "hashitalks_kv" { + path = "kv" + type = "generic" +} + +resource "vault_generic_secret" "demo_secrets" { + path = "kv/pipeline-secrets" + + data_json = <