aztfmod / rovergo

The next version of Rover, the command line tool for Azure CAF Landingzones. Developed in Go
MIT License
10 stars 7 forks source link

bug: additional auth cases #106

Closed sebastus closed 3 years ago

sebastus commented 3 years ago

Additional authentication cases have been discovered. We need all of them to be handled correctly.

Expected Behavior

All of these authentication cases should work, az login: (on an Azure VM)

All of the above cases should work where the logged in ID has permissions:

In cases above where --username (-u) parameter is specified to az login, must work with: (with MI only - not spn)

In addition to the above cases, az login with a user principal should work:

Desired outcome includes creation of unit tests for each of the cases.

Actual Behavior

Some of the above cases are handled correctly, but not all.

Steps to Reproduce the Problem

benc-uk commented 3 years ago

A major note on the owner role check, the only time it needs to be checked is for launchpad mode only See the old rover code

image

For all other deployments no checks are made

Just checked rovergo and our owner check https://github.com/aztfmod/rovergo/blob/d3d7b15cf71c499ec26a16e8a2498e8bd5f26ed4/pkg/azure/auth.go#L35 Is only called by runLaunchpadInit https://github.com/aztfmod/rovergo/blob/d3d7b15cf71c499ec26a16e8a2498e8bd5f26ed4/pkg/landingzone/landingzone.go#L211 so I think we're ok 🥇

benc-uk commented 3 years ago

Getting the objectId however is mandatory and is required by the CAF terraform in a TF_VAR

sebastus commented 3 years ago

The initial stage of resolving this issue is to enumerate the cases as comments in test/integration/auth_test.go