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
- func CreatePoisonRecord(keyStore keystore.PoisonKeyStorageAndGenerator, dataLength int) ([]byte, error)
- func CreateSymmetricPoisonRecord(keyStore keystore.PoisonKeyStorageAndGenerator, dataLength int) ([]byte, error)
- type CallbackStorage
- type EmptyCallback
- type ExecuteScriptCallback
- type StopCallback
Constants ¶
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
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