Code Monkey home page Code Monkey logo

demo-actions-azure-keyvault's Introduction

demo-actions-azure-keyvault

This repository contains a demo of using GitHub Actions with Federated/ODIC Authentication to pull a secret from Azure Key Vault.

Authentication to Azure

The GitHub Action authenticates to Azure as a service principal; however, instead of managing secrets in GitHub, this implements Federated Authentication with OIDC.

Documentation:

Demo

  1. Fork this repository
  2. Configure Azure infrastructure (see: Infrastructure Configuration)
    • Service Principal
    • Key Vault
    • Role assignment
  3. Set up GitHub secrets for Actions (see: GitHub Configuration)
  4. Execute Action

The Action runs manully from the Actions tab in this repository.

Actions Steps

The Action steps are defined in get-azure-secrets.yml.

  1. Azure Login: Logs into Azure CLI with Federated Credentials (OIDC). This eliminates the need to manage a client ID and secret.
  2. Get Secrets: This will fetch additional secrets from Azure Key Vault, using the identity from the Login step.
  3. Show Secrets: This will output the secrets from the Get Secrets step, showing that the secret2 value is masked.

Result

The log will show a result, one of a plaintext secret1 value and the other of a masked secret2 value:

secret1: value1
secret2: ***

Infrastructure Configuration

If you wish to fork and run this demo in your environment, you will need to provision a Key Vault in Azure and grant the service principal used in Actions the Key Vault Secrets User role or assign the appropriate legacy Key Vault access policy.

Documentation:

You can reference or use the deploy.sh script in this repository to assist with setting up a demo environment.

GitHub Configuration

GitHub Actions will also expect the following secrets to be configured in the repository:

  • AZURE_TENANT_ID: The tenant ID for your Azure environment
  • AZURE_CLIENT_ID: Your Azure service principal client ID
  • AZURE_SUBSCRIPTION_ID: Your Azure subscription ID
  • AZURE_KEY_VAULT_NAME: The name of the Azure Key Vault

demo-actions-azure-keyvault's People

Contributors

chrisromp avatar

Watchers

 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.