Skip to content

Adding the Azure sync module functions along with new cloud client functionality#50366

Merged
mvbrock merged 34 commits intomasterfrom
mvbrock/azure-integration-disco-azure
Jan 13, 2025
Merged

Adding the Azure sync module functions along with new cloud client functionality#50366
mvbrock merged 34 commits intomasterfrom
mvbrock/azure-integration-disco-azure

Conversation

@mvbrock
Copy link
Copy Markdown
Contributor

@mvbrock mvbrock commented Dec 17, 2024

This PR is a result of splitting #48843 into smaller PRs, and provides the Azure fetching functions and new cloud client functionality specifically for role assignments and definitions. This PR also incorporates the existing lib/msgraph client and removes the extraneous client code from the original PR.

@mvbrock mvbrock changed the base branch from master to mvbrock/azure-integration-disco-proto December 17, 2024 23:42
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from a817501 to e88e148 Compare December 17, 2024 23:43
Base automatically changed from mvbrock/azure-integration-disco-proto to master December 18, 2024 20:24
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from e88e148 to 308bc2c Compare December 18, 2024 20:29
@mvbrock mvbrock marked this pull request as ready for review December 19, 2024 07:07
@github-actions github-actions Bot requested a review from hugoShaka December 19, 2024 07:07
@mvbrock mvbrock added the no-changelog Indicates that a PR does not require a changelog entry label Dec 19, 2024
Comment thread lib/srv/discovery/fetchers/azure-sync/virtualmachines.go
Comment thread lib/srv/discovery/fetchers/azure-sync/roledefinitions.go Outdated
Comment thread lib/srv/discovery/fetchers/azure-sync/roledefinitions.go
Comment thread lib/srv/discovery/fetchers/azure-sync/roleassignments.go
Comment thread lib/srv/discovery/fetchers/azure-sync/roleassignments.go Outdated
Comment thread lib/srv/discovery/fetchers/azure-sync/msggraphclient.go Outdated
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from 02bcb5e to 0a4c1f4 Compare December 19, 2024 23:59
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from 0a4c1f4 to 672ae8d Compare December 20, 2024 00:01
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-hx7av502y-goteleport.vercel.app/docs

