-
Notifications
You must be signed in to change notification settings - Fork 23
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
🧹 Adding Country location to NamedLocation under conditional access - MS365 #4848
Conversation
HRouhani
commented
Nov 13, 2024
•
edited
Loading
edited
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.
Code wise LGTM.
But I think we should rename the resource.
@@ -60,6 +60,8 @@ microsoft.tenant @defaults("name") { | |||
microsoft.conditionalAccess { | |||
// IP named location | |||
namedLocations() []microsoft.conditionalAccess.ipNamedLocation | |||
// Country-based named location | |||
countryLocations() []microsoft.conditionalAccess.countryNamedLocation |
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.
From reading the docs, I think, this should be called namedLocations()
. It can be a country or an IP.
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.
Good points. I changed the structure totally to make it both be under the umbrella of namedLocation
@@ -70,6 +72,14 @@ microsoft.conditionalAccess.ipNamedLocation @defaults("name trusted") { | |||
trusted bool | |||
} | |||
|
|||
// Microsoft Conditional Access Country named location | |||
microsoft.conditionalAccess.countryNamedLocation @defaults("name lookupMethod") { |
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.
Same here:
namedLocation
instead of country...
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.
Thanks I did
After the merging I need to change all the policies get effected with this changes! |
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.
Nice refactor, just error checks are missing.
} | ||
|
||
ctx := context.Background() | ||
namedLocations, err := graphClient.Identity().ConditionalAccess().NamedLocations().Get(ctx, nil) |
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.
You should check the error here.
@@ -20,9 +20,6 @@ func (a *mqlMicrosoftConditionalAccess) namedLocations() ([]interface{}, error) | |||
|
|||
ctx := context.Background() | |||
namedLocations, err := graphClient.Identity().ConditionalAccess().NamedLocations().Get(ctx, nil) | |||
if err != nil { |
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, you should keep the err check.
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.
thanks, done
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.
done
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.
Thanks @HRouhani
… MS365 Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
Signed-off-by: Hossein Rouhani <h_rouhani@hotmail.com>
e518ac6
to
88ca6ba
Compare