Skip to content

Commit

Permalink
Add new properties to gitlab.group
Browse files Browse the repository at this point in the history
- emailsDisabled
- preventForkingOutsideGroup
- mentionsDisabled
- webURL

These are helpful for expanding the gitlab security policy + asset
overview data for the console

cnquery> gitlab.group{*}
gitlab.group: {
  name: "lunalectric"
  path: "lunalectric"
  description: ""
  projects: [
  0: gitlab.project name="Example Gitlab" visibility="private"
  ]
  id: 5409231
  requireTwoFactorAuthentication: true
  visibility: "private"
  preventForkingOutsideGroup: false
}
```

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Sep 20, 2023
1 parent c2a13a0 commit 6676413
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/gitlab/resources/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ func initGitlabGroup(runtime *plugin.Runtime, args map[string]*llx.RawData) (map
args["name"] = llx.StringData(grp.Name)
args["path"] = llx.StringData(grp.Path)
args["description"] = llx.StringData(grp.Description)
args["webURL"] = llx.StringData(string(grp.WebURL))
args["visibility"] = llx.StringData(string(grp.Visibility))
args["requireTwoFactorAuthentication"] = llx.BoolData(grp.RequireTwoFactorAuth)
args["preventForkingOutsideGroup"] = llx.BoolData(grp.PreventForkingOutsideGroup)
args["mentionsDisabled"] = llx.BoolData(grp.MentionsDisabled)
args["emailsDisabled"] = llx.BoolData(grp.EmailsDisabled)

return args, nil, nil
}
Expand Down
8 changes: 8 additions & 0 deletions providers/gitlab/resources/gitlab.lr
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ gitlab.group @defaults("name") {
path string
// Group description
description string
// URL of the project
webURL string
// Group visibility. Can be private, internal, or public.
visibility string
// Require all users in this group to setup Two-factor authentication.
requireTwoFactorAuthentication bool
// Don't allow forking projects outside this group
preventForkingOutsideGroup bool
// Disable group email notifications
emailsDisabled bool
// Disable group mentions within issues and merge requests
mentionsDisabled bool
// List all projects that belong to the group
projects() []gitlab.project
}
Expand Down
48 changes: 48 additions & 0 deletions providers/gitlab/resources/gitlab.lr.go

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

8 changes: 8 additions & 0 deletions providers/gitlab/resources/gitlab.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ resources:
gitlab.group:
fields:
description: {}
emailsDisabled:
min_mondoo_version: 9.0.0
id: {}
mentionsDisabled:
min_mondoo_version: 9.0.0
name: {}
path: {}
preventForkingOutsideGroup:
min_mondoo_version: 9.0.0
projects: {}
requireTwoFactorAuthentication: {}
visibility: {}
webURL:
min_mondoo_version: 9.0.0
maturity: experimental
min_mondoo_version: 5.15.0
gitlab.project:
Expand Down

0 comments on commit 6676413

Please sign in to comment.