helpers

package
v0.0.0-...-a56da61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

This package contains useful Dexter-specific functions used everywhere.

Most of the functions in this package are for looking up basic information about the local environment, and where Dexter should put things.

Index

Constants

This section is empty.

Variables

View Source
var LocalDemoPath = ""

Defines a local directory to use as the backend for Dexter. Overrides all calls to S3, used for demo purposes.

Functions

func BuildDemoPath

func BuildDemoPath()

Build the directory structure for a local Dexter demo.

func DeleteS3File

func DeleteS3File(path string) error

Delete a file from the Dexter S3 bucket.

func GetDexterDirectory

func GetDexterDirectory() string

Find the configuration directory for Dexter.

func GetDexterInvestigatorFile

func GetDexterInvestigatorFile() string

Return the full path for the file that stores the local investigator data.

func GetDexterKeyFile

func GetDexterKeyFile() string

Return the full path for the file that stores a user's private key.

func GetS3File

func GetS3File(name string) ([]byte, error)

Download a file from the Dexter S3 bucket.

func ListS3Path

func ListS3Path(path string) ([]string, error)

List the contents of a path in the Dexter S3 bucket.

func LoadLocalKey

func LoadLocalKey(passwordRetriever func() string) *rsa.PrivateKey

Load the local investigator's private key and decrypt it by getting the password from user interaction.

func LocalUsers

func LocalUsers() ([]string, error)

Look up local user names from /etc/passwd

func MoveS3File

func MoveS3File(oldpath, newpath string) error

Move a file in S3

func NewDexterID

func NewDexterID() string

Return a new randomly generated ID for a Dexter investigation

func OSQuerySocket

func OSQuerySocket() string

Lookup and cache the osquery socket

func PollInterval

func PollInterval() int

Lookup and cache the pool interval

func ProjectName

func ProjectName() string

Get the project name for this host. Useful when scoping in a production environment.

func ResolveUUID

func ResolveUUID(partial string) (string, error)

Given a prefix for an ID in Dexter, return the full ID if there is enough specificity. If there is too much ambiguity in the ID, and there are multiple possible matches, return an error. This function works for both investigation and report IDs.

func RunningDockerImages

func RunningDockerImages() ([]string, error)

Connect to the local docker socket and get a list of running docker images.

func S3Bucket

func S3Bucket() *string

Return an AWS string containing the S3 bucket defined by the DEXTER_AWS_S3_BUCKET environment variable

func StringWithArgs

func StringWithArgs(item string, args []string, private bool) string

Create a printable representation of a string with arguments, redacting the arguments if the private argument is true.

func StubLocalUsers

func StubLocalUsers(set []string)

Stub all calls to LocalUsers with a string slice. Useful for testing.

func StubProjectName

func StubProjectName(str string)

Stub all calls to ProjectName with a string, for testing.

func StubRunningDockerImages

func StubRunningDockerImages(images []string)

Stub all calls to RunningDockerImages with a string slice. Useful for testing.

func TaskStrings

func TaskStrings(tasks map[string][]string) []string

For each task in a Dexter investigation, create a printable string version. Return the slice of all of these.

func UploadS3File

func UploadS3File(path string, data io.ReadSeeker) error

Upload data to a file in the Dexter S3 bucket.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL