Giter Club home page Giter Club logo

testazurecodeoidc's Introduction

Test Azure OIDC Authentication

This is a test repo to test out Azure OIDC authentication with GitHub. It is designed to give a skeleton workflow for building + signing a PowerShell module with a key in Azure Key Vault plus a publishing step. See https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure and https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux for more information on OIDC auth with GitHub Actions and Azure.

The following GitHub secrets must be defined:

  • AZURE_SUBSCRIPTION_ID - The Azure subscription id guid the app is registered in
  • AZURE_TENANT_ID - The tenant id guid of the app registration
  • AZURE_CLIENT_ID - The client id guid of the app registration
  • AZURE_VAULT_NAME - The name of the Azure Key Vault the certificate is stored in
  • AZURE_VAULT_CERT_NAME - The name of the Azure Key Vault certificate

The federated credential is registered for this repo on the main branch as that is where the OIDC claim will be running as. While you can use a branch, tag, or environment name, Azure does not support pattern matching so I cannot use the claim for tags that match v*. In the end I decided on always signing the module when a commit to main is made and having a separate publish workflow that uses this artifact for publishing solving this problem. In the future I might revisit this to see if I can lock it down even further and only have the claim be valid when it is a release tag.

The authenticode signing work is done by the OpenAuthenticode module. See Authenticode Azure Keys for more information on how the module can use a key stores in an Azure Key Vault. It works seamlessly with the Azure OIDC login task to authenticate as a principal when retrieving a key without sharing any secrets.

Only secret left in the whole publishing process is the PowerShell Gallery nuget token. Until the PSGallery supports OIDC then this is unavoidable.

testazurecodeoidc's People

Contributors

jborean93 avatar

Watchers

 avatar  avatar

Forkers

manbearpiet

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.