Files
velociraptor/services/server_artifacts.go
Mike Cohen 408cc1d217 Deduplicate glob hits (#2490)
Where multiple glob expressions were used and the same file was found
by multiple expressions the path was not properly deduplicated.

Also improved locking on the upload deduplication. When one thread is
uploading, other threads should wait on it to complete.

Raw Registry accessor repeated the names of keys that have values of
the same name (i.e. default value for a key name). This go dudplicated
leading to loss of the value name. This fix returns a RawRegValueInfo
object which also behaves as a key (looks like a directory) so it can
be recursed into but also can be read as a Value (file).

Also this PR refactores the server artifact runner so it does not
require scheduling a task but it gets launched immediately.
2023-03-03 20:10:49 +10:00

31 lines
868 B
Go

package services
import (
"context"
config_proto "www.velocidex.com/golang/velociraptor/config/proto"
crypto_proto "www.velocidex.com/golang/velociraptor/crypto/proto"
flows_proto "www.velocidex.com/golang/velociraptor/flows/proto"
)
func GetServerArtifactRunner(config_obj *config_proto.Config) (ServerArtifactRunner, error) {
org_manager, err := GetOrgManager()
if err != nil {
return nil, err
}
return org_manager.Services(config_obj.OrgId).ServerArtifactRunner()
}
type ServerArtifactRunner interface {
// Start a new collection in the current process.
LaunchServerArtifact(
config_obj *config_proto.Config,
session_id string,
req *crypto_proto.FlowRequest,
collection_context *flows_proto.ArtifactCollectorContext) error
// Cancel the current running collection if possible.
Cancel(ctx context.Context, session_id, principal string)
}