Skip to content

Commit

Permalink
⭐️ Adding a resouces to the Microsoft Graph under group (MS365) (#4003)
Browse files Browse the repository at this point in the history
* adding a resouces to the Microsoft Graph under group

Signed-off-by: Hossein Rouhani <[email protected]>

* Change groupTypes to an array.

Signed-off-by: Preslav <[email protected]>

* adding a membershipRule and membershipRuleProcessingState to the Microsoft Graph under group

Signed-off-by: Hossein Rouhani <[email protected]>

* Apply suggestions from code review

---------

Signed-off-by: Hossein Rouhani <[email protected]>
Signed-off-by: Preslav <[email protected]>
Co-authored-by: Preslav <[email protected]>
  • Loading branch information
HRouhani and preslavgerchev authored May 15, 2024
1 parent e4043dd commit e0c4ab8
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 7 deletions.
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: 9.0.0
id: {}
mail: {}
mailEnabled: {}
mailNickname: {}
members: {}
membershipRule:
min_mondoo_version: 9.0.0
membershipRuleProcessingState:
min_mondoo_version: 9.0.0
securityEnabled: {}
visibility:
min_mondoo_version: 9.0.0
Expand Down

0 comments on commit e0c4ab8

Please sign in to comment.