engine

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: 32 Imported by: 0

Documentation

Overview

The Dexter engine contains all the functionality to run the dexter daemon loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicKeyForInvestigator

func GetPublicKeyForInvestigator(name string) (*rsa.PublicKey, error)

Lookup an embedded investigator and parse their public key into an *rsa.PublicKey.

func LoadInvestigatorNames

func LoadInvestigatorNames() (list []string)

Return the list of embedded investigators.

func LocalInvestigatorName

func LocalInvestigatorName() string

Return the name of the investigator currently operating Dexter from the CLI.

func Start

func Start()

Poll for investigations, validate them, and run the tasks if in scope.

Types

type DecryptionPayload

type DecryptionPayload struct {
	Nonce                      []byte
	EncryptedDataEncryptionKey []byte
}

A decryption payload contains all the information needed for an investigator to decrypt an investigation, a nonce for data encryption and the encrypted data encryption key.

func (DecryptionPayload) GetEncryptionKey

func (payload DecryptionPayload) GetEncryptionKey(passwordFunc func() string) []byte

Decrypt the encrypted data encryption key using the local investigator's key. A password function is used to retrieve the password for the local investigator's private key.

type Investigation

type Investigation struct {
	ID             string
	TaskList       map[string][]string
	Scope          map[string][]string
	KillContainers bool
	KillHost       bool
	Issuer         Signature
	Approvers      []Signature
	RecipientNames []string
}

An investigation is an instruction for some Dexter daemons to run some tasks. The Task list defines the tasks and their argumetns, while the Scope defines facts that must be true about the host in order for the investigation to be in scope.

func AllInvestigations

func AllInvestigations() []Investigation

Get all investigations, including archived ones

func CurrentInvestigations

func CurrentInvestigations() []Investigation

Get current investigations.

func InvestigationByID

func InvestigationByID(uuid string) (Investigation, error)

Lookup an investigation by ID, or partial ID.

func InvestigationByIDWithCache

func InvestigationByIDWithCache(cache []Investigation, uuid string) (Investigation, error)

Lookup an investigation by ID, or partial ID, using an already downloaded list of investigation.

func (*Investigation) Approve

func (investigation *Investigation) Approve(privateKey *rsa.PrivateKey)

func (*Investigation) ApproverNames

func (investigation *Investigation) ApproverNames() []string

List the names of the investigators who approved an investigation.

func (*Investigation) MinimumConsensus

func (investigation *Investigation) MinimumConsensus() int

Each task has different consensus requirements, return the highest value from all the tasks. That will be the amount of consensus required for this investigation.

func (*Investigation) ReportDirectory

func (investigation *Investigation) ReportDirectory() string

Return the local filesystem path that is being used to write report artifacts during this investigation.

func (*Investigation) ReportZip

func (investigation *Investigation) ReportZip() string

Return the path on the local filesystem for the zipped report that resulted from this investigation.

func (*Investigation) ScopeFactsStrings

func (investigation *Investigation) ScopeFactsStrings() []string

Get a slice of strings that are printable versions of the facts on this investigation.

func (*Investigation) ScopeFactsToString

func (investigation *Investigation) ScopeFactsToString() string

Get a single string that represents all facts on this investigation.

func (*Investigation) Sign

func (investigation *Investigation) Sign(privateKey *rsa.PrivateKey)

func (*Investigation) Upload

func (investigation *Investigation) Upload() error

Upload this investigation to S3.

func (*Investigation) ValidUniqueApprovers

func (investigation *Investigation) ValidUniqueApprovers() int

Return the number of signatures on an investigation that are from a unique set of investigators and are valid. This is equivalent to the current consensus level.

type Investigator

type Investigator struct {
	PublicKey PublicKey
	Name      string
}

An investigator is defined by their name and public key.

func LoadInvestigators

func LoadInvestigators() (list []Investigator)

Load the investigator structs from the embedded files and return a slice of investigators.

func LoadLocalInvestigator

func LoadLocalInvestigator() Investigator

Return the local investigator as an Investigator struct.

func NewInvestigator

func NewInvestigator(name, password string) (Investigator, []byte, error)

Create a new investigator object and the encrypted private key PEM block

func (Investigator) String

func (investigator Investigator) String() ([]byte, error)

Serialize the investigation into JSON

type Poller

type Poller interface {
	Poll() chan Investigation
}

A poller is anyy structure that can return a channel of investigations.

type PublicKey

type PublicKey struct {
	N, E string
}

Values for RSA public key, represented as strings for JSON.

type S3Poller

type S3Poller struct{}

A poller that will stream new files from the Dexter investigations S3 bucket.

func NewS3Poller

func NewS3Poller() *S3Poller

Create a new S3 poller.

func (*S3Poller) Poll

func (poller *S3Poller) Poll() chan Investigation

Get a chan of investigation structs from the Dexter investigations S3 bucket.

type Signature

type Signature struct {
	Name string
	Data []byte
}

A signature consists of the name of the investigator who did the signing, and the signature data.

Directories

Path Synopsis
This package contains useful Dexter-specific functions used everywhere.
This package contains useful Dexter-specific functions used everywhere.

Jump to

Keyboard shortcuts

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