@mvbrock mvbrock requested a review from tigrato December 20, 2024 02:58
Comment thread lib/msgraph/paginated.go Outdated
Comment thread lib/cloud/azure/roledefinitions.go
Comment thread lib/srv/discovery/fetchers/azure-sync/principals.go Outdated
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from 2894408 to 0dc6820 Compare December 30, 2024 17:16
Comment thread lib/msgraph/paginated.go Outdated
@mvbrock mvbrock requested a review from zmb3 December 30, 2024 17:51
Comment thread lib/srv/discovery/fetchers/azure-sync/roledefinitions.go Outdated
Comment thread lib/srv/discovery/fetchers/azure-sync/roledefinitions.go Outdated
Comment thread lib/cloud/azure/roledefinitions.go
Comment thread lib/msgraph/paginated.go Outdated
Comment thread e
Comment thread lib/msgraph/paginated.go Outdated
Comment thread lib/msgraph/paginated.go Outdated
Comment thread lib/msgraph/paginated.go Outdated
@mvbrock mvbrock requested review from tigrato and zmb3 January 7, 2025 05:17
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from 932b2e8 to a20ac6f Compare January 7, 2025 20:19
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-disco-azure branch from 8914c7d to 8b3cd5d Compare January 10, 2025 17:06
@mvbrock mvbrock requested a review from tigrato January 10, 2025 17:28
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from hugoShaka January 13, 2025 18:15
@mvbrock mvbrock added this pull request to the merge queue Jan 13, 2025
Merged via the queue into master with commit 47f4498 Jan 13, 2025
@mvbrock mvbrock deleted the mvbrock/azure-integration-disco-azure branch January 13, 2025 19:48
mvbrock added a commit that referenced this pull request Jan 31, 2025
…nctionality (#50366)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Forgot to decouple role definitions fetching function from the fetcher

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Updating go.sum

* Fixing rebase after protobuf gen

* Nolinting until upstream PRs

* Updating to use existing msgraph client

* Adding protection around nil values

* PR feedback

* Updating principal fetching to incorporate metadata from principal subtypes

* Updating opts to not leak URL parameters

* Conformant package name

* Using variadic options

* PR feedback

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* Also returning expanded principals for improved readability

* Removing ptrToList

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Linting

* Linting

* Collecting errors from fetching memberships and using a WithContext error group

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* e ref update

* Fixing method

* Fetching group members from groups rather than memberships of each principal

* Linting

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
mvbrock added a commit that referenced this pull request Jan 31, 2025
…nctionality (#50366)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Forgot to decouple role definitions fetching function from the fetcher

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Updating go.sum

* Fixing rebase after protobuf gen

* Nolinting until upstream PRs

* Updating to use existing msgraph client

* Adding protection around nil values

* PR feedback

* Updating principal fetching to incorporate metadata from principal subtypes

* Updating opts to not leak URL parameters

* Conformant package name

* Using variadic options

* PR feedback

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* Also returning expanded principals for improved readability

* Removing ptrToList

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Linting

* Linting

* Collecting errors from fetching memberships and using a WithContext error group

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* e ref update

* Fixing method

* Fetching group members from groups rather than memberships of each principal

* Linting

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
mvbrock added a commit that referenced this pull request Feb 5, 2025
…nctionality (#50366)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Forgot to decouple role definitions fetching function from the fetcher

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Updating go.sum

* Fixing rebase after protobuf gen

* Nolinting until upstream PRs

* Updating to use existing msgraph client

* Adding protection around nil values

* PR feedback

* Updating principal fetching to incorporate metadata from principal subtypes

* Updating opts to not leak URL parameters

* Conformant package name

* Using variadic options

* PR feedback

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* Also returning expanded principals for improved readability

* Removing ptrToList

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Linting

* Linting

* Collecting errors from fetching memberships and using a WithContext error group

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* e ref update

* Fixing method

* Fetching group members from groups rather than memberships of each principal

* Linting

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
github-merge-queue Bot pushed a commit that referenced this pull request Feb 5, 2025
* Adding Azure integration protobuf messages and gRPC methods (#48628)

* Adding Azure integration gRPC messages and RPC methods

* Make derive

* Update proto/accessgraph/v1alpha/azure.proto

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Update proto/accessgraph/v1alpha/azure.proto

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Update proto/accessgraph/v1alpha/azure.proto

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* More PR feedback and generating protobuf code

* Make derive

* Adding identities field to principals, condition to role assignments, and role name to role definitions

* Rebase conflicts

* Did not fully fetch from origin/master when rebasing

* Removing azure config field and keeping poll_interval as-is

* Correct from parent branch

* Apply suggestions from code review

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* Adding doc comments to access graph proto

* Adding object type to principals

* Adding location to Azure virtual machines

* Update proto/accessgraph/v1alpha/access_graph_service.proto

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Moving Azure Discovery protobuf config to the Azure Discovery PR

* Make grpc

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Post cherry-pick grpc

* Protobuf and configuration for Access Graph Azure Discovery (#50364)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding godoc and removing Integration field from fileconf

* Adding the Azure sync module functions along with new cloud client functionality (#50366)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Forgot to decouple role definitions fetching function from the fetcher

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Updating go.sum

* Fixing rebase after protobuf gen

* Nolinting until upstream PRs

* Updating to use existing msgraph client

* Adding protection around nil values

* PR feedback

* Updating principal fetching to incorporate metadata from principal subtypes

* Updating opts to not leak URL parameters

* Conformant package name

* Using variadic options

* PR feedback

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* Also returning expanded principals for improved readability

* Removing ptrToList

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Linting

* Linting

* Collecting errors from fetching memberships and using a WithContext error group

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* e ref update

* Fixing method

* Fetching group members from groups rather than memberships of each principal

* Linting

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Adding Azure sync functionality which can be used by the Azure Fetcher (#50367)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Fixing rebase after protobuf gen

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* Adding the Azure sync module functions along with new cloud client functionality

* Protobuf and configuration for Access Graph Azure Discovery

* Adding Azure sync functionality which can be called by the Azure fetcher

* Protobuf update

* Update sync process to use msgraph client

* Conformant package name

* Invoking membership expansion

* Setting principals before expansion

* Removing msgraphclient

* Update e ref

* Linting

* PR feedback

* Adding test names to reconciliation tests

* Adding channel buffer

* Going back to just reading from channel

* Linting

* PR feedback

* PR feedback

* PR feedback

* Apply suggestions from code review

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* Fixing flaky test

* Lint

* Fix imports

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Invoking the Azure fetcher in the Discovery service (#50369)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Fixing rebase after protobuf gen

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* Adding the Azure sync module functions along with new cloud client functionality

* Protobuf and configuration for Access Graph Azure Discovery

* Adding Azure sync functionality which can be called by the Azure fetcher

* Protobuf update

* Invoking membership expansion

* Setting principals before expansion

* Removing msgraphclient

* Linting

* PR feedback

* PR feedback

* Adding the Azure sync module functions along with new cloud client functionality

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* PR feedback

* Adding the Azure sync module functions along with new cloud client functionality

* Protobuf and configuration for Access Graph Azure Discovery

* Invoking the Azure fetcher in the Discovery service

* Protobuf gen fix

* Conformant package name

* Removing msgraphclient (again?)

* Rebase fixes

* More cleanup

* PR feedback

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Adding OIDC auth functionality to the Azure integration (#51219)

* Protobuf and configuration for Access Graph Azure Discovery

* Fixing rebase after protobuf gen

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* Protobuf and configuration for Access Graph Azure Discovery

* Adding Azure sync functionality which can be called by the Azure fetcher

* Protobuf update

* Linting

* PR feedback

* PR feedback

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* PR feedback

* Protobuf and configuration for Access Graph Azure Discovery

* Protobuf gen fix

* Rebase fixes

* More cleanup

* e ref update

* Invoking token generation and returning the response

* Quick test with a message to make sure RPC is invoked

* Skeleton of new Azure OIDC RPC call

* Fetching the Azure OIDC token during fetcher creation and establishing a credential assertion approach

* PR feedback; restricting token requests to auth, discovery, and proxy roles.

* Lint

* Fixing mocks

* Fix imports

* Fix test

* Rebase fxes

* Adding back OIDC fetching, accidentally removed it during rebase

* e ref

* Lint

* Fix imports

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Azure integration status reporting (#51391)

* Protobuf and configuration for Access Graph Azure Discovery

* Fixing rebase after protobuf gen

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* Protobuf and configuration for Access Graph Azure Discovery

* Adding Azure sync functionality which can be called by the Azure fetcher

* Protobuf update

* Linting

* PR feedback

* PR feedback

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* PR feedback

* Protobuf and configuration for Access Graph Azure Discovery

* Invoking the Azure fetcher in the Discovery service

* Protobuf gen fix

* Rebase fixes

* More cleanup

* PR feedback

* Invoking token generation and returning the response

* Fetching the Azure OIDC token during fetcher creation and establishing a credential assertion approach

* PR feedback; restricting token requests to auth, discovery, and proxy roles.

* Lint

* Rebase fxes

* Adding back OIDC fetching, accidentally removed it during rebase

* Initial refactoring to include Azure status reporting

* Converging status sync between AWS and Azure

* Fixing test

* Sending usage stats

* Fix imports

* Add godocs and correct a few comments

* Removing the usage events for now

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Post cherry-pick fixes

* Azure integration command (#47541)

* Initial command to create the managed identity and role

* Adding permissions and applying command params

* Adding graph permissions to the MSI

* Updating parameters

* Adding some details and cleaning up comments

* Fixing go.sum

* Linting

* License

* PR feedback

* Decoupling sync config with an interface for testing

* Tweaks to test mocking

* PR feedback

* Rebase adjustments

* PR feedback

* Switch to empty struct maps instead of bool maps for set representation

* Godocs

* Adding user agent to Azure SDK requests

* Linting

* Moving armcompute back to v3

* Post cherry-pick make grpc

* Post rebase make grpc

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
carloscastrojumo pushed a commit to carloscastrojumo/teleport that referenced this pull request Feb 19, 2025
…nctionality (gravitational#50366)

* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Forgot to decouple role definitions fetching function from the fetcher

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Updating go.sum

* Fixing rebase after protobuf gen

* Nolinting until upstream PRs

* Updating to use existing msgraph client

* Adding protection around nil values

* PR feedback

* Updating principal fetching to incorporate metadata from principal subtypes

* Updating opts to not leak URL parameters

* Conformant package name

* Using variadic options

* PR feedback

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* Also returning expanded principals for improved readability

* Removing ptrToList

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Linting

* Linting

* Collecting errors from fetching memberships and using a WithContext error group

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* e ref update

* Fixing method

* Fetching group members from groups rather than memberships of each principal

* Linting

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discovery no-changelog Indicates that a PR does not require a changelog entry size/lg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants