-
Notifications
You must be signed in to change notification settings - Fork 21
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
⭐️ Microsoft 365 risky users resource #4570
Conversation
7ce91c3
to
cde6355
Compare
ctx := context.Background() | ||
|
||
filter := "riskState eq 'atRisk'" | ||
resp, err := graphClient.IdentityProtection().RiskyUsers().Get(ctx, &identityprotection.RiskyUsersRequestBuilderGetRequestConfiguration{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is there any way we can check for the p2 license here so we can show a nice err msg or will the API itself throw such an err if the tenant is not p2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a better concept in general to check for permissions in Azure. Not just this one.
// User name | ||
name string | ||
// User principal | ||
principalName string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe we can use the microsoft..user
resource here? or can a risky user also be a service app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, lets remove it for now and stick with user reference. Great idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I reviewed the code. I think we should keep principalName
for now. Otherwise we always need to create all user objects. I would like to avoid that right now.
cde6355
to
0be8a5d
Compare
This PR adds the new
microsoft.security.riskyUsers
resource.List of risky users
You can easily query for Entra risky users:
Or if you want to see all details:
Check that no risky user exists
To verify that no risk user exist, you can just use MQL's
none()
function: