Azure setup: grant only Application.ReadWrite.OwnedBy - #471
Draft
bengreenberg5 wants to merge 1 commit into
Draft
Conversation
Porter's only Microsoft Graph operation is managing federated identity credentials on its own app registration. The script granted seven tenant-wide Graph permissions inherited from the client-secret era; replace them with Application.ReadWrite.OwnedBy, make the service principal an owner of its own app registration (OwnedBy only reaches registrations the caller owns), and remove the legacy grants — manifest entries and consented app role assignments — from app registrations that still carry them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3cL9QN3RQYJ3R8zTiervJ
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to porter-dev/code#8127 (RUN-4375). Porter's only Microsoft Graph operation is managing federated identity credentials on its own app registration, so the setup script now grants a single, ownership-scoped permission instead of seven tenant-wide ones.
Script changes (
scripts/setup-azure-porter-wif.sh)add_api_permissionsgrants onlyApplication.ReadWrite.OwnedBy.ensure_app_ownermakes the service principal an owner of its own app registration (az ad app owner add) —OwnedByonly reaches registrations the caller owns. Runs on every invocation, likeassign_custom_role.remove_legacy_api_permissionsstripsApplication.ReadWrite.All,Directory.ReadWrite.All,Domain.Read.All,Group.Create,Group.ReadWrite.All,RoleManagement.ReadWrite.Directory, andUser.ReadWrite.Allfrom an app registration that still carries them. It removes both the manifest entries and the admin-consented app role assignments —az ad app permission deletealone leaves the consent grant in place, and the grant is what puts the permission in the token.main:create_app_registration → assign_custom_role → ensure_app_owner → add_api_permissions → grant_admin_consent → remove_legacy_api_permissions → create_federated_credential.Docs
cloud-accounts/connecting-a-cloud-account.mdxdescribes the new steps and what the single permission does.Merge order
Merge after porter-dev/code#8127 is deployed. Until then Porter's connect-time check rejects an app registration that holds only
OwnedBy.Verification
bash -nandshellcheck -S warningclean. Not yet run against a live tenant — that's part of the e2e checklist on the code PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3cL9QN3RQYJ3R8zTiervJ