Skip to content

Commit

Permalink
add ms365 url segments
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym committed Aug 15, 2024
1 parent 8eb4f36 commit 48534d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions providers/ms365/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package config

import (
"go.mondoo.com/cnquery/v11/providers-sdk/v1/inventory"
"go.mondoo.com/cnquery/v11/providers-sdk/v1/plugin"
"go.mondoo.com/cnquery/v11/providers/ms365/provider"
)
Expand Down Expand Up @@ -67,4 +68,9 @@ var Config = plugin.Provider{
},
},
},
AssetUrlTrees: []*inventory.AssetUrlBranch{
{
PathSegments: []string{"technology=saas", "category=ms365"},
},
},
}
20 changes: 11 additions & 9 deletions providers/ms365/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba

func (s *Service) detect(asset *inventory.Asset, conn *connection.Ms365Connection) error {
asset.Platform = &inventory.Platform{
Name: "ms365",
Runtime: "ms365",
Family: []string{""},
Kind: "api",
Title: "Microsoft Azure",
Name: "ms365",
Runtime: "ms365",
Family: []string{""},
Kind: "api",
Title: "Microsoft Azure",
TechnologyUrlSegments: []string{"saas", "ms365"},
}

return nil
Expand All @@ -175,10 +176,11 @@ func (s *Service) discover(conn *connection.Ms365Connection, conf *inventory.Con
PlatformIds: []string{identifier},
Name: "Microsoft 365 tenant " + conn.TenantId(),
Platform: &inventory.Platform{
Name: "microsoft365",
Title: "Microsoft 365",
Runtime: "ms-graph",
Kind: "api",
Name: "microsoft365",
Title: "Microsoft 365",
Runtime: "ms-graph",
Kind: "api",
TechnologyUrlSegments: []string{"saas", "ms365"},
},
Connections: []*inventory.Config{conf.Clone()}, // pass-in the current config
Labels: map[string]string{
Expand Down

0 comments on commit 48534d2

Please sign in to comment.