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

feat: add support for aws azuread federation #165

Merged
merged 3 commits into from
Sep 8, 2021

Conversation

mholttech
Copy link
Contributor

This adds support for using AzureAD to Federate into AWS. Fixes #160.

Changelog

  • Adds support for AzureAD Federation of AWS IAM Roles

This adds support for using AzureAD to Federate into AWS. Fixes Noovolari#160.
@lgtm-com
Copy link

lgtm-com bot commented Aug 30, 2021

This pull request introduces 1 alert when merging 0a7ca2a into 00b89d7 - view on LGTM.com

new alerts:

  • 1 for Incomplete URL substring sanitization

@mholttech
Copy link
Contributor Author

mholttech commented Aug 30, 2021

This pull request introduces 1 alert when merging 0a7ca2a into 00b89d7 - view on LGTM.com

new alerts:

  • 1 for Incomplete URL substring sanitization

The full URL when authenticating is https://login.microsoftonline.com/<azuread-tenant-id>/saml2

I'm not sure if this is something that can be wildcarded for or if this needs to be handled differently.

@ericvilla
Copy link
Contributor

Hi @mholttech, looking at this implementation, it seems the filters you've added fit how the needAuthentication method works. Basically, it is an addition to the current logic and does not interfere with it.
Thank you very much for the effort and we'll add the feature in the next release.

@pethron
Copy link
Contributor

pethron commented Sep 1, 2021

I think the filter works but to further scope down I'd make a try with "https://login.microsoftonline.com/*/saml2"

@mholttech
Copy link
Contributor Author

I just tried that with my dev build, unfortunately that appears to break the SAML Authentication

@ericvilla
Copy link
Contributor

ericvilla commented Sep 7, 2021

Hi @mholttech!

I've set up a federation between an AzureAD SAML Application and an AWS IAM Identity Provider.

The solution works with your implementation, but it shows the login window every time you click to activate the session. The reason behind this behavior is that details.url.indexOf('login.microsoftonline.com') !== -1 filter is too open.

The very first call to login.microsoftonline.com host has the following template: https://login.microsoftonline.com/oauth2/authorize

The condition now is
if (details.url.indexOf('login.microsoftonline.com') !== -1 && details.url.indexOf('/oauth2/authorize') !== -1) { ... }

Using this condition, Leapp does not show the login windows if you're already logged in.

@mholttech
Copy link
Contributor Author

Hey @ericvilla, Thanks for the feedback. I'm updating the filter on my local build to validate on my end and then I'll update the PR

@lgtm-com
Copy link

lgtm-com bot commented Sep 7, 2021

This pull request introduces 1 alert when merging b8e2441 into fbcf00d - view on LGTM.com

new alerts:

  • 1 for Incomplete URL substring sanitization

@mholttech
Copy link
Contributor Author

@ericvilla It looks good to me. Works as expected and no longer seeing the popup during credential refresh

@lgtm-com
Copy link

lgtm-com bot commented Sep 8, 2021

This pull request introduces 3 alerts when merging 47d0401 into fbcf00d - view on LGTM.com

new alerts:

  • 3 for Incomplete URL substring sanitization

@ericvilla ericvilla merged commit 2d0b70b into Noovolari:master Sep 8, 2021
@mholttech mholttech deleted the feature/azuread-aws-login branch September 8, 2021 14:41
ericvilla added a commit that referenced this pull request Sep 30, 2021
* feat: add support for aws azuread federation

This adds support for using AzureAD to Federate into AWS. Fixes #160.

* fix: added /oauth2/authorize presence check in AWS IAM Role Federated login window

* fix: sanitized untrusted URLs

Co-authored-by: Eric Villa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure AD Login to AWS with AWS SAML
3 participants