-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathconfig.go
More file actions
70 lines (65 loc) · 1.9 KB
/
config.go
File metadata and controls
70 lines (65 loc) · 1.9 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
// Copyright Mondoo, Inc. 2024, 2026
// SPDX-License-Identifier: BUSL-1.1
package config
import (
"go.mondoo.com/mql/v13/providers-sdk/v1/inventory"
"go.mondoo.com/mql/v13/providers-sdk/v1/plugin"
"go.mondoo.com/mql/v13/providers/nmap/connection"
"go.mondoo.com/mql/v13/providers/nmap/provider"
)
var Config = plugin.Provider{
Name: "nmap",
ID: "go.mondoo.com/mql/v13/providers/nmap",
Version: "13.0.4",
ConnectionTypes: []string{provider.DefaultConnectionType},
Connectors: []plugin.Connector{
{
Name: "nmap",
Use: "nmap",
Short: "a Nmap network scanner",
Long: `Use the nmap provider to query network information using the Nmap network scanner, including open ports, services, and host information.
Requirement:
Nmap must be installed on your system. To learn how, read https://nmap.org/download.html.
Examples:
cnspec shell nmap host 192.168.1.1
cnspec shell nmap --networks 10.0.0.0/8,192.168.0.0/16
cnspec shell nmap --networks "192.168.1.0/24" --discover hosts
cnspec scan nmap host 192.168.1.1
cnspec shell nmap host 192.168.1.1 --ports 22,80,443
`,
MinArgs: 0,
MaxArgs: 2,
Discovery: []string{
connection.DiscoveryAll,
connection.DiscoveryAuto,
connection.DiscoveryHosts,
},
Flags: []plugin.Flag{
{
Long: "networks",
Type: plugin.FlagType_List,
Default: "",
Desc: "Comma-separated list of networks to scan (e.g., 10.0.0.0/8,192.168.0.0/16)",
},
{
Long: "ports",
Type: plugin.FlagType_String,
Default: "",
Desc: "Ports to scan (e.g., 22,80,443 or 1-1024)",
},
},
},
},
AssetUrlTrees: []*inventory.AssetUrlBranch{
{
PathSegments: []string{"technology=network", "category=nmap"},
Key: "kind",
Title: "Kind",
Values: map[string]*inventory.AssetUrlBranch{
"host": nil,
"domain": nil,
"org": nil,
},
},
},
}