Skip to content

docs: add Microsoft Entra ID integration for GitHub Actions#28858

Open
afzal442 wants to merge 3 commits into
argoproj:masterfrom
afzal442:enh/gha-entra
Open

docs: add Microsoft Entra ID integration for GitHub Actions#28858
afzal442 wants to merge 3 commits into
argoproj:masterfrom
afzal442:enh/gha-entra

Conversation

@afzal442

Copy link
Copy Markdown
Member

This change adds comprehensive documentation for integrating GitHub Actions with Argo CD using Microsoft Entra ID.

It outlines the process of federating GitHub OIDC tokens directly into Microsoft Entra ID, eliminating the need for Dex and enabling Argo CD to trust Entra ID via oidc.config. The documentation includes:

  • Prerequisites for setting up Entra ID and GitHub App Registrations.
  • Configuration steps for argocd-cm to trust Entra ID.
  • A detailed example of a GitHub Action workflow that authenticates using this method.
  • Guidance on configuring RBAC policies in Argo CD for this new authentication method, noting the difference in subject identification (service principal object ID vs. repository ref).

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Copilot AI review requested due to automatic review settings July 22, 2026 15:18
@afzal442
afzal442 requested review from a team as code owners July 22, 2026 15:18
@bunnyshell

bunnyshell Bot commented Jul 22, 2026

Copy link
Copy Markdown

❗ Preview Environment deployment failed on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Document GitHub Actions OIDC federation via Microsoft Entra ID

📝 Documentation 🕐 20-40 Minutes


AI Description

• Add guidance for GitHub Actions authentication via Entra workload identity federation.
• Document required Argo CD oidc.config issuer/audience settings for Entra-minted tokens.
• Explain Entra-based RBAC subjects (service principal object ID) and provide policy examples.
Diagram

graph TD
  gha["GitHub Actions"] --> jwt["GitHub OIDC JWT"] --> entra{{"Microsoft Entra ID"}} --> at["Argo CD access token"] --> argocd["Argo CD API/CLI"]
  cm["argocd-cm oidc.config"] --> argocd
  rbac["RBAC policy.csv"] --> argocd
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep Dex as the token exchange broker
  • ➕ Uses a well-trodden Argo CD setup pattern for GitHub OIDC token exchange
  • ➕ Keeps IdP-specific token/issuer quirks out of Argo CD OIDC configuration
  • ➖ Adds an extra component (Dex) to deploy and operate
  • ➖ Still requires exchanging GitHub OIDC tokens indirectly rather than via Entra WIF
2. Use purpose-built actions (e.g., azure/login) instead of raw curl/jq
  • ➕ Less custom shell, better-maintained auth flows and error handling
  • ➕ Often simpler for users already using Azure tooling in Actions
  • ➖ Introduces dependency on specific third-party actions/tooling
  • ➖ May obscure the exact OAuth parameters/audience requirements that matter for Argo CD OIDC trust

Recommendation: The PR’s approach (direct GitHub OIDC → Entra WIF → Argo CD via oidc.config) is strong for secretless CI auth and aligns with Entra’s recommended federation model. Consider optionally mentioning an action-based implementation as a convenience variant, but keeping the explicit curl/jq example is valuable because it makes the required audience/issuer details unambiguous.

Files changed (1) +162 / -2

Documentation (1) +162 / -2
github-actions.mdAdd Microsoft Entra ID workload identity federation guide for GHA +162/-2

Add Microsoft Entra ID workload identity federation guide for GHA

• Extends the GitHub Actions authentication documentation with an Entra ID section describing direct federation of the GitHub OIDC JWT into Entra (no Dex). Adds required 'argocd-cm' 'oidc.config' issuer/audience guidance, a full workflow example, and clarifies RBAC subject differences for Entra-minted 'client_credentials' tokens (service principal object ID).

docs/operator-manual/user-management/github-actions.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Argo CD’s operator documentation for GitHub Actions authentication by adding an alternative path that federates GitHub OIDC tokens into Microsoft Entra ID (Workload Identity Federation) and then uses the resulting Entra-issued token against Argo CD configured with oidc.config.

Changes:

  • Adds a new “Using Microsoft Entra ID” section describing prerequisites and argocd-cm oidc.config setup.
  • Provides a full GitHub Actions workflow example that performs GitHub OIDC → Entra token exchange and uses the Argo CD CLI.
  • Documents RBAC differences for Entra-based auth vs. Dex-based repo/ref subjects.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/operator-manual/user-management/github-actions.md
Comment thread docs/operator-manual/user-management/github-actions.md
Comment on lines +277 to +281
When authenticating through **Microsoft Entra ID**, the subject differs. Tokens
obtained via the `client_credentials` grant identify the workload App
Registration itself, not a repository, so the subject is the **object ID of the
service principal** (`sub`/`oid` claim) rather than a `repo:org/repo:ref`
subject. Bind your role to that ID instead:
Comment thread docs/operator-manual/user-management/github-actions.md
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3)   📘 Rule violations (0)   📜 Skill insights (0)
🐞 ≡ Correctness (2) ⛨ Security (1)
Context used
✅ Compliance rules (platform): 15 rules


