-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathfeatures.go
More file actions
127 lines (107 loc) · 3.89 KB
/
features.go
File metadata and controls
127 lines (107 loc) · 3.89 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Code generated by "featureflags -type=Feature"; DO NOT EDIT.
package mql
const (
// Resolve similar queries the same way. If 100 assets have the same dependent queries and overrides, they create the same resolved plan. Cannot be used with old resolver at the same time for asset.
// start: v3.x, available at v4.x, default at v5.x
// end: v6.0 => default now, no need to set it anymore
// status: builtin
MassQueries Feature = 1
// Allows MQL to use variable references across blocks. Fully changes the compiled code.
// start: v5.x
// end: v7.0
// status: builtin
PiperCode Feature = 2
// Only boolean results are checked when evaluating a query for success
// start: v6.x
// end: v8.0
// status: builtin
BoolAssertions Feature = 3
// Enables discovery of Kubernetes cluster nodes as individual assets
// start: v6.12
// end: unknown
// status: sunset, should be done via discovery code instead
K8sNodeDiscovery Feature = 4
// Add context to assets for e.g. Terraform
// start: v7.0
// end: v12.0
// status: new
MQLAssetContext Feature = 5
// Errors are treated as failures, see https://www.notion.so/mondoo/Errors-and-Scoring-5dc554348aad4118a1dbf35123368329
// start: v8.x
// end: v9.0
// status: sunset, we never really used this
ErrorsAsFailures Feature = 6
// Stores recording-like data with upstream, can still be controlled by the server
// start: v10.x
// end: v11.0
// status: default
StoreResourcesData Feature = 7
// Enables fine-grained assets discovery
// start: v11.x
// end: v12.0
// status: sunset, this is now managed via --discover
FineGrainedAssets Feature = 8
// Use serial number as the asset ID
// start: v11.x
// end: v12.0
// status: default
SerialNumberAsID Feature = 9
// Forces shell completion to be enabled (for windows)
// start: v11.x
// status: default
ForceShellCompletion Feature = 10
// Automatically add resource context to results and prints it
// start: v11.x
// status: default
ResourceContext Feature = 11
// Fail if no entrypoints or datapoints are found in the query.
// start: v11.x
// status: new, we still need to fix a few more tests
FailIfNoEntryPoints Feature = 12
//
// start: v12.x
// status: new
UploadResultsV2 Feature = 13
// Auto-update the execution engine
// start: v13.x
// status: new
AutoUpdateEngine Feature = 14
// Use BIOS UUID as the asset ID. Preferred over SerialNumber for VMs since some hypervisors (e.g., OpenStack) pass through the host's serial number to VMs, making it non-unique. On detected VMs, the BIOS UUID detector is added automatically; this flag enables it on non-VM (bare metal) machines.
// start: v13.x
// status: new
BiosUUIDAsID Feature = 15
// Placeholder to indicate how many feature flags exist. This number
// is changing with every new feature and cannot be used as a featureflag itself.
MAX_FEATURES byte = 16
)
var FeaturesValue = map[string]Feature{
"MassQueries": MassQueries,
"PiperCode": PiperCode,
"BoolAssertions": BoolAssertions,
"K8sNodeDiscovery": K8sNodeDiscovery,
"MQLAssetContext": MQLAssetContext,
"ErrorsAsFailures": ErrorsAsFailures,
"StoreResourcesData": StoreResourcesData,
"FineGrainedAssets": FineGrainedAssets,
"SerialNumberAsID": SerialNumberAsID,
"ForceShellCompletion": ForceShellCompletion,
"ResourceContext": ResourceContext,
"FailIfNoEntryPoints": FailIfNoEntryPoints,
"UploadResultsV2": UploadResultsV2,
"AutoUpdateEngine": AutoUpdateEngine,
"BiosUUIDAsID": BiosUUIDAsID,
}
// DefaultFeatures are a set of default flags that are active
var DefaultFeatures = Features{
byte(StoreResourcesData),
byte(SerialNumberAsID),
byte(ForceShellCompletion),
byte(ResourceContext),
}
// AvailableFeatures are a set of flags that can be activated
var AvailableFeatures = Features{
byte(MQLAssetContext),
byte(UploadResultsV2),
byte(AutoUpdateEngine),
byte(BiosUUIDAsID),
}