forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new client message type FlowRequest (Velocidex#2391)
This message combines all collections in the same flow into a single message, reducing the total number of task files in message queues. This should help to reduce IO operations and increase throughput
- Loading branch information
Showing
19 changed files
with
166 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package actions | ||
|
||
import actions_proto "www.velocidex.com/golang/velociraptor/actions/proto" | ||
|
||
func GetQueryName(args []*actions_proto.VQLRequest) string { | ||
for _, query := range args { | ||
if query.Name != "" { | ||
return query.Name | ||
} | ||
} | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package executor | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"www.velocidex.com/golang/velociraptor/actions" | ||
config_proto "www.velocidex.com/golang/velociraptor/config/proto" | ||
crypto_proto "www.velocidex.com/golang/velociraptor/crypto/proto" | ||
"www.velocidex.com/golang/velociraptor/responder" | ||
) | ||
|
||
func (self *ClientExecutor) ProcessFlowRequest( | ||
ctx context.Context, | ||
config_obj *config_proto.Config, req *crypto_proto.VeloMessage) { | ||
|
||
flow_manager := responder.GetFlowManager(ctx, config_obj) | ||
flow_context := flow_manager.FlowContext(req) | ||
|
||
// Control concurrency for the entire collection at once. | ||
if !req.Urgent { | ||
cancel, err := self.concurrency.StartConcurrencyControl(ctx) | ||
if err != nil { | ||
responder_obj := responder.NewResponder(ctx, config_obj, | ||
req, self.Outbound) | ||
defer responder_obj.Close() | ||
|
||
responder_obj.RaiseError(ctx, fmt.Sprintf("%v", err)) | ||
return | ||
} | ||
defer cancel() | ||
} | ||
|
||
for _, arg := range req.FlowRequest.VQLClientActions { | ||
responder_obj := responder.NewResponder(ctx, config_obj, | ||
req, self.Outbound) | ||
defer responder_obj.Close() | ||
|
||
// Each request has its own context. | ||
query_ctx, closer := flow_context.NewQueryContext(responder_obj) | ||
defer closer() | ||
|
||
actions.VQLClientAction{}.StartQuery( | ||
config_obj, query_ctx, responder_obj, arg) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ import ( | |
) | ||
|
||
const ( | ||
NOTIFY_CLIENT = true | ||
|
||
Unknown ClientOS = iota | ||
Windows | ||
Linux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.