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

Allow users to bring their own credential for deployment #176

Closed
glennmusa opened this issue Apr 26, 2021 · 4 comments · Fixed by #315
Closed

Allow users to bring their own credential for deployment #176

glennmusa opened this issue Apr 26, 2021 · 4 comments · Fixed by #315
Assignees
Labels
core New feature or request

Comments

@glennmusa
Copy link
Contributor

glennmusa commented Apr 26, 2021

Benefit/Result/Outcome
It'd be nice if I could deploy the MLZ and its configuration resources using a credential I already have.

Description
Today, we build the name for the MLZ Configuration Service Principal that is granted Contributor RBAC permissions on deployment subscriptions using the mlz_env_name argument.

Acceptance Criteria

  • Allow users to specify a --username and --password for use with deployments when a --service-principal flag is supplied
  • Check RBAC permissions for this SPN against the subscriptions for the deployment
  • Seed the MLZ Config KeyVault with this credential
  • Update mlz_objectid in .tfvars for setting Bastion jumpbox KeyVault access policies
  • If a credential is provided, do not create a new one for them
@glennmusa glennmusa added core New feature or request needs triage labels Apr 26, 2021
@bspender
Copy link
Contributor

@glennmusa - would it be within scope to bring your own service principal?
Example use case: I don't have Global Admin rights, so I have to get help from another team who needs to pre-create that SP for me. Upon completion, they provide me access to the Client id and secret, which I use to run the deployment

@glennmusa glennmusa changed the title allow users who to reuse a MLZ configuration service principal if they are an owner allow users to reuse a MLZ configuration service principal if they are an owner Apr 26, 2021
@glennmusa
Copy link
Contributor Author

@bspender certainly doesn't seem unrealistic! That's a great point. Thanks for bringing it up. Looks like we could have some conversations about BYO-Deployment Credential

@glennmusa glennmusa changed the title allow users to reuse a MLZ configuration service principal if they are an owner allow users to bring their own credential for deployment Apr 26, 2021
@brooke-hamilton brooke-hamilton changed the title allow users to bring their own credential for deployment Allow users to bring their own credential for deployment Apr 26, 2021
@glennmusa
Copy link
Contributor Author

I imagine it's do-able by passing along to an MLZ command a --service-principal flag and supplying values for --username and --password, attempts to login to AZ cli with those values, check the correct RBAC permissions/scope for the supplied subscriptions, skipping the SP creation if all is valid, then writes those values to the .mlzconfig.

@glennmusa
Copy link
Contributor Author

We'll need to get the object ID for setting KeyVault Access Policies when using KeyVault secrets as bastion jumpbox passwords: az ad sp show --id {the_client_id_of_the_service_principal} --query objectId --output tsv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core New feature or request
Projects
None yet
3 participants