-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathconfig.go
More file actions
82 lines (73 loc) · 2.24 KB
/
config.go
File metadata and controls
82 lines (73 loc) · 2.24 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
// Copyright Mondoo, Inc. 2024, 2026
// SPDX-License-Identifier: BUSL-1.1
package config
import (
"fmt"
"go.mondoo.com/mql/v13/providers-sdk/v1/plugin"
"go.mondoo.com/mql/v13/providers/tailscale/connection"
"go.mondoo.com/mql/v13/providers/tailscale/provider"
)
var Config = plugin.Provider{
Name: "tailscale",
ID: "go.mondoo.com/mql/v13/providers/tailscale",
Version: "13.0.4",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
Name: "tailscale",
Use: "tailscale",
Short: "a Tailscale network",
// The tailnet organization name. e.g. example.com
MinArgs: 0,
MaxArgs: 1,
Long: fmt.Sprintf(`
Use the tailscale provider to query devices, DNS nameservers, and more information about a Tailscale network,
known as a tailnet.
To authenticate using an API access token:
cnspec shell tailscale --token <access-token>
To authenticate using an OAuth client:
cnspec shell tailscale --client-id <id> --client-secret <secret>
You can also use the default environment variables '%s', '%s',
and '%s' to provide your credentials.
If you are using an API access token instead of an OAuth client, use the '%s' variable instead.
`,
connection.TAILSCALE_OAUTH_CLIENT_ID_VAR,
connection.TAILSCALE_OAUTH_CLIENT_SECRET_VAR,
connection.TAILSCALE_TAILNET_VAR,
connection.TAILSCALE_API_KEY_VAR,
),
Discovery: []string{
connection.DiscoveryAll,
connection.DiscoveryAuto,
connection.DiscoveryDevices,
connection.DiscoveryUsers,
},
Flags: []plugin.Flag{
{
Long: connection.OPTION_TOKEN,
Type: plugin.FlagType_String,
Default: "",
Desc: "Tailscale API access token for authentication",
},
{
Long: connection.OPTION_BASE_URL,
Type: plugin.FlagType_String,
Default: "",
Desc: "Base URL for the Tailscale API",
},
{
Long: connection.OPTION_CLIENT_ID,
Type: plugin.FlagType_String,
Default: "",
Desc: "Tailscale OAuth client ID for authentication",
},
{
Long: connection.OPTION_CLIENT_SECRET,
Type: plugin.FlagType_String,
Default: "",
Desc: "Tailscale OAuth client secret for authentication",
},
},
},
},
}