Skip to content

Commit

Permalink
Collect if a GitLab project allows forking projects
Browse files Browse the repository at this point in the history
This is part of GitLab's security recommendations. If we collect it we
can expand our policy to check for it.

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 19, 2023
1 parent fc5c872 commit 0742eb0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions providers/gitlab/resources/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func initGitlabGroup(runtime *plugin.Runtime, args map[string]*llx.RawData) (map
args["description"] = llx.StringData(grp.Description)
args["visibility"] = llx.StringData(string(grp.Visibility))
args["requireTwoFactorAuthentication"] = llx.BoolData(grp.RequireTwoFactorAuth)
args["preventForkingOutsideGroup"] = llx.BoolData(grp.PreventForkingOutsideGroup)

return args, nil, nil
}
Expand Down
2 changes: 2 additions & 0 deletions providers/gitlab/resources/gitlab.lr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ gitlab.group @defaults("name") {
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
// List all projects that belong to the group
projects() []gitlab.project
}
Expand Down
12 changes: 12 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.

2 changes: 2 additions & 0 deletions providers/gitlab/resources/gitlab.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ resources:
id: {}
name: {}
path: {}
preventForkingOutsideGroup:
min_mondoo_version: 9.0.0
projects: {}
requireTwoFactorAuthentication: {}
visibility: {}
Expand Down

0 comments on commit 0742eb0

Please sign in to comment.