-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathconfig.go
More file actions
85 lines (78 loc) · 2.63 KB
/
config.go
File metadata and controls
85 lines (78 loc) · 2.63 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
// Copyright (c) Mondoo, Inc.
// SPDX-License-Identifier: BUSL-1.1
package config
import (
"go.mondoo.com/cnquery/v11/providers-sdk/v1/plugin"
"go.mondoo.com/cnquery/v11/providers/snowflake/provider"
)
var Config = plugin.Provider{
Name: "snowflake",
ID: "go.mondoo.com/cnquery/v11/providers/snowflake",
Version: "11.0.89",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
Name: "snowflake",
Use: "snowflake",
Short: "a Snowflake account",
Long: `Use the snowflake provider to query a Snowflake account.
To access a Snowflake account, you must first authenticate with Snowflake. To do so, create an RSA key pair and assign the public key to your user account using Snowsight. To learn how, read https://docs.snowflake.com/en/user-guide/key-pair-auth. Then, in your shell, run:
shell snowflake --account <account id> --region <region> --user <your id> --role <the role you use> --private-key <path to your private RSA key>
Once you successfully authenticate, you can scan or query the Snowflake account.
Examples:
cnquery shell snowflake --account <account id> --region <region> --user <your id> --role <the role you use> --private-key <path to your private RSA key>
cnspec scan snowflake --account <account id> --region <region> --user <your id> --role <the role you use> --private-key <path to your private RSA key>
`,
Discovery: []string{},
Flags: []plugin.Flag{
{
Long: "user",
Type: plugin.FlagType_String,
Default: "",
Desc: "Snowflake user name",
},
{
Long: "ask-pass",
Type: plugin.FlagType_Bool,
Default: "false",
Desc: "Prompt for the connection password",
ConfigEntry: "-",
},
{
Long: "password",
Short: "p",
Type: plugin.FlagType_String,
Default: "",
Desc: "Set the connection password",
Option: plugin.FlagOption_Password,
ConfigEntry: "-",
},
{
Long: "identity-file",
Short: "i",
Type: plugin.FlagType_String,
Default: "",
Desc: "Select a file from which to read the identity (private key) for public key authentication",
},
{
Long: "account",
Type: plugin.FlagType_String,
Default: "",
Desc: "Snowflake account ID",
},
{
Long: "region",
Type: plugin.FlagType_String,
Default: "",
Desc: "Snowflake region",
},
{
Long: "role",
Type: plugin.FlagType_String,
Default: "",
Desc: "The role you use to access Snowflake",
},
},
},
},
}