Skip to content

Commit

Permalink
⭐ Add new properties to gitlab.group resource (#1782)
Browse files Browse the repository at this point in the history
Add new properties to gitlab.group

- emailsDisabled
- preventForkingOutsideGroup
- mentionsDisabled
- webURL

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

```
gitlab.group: {
  name: "mondoolabs"
  webURL: "https://gitlab.com/groups/mondoolabs"
  path: "mondoolabs"
  mentionsDisabled: false
  description: ""
  projects: [
  0: gitlab.project name="Example Gitlab" visibility="private"
  ]
  id: 5409231
  requireTwoFactorAuthentication: true
  visibility: "private"
  emailsDisabled: false
  preventForkingOutsideGroup: false
}
```

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Sep 20, 2023
1 parent 5b10442 commit ce0a538
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 ce0a538

Please sign in to comment.