poison

package
v0.0.0-...-982e07a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package poison generates poison record with desired length using provided key. Poison records are the records specifically designed and crafted in such a way that they wouldn't be queried by a user under normal circumstances. Read more in AcraPoisonRecordsMaker package.

https://github.com/cossacklabs/acra/wiki/Intrusion-detection

Index

Constants

View Source
const (
	UseDefaultDataLength = -1
	DefaultDataLength    = 100
)

Poison records length constants

Variables

This section is empty.

Functions

func CreatePoisonRecord

func CreatePoisonRecord(keyStore keystore.PoisonKeyStorageAndGenerator, dataLength int) ([]byte, error)

CreatePoisonRecord generates AcraStruct encrypted with Poison Record public key

func CreateSymmetricPoisonRecord

func CreateSymmetricPoisonRecord(keyStore keystore.PoisonKeyStorageAndGenerator, dataLength int) ([]byte, error)

CreateSymmetricPoisonRecord generates AcraBlock encrypted with Poison Record symmetric key

Types

type CallbackStorage

type CallbackStorage struct {
	// contains filtered or unexported fields
}

CallbackStorage stores all callbacks in internal storage, on Call iterates and calls each callbacks until error or end of iterating

func NewCallbackStorage

func NewCallbackStorage() *CallbackStorage

NewCallbackStorage creates new CallbackStorage

func (*CallbackStorage) AddCallback

func (storage *CallbackStorage) AddCallback(callback base.Callback)

AddCallback adds callback to end of list

func (*CallbackStorage) Call

func (storage *CallbackStorage) Call() error

Call calls all callbacks in sequence

func (*CallbackStorage) HasCallbacks

func (storage *CallbackStorage) HasCallbacks() bool

HasCallbacks returns number of callbacks in storage

type EmptyCallback

type EmptyCallback struct{}

EmptyCallback implements Callback and log message to show that RecordProcessor works

func (EmptyCallback) Call

func (EmptyCallback) Call() error

Call log on Call

type ExecuteScriptCallback

type ExecuteScriptCallback struct {
	// contains filtered or unexported fields
}

ExecuteScriptCallback represents what script to call on detecting poison record

func NewExecuteScriptCallback

func NewExecuteScriptCallback(path string) *ExecuteScriptCallback

NewExecuteScriptCallback returns callback for script execution

func (*ExecuteScriptCallback) Call

func (callback *ExecuteScriptCallback) Call() error

Call runs from scriptPath on detecting poison record

type StopCallback

type StopCallback struct{}

StopCallback represents special action to call if service should quit on detecting poison record

func (*StopCallback) Call

func (*StopCallback) Call() error

Call exists service with log

Jump to

Keyboard shortcuts

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