Skip to content

feat(auth): trusted Entra app roles and restricted multi-tenant sign-in - #61

Merged
Zacgoose merged 4 commits into
mainfrom
dev
Nov 4, 2026
Merged

Zacgoose merged 4 commits into
mainfrom
dev

Conversation

@Zacgoose

@Zacgoose Zacgoose commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces support for Azure Entra app roles with per-tenant allow-lists, enhancing role-based authorization for multi-tenant scenarios. It also improves CI/CD security and traceability by pinning GitHub Actions to specific commit SHAs and adding build provenance attestations. Additionally, several configuration and code quality improvements are included.

Authorization and App Role Enhancements:

  • Added support for Azure Entra app roles: tokens' roles claims are now honored only if the issuing tenant is explicitly trusted via a new allow-list table (AppRoleTableName). This prevents unauthorized tenants from granting themselves roles. (Services/Auth/AuthService.cs, Services/Configuration/AuthSettings.cs, Services/Auth/EasyAuthPrincipal.cs, Services/Hosting/CraftAuthMiddleware.cs) [1] [2] [3] [4] [5] [6] [7] [8]
  • Extended EasyAuthClaims to extract and carry TenantId (tid) and Roles from tokens, and updated the principal normalization flow to leverage these new claims for role resolution. (Services/Auth/EasyAuthPrincipal.cs, Services/Hosting/CraftAuthMiddleware.cs) [1] [2] [3] [4] [5]

Configuration and Setup Improvements:

  • Introduced the AppRoleTableName setting to configure the trusted tenants/roles table, and improved documentation for AllowedTenants to clarify multi-tenant behavior. (Services/Configuration/AuthSettings.cs, Services/Configuration/SetupSettings.cs) [1] [2]

CI/CD Security and Traceability:

  • Pinned all GitHub Actions in workflow files to specific commit SHAs for improved supply chain security. (.github/workflows/dev-container.yml, .github/workflows/release-container.yml) [1] [2] [3] [4] [5] [6]
  • Added build provenance attestation steps to workflows, enabling consumers to verify that published images originated from CI and not from direct pushes. (.github/workflows/dev-container.yml, .github/workflows/release-container.yml) [1] [2]
  • Added a dependabot.yml configuration to enable automated dependency update tracking for GitHub Actions. (.github/dependabot.yml)

These changes collectively improve both the security posture and flexibility of the authentication and deployment pipelines.

JohnDuprey and others added 4 commits November 3, 2026 00:45
Pin all third-party GitHub Actions to commit SHAs, add dependabot config to keep them updated, and sign build provenance attestations for container images. Also guard the release workflow so pre-releases and tags not merged into main cannot publish/overwrite the :latest image.
- Auth:AppRoleTableName lists, per tenant id, the roles that tenant may grant
- Token roles count only when the table trusts the token's tid, and authorise without an allowedUsers row
- Setup wizard offers Restricted Multi-Tenant with a list of other tenant IDs
- Multi-tenant apps with an allow-list set WEBSITE_AUTH_AAD_ALLOWED_TENANTS to the setup tenant plus that list
- Setup:AllowedTenants now feeds the same list
@Zacgoose
Zacgoose requested a review from JohnDuprey November 4, 2026 12:52
@Zacgoose Zacgoose changed the title Dev feat(auth): trusted Entra app roles and restricted multi-tenant sign-in Nov 4, 2026
@Zacgoose
Zacgoose merged commit f07d665 into main Nov 4, 2026
7 checks passed
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