-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathconfig.go
More file actions
90 lines (84 loc) · 2.74 KB
/
config.go
File metadata and controls
90 lines (84 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright (c) Mondoo, Inc.
// SPDX-License-Identifier: BUSL-1.1
package config
import (
"go.mondoo.com/cnquery/v12/providers-sdk/v1/inventory"
"go.mondoo.com/cnquery/v12/providers-sdk/v1/plugin"
"go.mondoo.com/cnquery/v12/providers/gitlab/provider"
)
var Config = plugin.Provider{
Name: "gitlab",
ID: "go.mondoo.com/cnquery/v9/providers/gitlab",
Version: "11.1.128",
ConnectionTypes: []string{
provider.ConnectionType,
provider.GitlabGroupConnection,
provider.GitlabProjectConnection,
},
Connectors: []plugin.Connector{
{
Name: "gitlab",
Use: "gitlab",
Short: "a GitLab group or project",
Long: `Use the gitlab provider to query resources within GitLab groups and projects.
Available commands:
group GitLab group
project GitLab project
Examples:
cnspec scan gitlab --group <GROUP_NAME> --token <YOUR_TOKEN>
cnspec scan gitlab --discover projects --token <YOUR_TOKEN>
cnspec scan gitlab --group <GROUP_NAME> --project <PROJECT_NAME> --token <YOUR_TOKEN>
cnspec scan gitlab --group <GROUP_NAME> --discover projects --token <YOUR_TOKEN>
cnspec scan gitlab --discover terraform --token <YOUR_TOKEN>
cnquery shell gitlab --group <GROUP_NAME> --token <YOUR_TOKEN>
cnquery shell gitlab --group <GROUP_NAME> --project <PROJECT_NAME> --token <YOUR_TOKEN>
Notes:
Mondoo needs a personal access token to scan a GitLab group or project. The token's level of access determines how much information Mondoo can retrieve. Instead of providing a token with every command, you can supply your personal access token to Mondoo by setting the GITLAB_TOKEN environment variable. To learn how, read https://mondoo.com/docs/cnspec/saas/gitlab/.
`,
Discovery: []string{
provider.DiscoveryGroup,
provider.DiscoveryProject,
provider.DiscoveryTerraform,
provider.DiscoveryK8sManifests,
},
Flags: []plugin.Flag{
{
Long: "token",
Type: plugin.FlagType_String,
Default: "",
Desc: "GitLab personal access token",
},
{
Long: "group",
Type: plugin.FlagType_String,
Option: plugin.FlagOption_Required,
Default: "",
Desc: "GitLab group to scan",
},
{
Long: "project",
Type: plugin.FlagType_String,
Default: "",
Desc: "GitLab project to scan",
},
{
Long: "url",
Type: plugin.FlagType_String,
Default: "",
Desc: "Custom GitLab base URL (https://example.com/)",
},
},
},
},
AssetUrlTrees: []*inventory.AssetUrlBranch{
{
PathSegments: []string{"technology=saas", "provider=gitlab"},
Key: "kind",
Title: "Kind",
Values: map[string]*inventory.AssetUrlBranch{
"project": nil,
"group": nil,
},
},
},
}