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.
Backups should also include custom artifacts. (Velocidex#3819)
* Root org will create a backup for all other orgs. The data for each org can be stored in the same zip file. * It is now possible to restore only some providers selectively.
- Loading branch information
Showing
12 changed files
with
398 additions
and
39 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
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,44 @@ | ||
package backup | ||
|
||
import ( | ||
"archive/zip" | ||
"context" | ||
"io" | ||
"io/fs" | ||
"time" | ||
|
||
config_proto "www.velocidex.com/golang/velociraptor/config/proto" | ||
"www.velocidex.com/golang/velociraptor/reporting" | ||
vql_subsystem "www.velocidex.com/golang/velociraptor/vql" | ||
"www.velocidex.com/golang/vfilter" | ||
) | ||
|
||
type containerDelegate struct { | ||
*reporting.Container | ||
prefix string | ||
} | ||
|
||
func (self *containerDelegate) Create(name string, mtime time.Time) ( | ||
io.WriteCloser, error) { | ||
return self.Container.Create(self.prefix+"/"+name, mtime) | ||
} | ||
|
||
func (self *containerDelegate) WriteResultSet( | ||
ctx context.Context, | ||
config_obj *config_proto.Config, | ||
dest string, in <-chan vfilter.Row) (total_rows int, err error) { | ||
|
||
scope := vql_subsystem.MakeScope() | ||
|
||
return self.Container.WriteResultSet( | ||
ctx, config_obj, scope, reporting.ContainerFormatJson, dest, in) | ||
} | ||
|
||
type zipDelegate struct { | ||
*zip.Reader | ||
prefix string | ||
} | ||
|
||
func (self zipDelegate) Open(name string) (fs.File, error) { | ||
return self.Reader.Open(self.prefix + "/" + name) | ||
} |
Oops, something went wrong.