Azure Application for access to specific mailboxes.

David Jenkins 946 Reputation points
2021-12-09T20:53:31.113+00:00

I'm confused how to lock down an Azure application. Let me detail what I've done.

I created an app.
I added the Office 365 Exchange EWS.AccessAsUser.All API permissions
I added full_access_as_app permissions also.
I created certificate also.

I can get the application to access the app and I can access mailboxes as expected. The application can access "ANY" mailbox at the moment.

How can I prevent usage of the App from allowing access to ANY mailbox? I'd like to lock it down to specific mailboxes the App can access.

I've read about New-ApplicationAccessPolicy. I'm just confused by what it's doing. I did set a new policy and tied it to a group and added the mailboxes I want the app to be able to access to it. I'm just waiting I guess for replication or something. It seems the app can still access multiple mailboxes not in the group.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. David Jenkins 946 Reputation points
    2021-12-10T15:37:56.14+00:00

    After a period of time the policy started working. I created a mail enabled security group and added the mailbox I want the app to access to it. It took a while but eventually the app will not connect to any other mailbox but the ones in the group. So works as it should.


1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 157.4K Reputation points MVP Volunteer Moderator
    2021-12-09T21:14:49.94+00:00

    For EWS, the only permission that application policies apply to:
    full_access_as_app

    156441-image.png

    https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access#supported-permissions-and-additional-resources

    so remove: EWS.AccessAsUser.All

    P.S.

    Verify access is working as expected afterwards:

    Example:

    Test-ApplicationAccessPolicy -Identity ******@contoso.com -AppId e7e4dbfc-046-4074-9b3b-2ae8f144f59b  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.