forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpool.go
48 lines (39 loc) · 1.17 KB
/
pool.go
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
package startup
import (
"context"
config_proto "www.velocidex.com/golang/velociraptor/config/proto"
"www.velocidex.com/golang/velociraptor/executor"
"www.velocidex.com/golang/velociraptor/http_comms"
"www.velocidex.com/golang/velociraptor/services"
"www.velocidex.com/golang/velociraptor/services/orgs"
)
// StartClientServices starts the various services needed by the
// client.
func StartPoolClientServices(
sm *services.Service,
config_obj *config_proto.Config,
exe *executor.PoolClientExecutor) error {
// Create a suitable service plan.
if config_obj.Frontend == nil {
config_obj.Frontend = &config_proto.FrontendConfig{}
}
if config_obj.Frontend.ServerServices == nil {
config_obj.Frontend.ServerServices = services.ClientServicesSpec()
}
_, err := services.GetOrgManager()
if err != nil {
_, err = orgs.NewOrgManager(sm.Ctx, sm.Wg, config_obj)
if err != nil {
return err
}
}
_, err = http_comms.StartHttpCommunicatorService(
sm.Ctx, sm.Wg, config_obj, exe,
func(ctx context.Context, config_obj *config_proto.Config) {})
if err != nil {
return err
}
err = executor.StartEventTableService(
sm.Ctx, sm.Wg, config_obj, exe.Outbound)
return nil
}