Documentation ¶
Overview ¶
storage defines a storage mechanism
storage implements a encrypted memory mechanism
Index ¶
- Constants
- Variables
- func AESEncrypt(key []byte, message []byte) (string, error)
- func AppendMany(sep string, slices ...[]byte) []byte
- func ParseB64RSAPublicKeyFromPEM(pubPEM string) (*rsa.PublicKey, error)
- type CacheMetrics
- type CorrelationData
- type GetInteractionsFunc
- type Options
- type PersistentEntry
- type Storage
- type StorageDB
- func (s *StorageDB) AddInteraction(correlationID string, data []byte) error
- func (s *StorageDB) AddInteractionWithId(id string, data []byte) error
- func (s *StorageDB) Close() error
- func (s *StorageDB) GetAllDescriptions() []*communication.DescriptionEntry
- func (s *StorageDB) GetCacheItem(token string) (*CorrelationData, error)
- func (s *StorageDB) GetCacheMetrics() (*CacheMetrics, error)
- func (s *StorageDB) GetDescription(correlationID string) (string, error)
- func (s *StorageDB) GetInteractions(correlationID, secret string) ([]string, string, error)
- func (s *StorageDB) GetInteractionsWithId(id string) ([]string, error)
- func (s *StorageDB) GetPersistentInteractions(correlationID string) ([]string, error)
- func (s *StorageDB) GetRegisteredSessions(activeOnly bool, from, to time.Time, desc, layout string) ([]*communication.SessionEntry, error)
- func (s *StorageDB) OnCacheRemovalCallback(key cache.Key, value cache.Value)
- func (s *StorageDB) RemoveID(correlationID, secret string) error
- func (s *StorageDB) SetDescription(correlationID string, description string) error
- func (s *StorageDB) SetID(ID string) error
- func (s *StorageDB) SetIDPublicKey(correlationID, secretKey, publicKey string, description string) error
Constants ¶
const YYYYMMDD = "2006-01-02"
Variables ¶
var DefaultOptions = Options{
MaxSize: 2500000,
}
Functions ¶
func AESEncrypt ¶ added in v1.0.8
AESEncrypt encrypts a message using AES and puts IV at the beginning of ciphertext.
func AppendMany ¶ added in v1.0.8
Types ¶
type CacheMetrics ¶
type CorrelationData ¶
type CorrelationData struct { sync.Mutex // data contains data for a correlation-id in AES encrypted json format. Data []string `json:"data"` // secretkey is a secret key for original user verification SecretKey string `json:"-"` // AESKey is the AES encryption key in encrypted format. AESKeyEncrypted string `json:"aes-key"` // decrypted AES key for signing AESKey []byte `json:"-"` }
CorrelationData is the data for a correlation-id.
type GetInteractionsFunc ¶ added in v1.0.8
type GetInteractionsFunc func() []string
type PersistentEntry ¶
type PersistentEntry struct { //Description of the connection Description string // contains filtered or unexported fields }
type Storage ¶
type Storage interface { GetCacheMetrics() (*CacheMetrics, error) SetIDPublicKey(correlationID, secretKey, publicKey, description string) error SetID(ID string) error AddInteraction(correlationID string, data []byte) error AddInteractionWithId(id string, data []byte) error GetInteractions(correlationID, secret string) ([]string, string, error) GetInteractionsWithId(id string) ([]string, error) RemoveID(correlationID, secret string) error GetCacheItem(token string) (*CorrelationData, error) Close() error GetDescription(correlationID string) (string, error) GetAllDescriptions() []*communication.DescriptionEntry SetDescription(correlationID string, description string) error GetPersistentInteractions(correlationID string) ([]string, error) GetRegisteredSessions(activeOnly bool, from, to time.Time, desc, layout string) ([]*communication.SessionEntry, error) }
type StorageDB ¶ added in v1.0.8
type StorageDB struct { Options *Options // contains filtered or unexported fields }
Storage is an storage for interactsh interaction data as well as correlation-id -> rsa-public-key data.
func (*StorageDB) AddInteraction ¶ added in v1.0.8
AddInteraction adds an interaction data to the correlation ID after encrypting it with Public Key for the provided correlation ID.
func (*StorageDB) AddInteractionWithId ¶ added in v1.0.8
AddInteractionWithId adds an interaction data to the id bucket
func (*StorageDB) GetAllDescriptions ¶ added in v1.0.8
func (s *StorageDB) GetAllDescriptions() []*communication.DescriptionEntry
GetAllDescriptions returns all descriptions
func (*StorageDB) GetCacheItem ¶ added in v1.0.8
func (s *StorageDB) GetCacheItem(token string) (*CorrelationData, error)
GetCacheItem returns an item as is
func (*StorageDB) GetCacheMetrics ¶ added in v1.0.8
func (s *StorageDB) GetCacheMetrics() (*CacheMetrics, error)
func (*StorageDB) GetDescription ¶ added in v1.0.8
GetDescription returns the description for a correlationID
func (*StorageDB) GetInteractions ¶ added in v1.0.8
GetInteractions returns the interactions for a correlationID and removes it from the storage. It also returns AES Encrypted Key for the IDs.
func (*StorageDB) GetInteractionsWithId ¶ added in v1.0.8
GetInteractions returns the interactions for a id and empty the cache
func (*StorageDB) GetPersistentInteractions ¶ added in v1.0.8
GetPersistentInteractions returns the interactions for a correlationID. It also returns AES Encrypted Key for the IDs.
func (*StorageDB) GetRegisteredSessions ¶ added in v1.0.8
func (s *StorageDB) GetRegisteredSessions(activeOnly bool, from, to time.Time, desc, layout string) ([]*communication.SessionEntry, error)
func (*StorageDB) OnCacheRemovalCallback ¶ added in v1.0.8
func (*StorageDB) RemoveID ¶ added in v1.0.8
RemoveID removes data for a correlation ID and data related to it.
func (*StorageDB) SetDescription ¶ added in v1.0.8
SetDescription sets the description of an associated ID