GithubHelp home page GithubHelp logo

wilson-urdaneta / secrethub-circleci-orb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from secrethub/secrethub-circleci-orb

0.0 0.0 0.0 134 KB

Load secrets into CircleCI jobs

Home Page: https://secrethub.io

License: Apache License 2.0

secrethub-circleci-orb's Introduction


1Password SecretHub has joined 1Password! Find out more on the SecretHub blog. ๐ŸŽ‰


CircleCI + SecretHub


Learn More View Docs


CircleCI Orb Partner badge

CircleCI Version Discord

No more copy-pasting sensitive values into a GUI. Securely load secrets into CircleCI and sync them automatically.

This Orb is officially supported and actively maintained by SecretHub, but community contributions are very welcome.

Usage

To execute a command that needs secrets, replace your CircleCI run command with secrethub/exec. You can make secrets available to your command as environment variables by referencing their SecretHub path, prefixed by secrethub://:

version: 2.1
orbs:
  secrethub: secrethub/[email protected]

jobs:
  deploy:
    docker:
      - image: cimg/base:stable
    environment:
      AWS_ACCESS_KEY_ID: secrethub://company/app/aws/access_key_id
      AWS_SECRET_ACCESS_KEY: secrethub://company/app/aws/secret_access_key
    steps:
      - checkout
      - secrethub/exec:
          command: |
            echo "This value will be masked: $AWS_ACCESS_KEY_ID"
            echo "This value will be masked: $AWS_SECRET_ACCESS_KEY"
            ./deploy-my-app.sh
workflows:
  deploy:
    jobs:
      - deploy

Alternatively, you can set the shell of the native CircleCI run command:

version: 2.1
orbs:
  secrethub: secrethub/[email protected]

jobs:
  deploy:
    docker:
      - image: cimg/base:stable
    steps:
      - secrethub/install
      - checkout
      - run:
          shell: secrethub run -- /bin/bash
          environment:
            AWS_ACCESS_KEY_ID: secrethub://company/app/aws/access_key_id
            AWS_SECRET_ACCESS_KEY: secrethub://company/app/aws/secret_access_key
          command: |
            echo "This value will be masked: $AWS_ACCESS_KEY_ID"
            echo "This value will be masked: $AWS_SECRET_ACCESS_KEY"
            ./deploy-my-app.sh
workflows:
  deploy:
    jobs:
      - deploy

You can either set the shell on the run command level, or you can set it on the job level to use it for every step in the job. That way you can also load secrets into other orbs:

version: 2.1
orbs:
  aws-cli: circleci/[email protected]
  secrethub: secrethub/[email protected]

jobs:
  deploy:
    executor: aws-cli/default
    shell: secrethub run -- /bin/bash
    environment:
      AWS_DEFAULT_REGION: us-east-1
      AWS_ACCESS_KEY_ID: secrethub://company/app/aws/access_key_id
      AWS_SECRET_ACCESS_KEY: secrethub://company/app/aws/secret_access_key
    steps:
      - secrethub/install
      - checkout
      - aws-cli/setup

workflows:
  deploy:
    jobs:
      - deploy

See the src/examples directory for more examples.

Masking

When using either the secrethub/exec orb command or the secrethub run shell wrapper, all secrets are automatically masked from the CI log output. If secrets (accidentally) get logged, they will be replaced with:

<redacted by SecretHub>

Authentication

For your CircleCI jobs to authenticate to SecretHub and decrypt the secrets they need, create a SecretHub service account, give it read access to the secrets it needs, and configure the credential as SECRETHUB_CREDENTIAL in your CircleCI project settings or Context environment variables.

secrethub-circleci-orb's People

Contributors

florisvdg avatar simonbarendse avatar bender-sh avatar marton6 avatar jpcoenen avatar kyletryon avatar mackenbach 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.