Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Connection module to read from JSON permissions file instead of hard coded values #1391

Open
tkol2022 opened this issue Oct 30, 2024 · 2 comments
Labels
enhancement This issue or pull request will add new or improve existing functionality
Milestone

Comments

@tkol2022
Copy link
Collaborator

tkol2022 commented Oct 30, 2024

💡 Summary

Currently the function Connect-Tenant in Connection.psm1 has a hard coded list of MS Graph permissions that it requests as scopes when connecting to the Graph endpoint. Soon there will be a new JSON file named ScubaGear-Permissions.json added to the repo and Connect-Tenant should be modified to dynamically pull the list of permissions from that file instead of the hard coded array.
We should also validate that the list of permissions being requested is current and does not contain any permissions that are no longer necessary due to code changes.

Image

Implementation notes

See a separate comment within this issue for the list of action items.

@tkol2022 tkol2022 added the enhancement This issue or pull request will add new or improve existing functionality label Oct 30, 2024
@schrolla
Copy link
Collaborator

This is dependent on completion of PR #1380 first.

@schrolla schrolla modified the milestones: Kraken, Lionfish Nov 4, 2024
@tkol2022
Copy link
Collaborator Author

tkol2022 commented Nov 25, 2024

Updated set of actions for this issue

Some recent work by Microsoft spawned a new strategy for documenting and coding permissions which affects the scope of this issue.
Refer to the updated actions below.

Code updates

  • Microsoft has custom coded a new function that gives the set of permissions needed for specific cmdlets. Add that function to ScubaGear so that it can be called from Connection.psm1.

  • Update the code in Connect-Tenant so that instead of using a hard coded set of permission values, it calls Microsoft's new function to dynamically fetch the list of permissions for the Scopes parameter passed to Connect-MgGraph.

Documentation updates

  • Upon performing an analysis of which permissions are currently needed to run ScubaGear, the Microsoft team determined that the RoleManagementPolicy.Read.AzureADGroup Graph permission is no longer necessary and is superseded by another permission we already configure for ScubaGear. Remove RoleManagementPolicy.Read.AzureADGroup from all references in the user documentation and in documentation in the /Testing/Docs folder.
    Image

  • Update the permissions list the documentation so that it matches the output of Microsoft's new custom coded function which lists all the permissions needed.

Tenant updates and Unit Testing

  • Update the permissions assigned to the Scuba Functional Test Orchestrator application so that they match the revised set of permissions in our documentation. Perform this update in all the test tenants. Test ScubaGear non-interactively with this application to make sure that it works. There should be no 401 errors.
  • Do the same for the Scuba GitHub Automation application. Test the GitHub actions to make sure that they work with no 401 errors.
  • Do the same for the Microsoft Graph Powershell service principal (in Enterprise Applications). To update this one you may have to blow away the existing set of permissions and reconnect from ScubaGear using interactive authentication and then perform the admin consent to the permissions. Make sure you do this with the new ScubaGear code that was revised according to this issue. Test ScubaGear with interactive auth to ensure that it works with no 401 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants