Migrate to MS Graph for AAD operations #63
Closed
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.
Overview
Migrate away from the Azure Active Directory Graph API and use Microsoft Graph for Azure Active Directory operations: creating and removing applications, passwords and service principals
This change is necessary as the AAD Graph API is deprecated and will no longer be supported from June 2022. Additionally, this API is feature frozen and exhibits longer delays due to eventual consistency.
Impact on practitioners will include:
Applications.ReadWrite.All
andGroups.ReadWrite.All
Design of Change
This makes use of manicminer/hamilton which is the same library being used by the Terraform AzureAD Provider.
There are some caveats, related to the API (not the library):
ffffff
does not work/addPassword
(and never subsequently)Related Issues/Pull Requests
[ ] Issue #58 - resolved by this change because the new API uses a transactional
/addPassword
endpoint instead of racily retrieving existing credentials, inserting a new one client-side, and posting the resulting array[ ] Issue #30 - should also resolve this issue by using the newer API which is easier to grant permissions for (AAD Graph is missing many permissions which forces practitioners to resort to directory roles)
Contributor Checklist
[ ] Add relevant docs to upstream Vault repository, or sufficient reasoning why docs won’t be added yet
My Docs PR Link - docs not yet added, kindly request code review first
[ ] Add output for any tests not ran in CI to the PR description (eg, acceptance tests)
[ ] Backwards compatible - whilst no compatibility issues exist, practitioners will need to review the API permissions given to Vault for Microsoft Graph
Test Results
Both the mocked and real tests are passing for me, using a MITM proxy to verify the API requests and responses are as expected.
make test