Skip to content

Commit 3114992

Browse files
scudettesnyk-bot
andauthored
Bugfix: Notebook cell type selector not working (#4650)
Also: * Upload Function/Plugin Minimum Filesize Bug * Page the notebook overview table when there are many cells in the notebook. Fixes: #4643 #4642 --------- Co-authored-by: snyk-bot <snyk-bot@snyk.io>
1 parent cc8aa11 commit 3114992

File tree

24 files changed

+90
-47
lines changed

24 files changed

+90
-47
lines changed

artifacts/testdata/server/testcases/artifacts.out.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Output: [
8989
"timeout": 0,
9090
"max_rows": 0,
9191
"max_logs": 0,
92-
"max_upload_bytes": 0,
92+
"max_upload_bytes": 1073741824,
9393
"trace_freq_sec": 0,
9494
"allow_custom_overrides": false,
9595
"log_batch_time": 0,
@@ -137,7 +137,7 @@ Output: [
137137
"timeout": 0,
138138
"max_rows": 0,
139139
"max_logs": 0,
140-
"max_upload_bytes": 0,
140+
"max_upload_bytes": 1073741824,
141141
"trace_freq_sec": 0,
142142
"allow_custom_overrides": false,
143143
"log_batch_time": 0,

artifacts/testdata/server/testcases/clients.out.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Output: [
119119
"timeout": 0,
120120
"max_rows": 0,
121121
"max_logs": 0,
122-
"max_upload_bytes": 0,
122+
"max_upload_bytes": 1073741824,
123123
"trace_freq_sec": 0,
124124
"allow_custom_overrides": false,
125125
"log_batch_time": 0,

artifacts/testdata/server/testcases/users.out.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ Output: [
260260
"lang": "fr",
261261
"default_password": "foobar",
262262
"options": "{\n \"selectionStyle\":\"line\",\n \"highlightActiveLine\":true,\n \"highlightSelectedWord\":true,\n \"copyWithEmptySelection\":false,\n \"cursorStyle\":\"ace\",\n \"mergeUndoDeltas\":true,\n \"behavioursEnabled\":true,\n \"wrapBehavioursEnabled\":true,\n \"showLineNumbers\":true,\n \"relativeLineNumbers\":true,\n \"hScrollBarAlwaysVisible\":false,\n \"vScrollBarAlwaysVisible\":false,\n \"highlightGutterLine\":true,\n \"animatedScroll\":false,\n \"showInvisibles\":false,\n \"showPrintMargin\":true,\n \"printMarginColumn\":80,\n \"printMargin\":80,\n \"fadeFoldWidgets\":false,\n \"showFoldWidgets\":true,\n \"displayIndentGuides\":true,\n \"showGutter\":true,\n \"fontSize\":15,\n \"fontFamily\":\"monospace\",\n \"scrollPastEnd\":0,\n \"theme\":\"ace/theme/xcode\",\n \"useTextareaForIME\":true,\n \"scrollSpeed\":2,\n \"dragDelay\":0,\n \"dragEnabled\":true,\n \"focusTimeout\":0,\n \"tooltipFollowsMouse\":true,\n \"firstLineNumber\":1,\n \"overwrite\":false,\n \"newLineMode\":\"auto\",\n \"useSoftTabs\":true,\n \"navigateWithinSoftTabs\":false,\n \"tabSize\":2,\n \"wrap\":\"free\",\n \"indentedSoftWrap\":true,\n \"foldStyle\":\"markbegin\",\n \"enableMultiselect\":true,\n \"enableBlockSelect\":true,\n \"enableEmmet\":true,\n \"enableBasicAutocompletion\":true,\n \"enableLiveAutocompletion\":true}",
263-
"customizations": {},
263+
"customizations": {
264+
"hunt_expiry_hours": 168
265+
},
264266
"links": [
265267
{
266268
"text": "Foobar",

bin/binary_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func TestProgressTimeout(t *testing.T) {
186186
"--config", config_file.Name(),
187187
"artifacts", "collect", "Sleep", "-v", "--progress_timeout", "0.1")
188188
out, err := cmd.CombinedOutput()
189-
require.NoError(t, err, string(out))
189+
require.Error(t, err, string(out))
190190
assert.Regexp(t, "Starting collection of Sleep", string(out))
191191

192192
// Make sure the collection timed out and dumped the goroutines.

config/migration.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,15 @@ func migrate_0_6_1(config_obj *config_proto.Config) {
182182
}
183183

184184
if config_obj.Defaults == nil {
185-
config_obj.Defaults = &config_proto.Defaults{
186-
HuntExpiryHours: 24 * 7,
187-
NotebookCellTimeoutMin: 10,
188-
}
185+
config_obj.Defaults = &config_proto.Defaults{}
186+
}
187+
188+
if config_obj.Defaults.HuntExpiryHours == 0 {
189+
config_obj.Defaults.HuntExpiryHours = 24 * 7
190+
}
191+
192+
if config_obj.Defaults.NotebookCellTimeoutMin == 0 {
193+
config_obj.Defaults.NotebookCellTimeoutMin = 10
189194
}
190195
}
191196

file_store/uploader/uploader.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ loop:
8787

8888
default:
8989
n, err := reader.Read(buf)
90-
if n == 0 || err == io.EOF {
90+
if err != nil && err != io.EOF {
9191
break loop
9292
}
93+
94+
if n == 0 {
95+
break loop
96+
}
97+
9398
data := buf[:n]
9499

95100
_, err = out_fd.Write(data)

flows/client_flow_runner_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ func (self *ServerTestSuite) TestForeman() {
442442
// The hunt will launch the Generic.Client.Info on the client.
443443
expected := api.MakeCollectorRequest(
444444
self.client_id, "Generic.Client.Info")
445+
expected.MaxUploadBytes = 1073741824
445446

446447
hunt_dispatcher, err := services.GetHuntDispatcher(self.ConfigObj)
447448
assert.NoError(self.T(), err)

gui/velociraptor/package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/velociraptor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"dependencies": {
7-
"@babel/runtime": "^7.28.4",
7+
"@babel/runtime": "^7.28.6",
88
"@fortawesome/fontawesome-svg-core": "6.7.2",
99
"@fortawesome/free-regular-svg-icons": "6.7.2",
1010
"@fortawesome/free-solid-svg-icons": "^6.7.2",

gui/velociraptor/src/components/docs/doc-button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class HelpDialog extends Component {
165165
}
166166

167167
searchTag = tag=>{
168-
this.setState({query: "tags:" + tag + " " + this.state.query});
168+
this.setState({query: "+tags:" + tag + " " + this.state.query});
169169
}
170170

171171

0 commit comments

Comments
 (0)