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 a resouces to the Microsoft Graph under group (MS365) #4003

Merged
merged 4 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
18 changes: 11 additions & 7 deletions providers/ms365/resources/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"go.mondoo.com/cnquery/v11/llx"
"go.mondoo.com/cnquery/v11/providers/ms365/connection"
"go.mondoo.com/cnquery/v11/types"
)

func (m *mqlMicrosoftGroup) id() (string, error) {
Expand Down Expand Up @@ -48,13 +49,16 @@ func (a *mqlMicrosoft) groups() ([]interface{}, error) {
for _, grp := range grps {
graphGrp, err := CreateResource(a.MqlRuntime, "microsoft.group",
map[string]*llx.RawData{
"id": llx.StringDataPtr(grp.GetId()),
"displayName": llx.StringDataPtr(grp.GetDisplayName()),
"mail": llx.StringDataPtr(grp.GetMail()),
"mailEnabled": llx.BoolDataPtr(grp.GetMailEnabled()),
"mailNickname": llx.StringDataPtr(grp.GetMailNickname()),
"securityEnabled": llx.BoolDataPtr(grp.GetSecurityEnabled()),
"visibility": llx.StringDataPtr(grp.GetVisibility()),
"id": llx.StringDataPtr(grp.GetId()),
"displayName": llx.StringDataPtr(grp.GetDisplayName()),
"mail": llx.StringDataPtr(grp.GetMail()),
"mailEnabled": llx.BoolDataPtr(grp.GetMailEnabled()),
"mailNickname": llx.StringDataPtr(grp.GetMailNickname()),
"securityEnabled": llx.BoolDataPtr(grp.GetSecurityEnabled()),
"visibility": llx.StringDataPtr(grp.GetVisibility()),
"groupTypes": llx.ArrayData(llx.TArr2Raw(grp.GetGroupTypes()), types.String),
"membershipRule": llx.StringDataPtr(grp.GetMembershipRule()),
"membershipRuleProcessingState": llx.StringDataPtr(grp.GetMembershipRuleProcessingState()),
})
if err != nil {
return nil, err
Expand Down
6 changes: 6 additions & 0 deletions providers/ms365/resources/ms365.lr
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ private microsoft.group @defaults("id displayName") {
visibility string
// List of group members
members() []microsoft.user
// Group types indicating the membership and classification of the group
groupTypes []string
// Membership rule used for dynamic group membership
membershipRule string
// State of the processing for the dynamic membership rule
membershipRuleProcessingState string
}

// Microsoft domain
Expand Down
36 changes: 36 additions & 0 deletions providers/ms365/resources/ms365.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions providers/ms365/resources/ms365.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ resources:
microsoft.group:
fields:
displayName: {}
groupTypes:
min_mondoo_version: latest
preslavgerchev marked this conversation as resolved.
Show resolved Hide resolved
id: {}
mail: {}
mailEnabled: {}
mailNickname: {}
members: {}
membershipRule:
min_mondoo_version: latest
preslavgerchev marked this conversation as resolved.
Show resolved Hide resolved
membershipRuleProcessingState:
min_mondoo_version: latest
preslavgerchev marked this conversation as resolved.
Show resolved Hide resolved
securityEnabled: {}
visibility:
min_mondoo_version: 9.0.0
Expand Down
Loading