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

Azure Cloud Shell: Add support for Device Conditional Access #8158

Open
lly-unik opened this issue Nov 4, 2020 · 7 comments
Open

Azure Cloud Shell: Add support for Device Conditional Access #8158

lly-unik opened this issue Nov 4, 2020 · 7 comments
Labels
Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@lly-unik
Copy link

lly-unik commented Nov 4, 2020

Environment

Windows build number: 10.0.19042.572
Windows Terminal version (if applicable): 1.3.2651.0

Steps to reproduce

Open Azure Cloud shell and attempt to connect with our Azure tenant

Pre-requisite

Our company uses Azure Conditional Access policies and require computers to be domain-joined devices in order to connect with our tenant without multi-factor.

Expected behavior

I would expect the cloud shell to connect once I completed the steps listed in the prompt (i.e. enter pin from device login web site)
https://devblogs.microsoft.com/commandline/the-azure-cloud-shell-connector-in-windows-terminal/

Actual behavior

I receive the following error:
AADSTS53001: Device is not in required device state: domain_joined. Conditional Access policy requires a domain joined device, and the device is not domain joined.
Trace ID: 24bab79e-1e96-4524-abd1-833c53a30d00
Correlation ID: ddbce269-f8ca-41e5-9d92-d9bb4d63320f
Timestamp: 2020-10-30 07:27:02Z

Additional notes

I've been made aware, that we've seen a similar error when using the Azure Storage Explorer.
https://feedback.azure.com/forums/217298-storage/suggestions/36283420-conditional-access-support-for-storage-explorer

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 4, 2020
@Don-Vito
Copy link
Contributor

Don-Vito commented Nov 5, 2020

Not an expert, but were you performing the Device Code Flow (entering device code into prompt)? Asking this because there is a known limitation in the Conditional Access, where it is not aware of the device state, as described here.
image

@lly-unik
Copy link
Author

lly-unik commented Nov 5, 2020

Yes, I believe this was what I was trying to do. I just opened the Azure Cloud Shell tab and wanted to authenticate using the flow suggested in the terminal.

What your suggesting is, that we should adjust our conditional access policies according to the above description? So I should be prompted for a multi-factor control when trying to connect through the Azure Cloud Shell?

I'll try and see if I'm able to test this and report back the results.

@Don-Vito
Copy link
Contributor

Don-Vito commented Nov 5, 2020

If it is OK with the security policies of your company, instead of requiring device state related conditions for the relevant apps, you can require user related conditions like MFA. An example can be found https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/untrusted-networks.
Of course you can provide additional scoping of this policy to specific apps, users, etc.

@DHowett
Copy link
Member

DHowett commented Nov 20, 2020

Thanks. This is, as you astutely note, due to us using device login. We will almost certainly have to rearchitect how login works, but we're not equipped to do so.

I'm going to put this up on the backlog. Let me know if your conditional access policy change helps 😄

@DHowett DHowett added this to the Terminal Backlog milestone Nov 20, 2020
@DHowett DHowett added Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 20, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 20, 2020
@Don-Vito
Copy link
Contributor

@DHowett - it's more a feature than a bug. IMHO the device login flow is a good choice for terminal, as it is simple and interactive, though it has some limitations with specific Conditional Access requirements. I guess we simply need to add some addition way to authenticate for users that device login doesn't fit their needs (service principal?)

@lly-unik
Copy link
Author

I was able to test this the other day and managed to get a successful verification using Azure Terminal with our tenant.

My IT-department couldn't tell me if they had changed anything. It appeared to just work out of the blue?! (which of course isn't true - something must have changed)

But I don't know whether a conditional Access rule was changed by IT or if something else changed.
Sorry I can't be of better help :-(

@Don-Vito
Copy link
Contributor

At least it works - which is great already!

@DHowett DHowett changed the title Error when connecting Azure Cloud Shell to tenant with domain joined device under conditional access policies Azure Cloud Shell: Add support for Device Conditional Access Jan 26, 2021
@DHowett DHowett added Issue-Task It's a feature request, but it doesn't really need a major design. and removed Issue-Bug It either shouldn't be doing this or needs an investigation. labels Jan 26, 2021
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants