go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/os/config/config.go (about) 1 // Copyright (c) Mondoo, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package config 5 6 import ( 7 "go.mondoo.com/cnquery/providers-sdk/v1/plugin" 8 "go.mondoo.com/cnquery/providers/os/provider" 9 "go.mondoo.com/cnquery/providers/os/resources/discovery/docker_engine" 10 ) 11 12 var Config = plugin.Provider{ 13 Name: "os", 14 ID: "go.mondoo.com/cnquery/providers/os", 15 Version: "9.0.9", 16 ConnectionTypes: []string{ 17 provider.LocalConnectionType, 18 provider.SshConnectionType, 19 provider.TarConnectionType, 20 provider.DockerSnapshotConnectionType, 21 provider.VagrantConnectionType, 22 provider.DockerImageConnectionType, 23 provider.DockerContainerConnectionType, 24 provider.DockerRegistryConnectionType, 25 provider.ContainerRegistryConnectionType, 26 provider.RegistryImageConnectionType, 27 provider.FilesystemConnectionType, 28 }, 29 Connectors: []plugin.Connector{ 30 { 31 Name: "local", 32 Use: "local", 33 Short: "your local system", 34 MinArgs: 0, 35 MaxArgs: 0, 36 Discovery: []string{ 37 docker_engine.DiscoveryContainerRunning, 38 docker_engine.DiscoveryContainerImages, 39 }, 40 Flags: []plugin.Flag{ 41 { 42 Long: "sudo", 43 Type: plugin.FlagType_Bool, 44 Default: "false", 45 Desc: "Elevate privileges with sudo.", 46 ConfigEntry: "sudo.active", 47 }, 48 { 49 Long: "id-detector", 50 Type: plugin.FlagType_String, 51 Default: "", 52 Desc: "User override for platform ID detection mechanism", 53 Option: plugin.FlagOption_Hidden, 54 }, 55 }, 56 }, 57 { 58 Name: "ssh", 59 Use: "ssh user@host", 60 Short: "a remote system via SSH", 61 MinArgs: 1, 62 MaxArgs: 1, 63 Flags: []plugin.Flag{ 64 { 65 Long: "sudo", 66 Type: plugin.FlagType_Bool, 67 Default: "false", 68 Desc: "Elevate privileges with sudo.", 69 }, 70 { 71 Long: "insecure", 72 Type: plugin.FlagType_Bool, 73 Default: "false", 74 Desc: "Disable SSH hostkey verification.", 75 }, 76 { 77 Long: "ask-pass", 78 Type: plugin.FlagType_Bool, 79 Default: "false", 80 Desc: "Prompt for connection password.", 81 ConfigEntry: "-", 82 }, 83 { 84 Long: "password", 85 Short: "p", 86 Type: plugin.FlagType_String, 87 Default: "", 88 Desc: "Set the connection password for SSH.", 89 Option: plugin.FlagOption_Password, 90 ConfigEntry: "-", 91 }, 92 { 93 Long: "identity-file", 94 Short: "i", 95 Type: plugin.FlagType_String, 96 Default: "", 97 Desc: "Select a file from which to read the identity (private key) for public key authentication.", 98 }, 99 { 100 Long: "id-detector", 101 Type: plugin.FlagType_String, 102 Default: "", 103 Desc: "User override for platform ID detection mechanism", 104 Option: plugin.FlagOption_Hidden, 105 }, 106 }, 107 }, 108 { 109 Name: "winrm", 110 Use: "winrm user@host", 111 Short: "a remote system via WinRM", 112 MinArgs: 1, 113 MaxArgs: 1, 114 Flags: []plugin.Flag{ 115 { 116 Long: "insecure", 117 Default: "false", 118 Desc: "Disable TLS/SSL checks", 119 Type: plugin.FlagType_Bool, 120 }, 121 { 122 Long: "ask-pass", 123 Default: "false", 124 Desc: "Prompt for connection password.", 125 Type: plugin.FlagType_Bool, 126 }, 127 { 128 Long: "password", 129 Short: "p", 130 Default: "false", 131 Desc: "Set the connection password for SSH.", 132 Type: plugin.FlagType_String, 133 Option: plugin.FlagOption_Password, 134 ConfigEntry: "-", 135 }, 136 { 137 Long: "id-detector", 138 Type: plugin.FlagType_String, 139 Default: "", 140 Desc: "User override for platform ID detection mechanism", 141 Option: plugin.FlagOption_Hidden, 142 }, 143 }, 144 }, 145 { 146 Name: "vagrant", 147 Use: "vagrant host", 148 Short: "a Vagrant host", 149 MinArgs: 1, 150 MaxArgs: 1, 151 Flags: []plugin.Flag{ 152 { 153 Long: "sudo", 154 Type: plugin.FlagType_Bool, 155 Default: "false", 156 Desc: "Elevate privileges with sudo.", 157 }, 158 { 159 Long: "id-detector", 160 Type: plugin.FlagType_String, 161 Default: "", 162 Desc: "User override for platform ID detection mechanism", 163 Option: plugin.FlagOption_Hidden, 164 }, 165 }, 166 }, 167 { 168 Name: "container", 169 Use: "container", 170 Short: "a running container or container image", 171 MinArgs: 1, 172 MaxArgs: 2, 173 Discovery: []string{ 174 docker_engine.DiscoveryContainerRunning, 175 docker_engine.DiscoveryContainerImages, 176 }, 177 Flags: []plugin.Flag{ 178 { 179 Long: "sudo", 180 Type: plugin.FlagType_Bool, 181 Default: "false", 182 Desc: "Elevate privileges with sudo.", 183 ConfigEntry: "sudo.active", 184 }, 185 { 186 Long: "id-detector", 187 Type: plugin.FlagType_String, 188 Default: "", 189 Desc: "User override for platform ID detection mechanism", 190 Option: plugin.FlagOption_Hidden, 191 }, 192 { 193 Long: "disable-cache", 194 Type: plugin.FlagType_Bool, 195 Default: "false", 196 Desc: "Disable the in-memory cache for images. WARNING: This will slow down scans significantly.", 197 }, 198 }, 199 }, 200 { 201 Name: "docker", 202 Use: "docker", 203 Short: "a running docker or docker image", 204 MinArgs: 1, 205 MaxArgs: 2, 206 Discovery: []string{ 207 docker_engine.DiscoveryContainerRunning, 208 docker_engine.DiscoveryContainerImages, 209 }, 210 Flags: []plugin.Flag{ 211 { 212 Long: "sudo", 213 Type: plugin.FlagType_Bool, 214 Default: "false", 215 Desc: "Elevate privileges with sudo.", 216 ConfigEntry: "sudo.active", 217 }, 218 { 219 Long: "id-detector", 220 Type: plugin.FlagType_String, 221 Default: "", 222 Desc: "User override for platform ID detection mechanism", 223 Option: plugin.FlagOption_Hidden, 224 }, 225 { 226 Long: "disable-cache", 227 Type: plugin.FlagType_Bool, 228 Default: "false", 229 Desc: "Disable the in-memory cache for images. WARNING: This will slow down scans significantly.", 230 }, 231 }, 232 }, 233 { 234 Name: "filesystem", 235 Aliases: []string{"fs"}, 236 Use: "filesystem [flags]", 237 Short: "a mounted file system target.", 238 MinArgs: 0, 239 MaxArgs: 0, 240 Flags: []plugin.Flag{ 241 { 242 Long: "path", 243 Type: plugin.FlagType_String, 244 Default: "", 245 Desc: "Path to a local file or directory for the connection to use.", 246 }, 247 }, 248 }, 249 }, 250 }