memory

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Repository is the structure that implements the in-memory repository for interacting with the Agent's C2 client

func NewRepository

func NewRepository() *Repository

NewRepository creates and returns a new in-memory repository for interacting with the Agent in-memory repository

func (*Repository) Add

func (r *Repository) Add(agent agent.Agent)

Add stores the Merlin Agent structure to the repository

func (*Repository) Get

func (r *Repository) Get() agent.Agent

Get returns the stored Agent structure

func (*Repository) SetAuthenticated

func (r *Repository) SetAuthenticated(authenticated bool)

SetAuthenticated updates the Agent's authentication status and stores the updated Agent in the repository

func (*Repository) SetComms

func (r *Repository) SetComms(comms agent.Comms)

SetComms updates the Agent's embedded Comms structure with the one provided and stores the updated Agent in the repository

func (*Repository) SetFailedCheckIn

func (r *Repository) SetFailedCheckIn(failed int)

SetFailedCheckIn updates the number of times the Agent has actually failed to check in and stores the updated Agent in the repository

func (*Repository) SetInitialCheckIn

func (r *Repository) SetInitialCheckIn(checkin time.Time)

SetInitialCheckIn updates the time stamp that the Agent first successfully connected to the Merlin server and stores the updated Agent in the repository

func (*Repository) SetKillDate

func (r *Repository) SetKillDate(epochDate int64)

SetKillDate sets the date, as an epoch timestamp, of when the Agent will quit running and stores the updated Agent in the repository

func (*Repository) SetMaxRetry

func (r *Repository) SetMaxRetry(retries int)

SetMaxRetry updates the number of times the Agent can fail to check in before it quits running and stores the updated Agent in the repository

func (*Repository) SetSkew

func (r *Repository) SetSkew(skew int64)

SetSkew updates the amount of jitter or skew added to the Agent's sleep or wait time and stores the updated Agent in the repository

func (*Repository) SetSleep

func (r *Repository) SetSleep(sleep time.Duration)

SetSleep updates the amount of time the Agent will wait or sleep before it attempts to check in again and stores the updated Agent in the repository

func (*Repository) SetStatusCheckIn

func (r *Repository) SetStatusCheckIn(checkin time.Time)

SetStatusCheckIn updates the last time the Agent successfully communicated with the Merlin server and stores the updated Agent in the repository

Jump to

Keyboard shortcuts

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