Coder Social home page Coder Social logo

yzdann / orb-hashicorp-vault-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smaeda-ks/orb-hashicorp-vault-cli

0.0 0.0 0.0 32 KB

A handy CircleCI Orb that helps you to integrate HashiCorp Vault with your CI/CD pipelines by leveraging the CircleCI OIDC support.

License: MIT License

orb-hashicorp-vault-cli's Introduction

orb-hashicorp-vault-cli

CircleCI Build Status CircleCI Orb Version GitHub License CircleCI Community

A custom CircleCI Orb for HashiCorp Vault CLI.

This Orb provides a few commands as below:

Command Description Documentation
install Install Vault binary to the current executor environment. link
auth-oidc Authenticate with Vault using OIDC and obtain a token. Upon successful authentication, the obtained token will be set to the VAULT_TOKEN environment variable using $BASH_ENV. link
revoke-self Revoke the token set to the VAULT_TOKEN environment variable against the Vault instance set to the VAULT_ADDR environment variable. link

Example Orb usage

description: |
  Install Vault binary, authenticate using OIDC, and get secrets.
usage:
  version: 2.1
  orbs:
    orb-hashicorp-vault-cli: smaeda-ks/[email protected]
  jobs:
    my-job:
      machine: true
      steps:
        - checkout
        # Install Vault
        - orb-hashicorp-vault-cli/install
        # Authenticate using OIDC and obtain token
        # This will automatically set VAULT_TOKEN env variable
        - orb-hashicorp-vault-cli/auth-oidc:
            vault-address: "http://localhost:8200"
            vault-role: "circleci-dev"
        - run:
            name: Get secret
            command: |
              # export secret using $BASH_ENV
              # so it can be referenced by subsequent steps within the job
              FOO=$(vault kv get -field=password secret/circleci/dev)
              echo "export SECRET_FOO=${FOO}" >> $BASH_ENV
        # Revoke Vault token after finishing all steps
        - orb-hashicorp-vault-cli/revoke-self
  workflows:
    use-my-orb:
      jobs:
        - my-job:
            # You must use context for jobs require OIDC
            context: my-context

Example Vault configuration

An example Vault configuration can be found in this repository's .circleci folder:

https://github.com/smaeda-ks/orb-hashicorp-vault-cli/blob/main/.circleci

Resources

CircleCI Orb Registry Page - The official registry page of this orb for all versions, executors, commands, and jobs described. CircleCI Orb Docs - Docs for using and creating CircleCI Orbs.

How to Contribute

We welcome issues to and pull requests against this repository!

orb-hashicorp-vault-cli's People

Contributors

smaeda-ks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.