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

fix(browser auth): fix browser auth in Azure to include tenant id #2415

Merged

Conversation

n4ch04
Copy link
Contributor

@n4ch04 n4ch04 commented May 29, 2023

Context

Browser auth in azure was failing under certain circunstancies. It looked like it was related with the tenant id assumed as default

Description

Modify the browser auth mode to include the tenant id as argument

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@n4ch04 n4ch04 requested a review from a team as a code owner May 29, 2023 10:14
prowler/providers/common/audit_info.py Outdated Show resolved Hide resolved
Comment on lines 448 to 453
azure_parser.add_argument(
"--tenant-id",
nargs="+",
default=[],
help="Azure tenant id to be used with --browser-auth option",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this variable is a list? If we need to pass a list of tenants please change it to --tenant-ids and change the description accordingly.

@@ -59,7 +60,14 @@ def __set_credentials__(
)
sys.exit(1)
else:
credentials = InteractiveBrowserCredential()
try:
credentials = InteractiveBrowserCredential(tenant_id=tenant_id[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about the --tenant-id.

@n4ch04 n4ch04 requested a review from jfagoagas May 29, 2023 12:36
@sergargar sergargar linked an issue May 30, 2023 that may be closed by this pull request
@jfagoagas jfagoagas changed the title fix(browser auth): fixed brow auth in azure to include tenant id fix(browser auth): fix browser auth in Azure to include tenant id Jun 2, 2023
prowler/lib/cli/parser.py Outdated Show resolved Hide resolved
prowler/lib/cli/parser.py Outdated Show resolved Hide resolved
@jfagoagas jfagoagas added the provider/azure Issues/PRs related with the Azure provider label Jun 2, 2023
@jfagoagas jfagoagas self-requested a review June 2, 2023 11:11
@jfagoagas jfagoagas merged commit 15a7de7 into master Jun 2, 2023
4 checks passed
@jfagoagas jfagoagas deleted the PRWLR-2110-bug-prowler-browser-auth-issue-on-azure-provider branch June 2, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/azure Issues/PRs related with the Azure provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: prowler: browser auth issue on azure provider
3 participants