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

Azure integration command #47541

Merged
merged 19 commits into from
Jan 16, 2025
Merged

Azure integration command #47541

merged 19 commits into from
Jan 16, 2025

Conversation

mvbrock
Copy link
Contributor

@mvbrock mvbrock commented Oct 13, 2024

Per https://github.com/gravitational/access-graph/issues/1326, this PR provides a new command to assign the necessary Azure and Graph API roles to the managed identity running the Discovery service.

@mvbrock mvbrock changed the title Command to create the managed identity and role for Azure Access Graph sync Azure integration commands Dec 23, 2024
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-cmd branch from 979537d to 142264d Compare December 23, 2024 17:23
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-cmd branch 2 times, most recently from f25b55b to 1d508cb Compare January 4, 2025 04:10
@mvbrock mvbrock marked this pull request as ready for review January 5, 2025 00:20
@mvbrock mvbrock added the no-changelog Indicates that a PR does not require a changelog entry label Jan 5, 2025
lib/config/configuration.go Show resolved Hide resolved
tool/teleport/common/teleport.go Outdated Show resolved Hide resolved
lib/msgraph/client.go Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
lib/integrations/azureoidc/accessgraph_sync.go Outdated Show resolved Hide resolved
@mvbrock mvbrock force-pushed the mvbrock/azure-integration-cmd branch from bb01fc5 to 452a1c4 Compare January 9, 2025 02:34
@mvbrock mvbrock changed the title Azure integration commands Azure integration command Jan 9, 2025
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from fheinecke January 10, 2025 15:16
@mvbrock mvbrock added this pull request to the merge queue Jan 10, 2025
@tigrato tigrato removed this pull request from the merge queue due to a manual request Jan 10, 2025
@mvbrock mvbrock requested a review from rosstimothy January 11, 2025 18:38
@mvbrock mvbrock enabled auto-merge January 15, 2025 17:02
@mvbrock mvbrock added this pull request to the merge queue Jan 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2025
@mvbrock mvbrock added this pull request to the merge queue Jan 16, 2025
Merged via the queue into master with commit b22f342 Jan 16, 2025
41 checks passed
@mvbrock mvbrock deleted the mvbrock/azure-integration-cmd branch January 16, 2025 18:03
mvbrock added a commit that referenced this pull request Jan 18, 2025
* 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
mvbrock added a commit that referenced this pull request Jan 31, 2025
* 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
mvbrock added a commit that referenced this pull request Feb 5, 2025
* 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
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 <[email protected]>

* Update proto/accessgraph/v1alpha/azure.proto

Co-authored-by: Tiago Silva <[email protected]>

* Update proto/accessgraph/v1alpha/azure.proto

Co-authored-by: Tiago Silva <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Moving Azure Discovery protobuf config to the Azure Discovery PR

* Make grpc

---------

Co-authored-by: Tiago Silva <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* PR feedback

* Fixing flaky test

* Lint

* Fix imports

---------

Co-authored-by: Tiago Silva <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants