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

Prototype detection of service principals with risky permissions or credentials #1327

Open
6 tasks
tkol2022 opened this issue Sep 23, 2024 · 0 comments
Open
6 tasks
Labels
hands-on-prototyping Reviewing an M365 feature by performing hands-on prototyping

Comments

@tkol2022
Copy link
Collaborator

💡 Summary

As part of the epic related to improving the security of M365 service principals, the scope of this issue is to perform hands-on prototyping to develop a method and code that ScubaGear could use to report on service principals that have risky MS Graph and other permissions. A secondary feature is to report on service principals that have credentials assigned to them.

Literature for reference

Example code:
https://github.com/12Knocksinna/Office365itpros/blob/master/ReportPermissionsApps.PS1
https://github.com/mandiant/Mandiant-Azure-AD-Investigator/blob/master/MandiantAzureADInvestigator.psm1#L430
Example permissions list:
https://itconnect.uw.edu/tools-services-support/it-systems-infrastructure/msinf/aad/apps/risky-aad-app-perms/
https://www.tenable.com/indicators/ioe/entra/DANGEROUS-API-PERMISSIONS-AFFECTING-THE-TENANT

Implementation notes

  • Develop an initial list of Graph permissions that could be considered high risk if abused. For example the RoleManagement.ReadWrite.Directory permission allows attackers to elevate themselves to the Global Administrator role.
  • Write some code or document a set of cmdlets to report on a list of service principals with these permissions
  • Write code or document a set of cmdlets to report on a list of service principals with credentials (certificate or secret) assigned to them
  • Read the articles below and see if they describe a different security problem that would require a different audit strategy or if what they describe is already covered with the reporting features covered in this issue.
    https://dirkjanm.io/azure-ad-privilege-escalation-application-admin/
    https://www.semperis.com/blog/unoauthorized-privilege-elevation-through-microsoft-applications/
  • Determine how this functionality could be incorporated into ScubaGear
  • Create separate issue to update ScubaGear if needed.
@tkol2022 tkol2022 added the hands-on-prototyping Reviewing an M365 feature by performing hands-on prototyping label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hands-on-prototyping Reviewing an M365 feature by performing hands-on prototyping
Projects
None yet
Development

No branches or pull requests

1 participant