🔴 Action Required

1. RBAC subject claim mismatch 🐞 ≡ Correctness
Description
The new Entra RBAC guidance suggests binding policy to the service principal object ID from the
sub/oid claim, but Argo CD computes the RBAC subject from federated_claims.user_id (Dex) or
the JWT sub claim only. If operators bind RBAC to oid and sub differs, authorization will fail
even though authentication succeeds.
Code

docs/operator-manual/user-management/github-actions.md[R277-281]

+When authenticating through **Microsoft Entra ID**, the subject differs. Tokens
+obtained via the `client_credentials` grant identify the workload App
+Registration itself, not a repository, so the subject is the **object ID of the
+service principal** (`sub`/`oid` claim) rather than a `repo:org/repo:ref`
+subject. Bind your role to that ID instead:
Relevance

⭐⭐⭐ High

Team is attentive to Entra/JWT claim nuances (e.g., adding Entra-specific claim fallbacks in PR
#28656).

PR-#28656

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The documentation states the subject is the service principal object ID from sub/oid, but Argo
CD’s RBAC enforcer uses jwtutil.GetUserIdentifier(), which falls back to sub and does not read
oid, so binding RBAC to oid can misconfigure authorization.

docs/operator-manual/user-management/github-actions.md[277-289]
util/jwt/jwt.go[142-165]
server/rbacpolicy/rbacpolicy.go[58-66]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The docs currently imply Argo CD may use either `sub` or `oid` as the RBAC subject for Entra-issued tokens. In Argo CD, the RBAC subject is derived from `federated_claims.user_id` (when present) and otherwise from the JWT `sub` claim; the `oid` claim is not consulted.

## Issue Context
- Argo CD RBAC subject is computed via `jwtutil.GetUserIdentifier()` and used directly in the RBAC enforcer.
- The docs should instruct users to bind RBAC to the exact value Argo CD uses (`sub`), and only mention “object ID” insofar as it is the value carried in `sub` for their chosen Entra token type.

## Fix Focus Areas
- docs/operator-manual/user-management/github-actions.md[277-293]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Missing contents permission 🐞 ≡ Correctness
Description
The new workflow example sets permissions to only id-token: write but then uses
actions/checkout@v4 and git fetch. With an explicit permissions block, the example may lack
contents: read, causing checkout/fetch to fail and making the documented workflow non-functional
in common setups (e.g., private repos).
Code

docs/operator-manual/user-management/github-actions.md[R180-192]

+permissions:
+  id-token: write # This is required for requesting the JWT
+
+jobs:
+  argocd-test:
+    runs-on: ubuntu-latest
+    env:
+      ARGOCD_SERVER: argocd.example.com
+      ARGOCD_OPTS: --grpc-web
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0        # need the base ref to diff against
Relevance

⭐⭐ Medium

No prior reviews on GitHub Actions doc permissions; team often fixes doc correctness mismatches (PR
#28396).

PR-#28396

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow snippet explicitly sets only id-token: write under permissions and then immediately
uses actions/checkout@v4 (and later git fetch), creating a missing-permissions hazard for the
documented example.

docs/operator-manual/user-management/github-actions.md[174-208]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The sample workflow declares a restrictive top-level `permissions:` block but does not grant repository read access while using `actions/checkout` and `git fetch`, which can prevent the workflow from operating.

## Issue Context
The example is intended to be copy/pasteable; it should explicitly include the minimum permissions needed for the steps it demonstrates.

## Fix Focus Areas
- docs/operator-manual/user-management/github-actions.md[180-192]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



🟡 Remediation Recommended

3. Unpinned CLI download 🐞 ⛨ Security
Description
The new Entra workflow example downloads the Argo CD CLI from the mutable releases/latest URL
without integrity verification. This is non-reproducible and introduces avoidable supply-chain risk
for a workflow that is intended to run with deployment-related privileges.
Code

docs/operator-manual/user-management/github-actions.md[R194-200]

+      - name: Setup ArgoCD CLI
+        run: |
+          curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
+          mkdir -p "$RUNNER_TEMP/argocd"
+          install -m 555 argocd-linux-amd64 "$RUNNER_TEMP/argocd/argocd"
+          echo "$RUNNER_TEMP/argocd" >> "$GITHUB_PATH"
+          rm argocd-linux-amd64
Relevance

⭐⭐⭐ High

Team accepts supply-chain hardening in GitHub Actions (e.g., security review on checkout credentials
in PR #28215).

PR-#28215

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The documentation’s install step uses a releases/latest download and performs no
checksum/signature validation, meaning the installed executable can change over time and is not
independently integrity-checked.

docs/operator-manual/user-management/github-actions.md[194-200]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow installs `argocd` by downloading from a mutable `releases/latest` URL without pinning a version or verifying checksums/signatures.

## Issue Context
For CI/CD documentation, the recommended pattern is: pin the CLI version (e.g., an `ARGOCD_VERSION` env var) and verify integrity (e.g., SHA256 from a published checksums file), or use a trusted installation method.

## Fix Focus Areas
- docs/operator-manual/user-management/github-actions.md[194-200]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Powered by Qodo

Copilot AI review requested due to automatic review settings July 22, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

docs/operator-manual/user-management/github-actions.md:157

  • The example oidc.config uses https://sts.windows.net/{tenant-id}/ as the issuer, but Argo CD uses OIDC discovery (/.well-known/openid-configuration). Entra ID discovery works with https://login.microsoftonline.com/{tenant-id}/v2.0, which is also what microsoft.md documents. As written, the example is likely to fail discovery/token validation.
  issuer: https://sts.windows.net/{tenant-id}/

Comment on lines 8 to +11
You need to use OAuth 2.0 Token Exchange. Some identity providers supports this
out of the box such as Dex.
out of the box such as Dex. Alternatively, you can federate the GitHub OIDC
token directly into Microsoft Entra ID and have Argo CD trust Entra via
`oidc.config`.
Copilot AI review requested due to automatic review settings July 22, 2026 16:01
@afzal442 afzal442 changed the title Add Microsoft Entra ID integration for GitHub Actions docs: add Microsoft Entra ID integration for GitHub Actions Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

docs/operator-manual/user-management/github-actions.md:157

  • The oidc.config example sets issuer to https://sts.windows.net/{tenant-id}/, but the NOTE immediately below (and docs/operator-manual/user-management/microsoft.md:75) indicates Entra ID OIDC discovery should use https://login.microsoftonline.com/{tenant-id}/v2.0. As written, this example is internally inconsistent and will likely break OIDC discovery.
  issuer: https://sts.windows.net/{tenant-id}/

Comment on lines +132 to +134
This assumes Argo CD is already configured to trust Entra ID directly via
`oidc.config` as described in
[Microsoft Entra ID App Registration Auth using OIDC](microsoft.md#entra-id-app-registration-auth-using-oidc).
You need to use OAuth 2.0 Token Exchange. Some identity providers supports this
out of the box such as Dex.
out of the box such as Dex. Alternatively, you can federate the GitHub OIDC
token directly into Microsoft Entra ID and have Argo CD trust Entra via
Copilot AI review requested due to automatic review settings July 22, 2026 16:42
@afzal442
afzal442 requested a review from a team as a code owner July 22, 2026 16:42
This change adds comprehensive documentation for integrating GitHub Actions with Argo CD using Microsoft Entra ID.

It outlines the process of federating GitHub OIDC tokens directly into Microsoft Entra ID, eliminating the need for Dex and enabling Argo CD to trust Entra ID via `oidc.config`. The documentation includes:

- Prerequisites for setting up Entra ID and GitHub App Registrations.
- Configuration steps for `argocd-cm` to trust Entra ID.
- A detailed example of a GitHub Action workflow that authenticates using this method.
- Guidance on configuring RBAC policies in Argo CD for this new authentication method, noting the difference in subject identification (service principal object ID vs. repository ref).

Signed-off-by: afzal442 <afzal442@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 22, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (4)

docs/operator-manual/user-management/github-actions.md:11

  • Grammar issue and inconsistent terminology: “providers supports” should be “providers support”, and “trust Entra” should be “trust Entra ID” for clarity.
You need to use OAuth 2.0 Token Exchange. Some identity providers supports this
out of the box such as Dex. Alternatively, you can federate the GitHub OIDC
token directly into Microsoft Entra ID and have Argo CD trust Entra via
`oidc.config`.

docs/operator-manual/user-management/github-actions.md:182

  • The workflow example sets a top-level permissions: block but only grants id-token: write. When permissions is specified, unspecified permissions become none, which can break actions/checkout/git fetch (needs contents: read, especially for private repos).
permissions:
  id-token: write # This is required for requesting the JWT

docs/operator-manual/user-management/github-actions.md:168

  • The NOTE asserts a specific issuer format, but the repo’s Entra OIDC doc (docs/operator-manual/user-management/microsoft.md) uses https://login.microsoftonline.com/{tenant}/v2.0 for interactive login. Please clarify that the issuer here must match the actual token iss for this flow, so readers don’t apply the wrong issuer value.
> Tokens minted via the `client_credentials` grant are v1.0 access tokens
> issued by `https://sts.windows.net/{tenant-id}/`. Make sure the `issuer` in
> `oidc.config` matches (not the `login.microsoftonline.com/{tenant}/v2.0`
> form), and that the token's `aud` claim — the Argo CD App Registration client
> ID — is listed in `allowedAudiences`.

docs/operator-manual/user-management/github-actions.md:281

  • This section implies Argo CD may use the Entra token’s oid claim as the subject. Argo CD’s RBAC subject matching uses the token’s sub (see util/jwt/jwt.go:GetUserIdentifier), so mentioning oid here can lead to RBAC rules that never match.
When authenticating through **Microsoft Entra ID**, the subject differs. Tokens
obtained via the `client_credentials` grant identify the workload App
Registration itself, not a repository, so the subject is the **object ID of the
service principal** (`sub`/`oid` claim) rather than a `repo:org/repo:ref`
subject. Bind your role to that ID instead:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants