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

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

Merged
merged 34 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2540355
Protobuf and configuration for Access Graph Azure Discovery
mvbrock Dec 17, 2024
64a4c18
Adding the Azure sync module functions along with new cloud client fu…
mvbrock Dec 17, 2024
666b482
Forgot to decouple role definitions fetching function from the fetcher
mvbrock Dec 17, 2024
64ee74c
Moving reconciliation to the upstream azure sync PR
mvbrock Dec 17, 2024
f4ed0e3
Moving reconciliation test to the upstream azure sync PR
mvbrock Dec 17, 2024
597ba79
Updating go.sum
mvbrock Dec 17, 2024
1edb6de
Fixing rebase after protobuf gen
mvbrock Dec 18, 2024
0f7a405
Nolinting until upstream PRs
mvbrock Dec 19, 2024
1fa09cf
Updating to use existing msgraph client
mvbrock Dec 19, 2024
3b70c0b
Adding protection around nil values
mvbrock Dec 20, 2024
69486a2
PR feedback
mvbrock Dec 20, 2024
861b562
Updating principal fetching to incorporate metadata from principal su…
mvbrock Dec 20, 2024
37e3dda
Updating opts to not leak URL parameters
mvbrock Dec 30, 2024
cce7007
Conformant package name
mvbrock Dec 31, 2024
d498564
Using variadic options
mvbrock Jan 6, 2025
6726772
PR feedback
mvbrock Jan 6, 2025
bacbe49
Removing memberOf expansion
mvbrock Jan 6, 2025
fa9d8a6
Expanding memberships by calling memberOf on each user
mvbrock Jan 7, 2025
8f07e78
Also returning expanded principals for improved readability
mvbrock Jan 7, 2025
f075bc8
Removing ptrToList
mvbrock Jan 7, 2025
2b5b928
PR feedback
mvbrock Jan 9, 2025
0572557
Rebase go.sum stuff
mvbrock Jan 9, 2025
4959c11
Go mod tidy
mvbrock Jan 9, 2025
8ac788c
Linting
mvbrock Jan 9, 2025
194ae3e
Linting
mvbrock Jan 9, 2025
1eacf07
Collecting errors from fetching memberships and using a WithContext e…
mvbrock Jan 9, 2025
4cf25c4
Fixing go.mod
mvbrock Jan 9, 2025
ae6bba6
Update lib/msgraph/paginated.go
mvbrock Jan 10, 2025
aafeb05
PR feedback
mvbrock Jan 10, 2025
8b3cd5d
e ref update
mvbrock Jan 10, 2025
c2319c6
e ref update
mvbrock Jan 10, 2025
acf1415
Fixing method
mvbrock Jan 10, 2025
3c90b4d
Fetching group members from groups rather than memberships of each pr…
mvbrock Jan 11, 2025
c7cd683
Linting
mvbrock Jan 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removing ptrToList
  • Loading branch information
mvbrock committed Jan 10, 2025
commit f075bc8585fae7e5f8b2cf57351520676f710b30
15 changes: 3 additions & 12 deletions lib/srv/discovery/fetchers/azure-sync/roledefinitions.go
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ package azuresync
import (
"context"
"fmt" //nolint:golint // used in a dependent PR
"github.com/gravitational/teleport/lib/utils/slices"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2"
"github.com/gravitational/trace"
@@ -59,8 +60,8 @@ func fetchRoleDefinitions(ctx context.Context, subscriptionID string, cli RoleDe
continue
}
pbPerm := accessgraphv1alpha.AzureRBACPermission{
Actions: ptrsToList(perm.Actions),
NotActions: ptrsToList(perm.NotActions),
Actions: slices.FromPointers(perm.Actions),
NotActions: slices.FromPointers(perm.NotActions),
}
pbPerms = append(pbPerms, &pbPerm)
}
@@ -75,13 +76,3 @@ func fetchRoleDefinitions(ctx context.Context, subscriptionID string, cli RoleDe
}
return pbRoleDefs, trace.NewAggregate(fetchErrs...)
}

func ptrsToList(ptrs []*string) []string { //nolint:unused // used in a dependent PR
strList := make([]string, 0, len(ptrs))
for _, ptr := range ptrs {
if ptr != nil {
strList = append(strList, *ptr)
}
}
return strList
}